0

I have a child fragment (2nd/3rd node) that consists of a complex UI.

<ConstraintLayout>
 - ScrollView
    - ConstraintLayout
       - 1 ImageView
       - 18 TextView
       - 13 TextInputLayout each has it's own TextInputEditText
       - 1 RecyclerView
 - Guideline
 - 5 Buttons
</ConstraintLayout>
  1. Fragment opens slowly
  2. It gives the warning Android doing too much work on its main thread and skipping many frames.
  3. Each field is getting observed from the ViewModel ObservableField values. (Not setting the values also cause the same warning)
Akshay Nandwana
  • 1,260
  • 11
  • 18
  • 18 TextView and 13 TextInputLayout i would say u might wanna rethink your UX for this . Anyway Are there any view which are Conditionally Visible ? If yes You can use ViewStub for those Views . Here is a thread on this https://stackoverflow.com/questions/14678593/the-application-may-be-doing-too-much-work-on-its-main-thread – ADM Feb 28 '22 at 06:24
  • `ViewStub` sounds good, this comes to a condition of which would be a good option as per performance? 1. Using multiple `ViewStub` by dividing 18 TextView and 1 TextInputLayout into multiple sub-groups 2. Using a RecyclerView – Akshay Nandwana Feb 28 '22 at 07:05

0 Answers0