Optimize custom views
See original GitHub issueWhat’s the problem
- There are custom views, for instance, AddressInputView.
- They are extended from ConstraintLayout or LinearLayout.
- They inflate some layout file. For AddressInputView it’s
view_input_address.xml - The
view_input_address.xmllayout root tag is also ConstraintLayout. - It resulted in double nested ConstraintLayout
How to resolve
Use merge tag in all such layout files. Check SwapAllowanceView for reference.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Optimizing the View - Android Developers
The most important part of a custom view is its appearance. Custom drawing can be easy or complex according to your application's needs....
Read more >How to optimize custom view? - android - Stack Overflow
So I defined an custom view based on LinearLayout: public class AlphabetButton extends LinearLayout{ private Button alphabetButton; ...
Read more >Optimizing the View | Android Developers
If you have a complex UI, you should consider writing a custom ViewGroup to perform its layout. Unlike the built-in views, your custom...
Read more >Objective overview - Optimize Resource Hub - Google Help
Optimize Permissions: Users with View access to the Optimize container can see that a custom objective was used in the experiment and the...
Read more >#PerfMatters using custom Views in Android to improve ...
Custom Views and ViewGroups can be a great way to improve performance and make code more maintainable in your application.
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

Hi @herou. Please take this ticket, if you’re interested.
@herou, there are some issues with layouts after replacing layouts with merge tags. We’ve found out that the root tags of layout files had some properties set before. After replacing them with the
mergetag those properties are ignored. It can be resolved by setting properties in:We should decide how to resolve it.
Also, there are some custom views left. Here is the list: