mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
am 5d774a17: am 1243f6f3: am 762955b3: am af016cf1: Merge "Fix for menu XML ending with a sub menu" into lmp-mr1-ub-dev
* commit '5d774a17320f94d75b360f572a562d00c78e5911': Fix for menu XML ending with a sub menu GitOrigin-RevId=245d1e14c05a695e45c7f887a1ac1d03cfae2d7a PiperOrigin-RevId: 140548800
This commit is contained in:
parent
f238714b0d
commit
974bff077b
@ -233,6 +233,12 @@ public class NavigationMenuPresenter implements MenuPresenter, AdapterView.OnIte
|
||||
mItemBackground = itemBackground;
|
||||
}
|
||||
|
||||
public void setUpdateSuspended(boolean updateSuspended) {
|
||||
if (mAdapter != null) {
|
||||
mAdapter.setUpdateSuspended(updateSuspended);
|
||||
}
|
||||
}
|
||||
|
||||
private class NavigationMenuAdapter extends BaseAdapter {
|
||||
|
||||
private static final String STATE_CHECKED_ITEMS = "android:menu:checked";
|
||||
@ -432,6 +438,10 @@ public class NavigationMenuPresenter implements MenuPresenter, AdapterView.OnIte
|
||||
}
|
||||
}
|
||||
|
||||
public void setUpdateSuspended(boolean updateSuspended) {
|
||||
mUpdateSuspended = updateSuspended;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -207,7 +207,10 @@ public class NavigationView extends ScrimInsetsFrameLayout {
|
||||
* @param resId ID of a menu resource to inflate
|
||||
*/
|
||||
public void inflateMenu(int resId) {
|
||||
mPresenter.setUpdateSuspended(true);
|
||||
getMenuInflater().inflate(resId, mMenu);
|
||||
mPresenter.setUpdateSuspended(false);
|
||||
mPresenter.updateMenuView(false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user