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 committed by Mark Collins
parent f63fdf26c9
commit 6848e69638
9 changed files with 41 additions and 15 deletions

View File

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

View File

@ -14,7 +14,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
app:cardCornerRadius="16dp"
app:cardCornerRadius="@dimen/cornerRadiusMedium"
app:cardElevation="2dp">
<ImageView

View File

@ -6,7 +6,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="7.5dp"
app:cardCornerRadius="14dp">
app:cardCornerRadius="@dimen/cornerRadiusMedium"
app:cardElevation="2dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"

View File

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

View File

@ -9,7 +9,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/card_content_padding">
android:padding="@dimen/cornerRadiusMedium">
<com.google.android.material.radiobutton.MaterialRadioButton
android:id="@+id/radio_button"

View File

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

View File

@ -2,6 +2,6 @@
<resources>
<dimen name="grid_padding">8dp</dimen>
<dimen name="onScreenItemHorizontalMargin">10dp</dimen>
<dimen name="card_content_padding">12dp</dimen>
<dimen name="corner_radius">8dp</dimen>
<dimen name="cornerRadius">6dp</dimen>
<dimen name="cornerRadiusMedium">12dp</dimen>
</resources>

View File

@ -1,9 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="RoundedAppImage">
<style name="ShapeAppearance.App.SmallComponent" parent="ShapeAppearance.MaterialComponents.SmallComponent">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">@dimen/corner_radius</item>
<item name="cornerSize">@dimen/cornerRadius</item>
</style>
<style name="ShapeAppearance.App.MediumComponent" parent="ShapeAppearance.MaterialComponents.MediumComponent">
<item name="cornerFamily">rounded</item>
<item name="cornerSize">@dimen/cornerRadiusMedium</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/cornerRadiusMedium</item>
<item name="cornerSizeTopRight">@dimen/cornerRadiusMedium</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/cornerRadiusMedium</item>
</style>
<style name="ChipChoice.Material">

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<resources>
<style name="BaseAppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorOnPrimary">@android:color/white</item>
@ -14,8 +13,11 @@
<item name="chipChoiceStyle">@style/ChipChoice</item>
<item name="alertDialogTheme">@style/ThemeOverlay.MaterialComponents.MaterialAlertDialog</item>
<item name="bottomSheetDialogTheme">@style/ThemeOverlay.MaterialComponents.BottomSheetDialog</item>
<item name="alertDialogTheme">@style/ThemeOverlay.App.MaterialAlertDialog</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 name="AppTheme" parent="BaseAppTheme">