Solution for Which Layout is more optimal for millisecond refreshing?
is Given Below:
I’ve read on multiple articles the advantages and disadvantages of ConstraintLayout vs RelativeLayout. Each one of them has its own ups and downs. But I have a specific case.
I am trying to choose the best Layout for my app (both work good for organizing my app) but the visible views are refreshed literally every 10 milliseconds. My app has two fragment only for the time being and one of them has many elements in it which get refreshed constantly.
The fragment I am talking about has (for now) a parent ConstraintLayout and 2 Child ConstraintLayouts. I changed the parent to RelativeLayout but I haven’t seen any difference (Testing on my main device which is already very fast and potent). But would there be a significant difference on low-end phones? I have no means to try it on real physical low-end phones for the time being.
Here is my XML file.
`<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ui.home.HomeFragment" android:id="@+id/constraintLayout"> <TextView /> <EditText /> <Spinner /> <TextView /> <EditText /> <TextView /> <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/infoConstraintLayout" > <TextView /> <TextView /> <TextView /> <TextView /> <TextView /> <TextView /> <TextView /> <TextView /> <TextView /> <TextView /> <TextView /> <Chronometer /> </androidx.constraintlayout.widget.ConstraintLayout> <ImageView /> <com.google.android.material.button.MaterialButton android:id="@+id/Button"/> </androidx.constraintlayout.widget.ConstraintLayout>`
Much appreciated in advance.