-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question/Opinion] Creating Reusable Components with Paris/Epoxy #132
Comments
@idrisadetunmbi it sounds like you're running into the issue described here: https://github.com/airbnb/paris/wiki/View-Recycling The solution is to make sure all your styles define the same set of attributes. For example if one sets a |
@ngsilverman , thanks for responding quickly. Just to clarify further, in your experience, does it work to define a base style that new styles inherit from rather than explicitly defining all the attributes for each new style? I am currently doing this and still running into the issue and wanted to know if it is not the right way to do it. |
@idrisadetunmbi , did you ever figure out a slick way to manage your styles?
I'm currently doing the same thing with a base style. Did you stick with this system? |
@idrisadetunmbi yup using base styles should be possible. Are you sure all the styles used for a given view type are setting the same attributes? Could you share your style code? |
This is not an issue with the library, I am just wondering what the best way is in creating reusable components using Paris/Epoxy. I created a simple
TextView
custom view as defined below:The goal is to be able to reuse the model generated by this wherever a text is required in the app and override the default style by using the model's
styleBuilder
/style
properties as required.I have tried this across about 3 screens, but so far, it is not working as expected. The styles defined across different instances are getting mixed up .e.g. an instance that does not define a
drawableLeft
in its style override shows it (while it is defined in another instance).@ngsilverman, please can you advise if this might not be right way to create such reusable components or if it is, what I might be doing wrong with the approach. Thank you.
The text was updated successfully, but these errors were encountered: