Skip to content

Commit

Permalink
Improve settings UI
Browse files Browse the repository at this point in the history
  • Loading branch information
WSTxda committed Dec 1, 2024
1 parent e9b5567 commit 144af02
Show file tree
Hide file tree
Showing 15 changed files with 101 additions and 59 deletions.
10 changes: 5 additions & 5 deletions app/src/main/java/com/wstxda/gsl/ui/SettingsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ class SettingsActivity : AppCompatActivity() {
}

private fun enableEdgeToEdgeNoContrast() {
enableEdgeToEdge(
navigationBarStyle = SystemBarStyle.auto(
Color.TRANSPARENT, Color.TRANSPARENT
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
enableEdgeToEdge(
navigationBarStyle = SystemBarStyle.auto(
Color.TRANSPARENT, Color.TRANSPARENT
)
)
)
if (Build.VERSION.SDK_INT >= 29) {
window.isNavigationBarContrastEnforced = false
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:layout_height="?attr/collapsingToolbarLayoutMediumSize"
app:expandedTitleMarginEnd="22dp"
app:expandedTitleMarginStart="22dp"
app:expandedTitleTextAppearance="?attr/textAppearanceDisplaySmall"
app:expandedTitleTextAppearance="?attr/collapsedTitleTextAppearance"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:titleCollapseMode="scale">

Expand Down
38 changes: 26 additions & 12 deletions app/src/main/res/layout/bottom_sheet_assistant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingBottom="20dp">
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:paddingBottom="24dp">

<com.google.android.material.bottomsheet.BottomSheetDragHandleView
android:id="@+id/drag_handler"
Expand All @@ -30,30 +30,44 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/drag_handler" />

<com.google.android.material.textview.MaterialTextView
android:id="@+id/summary"
android:layout_width="wrap_content"
<com.google.android.material.circularreveal.cardview.CircularRevealCardView
android:id="@+id/summary_card"
style="?attr/materialCardViewFilledStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="24dp"
android:text="@string/assistant_game_summary"
android:layout_marginEnd="5dp"
android:layout_marginBottom="8dp"
app:cardBackgroundColor="?attr/colorSurfaceContainerHigh"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/title" />
app:layout_constraintTop_toBottomOf="@id/title">

<com.google.android.material.textview.MaterialTextView
android:id="@+id/summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:padding="16dp"
android:text="@string/assistant_game_summary"
android:textAppearance="?attr/textAppearanceBodyMedium" />
</com.google.android.material.circularreveal.cardview.CircularRevealCardView>

<com.google.android.material.button.MaterialButton
android:id="@+id/setup_button"
style="@style/Widget.Material3.Button"
style="?attr/materialIconButtonFilledStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:layout_marginTop="24dp"
android:text="@string/assistant_setup_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/summary" />
app:layout_constraintTop_toBottomOf="@id/summary_card" />

<com.google.android.material.button.MaterialButton
android:id="@+id/cancel_button"
style="@style/Widget.Material3.Button.TonalButton"
style="?attr/materialIconButtonFilledTonalStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
Expand Down
11 changes: 7 additions & 4 deletions app/src/main/res/layout/preference_material_bottom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,28 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="14dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="14dp"
android:layout_marginBottom="16dp"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:maxLines="2"
android:textAppearance="?android:textAppearanceListItem" />
android:textAppearance="?attr/textAppearanceBodyLarge" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:maxLines="8" />
android:maxLines="8"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?attr/colorOnSurfaceVariant" />
</LinearLayout>

<LinearLayout
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/res/layout/preference_material_category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="28dp"
android:layout_marginEnd="24dp"
android:layout_marginStart="32dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="12dp"
android:baselineAligned="false"
android:orientation="horizontal">
Expand All @@ -13,8 +13,9 @@
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:letterSpacing="0.1"
android:textAllCaps="true"
android:textAppearance="?attr/textAppearanceTitleSmall"
android:textAppearance="?attr/textAppearanceLabelMedium"
android:textColor="?attr/colorOnSurfaceVariant"
android:textSize="12sp" />
</LinearLayout>
12 changes: 8 additions & 4 deletions app/src/main/res/layout/preference_material_middle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,28 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="14dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="14dp"
android:layout_marginBottom="16dp"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:maxLines="2"
android:textAppearance="?android:textAppearanceListItem" />
android:textAppearance="?attr/textAppearanceBodyLarge" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="8" />
android:ellipsize="marquee"
android:maxLines="8"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?colorOnSurfaceVariant" />
</LinearLayout>

<LinearLayout
Expand Down
12 changes: 8 additions & 4 deletions app/src/main/res/layout/preference_material_shortcuts_bottom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,28 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="10dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="10dp"
android:layout_marginBottom="12dp"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:maxLines="2"
android:textAppearance="?android:textAppearanceListItem" />
android:textAppearance="?attr/textAppearanceBodyLarge" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="8" />
android:ellipsize="marquee"
android:maxLines="8"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?colorOnSurfaceVariant" />
</LinearLayout>

<LinearLayout
Expand Down
12 changes: 8 additions & 4 deletions app/src/main/res/layout/preference_material_shortcuts_middle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,28 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="10dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="10dp"
android:layout_marginBottom="12dp"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:maxLines="2"
android:textAppearance="?android:textAppearanceListItem" />
android:textAppearance="?attr/textAppearanceBodyLarge" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="8" />
android:ellipsize="marquee"
android:maxLines="8"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?colorOnSurfaceVariant" />
</LinearLayout>

<LinearLayout
Expand Down
12 changes: 8 additions & 4 deletions app/src/main/res/layout/preference_material_shortcuts_tile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="12dp"
android:layout_marginTop="24dp"
android:background="@drawable/preference_background_tile"
android:baselineAligned="false"
android:clickable="true"
Expand All @@ -25,23 +25,27 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="14dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="14dp"
android:layout_marginBottom="16dp"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:maxLines="2"
android:textAppearance="?attr/textAppearanceLabelLarge" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="8" />
android:ellipsize="marquee"
android:maxLines="8"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?attr/colorOnSurfaceVariant" />
</LinearLayout>
</LinearLayout>
12 changes: 8 additions & 4 deletions app/src/main/res/layout/preference_material_shortcuts_top.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,28 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="10dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="10dp"
android:layout_marginBottom="12dp"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:maxLines="2"
android:textAppearance="?android:textAppearanceListItem" />
android:textAppearance="?attr/textAppearanceBodyLarge" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="8" />
android:ellipsize="marquee"
android:maxLines="8"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?attr/colorOnSurfaceVariant" />
</LinearLayout>

<LinearLayout
Expand Down
12 changes: 8 additions & 4 deletions app/src/main/res/layout/preference_material_top.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,28 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="14dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="14dp"
android:layout_marginBottom="16dp"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:maxLines="2"
android:textAppearance="?android:textAppearanceListItem" />
android:textAppearance="?attr/textAppearanceBodyLarge" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="8" />
android:ellipsize="marquee"
android:maxLines="8"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?attr/colorOnSurfaceVariant" />
</LinearLayout>

<LinearLayout
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<string name="password_manager_root_error">Conceder primero el permiso de root</string>

<string name="assistant_game_title">¿Activar accesos directos del asistente por voz?</string>
<string name="assistant_game_summary">Usa accesos directos del asistente por voz para abrir tus juegos con botones y gestos en este dispositivo. Selecciona <b>Atajos de Google</b> como asistente predeterminado para habilitar esta función</string>
<string name="assistant_game_summary">Usa accesos directos del asistente por voz para abrir tus juegos con botones y gestos en este dispositivo. Selecciona <b>Atajos de Google</b> como asistente de voz predeterminado para habilitar esta función</string>
<string name="assistant_setup_button">Activar Asistente</string>
<string name="assistant_cancel_button">Cancelar</string>

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
<string name="game_manager_not_found">Gerenciador de jogos não suportado neste dispositivo</string>
<string name="password_manager_root_error">Conceda acesso root primeiro</string>

<string name="assistant_game_title">Ativar atalhos assistente de voz?</string>
<string name="assistant_game_summary">Use atalhos do assistente de voz para abrir seus jogos com botões e gestos neste dispositivo. Selecione <b>Atalhos do Google</b> como assistente padrão para ativar esse recurso</string>
<string name="assistant_game_title">Usar atalhos do assistente de voz?</string>
<string name="assistant_game_summary">Use atalhos do assistente de voz para abrir seus jogos com botões e gestos neste dispositivo. Selecione <b>Atalhos do Google</b> como assistente de voz padrão para ativar este recurso</string>
<string name="assistant_setup_button">Ativar Assistente</string>
<string name="assistant_cancel_button">Cancelar</string>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<string name="password_manager_root_error">Grant root permission first</string>

<string name="assistant_game_title">Enable voice assistant shortcuts?</string>
<string name="assistant_game_summary">Use voice assistant shortcuts to open your games with buttons and gestures on this device. Select <b>Google Shortcuts Launcher</b> as the default assistant to enable this feature</string>
<string name="assistant_game_summary">Use voice assistant shortcuts to open your games with buttons and gestures on this device. Select <b>Google Shortcuts Launcher</b> as the default voice assistant to enable this feature</string>
<string name="assistant_setup_button">Enable Assistant</string>
<string name="assistant_cancel_button">Cancel</string>

Expand Down
Loading

0 comments on commit 144af02

Please sign in to comment.