Allow ModelView usage without an xml layout #282
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of needing to create an xml layout for each
@ModelView
view, you can use the@ModelView( autoLayout = Size. ...)
param to specify what layout params you want for your view.Epoxy will then programmatically create the view and the layout params for you.
Looking for feedback on naming, if this seems good I will flesh out comments and tests.
There were a couple different approaches we could take here, I chose a simple path with just one param so that it is very quick and easy to set this up. I figure that if anybody wants more control with exact sizing they can use an xml file.
Also, we will be releasing more powerful dynamic styling support soon which will also help with the more complex cases, and given that it seems nice to keep one very simple approach.