Browse Source

legacy action bar theming

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 2 years ago
parent
commit
d3eb0d09cf

+ 1 - 1
app/build.gradle

@@ -355,7 +355,7 @@ dependencies {
     gplayImplementation "com.google.firebase:firebase-messaging:23.0.7"
 
     // TODO change back to tag before merging
-    implementation 'com.github.nextcloud.android-common:ui:074f45ea43'
+    implementation 'com.github.nextcloud.android-common:ui:ed0e1dfd27'
 }
 
 configurations.all {

+ 10 - 4
app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java

@@ -91,6 +91,7 @@ import androidx.annotation.VisibleForTesting;
 import androidx.appcompat.app.ActionBar;
 import androidx.appcompat.app.AlertDialog;
 import androidx.appcompat.app.AppCompatDelegate;
+import androidx.core.content.res.ResourcesCompat;
 
 /**
  * An Activity that allows the user to change the application's settings.
@@ -755,12 +756,17 @@ public class SettingsActivity extends ThemedPreferenceActivity
         ActionBar actionBar = getDelegate().getSupportActionBar();
 
         if (actionBar != null) {
-            themeToolbarUtils.setColoredTitle(actionBar, getString(R.string.actionbar_settings), this);
             themeToolbarUtils.colorStatusBar(this);
-            actionBar.setBackgroundDrawable(new ColorDrawable(themeColorUtils.primaryAppbarColor(this)));
-
             actionBar.setDisplayHomeAsUpEnabled(true);
-            themeToolbarUtils.tintBackButton(actionBar, this);
+            actionBar.setDisplayShowTitleEnabled(true);
+            if (this.getResources() != null) {
+                viewThemeUtils.material.themeActionBar(this,
+                                                       actionBar,
+                                                       getString(R.string.actionbar_settings),
+                                                       ResourcesCompat.getDrawable(this.getResources(),
+                                                                                   R.drawable.ic_arrow_back,
+                                                                                   null));
+            }
         }
     }