I have an app which has a tons of graphic elements, I tried to eliminate layout complexity by using RelativeLayout and wondering what else can be done to speed up UI based on standard layout system with a lot of graphic elements?
App Launch TimeDon't instantiate too many views on the first screen that appear to the user. Don't inflate parts of the UI that you don't need during the initial launch. Don't run expensive content decoding like bitmaps. Use Firebase Performance Monitoring or Android Vitals to monitor and optimize your app launch time.
Use compound drawables - A LinearLayout which contains an ImageView and a TextView can be more efficiently handled as a compound drawable. Merge root frame - If a FrameLayout is the root of a layout and does not provide background or padding etc, it can be replaced with a merge tag which is slightly more efficient.
Revise your layout Because the layout performance above slows down due to a nested LinearLayout , the performance might improve by flattening the layout—make the layout shallow and wide, rather than narrow and deep. A RelativeLayout as the root node allows for such layouts.
You can check blog by Romain Guy http://www.curious-creature.org/category/android/, he writes often on performance topic. Especially take a look at this article
There is a guide on android developers website for UI design and Performace :
Android UI Performance
Have fun
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