mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 06:35:48 +03:00
Migrate navigation view to m3 theming
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
a92bc8529a
commit
117b07a3e9
2 changed files with 3 additions and 18 deletions
|
@ -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 {
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue