Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #10532 from t895/material3-migration
Android: Inherit from Material 3 themes and round corners on box art
  • Loading branch information
JosJuice committed Mar 27, 2022
2 parents b379df3 + fde39b4 commit f12681b
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 16 deletions.
12 changes: 12 additions & 0 deletions Source/Android/app/src/main/res/drawable-anydpi/ic_back.xml
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF"
android:alpha="1"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 10 additions & 8 deletions Source/Android/app/src/main/res/layout/card_game.xml
@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
tools:layout_width="160dp"
android:layout_height="270dp"
android:transitionName="card_game"
android:focusable="true"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground">
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:layout_width="160dp"
android:layout_height="249dp"
android:transitionName="card_game"
android:focusable="true"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground"
app:cardCornerRadius="8dp">

<LinearLayout
android:layout_width="match_parent"
Expand Down
3 changes: 2 additions & 1 deletion Source/Android/app/src/main/res/layout/fragment_grid.xml
Expand Up @@ -15,7 +15,8 @@
android:id="@+id/grid_games"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/card_game"/>
tools:listitem="@layout/card_game"
android:paddingTop="8dp"/>

</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

Expand Down
16 changes: 9 additions & 7 deletions Source/Android/app/src/main/res/values/styles.xml
Expand Up @@ -2,7 +2,7 @@
<resources>

<!-- Inherit from the material theme -->
<style name="DolphinBase" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<style name="DolphinBase" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Main theme colors -->
<!-- Branding color for the app bar -->
<item name="colorSurface">@color/dolphin_blue</item>
Expand All @@ -19,21 +19,23 @@
</style>

<!-- Same as above, but use default action bar, and mandate margins. -->
<style name="DolphinSettingsBase" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="DolphinSettingsBase" parent="Theme.Material3.DayNight">
<item name="colorSurface">@color/dolphin_blue</item>
<item name="colorPrimary">@color/dolphin_blue</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item>
<item name="titleTextColor">@android:color/white</item>
<item name="homeAsUpIndicator">@drawable/ic_back</item>
</style>

<!-- Themes for Dialogs -->

<style name="DolphinDialogBase" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
<style name="DolphinDialogBase" parent="Theme.Material3.DayNight.Dialog.Alert">
<item name="colorPrimary">@color/dolphin_blue</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item>
</style>

<style name="DolphinEmulationBase" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<style name="DolphinEmulationBase" parent="Theme.Material3.DayNight.NoActionBar">
<item name="colorPrimary">@color/dolphin_blue</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item>
Expand Down Expand Up @@ -68,7 +70,7 @@
<item name="browseTitleViewLayout">@layout/titleview</item>
</style>

<style name="InGameMenuOption" parent="Widget.MaterialComponents.Button.TextButton">
<style name="InGameMenuOption" parent="Widget.Material3.Button.TextButton">
<item name="android:textSize">16sp</item>
<item name="android:fontFamily">sans-serif-condensed</item>
<item name="android:textColor">@android:color/white</item>
Expand Down Expand Up @@ -102,10 +104,10 @@

<!-- If you want to set a specific toolbar theme, do it here -->

<item name="nnf_toolbarTheme">@style/ThemeOverlay.MaterialComponents.Dark.ActionBar</item>
<item name="nnf_toolbarTheme">@style/ThemeOverlay.Material3.Dark.ActionBar</item>
</style>

<style name="FilePickerAlertDialogTheme" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
<style name="FilePickerAlertDialogTheme" parent="Theme.Material3.DayNight.Dialog.Alert">
<item name="colorSurface">@color/dolphin_blue</item>
<item name="colorPrimary">@color/dolphin_blue</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item>
Expand Down

0 comments on commit f12681b

Please sign in to comment.