From b62f08911190dc2886d07ad838d51b7f5a536184 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Wed, 6 Dec 2023 20:14:26 +0530 Subject: [PATCH] play-services-core: Theme improvements * Apply background color on status and navigation bar from API 23 * Drop ActionBar theme and switch to Toolbar which works better with theming Signed-off-by: Aayush Gupta Change-Id: I82a0b00cf4d50e2ddf6739c730814f4ab3ab91c2 --- .../org/microg/tools/ui/AbstractSettingsActivity.java | 3 +++ .../src/main/res/layout/settings_activity.xml | 7 +++++++ play-services-core/src/main/AndroidManifest.xml | 2 +- .../java/org/microg/gms/ui/MainSettingsActivity.java | 2 ++ .../src/main/res/layout/settings_root_activity.xml | 7 +++++++ .../src/main/res/values-night-v23/themes.xml | 10 ++++++++++ .../src/main/res/values-night-v27/themes.xml | 11 +++++++++++ play-services-core/src/main/res/values-v23/themes.xml | 10 ++++++++++ play-services-core/src/main/res/values-v27/themes.xml | 11 +++++++++++ play-services-core/src/main/res/values/themes.xml | 6 ++++++ 10 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 play-services-core/src/main/res/values-night-v23/themes.xml create mode 100644 play-services-core/src/main/res/values-night-v27/themes.xml create mode 100644 play-services-core/src/main/res/values-v23/themes.xml create mode 100644 play-services-core/src/main/res/values-v27/themes.xml diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsActivity.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsActivity.java index a771a9ea36..5450a7e215 100644 --- a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsActivity.java +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsActivity.java @@ -5,6 +5,7 @@ import android.view.ViewGroup; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; @@ -19,6 +20,8 @@ public abstract class AbstractSettingsActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.settings_activity); + setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); + if (showHomeAsUp) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); } diff --git a/play-services-core/microg-ui-tools/src/main/res/layout/settings_activity.xml b/play-services-core/microg-ui-tools/src/main/res/layout/settings_activity.xml index a664de26af..acc78dc5e6 100644 --- a/play-services-core/microg-ui-tools/src/main/res/layout/settings_activity.xml +++ b/play-services-core/microg-ui-tools/src/main/res/layout/settings_activity.xml @@ -19,6 +19,13 @@ android:layout_height="match_parent" android:orientation="vertical"> + + + android:theme="@style/Theme.App"> diff --git a/play-services-core/src/main/java/org/microg/gms/ui/MainSettingsActivity.java b/play-services-core/src/main/java/org/microg/gms/ui/MainSettingsActivity.java index af930b5f25..e9095e1165 100644 --- a/play-services-core/src/main/java/org/microg/gms/ui/MainSettingsActivity.java +++ b/play-services-core/src/main/java/org/microg/gms/ui/MainSettingsActivity.java @@ -5,6 +5,7 @@ import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import androidx.navigation.NavController; import androidx.navigation.fragment.NavHostFragment; import androidx.navigation.ui.AppBarConfiguration; @@ -32,6 +33,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { } setContentView(R.layout.settings_root_activity); + setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); for (SettingsProvider settingsProvider : getAllSettingsProviders(this)) { settingsProvider.extendNavigation(getNavController()); diff --git a/play-services-core/src/main/res/layout/settings_root_activity.xml b/play-services-core/src/main/res/layout/settings_root_activity.xml index a592e38d2f..5e1eaf3ed6 100644 --- a/play-services-core/src/main/res/layout/settings_root_activity.xml +++ b/play-services-core/src/main/res/layout/settings_root_activity.xml @@ -9,6 +9,13 @@ android:layout_height="match_parent" android:orientation="vertical"> + + + + + + + diff --git a/play-services-core/src/main/res/values-night-v27/themes.xml b/play-services-core/src/main/res/values-night-v27/themes.xml new file mode 100644 index 0000000000..31acb06cc9 --- /dev/null +++ b/play-services-core/src/main/res/values-night-v27/themes.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/play-services-core/src/main/res/values-v23/themes.xml b/play-services-core/src/main/res/values-v23/themes.xml new file mode 100644 index 0000000000..9c4f22b677 --- /dev/null +++ b/play-services-core/src/main/res/values-v23/themes.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/play-services-core/src/main/res/values-v27/themes.xml b/play-services-core/src/main/res/values-v27/themes.xml new file mode 100644 index 0000000000..bcc7971d06 --- /dev/null +++ b/play-services-core/src/main/res/values-v27/themes.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/play-services-core/src/main/res/values/themes.xml b/play-services-core/src/main/res/values/themes.xml index d767b2fefb..c2c8d4f978 100644 --- a/play-services-core/src/main/res/values/themes.xml +++ b/play-services-core/src/main/res/values/themes.xml @@ -16,6 +16,12 @@ + +