Improve design consistency across the app

Game images, buttons and dialogs now have a consistent corner radius, across all game list layouts.
This commit is contained in:
lynxnb 2022-01-21 19:25:46 +01:00
parent b22ad8035c
commit bf331abcdc
8 changed files with 38 additions and 9 deletions

View File

@ -14,7 +14,7 @@
android:layout_height="150dp" android:layout_height="150dp"
android:contentDescription="@string/icon" android:contentDescription="@string/icon"
android:focusable="false" android:focusable="false"
app:shapeAppearanceOverlay="@style/RoundedAppImage" app:shapeAppearance="?attr/shapeAppearanceSmallComponent"
tools:src="@drawable/default_icon" /> tools:src="@drawable/default_icon" />
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout

View File

@ -15,7 +15,7 @@
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
app:cardCornerRadius="16dp" app:cardCornerRadius="@dimen/corner_radius_large"
app:cardElevation="2dp"> app:cardElevation="2dp">
<ImageView <ImageView

View File

@ -9,7 +9,7 @@
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
app:cardCornerRadius="16dp" app:cardCornerRadius="@dimen/corner_radius_large"
app:cardElevation="2dp"> app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout

View File

@ -18,7 +18,7 @@
android:focusable="false" android:focusable="false"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:shapeAppearanceOverlay="@style/RoundedAppImage" app:shapeAppearance="?attr/shapeAppearanceSmallComponent"
tools:src="@drawable/default_icon" /> tools:src="@drawable/default_icon" />
<TextView <TextView

View File

@ -111,7 +111,7 @@
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
app:cardCornerRadius="16dp" app:cardCornerRadius="@dimen/corner_radius_large"
app:cardElevation="2dp" app:cardElevation="2dp"
app:layout_constraintTop_toBottomOf="@id/sub_text" /> app:layout_constraintTop_toBottomOf="@id/sub_text" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<dimen name="grid_padding">8dp</dimen> <dimen name="grid_padding">8dp</dimen>
<dimen name="corner_radius">8dp</dimen> <dimen name="corner_radius">6dp</dimen>
<dimen name="corner_radius_large">12dp</dimen>
</resources> </resources>

View File

@ -1,11 +1,36 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="RoundedAppImage"> <style name="ShapeAppearance.App.SmallComponent" parent="ShapeAppearance.MaterialComponents.SmallComponent">
<item name="cornerFamily">rounded</item> <item name="cornerFamily">rounded</item>
<item name="cornerSize">@dimen/corner_radius</item> <item name="cornerSize">@dimen/corner_radius</item>
</style> </style>
<style name="ShapeAppearance.App.MediumComponent" parent="ShapeAppearance.MaterialComponents.MediumComponent">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">@dimen/corner_radius</item>
</style>
<!-- android:elevation makes BottomSheetDialog background color brighter than it should be -->
<style name="ThemeOverlay.App.BottomSheetDialog" parent="ThemeOverlay.MaterialComponents.BottomSheetDialog">
<item name="bottomSheetStyle">@style/Widget.App.BottomSheet</item>
</style>
<style name="Widget.App.BottomSheet" parent="Widget.MaterialComponents.BottomSheet.Modal">
<item name="android:elevation">@null</item>
<item name="shapeAppearanceOverlay">@style/ShapeAppearance.App.BottomSheetDialog</item>
</style>
<style name="ShapeAppearance.App.BottomSheetDialog" parent="">
<item name="cornerSizeTopLeft">@dimen/corner_radius_large</item>
<item name="cornerSizeTopRight">@dimen/corner_radius_large</item>
</style>
<!-- Workaround for AndroidX Preference as it doesn't use MaterialAlertDialogBuilder -->
<style name="ThemeOverlay.App.MaterialAlertDialog" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
<item name="android:dialogCornerRadius">@dimen/corner_radius</item>
</style>
<style name="ChipChoice" parent="Widget.MaterialComponents.Chip.Choice"> <style name="ChipChoice" parent="Widget.MaterialComponents.Chip.Choice">
<item name="android:textAllCaps">true</item> <item name="android:textAllCaps">true</item>
<item name="chipStartPadding">8dp</item> <item name="chipStartPadding">8dp</item>

View File

@ -15,8 +15,11 @@
<item name="chipChoiceStyle">@style/ChipChoice</item> <item name="chipChoiceStyle">@style/ChipChoice</item>
<item name="alertDialogTheme">@style/ThemeOverlay.MaterialComponents.MaterialAlertDialog</item> <item name="alertDialogTheme">@style/ThemeOverlay.App.MaterialAlertDialog</item>
<item name="bottomSheetDialogTheme">@style/ThemeOverlay.MaterialComponents.BottomSheetDialog</item> <item name="bottomSheetDialogTheme">@style/ThemeOverlay.App.BottomSheetDialog</item>
<item name="shapeAppearanceSmallComponent">@style/ShapeAppearance.App.SmallComponent</item>
<item name="shapeAppearanceMediumComponent">@style/ShapeAppearance.App.MediumComponent</item>
</style> </style>
<style name="AppTheme" parent="BaseAppTheme"> <style name="AppTheme" parent="BaseAppTheme">