From 117b07a3e99ef1aaa042759e4ec80448156b3e17 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 12 Sep 2022 22:41:58 +0200 Subject: [PATCH] Migrate navigation view to m3 theming Signed-off-by: Andy Scherzinger --- app/build.gradle | 2 +- .../android/ui/activity/DrawerActivity.java | 19 ++----------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3fa2306706..9a66331a86 100644 --- a/app/build.gradle +++ b/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 { diff --git a/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java index c6208709c3..2642f4af0a 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java +++ b/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"); }