Android: improve app design

This commit is contained in:
Simonx22 2022-01-06 15:31:52 -05:00 committed by Simonx22
parent 94ad33c42c
commit c6a074ca64
18 changed files with 77 additions and 49 deletions

View File

@ -52,6 +52,9 @@ public class UserDataActivity extends AppCompatActivity implements View.OnClickL
buttonOpenSystemFileManager.setVisibility(android_11 ? View.VISIBLE : View.GONE);
buttonOpenSystemFileManager.setOnClickListener(this);
// show up button
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
@ -81,6 +84,13 @@ public class UserDataActivity extends AppCompatActivity implements View.OnClickL
}
}
@Override
public boolean onSupportNavigateUp()
{
onBackPressed();
return true;
}
private Intent getFileManagerIntent(String packageName)
{
// Fragile, but some phones don't expose the system file manager in any better way

View File

@ -133,7 +133,7 @@ public final class TvMainActivity extends FragmentActivity
// Set display parameters for the BrowseFragment
mBrowseFragment.setHeadersState(BrowseSupportFragment.HEADERS_ENABLED);
mBrowseFragment.setBrandColor(ContextCompat.getColor(this, R.color.dolphin_blue_dark));
mBrowseFragment.setBrandColor(ContextCompat.getColor(this, R.color.dolphin_blue_secondary));
buildRowsAdapter();
mBrowseFragment.setOnItemViewClickedListener(

View File

@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:color="@color/dolphin_blue_dark"
android:color="@color/dolphin_blue_secondary"
android:state_focused="true"/>
<item
android:color="@android:color/white"/>

View File

@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_selected="true"
android:drawable="@color/dolphin_accent_gamecube"/>
android:drawable="@color/dolphin_blue"/>
<item
android:drawable="@color/tv_card_unselected"/>
</selector>

View File

@ -13,7 +13,7 @@
android:id="@+id/text_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/TextAppearance.AppCompat.Headline"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:textSize="16sp"
tools:text="Hyrule Field Speed Hack"
android:layout_margin="@dimen/spacing_large"

View File

@ -9,23 +9,25 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_main"
android:background="?colorPrimary"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/dolphin_blue"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.DayNight"/>
app:popupTheme="@style/Theme.MaterialComponents.DayNight" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabs_platforms"
style="@style/Widget.Design.TabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabBackground="?colorPrimary"
android:background="@color/dolphin_blue"
app:tabGravity="fill"
app:tabIndicatorColor="@color/dolphin_white"
app:tabIndicatorHeight="3dp"
app:tabMode="fixed"
app:tabTextAppearance="@style/MyCustomTextAppearance" />
@ -42,10 +44,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:backgroundTint="@color/dolphin_blue"
android:minHeight="48dp"
android:src="@drawable/ic_add"
app:borderWidth="0dp"
app:layout_anchor="@+id/pager_platforms"
app:layout_anchorGravity="bottom|right|end"
app:rippleColor="?android:colorPrimaryDark" />
app:tint="@android:color/white" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -15,7 +15,7 @@
<TextView
android:id="@+id/input_scale_name"
style="@style/TextAppearance.AppCompat.Headline"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
@ -62,7 +62,7 @@
<TextView
android:id="@+id/input_opacity_name"
style="@style/TextAppearance.AppCompat.Headline"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"

View File

@ -24,7 +24,7 @@
android:id="@+id/label_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.AppCompat.Headline"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:textSize="18sp"
android:text="@string/cheats_name"
android:layout_margin="@dimen/spacing_large"
@ -52,7 +52,7 @@
android:id="@+id/label_creator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.AppCompat.Headline"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:textSize="18sp"
android:text="@string/cheats_creator"
android:layout_margin="@dimen/spacing_large"
@ -79,7 +79,7 @@
android:id="@+id/label_notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.AppCompat.Headline"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:textSize="18sp"
android:text="@string/cheats_notes"
android:layout_margin="@dimen/spacing_large"
@ -106,7 +106,7 @@
android:id="@+id/label_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.AppCompat.Headline"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:textSize="18sp"
android:text="@string/cheats_code"
android:layout_margin="@dimen/spacing_large"

View File

@ -22,6 +22,7 @@
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_small"
android:text="@string/cheats_open_settings"
android:textColor="@color/dolphin_white"
app:layout_constraintStart_toEndOf="@id/text_warning"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="16dp"
android:background="@color/dolphin_blue_dark"
android:background="@color/dolphin_blue"
tools:layout_width="250dp">
<TextView

View File

@ -13,7 +13,7 @@
android:id="@+id/text_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/TextAppearance.AppCompat.Headline"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:textSize="16sp"
tools:text="Hyrule Field Speed Hack"
android:layout_margin="@dimen/spacing_large"

View File

@ -12,7 +12,7 @@
tools:text="CPU Settings"
android:layout_marginStart="@dimen/spacing_large"
android:layout_marginBottom="@dimen/spacing_small"
android:textColor="?android:colorAccent"
android:textColor="@color/dolphin_blue"
android:textStyle="bold"
android:layout_gravity="start|bottom"/>

View File

@ -11,7 +11,7 @@
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/TextAppearance.AppCompat.Headline"
style="@style/TextAppearance.MaterialComponents.Headline5"
tools:text="Setting Name"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"

View File

@ -10,7 +10,7 @@
<TextView
android:id="@+id/text_setting_name"
style="@style/TextAppearance.AppCompat.Headline"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
@ -43,7 +43,8 @@
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/spacing_large"
android:clickable="false"
android:focusable="false"
android:clickable="false"/>
android:buttonTint="@color/dolphin_blue"/>
</RelativeLayout>

View File

@ -11,7 +11,7 @@
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/TextAppearance.AppCompat.Headline"
style="@style/TextAppearance.MaterialComponents.Headline5"
tools:text="Setting Name"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"

View File

@ -1,4 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="dolphin_purple">#A277FF</color>
<color name="dolphin_blue">#1976d2</color>
<color name="dolphin_blue_secondary">#2196f3</color>
<color name="dolphin_white">#FFFFFF</color>
<color name="dolphin_accent_wii">#9e9e9e</color>
<color name="dolphin_accent_wiiware">#2979ff</color>
<color name="tv_card_unselected">#444444</color>
<color name="invalid_setting_overlay">#36ff0000</color>
</resources>

View File

@ -1,16 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="dolphin_blue">#2196f3</color>
<color name="dolphin_blue_dark">#1976d2</color>
<color name="dolphin_purple">#651fff</color>
<color name="dolphin_blue_secondary">#21b0f3</color>
<color name="dolphin_white">#ffffff</color>
<color name="dolphin_accent_wii">#9e9e9e</color>
<color name="dolphin_accent_wiiware">#2979ff</color>
<color name="dolphin_accent_gamecube">#651fff</color>
<color name="tv_card_unselected">#444444</color>
<color name="invalid_setting_overlay">#36ff0000</color>
</resources>

View File

@ -2,13 +2,13 @@
<resources>
<!-- Inherit from the material theme -->
<style name="DolphinBase" parent="Theme.AppCompat.DayNight.NoActionBar">
<style name="DolphinBase" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Main theme colors -->
<!-- Branding color for the app bar -->
<item name="colorSurface">@color/dolphin_blue</item>
<item name="colorPrimary">@color/dolphin_blue</item>
<!-- Darker variant for the status bar and contextual app bars -->
<item name="colorPrimaryDark">@color/dolphin_blue_dark</item>
<item name="colorAccent">@color/dolphin_purple</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item>
<!-- Enable window content transitions -->
<item name="android:windowContentTransitions">true</item>
@ -19,20 +19,24 @@
</style>
<!-- Same as above, but use default action bar, and mandate margins. -->
<style name="DolphinSettingsBase" parent="Theme.AppCompat.DayNight.DarkActionBar">
<style name="DolphinSettingsBase" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="colorSurface">@color/dolphin_blue</item>
<item name="colorPrimary">@color/dolphin_blue</item>
<item name="colorPrimaryDark">@color/dolphin_blue_dark</item>
<item name="colorAccent">@color/dolphin_purple</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item>
</style>
<!-- Themes for Dialogs -->
<style name="DolphinDialogBase" parent="Theme.AppCompat.DayNight.Dialog.Alert" />
<style name="DolphinEmulationBase" parent="Theme.AppCompat.DayNight.NoActionBar">
<style name="DolphinDialogBase" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
<item name="colorPrimary">@color/dolphin_blue</item>
<item name="colorPrimaryDark">@color/dolphin_blue_dark</item>
<item name="colorAccent">@color/dolphin_purple</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item>
</style>
<style name="DolphinEmulationBase" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="colorPrimary">@color/dolphin_blue</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowBackground">@android:color/black</item>
@ -50,9 +54,10 @@
<!-- Android TV Themes -->
<style name="DolphinTvBase" parent="Theme.Leanback.Browse">
<item name="colorSurface">@color/dolphin_blue</item>
<item name="colorPrimary">@color/dolphin_blue</item>
<item name="colorPrimaryDark">@color/dolphin_blue_dark</item>
<item name="colorAccent">@color/dolphin_purple</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item>
<!-- Enable window content transitions -->
<item name="android:windowContentTransitions">true</item>
@ -63,7 +68,7 @@
<item name="browseTitleViewLayout">@layout/titleview</item>
</style>
<style name="InGameMenuOption" parent="Widget.AppCompat.Button.Borderless">
<style name="InGameMenuOption" parent="Widget.MaterialComponents.Button.TextButton">
<item name="android:textSize">16sp</item>
<item name="android:fontFamily">sans-serif-condensed</item>
<item name="android:textColor">@android:color/white</item>
@ -86,8 +91,8 @@
<!-- Inherit from a base file picker theme that handles day/night -->
<style name="FilePickerTheme" parent="FilePickerBaseTheme">
<item name="colorPrimary">@color/dolphin_blue</item>
<item name="colorPrimaryDark">@color/dolphin_blue_dark</item>
<item name="colorAccent">@color/dolphin_accent_gamecube</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item>
<!--&lt;!&ndash; Setting a divider is entirely optional &ndash;&gt;-->
<item name="nnf_list_item_divider">?android:attr/listDivider</item>
@ -97,13 +102,14 @@
<!-- If you want to set a specific toolbar theme, do it here -->
<item name="nnf_toolbarTheme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
<item name="nnf_toolbarTheme">@style/ThemeOverlay.MaterialComponents.Dark.ActionBar</item>
</style>
<style name="FilePickerAlertDialogTheme" parent="Theme.AppCompat.DayNight.Dialog.Alert">
<style name="FilePickerAlertDialogTheme" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
<item name="colorSurface">@color/dolphin_blue</item>
<item name="colorPrimary">@color/dolphin_blue</item>
<item name="colorPrimaryDark">@color/dolphin_blue_dark</item>
<item name="colorAccent">@color/dolphin_accent_gamecube</item>
<item name="colorPrimaryDark">@color/dolphin_blue</item>
<item name="colorAccent">@color/dolphin_blue_secondary</item>
</style>
</resources>