Skip to content

Commit

Permalink
Refresh: Update settings UI
Browse files Browse the repository at this point in the history
  • Loading branch information
WSTxda committed Nov 7, 2024
1 parent 04cc0d8 commit b282733
Show file tree
Hide file tree
Showing 21 changed files with 121 additions and 158 deletions.
14 changes: 0 additions & 14 deletions app/src/main/res/drawable-night/preference_card_bottom.xml

This file was deleted.

14 changes: 0 additions & 14 deletions app/src/main/res/drawable-night/preference_card_center.xml

This file was deleted.

14 changes: 0 additions & 14 deletions app/src/main/res/drawable-night/preference_card_top.xml

This file was deleted.

6 changes: 3 additions & 3 deletions app/src/main/res/drawable/preference_card_bottom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<item>
<shape>
<corners
android:bottomLeftRadius="18dp"
android:bottomRightRadius="18dp"
android:bottomLeftRadius="16dp"
android:bottomRightRadius="16dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
<solid android:color="?colorSurface" />
<solid android:color="?colorSurfaceContainerLow" />
</shape>
</item>
</ripple>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/preference_card_center.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
<solid android:color="?colorSurface" />
<solid android:color="?colorSurfaceContainerLow" />
</shape>
</item>
</ripple>
6 changes: 3 additions & 3 deletions app/src/main/res/drawable/preference_card_top.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="18dp"
android:topRightRadius="18dp" />
<solid android:color="?colorSurface" />
android:topLeftRadius="16dp"
android:topRightRadius="16dp" />
<solid android:color="?colorSurfaceContainerLow" />
</shape>
</item>
</ripple>
5 changes: 3 additions & 2 deletions app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
style="?attr/collapsingToolbarLayoutMediumStyle"
android:layout_width="match_parent"
android:layout_height="?attr/collapsingToolbarLayoutMediumSize"
android:background="?android:colorBackground"
app:contentScrim="?android:attr/colorBackground"
app:collapsedTitleGravity="center"
app:expandedTitleMarginEnd="22dp"
app:expandedTitleMarginStart="22dp"
app:expandedTitleTextAppearance="?attr/textAppearanceHeadlineMedium"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">

Expand Down
15 changes: 8 additions & 7 deletions app/src/main/res/layout/preference_material_bottom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,31 @@
android:layout_marginEnd="16dp"
android:layout_marginBottom="20dp"
android:importantForAccessibility="no"
app:tint="?attr/colorOnSurface" />
app:tint="?android:textColorPrimary" />

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:layout_marginTop="14dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="14dp"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/colorOnSurface"
android:textSize="16sp" />
android:maxLines="2"
android:textAppearance="?android:textAppearanceListItem" />

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

<LinearLayout
Expand Down
20 changes: 20 additions & 0 deletions app/src/main/res/layout/preference_material_category.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="12dp"
android:baselineAligned="false"
android:orientation="horizontal">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAllCaps="true"
android:textAppearance="@style/TextAppearance.Material3.TitleSmall"
android:textColor="?attr/colorOnSurfaceVariant"
android:textSize="12sp"
android:textStyle="bold" />
</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@
android:layout_marginEnd="16dp"
android:layout_marginBottom="20dp"
android:importantForAccessibility="no"
app:tint="?attr/colorOnSurface" />
app:tint="?android:textColorPrimary" />

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:layout_marginTop="14dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="14dp"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/colorOnSurface"
android:textSize="16sp" />
android:maxLines="2"
android:textAppearance="?android:textAppearanceListItem" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/colorOnSurfaceVariant"
android:textSize="14sp" />
android:maxLines="8" />
</LinearLayout>

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

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/colorOnSurface"
android:textSize="16sp" />
android:maxLines="2"
android:textAppearance="?android:textAppearanceListItem" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/colorOnSurfaceVariant"
android:textSize="14sp" />
android:maxLines="8" />
</LinearLayout>

<LinearLayout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:layout_marginTop="14dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="14dp"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/colorOnSurface"
android:textSize="16sp" />
android:maxLines="2"
android:textAppearance="?android:textAppearanceListItem" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/colorOnSurfaceVariant"
android:textSize="14sp" />
android:maxLines="8" />
</LinearLayout>

<LinearLayout
Expand Down
13 changes: 6 additions & 7 deletions app/src/main/res/layout/preference_material_shortcuts_top.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:background="@drawable/preference_card_top"
android:baselineAligned="false"
Expand All @@ -26,24 +25,24 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:layout_marginTop="14dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="14dp"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/colorOnSurface"
android:textSize="16sp" />
android:maxLines="2"
android:textAppearance="?android:textAppearanceListItem" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/colorOnSurfaceVariant"
android:textSize="14sp" />
android:maxLines="8" />
</LinearLayout>

<LinearLayout
Expand Down
15 changes: 7 additions & 8 deletions app/src/main/res/layout/preference_material_top.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:background="@drawable/preference_card_top"
android:baselineAligned="false"
Expand All @@ -22,30 +21,30 @@
android:layout_marginEnd="16dp"
android:layout_marginBottom="20dp"
android:importantForAccessibility="no"
app:tint="?attr/colorOnSurface" />
app:tint="?android:textColorPrimary" />

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:layout_marginTop="14dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="14dp"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/colorOnSurface"
android:textSize="16sp" />
android:maxLines="2"
android:textAppearance="?android:textAppearanceListItem" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?attr/colorOnSurfaceVariant"
android:textSize="14sp" />
android:maxLines="8" />
</LinearLayout>

<LinearLayout
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/values-night-v27/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<style name="AppTheme.Base" parent="@style/Theme.Material3.Dark.NoActionBar">
<!--attributes colors-->
<item name="android:colorAccent">?colorPrimary</item>
<item name="android:colorBackground">@color/md_theme_surface</item>
<!--components theme-->
<item name="alertDialogTheme">@style/Theme.AlertDialog</item>
<item name="switchPreferenceCompatStyle">@style/Theme.SwitchPreferenceCompat</item>
Expand Down Expand Up @@ -32,6 +31,7 @@
<item name="colorErrorContainer">@color/md_theme_errorContainer</item>
<item name="colorOnErrorContainer">@color/md_theme_onErrorContainer</item>
<item name="colorOnBackground">@color/md_theme_onBackground</item>
<item name="android:colorBackground">@color/md_theme_background</item>
<item name="colorSurface">@color/md_theme_surface</item>
<item name="colorOnSurface">@color/md_theme_onSurface</item>
<item name="colorSurfaceVariant">@color/md_theme_surfaceVariant</item>
Expand Down Expand Up @@ -61,9 +61,9 @@
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item>
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item>
<!-- layout padding -->
<item name="android:listPreferredItemPaddingLeft">28dp</item>
<item name="android:listPreferredItemPaddingRight">28dp</item>
<item name="android:listPreferredItemPaddingStart">28dp</item>
<item name="android:listPreferredItemPaddingEnd">28dp</item>
<item name="android:listPreferredItemPaddingLeft">17dp</item>
<item name="android:listPreferredItemPaddingRight">17dp</item>
<item name="android:listPreferredItemPaddingStart">17dp</item>
<item name="android:listPreferredItemPaddingEnd">17dp</item>
</style>
</resources>
Loading

0 comments on commit b282733

Please sign in to comment.