question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get View Type of Model generated using ModelView and autoLayout

See original GitHub issue

It 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:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alexbchrcommented, Dec 5, 2017

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!

0reactions
JiangDaYa0commented, Mar 20, 2018

@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 . 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found