Răsfoiți Sursa

Migrate navigation view to m3 theming

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 2 ani în urmă
părinte
comite
117b07a3e9

+ 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:8d8cd09'
+    implementation 'com.github.nextcloud.android-common:ui:074f45ea43'
 }
 
 configurations.all {

+ 2 - 17
app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java

@@ -784,24 +784,9 @@ public abstract class DrawerActivity extends ToolbarActivity
      */
     protected void setDrawerMenuItemChecked(int menuItemId) {
         if (mNavigationView != null && mNavigationView.getMenu().findItem(menuItemId) != null) {
+            viewThemeUtils.platform.colorNavigationView(mNavigationView);
             mCheckedMenuItem = menuItemId;
-            MenuItem currentItem = mNavigationView.getMenu().findItem(menuItemId);
-
-            currentItem.setChecked(true);
-
-            // For each menu item, change the color of the selected item, and of the other items
-            for (int i = 0; i < mNavigationView.getMenu().size(); i++) {
-                MenuItem menuItem = mNavigationView.getMenu().getItem(i);
-                if (menuItem.getIcon() != null) {
-                    if (menuItem == currentItem) {
-                        viewThemeUtils.platform.colorMenuItemIconActive(this, menuItem);
-                        viewThemeUtils.platform.colorMenuItemTextActive(this, menuItem);
-                    } else {
-                        viewThemeUtils.platform.colorToolbarMenuIcon(this, menuItem);
-                        viewThemeUtils.platform.colorMenuItemText(this, menuItem);
-                    }
-                }
-            }
+            mNavigationView.getMenu().findItem(menuItemId).setChecked(true);
         } else {
             Log_OC.w(TAG, "setDrawerMenuItemChecked has been called with invalid menu-item-ID");
         }