android: Settings UI tweaks

New spacing and fonts for list items
This commit is contained in:
Charles Lombardo 2023-05-22 15:13:18 -04:00 committed by bunnei
parent 412c95e0b0
commit e42c966110
6 changed files with 24 additions and 23 deletions

View file

@ -77,7 +77,7 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
} }
private fun addConfigSettings(sl: ArrayList<SettingsItem>) { private fun addConfigSettings(sl: ArrayList<SettingsItem>) {
settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.preferences_settings)) settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.preferences_advanced_settings))
sl.apply { sl.apply {
add( add(
SubmenuSetting( SubmenuSetting(

View file

@ -35,6 +35,7 @@
android:id="@+id/frame_content" android:id="@+id/frame_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginHorizontal="12dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<View <View

View file

@ -3,29 +3,29 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:minHeight="72dp" android:minHeight="72dp"
android:paddingBottom="@dimen/spacing_large" android:padding="@dimen/spacing_large">
android:paddingTop="@dimen/spacing_large">
<TextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/text_setting_name"
style="@style/TextAppearance.Material3.HeadlineMedium" style="@style/TextAppearance.Material3.HeadlineMedium"
android:id="@+id/text_setting_name"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginStart="@dimen/spacing_large"
android:textSize="16sp" android:textSize="16sp"
android:textAlignment="viewStart" android:textAlignment="viewStart"
app:lineHeight="28dp"
tools:text="Setting Name" /> tools:text="Setting Name" />
<TextView <TextView
style="@style/TextAppearance.Material3.BodySmall"
android:id="@+id/text_setting_description" android:id="@+id/text_setting_description"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -33,8 +33,6 @@
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignStart="@+id/text_setting_name" android:layout_alignStart="@+id/text_setting_name"
android:layout_below="@+id/text_setting_name" android:layout_below="@+id/text_setting_name"
android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginTop="@dimen/spacing_small" android:layout_marginTop="@dimen/spacing_small"
android:visibility="visible" android:visibility="visible"
android:textAlignment="viewStart" android:textAlignment="viewStart"

View file

@ -3,35 +3,37 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:minHeight="72dp"> android:minHeight="72dp"
android:paddingStart="@dimen/spacing_large"
android:paddingEnd="24dp"
android:paddingVertical="@dimen/spacing_large">
<com.google.android.material.materialswitch.MaterialSwitch <com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switch_widget" android:id="@+id/switch_widget"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true" android:layout_centerVertical="true" />
android:layout_marginEnd="24dp" />
<TextView <com.google.android.material.textview.MaterialTextView
style="@style/TextAppearance.Material3.BodySmall"
android:id="@+id/text_setting_description" android:id="@+id/text_setting_description"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignStart="@+id/text_setting_name" android:layout_alignStart="@+id/text_setting_name"
android:layout_below="@+id/text_setting_name" android:layout_below="@+id/text_setting_name"
android:layout_marginBottom="@dimen/spacing_large"
android:layout_marginEnd="@dimen/spacing_large" android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginTop="@dimen/spacing_small" android:layout_marginTop="@dimen/spacing_small"
android:layout_toStartOf="@+id/switch_widget" android:layout_toStartOf="@+id/switch_widget"
android:textAlignment="viewStart" android:textAlignment="viewStart"
tools:text="@string/frame_limit_enable_description" /> tools:text="@string/frame_limit_enable_description" />
<TextView <com.google.android.material.textview.MaterialTextView
style="@style/TextAppearance.Material3.HeadlineMedium" style="@style/TextAppearance.Material3.HeadlineMedium"
android:id="@+id/text_setting_name" android:id="@+id/text_setting_name"
android:layout_width="0dp" android:layout_width="0dp"
@ -39,11 +41,10 @@
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_marginEnd="@dimen/spacing_large" android:layout_marginEnd="@dimen/spacing_large"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginTop="@dimen/spacing_large"
android:layout_toStartOf="@+id/switch_widget" android:layout_toStartOf="@+id/switch_widget"
android:textSize="16sp" android:textSize="16sp"
android:textAlignment="viewStart" android:textAlignment="viewStart"
app:lineHeight="28dp"
tools:text="@string/frame_limit_enable" /> tools:text="@string/frame_limit_enable" />
</RelativeLayout> </RelativeLayout>

View file

@ -2,16 +2,16 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp"> android:layout_height="48dp"
android:paddingVertical="4dp"
android:paddingHorizontal="@dimen/spacing_large">
<TextView <com.google.android.material.textview.MaterialTextView
style="@style/TextAppearance.Material3.TitleSmall"
android:id="@+id/text_header_name" android:id="@+id/text_header_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical" android:layout_gravity="start|center_vertical"
android:layout_marginHorizontal="@dimen/spacing_large"
android:layout_marginBottom="@dimen/spacing_small"
android:layout_marginTop="@dimen/spacing_small"
android:textColor="?attr/colorPrimary" android:textColor="?attr/colorPrimary"
android:textAlignment="viewStart" android:textAlignment="viewStart"
android:textStyle="bold" android:textStyle="bold"

View file

@ -162,6 +162,7 @@
<string name="installing_driver">Installing driver…</string> <string name="installing_driver">Installing driver…</string>
<!-- Preferences Screen --> <!-- Preferences Screen -->
<string name="preferences_advanced_settings">Advanced Settings</string>
<string name="preferences_settings">Settings</string> <string name="preferences_settings">Settings</string>
<string name="preferences_general">General</string> <string name="preferences_general">General</string>
<string name="preferences_system">System</string> <string name="preferences_system">System</string>