I've been inspecting the Gmail app in Android using the HierarchyViewer and found something interesting in that each item in the email list looks like a canvas view - I was expecting something like a RelativeLayout with child components:
My initial though is that it's done this way for performance reasons - one canvas view per item is much better than multiple views per item, especially in a long list which seems to scroll very smoothly. Does this sound correct? Do Google recommend this approach anywhere in their official documentation? Is it an approach that other people should look at for performance?
Yes the fewer views the more efficient the UI is. If you have a visually complicated UI element it can be much more efficient to implement it as a custom view or layout rather than trying to compose individual views.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With