Skip to content
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

Make layout classes open #26

Open
EvGem7 opened this issue Jul 1, 2020 · 2 comments
Open

Make layout classes open #26

EvGem7 opened this issue Jul 1, 2020 · 2 comments
Assignees

Comments

@EvGem7
Copy link

EvGem7 commented Jul 1, 2020

I want to use <merge> tag so I want to inherit from layout classes but they are final. NeumorphCardView in particular.

@fornewid
Copy link
Owner

fornewid commented Jul 2, 2020

I did not fully understand the exact purpose.
Please can you explain to me with codes?

@EvGem7
Copy link
Author

EvGem7 commented Jul 7, 2020

@fornewid For example: I want to create a custom view which root layout is one of your ViewGroups. In constructor of the view I use View.inflate(context, R.layout.view_example, this). Root tag of the R.layout.view_example layout is <merge>. So I need to inherit from your layout class to make this work.

I can inherit from FrameLayout and don't use the <merge> tag, but it's bad because of excess nesting.

<FrameLayout> <YourCardView/> <FrameLayout/> without merge

vs

<YourCardView /> with merge

Also there may be more reasons to inherit from your classes. You create a library, so some users may want to customize it more than you let =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants