How to get View Type of Model generated using ModelView and autoLayout
See original GitHub issueIt is easy to get the View Type when using @ModelView annotation and defaultLayout parameter, as the View Type is equals to the layout ID (R.layout.my_view).
However, when using the @ModelView annotation with the autoLayout option, I don’t see any way to get the View Type of the view.
For example:
@ModelView(autoLayout = Size.MATCH_WIDTH_WRAP_HEIGHT)
Do I really need to set a defaultLayout if I want to get the View Type? I need the View Type in a custom ItemDecoration…
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Auto Layout - How to use Model View Controller MVC (Ep 5)
Today's lesson will go through a bit of the Model View Controller pattern, often referred to as MVC. We'll explore why its a...
Read more >Programmatic AutoLayout in MVVM - Medium
The project has the classic MVVM structure: we have a Data model, a ViewController , a ViewModel , and a View . The...
Read more >Epoxy Processor Exception: Unable to get layout resource for ...
You have to define an autoLayout or defaultLayout . @ModelView(autoLayout = Size.MATCH_WIDTH_WRAP_HEIGHT) public class MyView extends ...
Read more >ModelView (epoxy-annotations 2.7.3 API) - AppDoc
The layout file to use in the generated model to inflate the view. This is required unless a default pattern is set via...
Read more >Model diagram appearance—ArcGIS Pro | Documentation
at the bottom of the model view or on the ModelBuilder tab in the View group. ... By default, all elements in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I like the idea of having the divider set on the Model itself and toggling it using an Interceptor. I think this is a more elegant solution and that it provides more flexibility.
For example, one problem I faced with ItemDecorations is that they don’t animate when for example you show a bunch of items with dividers. The items appear with a fade-in animation, but the dividers just appear without any animation. Using the divider directly in the model would fix this issue.
Thanks for your help and ideas!
@elihart Use the base Models for myself view is a great idea. But, I guess, this way means i need use a BaseView for all the Views, I don’t want to do that.Can you provide an example? The is a lot to me . 😃