I checked my UI with Android studio profiler (Recorded system trace) and I got following result: As you can see here it takes 28ms for a frame to load when I open my fragment. Also we can see that almost all time is taken by traversal and measure. I tried to refactor my xml and now it looks like:
<MotionLayout>
<SwiperefreshLayout>
<NestedScrollView>
<LinearLayout>
<include
layout="cardView1">
<include
layout="cardView2">
//..........
<include
layout="cardVie7">
<LinearLayout>
<NestedScrollView>
<SwipeRefreshLayout>
<MotionLayout>
It's just complex UI with lots of nested cards which can have recycleview ot other content inside. After my refactoring there still some problems with the frame time as you can see. Is there a way improve my UI performance or maybe at least get more detailed info of what's wrong and why it takes so long to draw the UI?
question from:https://stackoverflow.com/questions/65545525/improving-ui-performance