Migrate navigation view to m3 theming

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-09-12 22:41:58 +02:00 committed by Álvaro Brey
parent a92bc8529a
commit 117b07a3e9
No known key found for this signature in database
GPG key ID: 2585783189A62105
2 changed files with 3 additions and 18 deletions

View file

@ -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 {

View file

@ -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");
}