Aperture: Rework seconday top bar buttons

Inspired from Glimpse

Change-Id: I06ceb5363636a2de4d2b128491b6613820134c7c
diff --git a/app/src/main/res/layout/activity_camera.xml b/app/src/main/res/layout/activity_camera.xml
index e20889b..f3b4c70 100644
--- a/app/src/main/res/layout/activity_camera.xml
+++ b/app/src/main/res/layout/activity_camera.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
-     SPDX-FileCopyrightText: 2022-2023 The LineageOS Project
+     SPDX-FileCopyrightText: 2022-2024 The LineageOS Project
      SPDX-License-Identifier: Apache-2.0
 -->
 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
@@ -130,105 +130,80 @@
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent">
 
-        <androidx.constraintlayout.widget.ConstraintLayout
+        <LinearLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:paddingHorizontal="16dp"
+            android:gravity="top|center"
             android:paddingVertical="8dp">
 
+            <!-- Cannot mess with fixed padding from here because of insets -->
+            <Space
+                android:layout_width="16dp"
+                android:layout_height="match_parent" />
+
             <!-- Photo mode specific settings -->
             <Button
                 android:id="@+id/aspectRatioButton"
                 style="@style/Theme.Aperture.Camera.SecondaryTopBarButton"
                 android:drawableTop="@drawable/ic_aspect_ratio"
-                android:text="@string/aspect_ratio_4_3"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toStartOf="@+id/effectButton"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toTopOf="parent" />
+                android:text="@string/aspect_ratio_4_3" />
 
             <Button
                 android:id="@+id/effectButton"
                 style="@style/Theme.Aperture.Camera.SecondaryTopBarButton"
                 android:drawableTop="@drawable/ic_blur_off"
-                android:text="@string/effect_none"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toStartOf="@+id/videoQualityButton"
-                app:layout_constraintStart_toEndOf="@+id/aspectRatioButton"
-                app:layout_constraintTop_toTopOf="parent" />
+                android:text="@string/effect_none" />
 
             <!-- Video mode specific settings -->
             <Button
                 android:id="@+id/videoQualityButton"
                 style="@style/Theme.Aperture.Camera.SecondaryTopBarButton"
                 android:drawableTop="@drawable/ic_hd"
-                android:text="@string/video_quality_fhd"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toStartOf="@+id/videoFrameRateButton"
-                app:layout_constraintStart_toEndOf="@+id/effectButton"
-                app:layout_constraintTop_toTopOf="parent" />
+                android:text="@string/video_quality_fhd" />
 
             <Button
                 android:id="@+id/videoFrameRateButton"
                 style="@style/Theme.Aperture.Camera.SecondaryTopBarButton"
                 android:drawableTop="@drawable/ic_video_frame_rate"
-                android:text="@string/video_framerate_auto"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toStartOf="@+id/videoDynamicRangeButton"
-                app:layout_constraintStart_toEndOf="@+id/videoQualityButton"
-                app:layout_constraintTop_toTopOf="parent" />
+                android:text="@string/video_framerate_auto" />
 
             <Button
                 android:id="@+id/videoDynamicRangeButton"
                 style="@style/Theme.Aperture.Camera.SecondaryTopBarButton"
                 android:drawableTop="@drawable/ic_hdr_off"
-                android:text="@string/video_dynamic_range_sdr"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toStartOf="@+id/micButton"
-                app:layout_constraintStart_toEndOf="@+id/videoFrameRateButton"
-                app:layout_constraintTop_toTopOf="parent" />
+                android:text="@string/video_dynamic_range_sdr" />
 
             <Button
                 android:id="@+id/micButton"
                 style="@style/Theme.Aperture.Camera.SecondaryTopBarButton"
                 android:drawableTop="@drawable/ic_mic_off"
-                android:text="@string/mic_off"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toStartOf="@+id/timerButton"
-                app:layout_constraintStart_toEndOf="@+id/videoDynamicRangeButton"
-                app:layout_constraintTop_toTopOf="parent" />
+                android:text="@string/mic_off" />
 
             <!-- Common settings -->
             <Button
                 android:id="@+id/timerButton"
                 style="@style/Theme.Aperture.Camera.SecondaryTopBarButton"
                 android:drawableTop="@drawable/ic_timer_off"
-                android:text="@string/timer_off"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toStartOf="@+id/gridButton"
-                app:layout_constraintStart_toEndOf="@+id/micButton"
-                app:layout_constraintTop_toTopOf="parent" />
+                android:text="@string/timer_off" />
 
             <Button
                 android:id="@+id/gridButton"
                 style="@style/Theme.Aperture.Camera.SecondaryTopBarButton"
                 android:drawableTop="@drawable/ic_grid_3x3_off"
-                android:text="@string/grid_off"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toStartOf="@+id/settingsButton"
-                app:layout_constraintStart_toEndOf="@+id/timerButton"
-                app:layout_constraintTop_toTopOf="parent" />
+                android:text="@string/grid_off" />
 
             <Button
                 android:id="@+id/settingsButton"
                 style="@style/Theme.Aperture.Camera.SecondaryTopBarButton"
                 android:drawableTop="@drawable/ic_settings"
-                android:text="@string/settings"
-                app:layout_constraintBottom_toBottomOf="parent"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toEndOf="@+id/gridButton"
-                app:layout_constraintTop_toTopOf="parent" />
-        </androidx.constraintlayout.widget.ConstraintLayout>
+                android:text="@string/settings" />
+
+            <!-- Cannot mess with fixed padding from here because of insets -->
+            <Space
+                android:layout_width="16dp"
+                android:layout_height="match_parent" />
+
+        </LinearLayout>
 
     </HorizontalScrollView>
 
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
index 92d917a..24ace57 100644
--- a/app/src/main/res/values/themes.xml
+++ b/app/src/main/res/values/themes.xml
@@ -35,11 +35,10 @@
 
     <!-- Secondary top bar icons theme -->
     <style name="Theme.Aperture.Camera.SecondaryTopBarButton" parent="Theme.Aperture.Camera.SecondaryBarButton">
-        <item name="android:layout_width">0dp</item>
+        <item name="android:layout_width">96dp</item>
         <item name="android:layout_height">wrap_content</item>
-        <item name="layout_constraintDimensionRatio">1:1</item>
-        <item name="layout_constraintHorizontal_bias">0.5</item>
-        <item name="layout_constraintVertical_bias">0.0</item>
+        <item name="android:hyphenationFrequency">normal</item>
+        <item name="android:maxLines">3</item>
         <item name="android:paddingHorizontal">0dp</item>
         <item name="android:textStyle">bold</item>
         <item name="android:typeface">monospace</item>