I am developing an OpenGL app for android. The app is now pretty much ready so it was time to get the UI done.
I decided to have the OpenGL app on the left, and the UI on the right (it really doesn't need to be pretty, it's more a demonstration thing).
When it was just the app, it ran flawlessly. 60FPS with no drops whatsoever, smooth movement when controlling the camera. In fact, the app itself still runs flawlessly, but the UI is horrible. I can't scroll without the UI skipping frames like crazy.
I'm new to android, so I imagine something in the way I'm doing the layout is causing some weird recursion bogging down the whole thing.
Here is my layout. Keep in mind the app is locked to landscape at all times.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearlayout1"
android:layout_width="match_parent"
android:layout_height="match_parent">
<PedroFernandes.NSS.OpenGLView
android:id="@+id/openGLView3"
android:layout_width="551dp"
android:layout_height="match_parent" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<SeekBar
android:id="@+id/Time"
style="@style/Widget.AppCompat.SeekBar.Discrete"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="45dp"
android:layout_weight="2"
android:max="2399"
android:progress="1200" />
<TextView
android:id="@+id/textTime"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/Year"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="45dp"
android:layout_weight="2"
android:ems="2022"
android:inputType="number" />
<TextView
android:id="@+id/textYear"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/Month"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="45dp"
android:layout_weight="2"
android:ems="9"
android:inputType="number" />
<TextView
android:id="@+id/textMonth"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/Day"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:minHeight="45dp"
android:ems="20"
android:inputType="number" />
<TextView
android:id="@+id/textDay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/Latitude"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:minHeight="45dp"
android:ems="0"
android:inputType="number" />
<TextView
android:id="@+id/textLatitude"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/Longitude"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:minHeight="45dp"
android:ems="0"
android:inputType="number" />
<TextView
android:id="@+id/textLongitude"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<SeekBar
android:id="@+id/G"
style="@style/Widget.AppCompat.SeekBar.Discrete"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="45dp"
android:layout_weight="2"
android:min="-999"
android:max="999"
android:progress="900" />
<TextView
android:id="@+id/textG"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/AtmPressure"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:minHeight="45dp"
android:ems="101325"
android:inputType="number" />
<TextView
android:id="@+id/textAtmPressure"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/Temperature"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:minHeight="45dp"
android:ems="20"
android:inputType="number" />
<TextView
android:id="@+id/textTemperature"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="3" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="50dp"
android:orientation="horizontal">
<SeekBar
android:id="@+id/IndexRefraction"
style="@style/Widget.AppCompat.SeekBar.Discrete"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:minHeight="45dp"
android:min="100000"
android:max="120000"
android:progress="100200" />
<TextView
android:id="@+id/textIndexRefraction"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3" />
</LinearLayout>
<TextView
android:id="@+id/WaveTitle"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/WaveR"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:minHeight="45dp"
android:ems="700"
android:inputType="number" />
<EditText
android:id="@+id/WaveG"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:minHeight="45dp"
android:ems="530"
android:inputType="number" />
<EditText
android:id="@+id/WaveB"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:minHeight="45dp"
android:ems="470"
android:inputType="number" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
It's essentially a scrollable list of slider/input on the left, legend on the right. Is there something in this causing the poor performance? Tested on both a pixel 5 emulator and a S21 ultra.
Thanks