Ver código fonte

feat(options): add titles to configuration views (#181)

Co-authored-by: Joshua Kuestersteffen <jkuester@kuester7.com>
Klaus-Hendrik Wolf 2 anos atrás
pai
commit
da163e7d31

+ 11 - 1
app/src/main/java/com/sduduzog/slimlauncher/ui/options/CustomiseAppsFragment.kt

@@ -20,7 +20,11 @@ import com.sduduzog.slimlauncher.utils.BaseFragment
 import com.sduduzog.slimlauncher.utils.OnItemActionListener
 import com.sduduzog.slimlauncher.utils.OnShitDoneToAppsListener
 import dagger.hilt.android.AndroidEntryPoint
-import kotlinx.android.synthetic.main.customise_apps_fragment.*
+import kotlinx.android.synthetic.main.customise_apps_fragment.customise_apps_fragment
+import kotlinx.android.synthetic.main.customise_apps_fragment.customise_apps_fragment_add
+import kotlinx.android.synthetic.main.customise_apps_fragment.customise_apps_fragment_back
+import kotlinx.android.synthetic.main.customise_apps_fragment.customise_apps_fragment_list
+import kotlinx.android.synthetic.main.customise_apps_fragment.customise_apps_fragment_remove_all
 
 
 @AndroidEntryPoint
@@ -34,6 +38,12 @@ class CustomiseAppsFragment : BaseFragment(), OnShitDoneToAppsListener {
         return inflater.inflate(R.layout.customise_apps_fragment, container, false)
     }
 
+    override fun onActivityCreated(savedInstanceState: Bundle?) {
+        super.onActivityCreated(savedInstanceState)
+        customise_apps_fragment_back.setOnClickListener {
+            requireActivity().onBackPressedDispatcher.onBackPressed()
+        }
+    }
     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
         super.onViewCreated(view, savedInstanceState)
         val adapter = CustomAppsAdapter(this)

+ 7 - 1
app/src/main/java/com/sduduzog/slimlauncher/ui/options/CustomizeAppDrawerAppListFragment.kt

@@ -9,7 +9,10 @@ import com.sduduzog.slimlauncher.adapters.CustomizeAppDrawerAppsAdapter
 import com.sduduzog.slimlauncher.datasource.UnlauncherDataSource
 import com.sduduzog.slimlauncher.utils.BaseFragment
 import dagger.hilt.android.AndroidEntryPoint
-import kotlinx.android.synthetic.main.customize_app_drawer_app_list_fragment.*
+import kotlinx.android.synthetic.main.customize_app_drawer_app_list_fragment.customize_app_drawer_fragment
+import kotlinx.android.synthetic.main.customize_app_drawer_app_list_fragment.customize_app_drawer_fragment_app_list
+import kotlinx.android.synthetic.main.customize_app_drawer_app_list_fragment.customize_app_drawer_fragment_app_progress_bar
+import kotlinx.android.synthetic.main.customize_app_drawer_app_list_fragment.customize_app_drawer_fragment_back
 import javax.inject.Inject
 
 @AndroidEntryPoint
@@ -39,5 +42,8 @@ class CustomizeAppDrawerAppListFragment : BaseFragment() {
                 customize_app_drawer_fragment_app_progress_bar.visibility = View.VISIBLE
             }
         }
+        customize_app_drawer_fragment_back.setOnClickListener {
+            requireActivity().onBackPressedDispatcher.onBackPressed()
+        }
     }
 }

+ 5 - 0
app/src/main/java/com/sduduzog/slimlauncher/ui/options/CustomizeAppDrawerFragment.kt

@@ -12,6 +12,7 @@ import com.sduduzog.slimlauncher.utils.BaseFragment
 import com.sduduzog.slimlauncher.utils.createTitleAndSubtitleText
 import dagger.hilt.android.AndroidEntryPoint
 import kotlinx.android.synthetic.main.customize_app_drawer_fragment.customize_app_drawer_fragment
+import kotlinx.android.synthetic.main.customize_app_drawer_fragment.customize_app_drawer_fragment_back
 import kotlinx.android.synthetic.main.customize_app_drawer_fragment.customize_app_drawer_fragment_search_options
 import kotlinx.android.synthetic.main.customize_app_drawer_fragment.customize_app_drawer_fragment_show_headings_switch
 import kotlinx.android.synthetic.main.customize_app_drawer_fragment.customize_app_drawer_fragment_visible_apps
@@ -37,6 +38,10 @@ class CustomizeAppDrawerFragment : BaseFragment() {
         customize_app_drawer_fragment_visible_apps
             .setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_customiseAppDrawerFragment_to_customiseAppDrawerAppListFragment))
 
+        customize_app_drawer_fragment_back.setOnClickListener{
+            requireActivity().onBackPressedDispatcher.onBackPressed()
+        }
+        
         setupSearchFieldOptionsButton()
         setupHeadingSwitch()
     }

+ 4 - 0
app/src/main/java/com/sduduzog/slimlauncher/ui/options/CustomizeQuickButtonsFragment.kt

@@ -11,6 +11,7 @@ import com.sduduzog.slimlauncher.ui.dialogs.ChooseQuickButtonDialog
 import com.sduduzog.slimlauncher.utils.BaseFragment
 import dagger.hilt.android.AndroidEntryPoint
 import kotlinx.android.synthetic.main.customize_quick_buttons_fragment.customize_quick_buttons_fragment
+import kotlinx.android.synthetic.main.customize_quick_buttons_fragment.customize_quick_buttons_fragment_back
 import kotlinx.android.synthetic.main.customize_quick_buttons_fragment.customize_quick_buttons_fragment_center
 import kotlinx.android.synthetic.main.customize_quick_buttons_fragment.customize_quick_buttons_fragment_left
 import kotlinx.android.synthetic.main.customize_quick_buttons_fragment.customize_quick_buttons_fragment_right
@@ -42,6 +43,9 @@ class CustomizeQuickButtonsFragment : BaseFragment() {
                 .setImageResource(QuickButtonPreferencesRepository.RES_BY_ICON.getValue(prefs.rightButton.iconId))
         }
 
+        customize_quick_buttons_fragment_back.setOnClickListener {
+            requireActivity().onBackPressedDispatcher.onBackPressed()
+        }
         customize_quick_buttons_fragment_left.setOnClickListener {
             ChooseQuickButtonDialog(
                 prefsRepo,

+ 5 - 0
app/src/main/java/com/sduduzog/slimlauncher/ui/options/CustomizeSearchFieldFragment.kt

@@ -10,6 +10,7 @@ import com.sduduzog.slimlauncher.ui.dialogs.ChooseSearchBarPositionDialog
 import com.sduduzog.slimlauncher.utils.BaseFragment
 import com.sduduzog.slimlauncher.utils.createTitleAndSubtitleText
 import dagger.hilt.android.AndroidEntryPoint
+import kotlinx.android.synthetic.main.customize_app_drawer_fragment_search_field_options.customise_apps_fragment_back
 import kotlinx.android.synthetic.main.customize_app_drawer_fragment_search_field_options.customize_app_drawer_fragment_search_field_options
 
 import kotlinx.android.synthetic.main.customize_app_drawer_fragment_search_field_options.customize_app_drawer_fragment_search_field_position
@@ -40,6 +41,10 @@ class CustomizeSearchFieldFragment : BaseFragment() {
     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
         super.onViewCreated(view, savedInstanceState)
 
+        customise_apps_fragment_back.setOnClickListener{
+            requireActivity().onBackPressedDispatcher.onBackPressed()
+        }
+
         setupShowSearchBarSwitch()
         setupSearchBarPositionOption()
         setupKeyboardSwitch()

+ 3 - 0
app/src/main/java/com/sduduzog/slimlauncher/ui/options/OptionsFragment.kt

@@ -41,6 +41,9 @@ class OptionsFragment : BaseFragment() {
             val intent = Intent(Settings.ACTION_SETTINGS)
             launchActivity(it, intent)
         }
+        options_fragment_back.setOnClickListener{
+            requireActivity().onBackPressedDispatcher.onBackPressed()
+        }
         options_fragment_device_settings.setOnLongClickListener {
             val intent = Intent(Settings.ACTION_HOME_SETTINGS)
             launchActivity(it, intent)

+ 9 - 0
app/src/main/res/drawable/ic_back.xml

@@ -0,0 +1,9 @@
+<vector
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:autoMirrored="true"
+    android:height="24dp" android:width="24dp"
+    android:viewportHeight="24" android:viewportWidth="24">
+    <path
+        android:fillColor="?attr/colorAccent"
+        android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
+</vector>

+ 3 - 13
app/src/main/res/layout/add_app_fragment.xml

@@ -5,17 +5,15 @@
     android:id="@+id/add_app_fragment"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:layout_marginTop="@dimen/_8sdp"
+    android:layout_marginStart="@dimen/_16sdp"
+    android:layout_marginEnd="@dimen/_16sdp"
     tools:context=".ui.options.AddAppFragment">
 
     <EditText
         android:id="@+id/add_app_fragment_edit_text"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginStart="8dp"
-        android:layout_marginLeft="8dp"
-        android:layout_marginTop="32dp"
-        android:layout_marginEnd="8dp"
-        android:layout_marginRight="8dp"
         android:ems="10"
         android:imeOptions="actionDone"
         android:inputType="none|textNoSuggestions|textCapWords"
@@ -30,10 +28,6 @@
         android:id="@+id/add_app_fragment_list"
         android:layout_width="0dp"
         android:layout_height="0dp"
-        android:layout_marginStart="8dp"
-        android:layout_marginLeft="8dp"
-        android:layout_marginEnd="8dp"
-        android:layout_marginRight="8dp"
         app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
@@ -46,11 +40,7 @@
         style="?android:attr/progressBarStyle"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginStart="8dp"
-        android:layout_marginLeft="8dp"
         android:layout_marginTop="8dp"
-        android:layout_marginEnd="8dp"
-        android:layout_marginRight="8dp"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"

+ 20 - 13
app/src/main/res/layout/customise_apps_fragment.xml

@@ -5,25 +5,33 @@
     android:id="@+id/customise_apps_fragment"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:layout_marginStart="8dp"
-    android:layout_marginLeft="8dp"
-    android:layout_marginEnd="8dp"
-    android:layout_marginRight="8dp"
+    android:layout_marginTop="@dimen/_8sdp"
+    android:layout_marginStart="@dimen/_16sdp"
+    android:layout_marginEnd="@dimen/_16sdp"
     tools:context=".ui.options.CustomiseAppsFragment">
 
-    <TextView
-        android:id="@+id/textView6"
+    <ImageView
+        android:id="@+id/customise_apps_fragment_back"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginStart="@dimen/_8sdp"
+        android:padding="@dimen/_8ssp"
+        android:paddingStart="0dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:srcCompat="@drawable/ic_back"
+        android:contentDescription="@string/content_description_back"
+        tools:ignore="RtlSymmetry" />
+    <TextView
+        android:id="@+id/customise_apps_fragment_title"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
         android:textColor="?headerTextColor"
-        android:layout_marginTop="@dimen/_8sdp"
         android:text="@string/options_fragment_customise_apps"
         android:textAppearance="@style/TextAppearance.AppCompat"
         android:textSize="@dimen/font_size_customize_title"
-        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/customise_apps_fragment_back"
+        app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
-
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/customise_apps_fragment_list"
         android:layout_width="0dp"
@@ -32,11 +40,10 @@
         app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/textView6"
+        app:layout_constraintTop_toBottomOf="@+id/customise_apps_fragment_title"
         app:layout_constraintBottom_toBottomOf="parent"
         tools:itemCount="5"
         tools:listitem="@layout/customise_apps_fragment_list_item" />
-
     <TextView
         android:id="@+id/customise_apps_fragment_add"
         android:layout_width="wrap_content"
@@ -48,7 +55,6 @@
         android:textSize="@dimen/font_size_add_apps_action"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintStart_toStartOf="parent" />
-
     <TextView
         android:id="@+id/customise_apps_fragment_remove_all"
         android:layout_width="wrap_content"
@@ -59,4 +65,5 @@
         android:textSize="@dimen/font_size_add_apps_action"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent" />
+
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 0 - 2
app/src/main/res/layout/customise_apps_fragment_list_item.xml

@@ -28,8 +28,6 @@
         android:id="@+id/ca_list_item_app_name"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginStart="8dp"
-        android:layout_marginLeft="8dp"
         android:ellipsize="end"
         android:maxLines="1"
         android:singleLine="true"

+ 28 - 5
app/src/main/res/layout/customize_app_drawer_app_list_fragment.xml

@@ -5,21 +5,44 @@
     android:id="@+id/customize_app_drawer_fragment"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:layout_marginStart="8dp"
-    android:layout_marginLeft="8dp"
-    android:layout_marginEnd="8dp"
-    android:layout_marginRight="8dp"
+    android:layout_marginStart="@dimen/_16sdp"
+    android:layout_marginEnd="@dimen/_16sdp"
+    android:layout_marginTop="@dimen/_8sdp"
     tools:context=".ui.options.CustomizeAppDrawerFragment">
 
+    <ImageView
+        android:id="@+id/customize_app_drawer_fragment_back"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="@dimen/_8ssp"
+        android:paddingStart="0dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:srcCompat="@drawable/ic_back"
+        android:contentDescription="@string/content_description_back"
+        tools:ignore="RtlSymmetry" />
+    <TextView
+        android:id="@+id/customize_app_drawer_fragment_app_list_title"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:textColor="?headerTextColor"
+        android:text="@string/customize_app_drawer_fragment_visible_apps"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="@dimen/font_size_customize_title"
+        app:layout_constraintStart_toEndOf="@+id/customize_app_drawer_fragment_back"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/customize_app_drawer_fragment_app_list"
         android:layout_width="0dp"
         android:layout_height="0dp"
+        android:layout_marginTop="@dimen/_16sdp"
         app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/customize_app_drawer_fragment_app_list_title"
         tools:listitem="@layout/customize_app_drawer_fragment_app_list_item" />
 
     <ProgressBar

+ 64 - 31
app/src/main/res/layout/customize_app_drawer_fragment.xml

@@ -6,45 +6,78 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_marginStart="@dimen/_16sdp"
-    android:layout_marginLeft="@dimen/_16sdp"
     android:layout_marginEnd="@dimen/_16sdp"
-    android:layout_marginRight="@dimen/_16sdp"
+    android:layout_marginTop="@dimen/_8sdp"
     tools:context=".ui.options.CustomizeAppDrawerFragment">
 
-    <TextView
-        android:id="@+id/customize_app_drawer_fragment_visible_apps"
-        android:layout_width="match_parent"
+    <ImageView
+        android:id="@+id/customize_app_drawer_fragment_back"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginTop="32dp"
-        android:textColor="?headerTextColor"
-        android:text="@string/customize_app_drawer_fragment_visible_apps"
-        android:textAppearance="@style/TextAppearance.AppCompat"
-        android:textSize="@dimen/font_size_customize_options"
+        android:padding="@dimen/_8ssp"
+        android:paddingStart="0dp"
+        app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-
+        app:srcCompat="@drawable/ic_back"
+        android:contentDescription="@string/content_description_back"
+        tools:ignore="RtlSymmetry" />
     <TextView
-        android:id="@+id/customize_app_drawer_fragment_search_options"
-        android:layout_width="match_parent"
+        android:id="@+id/customize_app_drawer_title"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginTop="32dp"
-        android:layout_marginEnd="@dimen/_16sdp"
-        android:text="@string/customize_app_drawer_fragment_search_field_options"
+        android:text="@string/options_fragment_customize_app_drawer"
         android:textAppearance="@style/TextAppearance.AppCompat"
-        android:textSize="@dimen/font_size_customize_options"
-        app:layout_constraintStart_toStartOf="@id/customize_app_drawer_fragment_visible_apps"
-        app:layout_constraintTop_toBottomOf="@id/customize_app_drawer_fragment_visible_apps" />
+        android:textSize="@dimen/font_size_customize_title"
+        app:layout_constraintStart_toEndOf="@+id/customize_app_drawer_fragment_back"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
 
-    <androidx.appcompat.widget.SwitchCompat
-        android:id="@+id/customize_app_drawer_fragment_show_headings_switch"
+    <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="32dp"
-        android:layout_marginEnd="@dimen/_16sdp"
-        android:text="@string/customize_app_drawer_fragment_show_headings"
-        android:textAppearance="@style/TextAppearance.AppCompat"
-        android:textSize="@dimen/font_size_customize_options"
-        app:layout_constraintStart_toStartOf="parent"
-        android:textColor="?switchTextColor"
-        app:layout_constraintTop_toBottomOf="@id/customize_app_drawer_fragment_search_options" />
+        android:layout_height="0dp"
+        android:layout_marginTop="@dimen/margin_list_items"
+        android:layout_marginStart="@dimen/_8sdp"
+        android:overScrollMode="ifContentScrolls"
+        android:scrollbars="none"
+        app:layout_constraintTop_toBottomOf="@id/customize_app_drawer_title">
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingBottom="@dimen/_100sdp">
+
+            <TextView
+                android:id="@+id/customize_app_drawer_fragment_visible_apps"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:textColor="?headerTextColor"
+                android:text="@string/customize_app_drawer_fragment_visible_apps"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+            <TextView
+                android:id="@+id/customize_app_drawer_fragment_search_options"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/margin_list_items"
+                android:text="@string/customize_app_drawer_fragment_search_field_options"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/customize_app_drawer_fragment_visible_apps" />
+            <androidx.appcompat.widget.SwitchCompat
+                android:id="@+id/customize_app_drawer_fragment_show_headings_switch"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/margin_list_items"
+                android:text="@string/customize_app_drawer_fragment_show_headings"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                app:layout_constraintStart_toStartOf="parent"
+                android:textColor="?switchTextColor"
+                app:layout_constraintTop_toBottomOf="@id/customize_app_drawer_fragment_search_options" />
+
+        </androidx.constraintlayout.widget.ConstraintLayout>
+    </ScrollView>
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 76 - 43
app/src/main/res/layout/customize_app_drawer_fragment_search_field_options.xml

@@ -4,59 +4,92 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:id="@+id/customize_app_drawer_fragment_search_field_options"
     android:layout_marginStart="@dimen/_16sdp"
-    android:layout_marginLeft="@dimen/_16sdp"
     android:layout_marginEnd="@dimen/_16sdp"
-    android:layout_marginRight="@dimen/_16sdp"
+    android:layout_marginTop="@dimen/_8sdp"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     tools:context=".ui.options.CustomizeSearchFieldFragment">
 
-    <TextView
-        android:id="@+id/customize_app_drawer_fragment_search_field_position"
-        android:layout_width="match_parent"
+    <ImageView
+        android:id="@+id/customise_apps_fragment_back"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginTop="32dp"
-        android:text="@string/customize_app_drawer_fragment_search_bar_position"
-        android:textAppearance="@style/TextAppearance.AppCompat"
-        android:textSize="@dimen/_20ssp"
-        app:layout_constraintStart_toStartOf="@id/customize_app_drawer_fragment_show_search_field_switch"
-        app:layout_constraintTop_toBottomOf="@id/customize_app_drawer_fragment_show_search_field_switch" />
-
-    <androidx.appcompat.widget.SwitchCompat
-        android:id="@+id/customize_app_drawer_fragment_show_search_field_switch"
-        android:layout_width="match_parent"
+        android:padding="@dimen/_8ssp"
+        android:paddingStart="0dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:srcCompat="@drawable/ic_back"
+        android:contentDescription="@string/content_description_back"
+        tools:ignore="RtlSymmetry" />
+    <TextView
+        android:id="@+id/customise_apps_fragment_title"
+        android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginTop="32dp"
-        android:text="@string/customize_app_drawer_fragment_show_search_bar"
+        android:textColor="?headerTextColor"
+        android:text="@string/customize_app_drawer_fragment_search_field_options"
         android:textAppearance="@style/TextAppearance.AppCompat"
-        android:textSize="@dimen/_20ssp"
-        android:textColor="?switchTextColor"
-        app:layout_constraintStart_toStartOf="parent"
+        android:textSize="@dimen/font_size_customize_title"
+        app:layout_constraintStart_toEndOf="@+id/customise_apps_fragment_back"
+        app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
 
-    <androidx.appcompat.widget.SwitchCompat
-        android:id="@+id/customize_app_drawer_open_keyboard_switch"
+    <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="32dp"
-        android:layout_marginBottom="32dp"
-        android:text="@string/customize_app_drawer_fragment_open_keyboard"
-        android:textAppearance="@style/TextAppearance.AppCompat"
-        android:textSize="@dimen/_20ssp"
-        android:textColor="?switchTextColor"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@id/customize_app_drawer_fragment_search_field_position" />
+        android:layout_height="0dp"
+        android:layout_marginTop="@dimen/_16sdp"
+        android:layout_marginStart="@dimen/_8sdp"
+        android:overScrollMode="ifContentScrolls"
+        android:scrollbars="none"
+        app:layout_constraintTop_toBottomOf="@id/customise_apps_fragment_title">
 
-    <androidx.appcompat.widget.SwitchCompat
-        android:id="@+id/customize_app_drawer_search_all_switch"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="32dp"
-        android:layout_marginBottom="32dp"
-        android:text="@string/customize_app_drawer_fragment_search_all"
-        android:textAppearance="@style/TextAppearance.AppCompat"
-        android:textSize="@dimen/font_size_customize_options"
-        android:textColor="?switchTextColor"
-        app:layout_constraintTop_toBottomOf="@id/customize_app_drawer_open_keyboard_switch"
-        app:layout_constraintStart_toStartOf="parent"/>
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingBottom="@dimen/_100sdp">
+
+            <androidx.appcompat.widget.SwitchCompat
+                android:id="@+id/customize_app_drawer_fragment_show_search_field_switch"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/customize_app_drawer_fragment_show_search_bar"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                android:textColor="?switchTextColor"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+            <TextView
+                android:id="@+id/customize_app_drawer_fragment_search_field_position"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/margin_list_items"
+                android:text="@string/customize_app_drawer_fragment_search_bar_position"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/customize_app_drawer_fragment_show_search_field_switch" />
+            <androidx.appcompat.widget.SwitchCompat
+                android:id="@+id/customize_app_drawer_open_keyboard_switch"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/margin_list_items"
+                android:text="@string/customize_app_drawer_fragment_open_keyboard"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                android:textColor="?switchTextColor"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/customize_app_drawer_fragment_search_field_position" />
+            <androidx.appcompat.widget.SwitchCompat
+                android:id="@+id/customize_app_drawer_search_all_switch"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/margin_list_items"
+                android:text="@string/customize_app_drawer_fragment_search_all"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                android:textColor="?switchTextColor"
+                app:layout_constraintTop_toBottomOf="@id/customize_app_drawer_open_keyboard_switch"
+                app:layout_constraintStart_toStartOf="parent"/>
+
+        </androidx.constraintlayout.widget.ConstraintLayout>
+    </ScrollView>
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 17 - 7
app/src/main/res/layout/customize_quick_buttons_fragment.xml

@@ -5,21 +5,33 @@
     android:id="@+id/customize_quick_buttons_fragment"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:layout_marginStart="@dimen/_16sdp"
+    android:layout_marginEnd="@dimen/_16sdp"
+    android:layout_marginTop="@dimen/_8sdp"
     tools:context=".ui.options.CustomizeQuickButtonsFragment">
 
+    <ImageView
+        android:id="@+id/customize_quick_buttons_fragment_back"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="@dimen/_8ssp"
+        android:paddingStart="0dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:srcCompat="@drawable/ic_back"
+        android:contentDescription="@string/content_description_back"
+        tools:ignore="RtlSymmetry" />
     <TextView
         android:id="@+id/customize_quick_buttons_fragment_header"
-        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginStart="@dimen/_16sdp"
-        android:layout_marginTop="@dimen/_8sdp"
+        android:layout_width="0dp"
         android:text="@string/options_fragment_customize_quick_buttons"
         android:textColor="?headerTextColor"
         android:textAppearance="@style/TextAppearance.AppCompat"
         android:textSize="@dimen/font_size_customize_title"
-        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintStart_toEndOf="@id/customize_quick_buttons_fragment_back"
+        app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="parent" />
-
     <ImageView
         android:id="@+id/customize_quick_buttons_fragment_left"
         android:layout_width="wrap_content"
@@ -32,7 +44,6 @@
         app:layout_constraintStart_toStartOf="parent"
         app:srcCompat="@drawable/ic_call"
         tools:ignore="ContentDescription" />
-
     <ImageView
         android:id="@+id/customize_quick_buttons_fragment_center"
         android:layout_width="wrap_content"
@@ -46,7 +57,6 @@
         app:layout_constraintStart_toEndOf="@+id/customize_quick_buttons_fragment_left"
         app:srcCompat="@drawable/ic_cog"
         tools:ignore="ContentDescription" />
-
     <ImageView
         android:id="@+id/customize_quick_buttons_fragment_right"
         android:layout_width="wrap_content"

+ 130 - 138
app/src/main/res/layout/options_fragment.xml

@@ -1,151 +1,143 @@
 <?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+<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:id="@+id/options_fragment"
+    android:layout_marginStart="@dimen/_16sdp"
+    android:layout_marginEnd="@dimen/_16sdp"
+    android:layout_marginTop="@dimen/_8sdp"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:overScrollMode="ifContentScrolls"
-    android:scrollbars="none">
+    tools:context=".ui.options.OptionsFragment">
 
-    <androidx.constraintlayout.widget.ConstraintLayout
-        android:id="@+id/options_fragment"
-        android:layout_width="match_parent"
+    <ImageView
+        android:id="@+id/options_fragment_back"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginStart="24dp"
-        android:layout_marginEnd="24dp"
-        tools:context=".ui.options.OptionsFragment">
-
-        <TextView
-            android:id="@+id/textView5"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="@dimen/_8sdp"
-            android:stateListAnimator="@xml/animate_scale"
-            android:text="@string/main_fragment_options"
-            android:textAppearance="@style/TextAppearance.AppCompat"
-            android:textColor="?headerTextColor"
-            android:textSize="@dimen/font_size_customize_title"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent" />
-
-        <TextView
-            android:id="@+id/options_fragment_device_settings"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="32dp"
-            android:text="@string/options_fragment_device_settings"
-            android:textAppearance="@style/TextAppearance.AppCompat"
-            android:textSize="@dimen/_20ssp"
-            app:layout_constraintBottom_toTopOf="@+id/options_fragment_change_theme"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/textView5"
-            app:layout_constraintVertical_bias="0.17000002"
-            app:layout_constraintVertical_chainStyle="packed" />
-
-        <TextView
-            android:id="@+id/options_fragment_change_theme"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="32dp"
-            android:stateListAnimator="@xml/animate_scale"
-            android:text="@string/options_fragment_change_theme"
-            android:textAppearance="@style/TextAppearance.AppCompat"
-            android:textSize="@dimen/font_size_customize_options"
-            app:layout_constraintBottom_toTopOf="@+id/options_fragment_choose_time_format"
-            app:layout_constraintStart_toStartOf="@+id/options_fragment_device_settings"
-            app:layout_constraintTop_toBottomOf="@+id/options_fragment_device_settings" />
-
-        <TextView
-            android:id="@+id/options_fragment_choose_time_format"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="32dp"
-            android:stateListAnimator="@xml/animate_scale"
-            android:text="@string/options_fragment_choose_time_format"
-            android:textAppearance="@style/TextAppearance.AppCompat"
-            android:textSize="@dimen/font_size_customize_options"
-            app:layout_constraintBottom_toTopOf="@+id/options_fragment_toggle_status_bar"
-            app:layout_constraintStart_toStartOf="@+id/options_fragment_change_theme"
-            app:layout_constraintTop_toBottomOf="@+id/options_fragment_change_theme" />
-
-        <TextView
-            android:id="@+id/options_fragment_toggle_status_bar"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="32dp"
-            android:stateListAnimator="@xml/animate_scale"
-            android:text="@string/options_fragment_toggle_status_bar"
-            android:textAppearance="@style/TextAppearance.AppCompat"
-            android:textSize="@dimen/font_size_customize_options"
-            app:layout_constraintBottom_toTopOf="@+id/options_fragment_customise_apps"
-            app:layout_constraintStart_toStartOf="@+id/options_fragment_choose_time_format"
-            app:layout_constraintTop_toBottomOf="@+id/options_fragment_choose_time_format" />
-
-        <TextView
-            android:id="@+id/options_fragment_customise_apps"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="32dp"
-            android:layout_marginBottom="32dp"
-            android:stateListAnimator="@xml/animate_scale"
-            android:text="@string/options_fragment_customise_apps"
-            android:textAppearance="@style/TextAppearance.AppCompat"
-            android:textSize="@dimen/font_size_customize_options"
-            app:layout_constraintBottom_toTopOf="@id/options_fragment_choose_alignment"
-            app:layout_constraintStart_toStartOf="@+id/options_fragment_toggle_status_bar"
-            app:layout_constraintTop_toBottomOf="@id/options_fragment_toggle_status_bar" />
-
-        <TextView
-            android:id="@+id/options_fragment_choose_alignment"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:stateListAnimator="@xml/animate_scale"
-            android:text="@string/options_fragment_choose_alignment"
-            android:textAppearance="@style/TextAppearance.AppCompat"
-            android:textSize="@dimen/_20ssp"
-            app:layout_constraintBottom_toTopOf="@id/options_fragment_customize_quick_buttons"
-            app:layout_constraintStart_toStartOf="@+id/options_fragment_customise_apps"
-            app:layout_constraintTop_toBottomOf="@id/options_fragment_customise_apps" />
+        android:padding="@dimen/_8ssp"
+        android:paddingStart="0dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:srcCompat="@drawable/ic_back"
+        android:contentDescription="@string/content_description_back"
+        tools:ignore="RtlSymmetry" />
+    <TextView
+        android:id="@+id/options_fragment_title"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:textColor="?headerTextColor"
+        android:text="@string/main_fragment_options"
+        android:textAppearance="@style/TextAppearance.AppCompat"
+        android:textSize="@dimen/font_size_customize_title"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toEndOf="@id/options_fragment_back" />
 
-        <TextView
-            android:id="@+id/options_fragment_customize_quick_buttons"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="32dp"
-            android:layout_marginBottom="32dp"
-            android:stateListAnimator="@xml/animate_scale"
-            android:text="@string/options_fragment_customize_quick_buttons"
-            android:textAppearance="@style/TextAppearance.AppCompat"
-            android:textSize="@dimen/font_size_customize_options"
-            app:layout_constraintBottom_toTopOf="@id/options_fragment_customize_app_drawer"
-            app:layout_constraintStart_toStartOf="@+id/options_fragment_choose_alignment"
-            app:layout_constraintTop_toBottomOf="@+id/options_fragment_choose_alignment" />
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_marginTop="@dimen/_16sdp"
+        android:layout_marginStart="@dimen/_8sdp"
+        android:overScrollMode="ifContentScrolls"
+        android:scrollbars="none"
+        app:layout_constraintTop_toBottomOf="@+id/options_fragment_title" >
 
-        <TextView
-            android:id="@+id/options_fragment_customize_app_drawer"
+        <androidx.constraintlayout.widget.ConstraintLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginTop="32dp"
-            android:layout_marginBottom="32dp"
-            android:stateListAnimator="@xml/animate_scale"
-            android:text="@string/options_fragment_customize_app_drawer"
-            android:textAppearance="@style/TextAppearance.AppCompat"
-            android:textSize="@dimen/font_size_customize_options"
-            app:layout_constraintStart_toStartOf="@+id/options_fragment_customize_quick_buttons"
-            app:layout_constraintTop_toBottomOf="@+id/options_fragment_customize_quick_buttons"
-            />
+            android:paddingBottom="@dimen/_100sdp">
 
-        <androidx.appcompat.widget.SwitchCompat
-            android:id="@+id/options_fragment_auto_device_theme_wallpaper"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="32dp"
-            android:textColor="?switchTextColor"
-            android:text="@string/customize_app_drawer_fragment_auto_theme_wallpaper_text"
-            android:textAppearance="@style/TextAppearance.AppCompat"
-            android:textSize="@dimen/font_size_customize_options"
-            app:layout_constraintStart_toStartOf="@+id/options_fragment_customize_app_drawer"
-            app:layout_constraintTop_toBottomOf="@id/options_fragment_customize_app_drawer" />
-    </androidx.constraintlayout.widget.ConstraintLayout>
+            <TextView
+                android:id="@+id/options_fragment_device_settings"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/options_fragment_device_settings"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+            <TextView
+                android:id="@+id/options_fragment_change_theme"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/margin_list_items"
+                android:text="@string/options_fragment_change_theme"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/options_fragment_device_settings" />
+            <TextView
+                android:id="@+id/options_fragment_choose_time_format"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/margin_list_items"
+                android:text="@string/options_fragment_choose_time_format"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/options_fragment_change_theme" />
+            <TextView
+                android:id="@+id/options_fragment_toggle_status_bar"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/margin_list_items"
+                android:text="@string/options_fragment_toggle_status_bar"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/options_fragment_choose_time_format" />
+            <TextView
+                android:id="@+id/options_fragment_customise_apps"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/margin_list_items"
+                android:text="@string/options_fragment_customise_apps"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/options_fragment_toggle_status_bar" />
+            <TextView
+                android:id="@+id/options_fragment_choose_alignment"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/margin_list_items"
+                android:text="@string/options_fragment_choose_alignment"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/options_fragment_customise_apps" />
+            <TextView
+                android:id="@+id/options_fragment_customize_quick_buttons"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/margin_list_items"
+                android:text="@string/options_fragment_customize_quick_buttons"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/options_fragment_choose_alignment" />
+            <TextView
+                android:id="@+id/options_fragment_customize_app_drawer"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/margin_list_items"
+                android:text="@string/options_fragment_customize_app_drawer"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/options_fragment_customize_quick_buttons" />
+            <androidx.appcompat.widget.SwitchCompat
+                android:id="@+id/options_fragment_auto_device_theme_wallpaper"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/margin_list_items"
+                android:textColor="?switchTextColor"
+                android:text="@string/customize_app_drawer_fragment_auto_theme_wallpaper_text"
+                android:textAppearance="@style/TextAppearance.AppCompat"
+                android:textSize="@dimen/font_size_customize_options"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/options_fragment_customize_app_drawer" />
 
-</ScrollView>
+        </androidx.constraintlayout.widget.ConstraintLayout>
+    </ScrollView>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 2 - 0
app/src/main/res/values/dimens.xml

@@ -17,4 +17,6 @@
     <dimen name="font_size_customize_apps_list_item">@dimen/_24ssp</dimen>
     <dimen name="font_size_add_apps_search">@dimen/_18ssp</dimen>
     <dimen name="font_size_add_apps_action">@dimen/_18ssp</dimen>
+    
+    <dimen name="margin_list_items">@dimen/_24sdp</dimen>
 </resources>

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -41,6 +41,7 @@
     <string name="prefs_settings_key_time_format" translatable="false">time_format</string>
     <string name="prefs_settings_key_toggle_status_bar" translatable="false">hide_status_bar</string>
     <string name="prefs_settings_alignment" translatable="false">alignment</string>
+    <string name="content_description_back">Back</string>
     <string name="choose_time_format_dialog_title">Choose Time Format</string>
     <string name="main_fragment_options">Options</string>
     <string name="options_fragment_device_settings">Device Settings</string>