mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-26 17:12:31 -06:00
145 lines
5 KiB
Java
145 lines
5 KiB
Java
package com.google.android.material.navigation;
|
|
|
|
import android.content.Context;
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import android.view.ViewGroup;
|
|
import androidx.appcompat.view.menu.MenuBuilder;
|
|
import androidx.appcompat.view.menu.MenuItemImpl;
|
|
import androidx.appcompat.view.menu.MenuPresenter;
|
|
import androidx.appcompat.view.menu.MenuView;
|
|
import androidx.appcompat.view.menu.SubMenuBuilder;
|
|
import com.google.android.material.badge.BadgeUtils;
|
|
import com.google.android.material.internal.ParcelableSparseArray;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class NavigationBarPresenter implements MenuPresenter {
|
|
private int id;
|
|
private MenuBuilder menu;
|
|
private NavigationBarMenuView menuView;
|
|
private boolean updateSuspended = false;
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuPresenter
|
|
public boolean collapseItemActionView(MenuBuilder menuBuilder, MenuItemImpl menuItemImpl) {
|
|
return false;
|
|
}
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuPresenter
|
|
public boolean expandItemActionView(MenuBuilder menuBuilder, MenuItemImpl menuItemImpl) {
|
|
return false;
|
|
}
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuPresenter
|
|
public boolean flagActionItems() {
|
|
return false;
|
|
}
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuPresenter
|
|
public int getId() {
|
|
return this.id;
|
|
}
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuPresenter
|
|
public MenuView getMenuView(ViewGroup viewGroup) {
|
|
return this.menuView;
|
|
}
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuPresenter
|
|
public void onCloseMenu(MenuBuilder menuBuilder, boolean z) {
|
|
}
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuPresenter
|
|
public boolean onSubMenuSelected(SubMenuBuilder subMenuBuilder) {
|
|
return false;
|
|
}
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuPresenter
|
|
public void setCallback(MenuPresenter.Callback callback) {
|
|
}
|
|
|
|
public void setId(int i) {
|
|
this.id = i;
|
|
}
|
|
|
|
public void setMenuView(NavigationBarMenuView navigationBarMenuView) {
|
|
this.menuView = navigationBarMenuView;
|
|
}
|
|
|
|
public void setUpdateSuspended(boolean z) {
|
|
this.updateSuspended = z;
|
|
}
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuPresenter
|
|
public void initForMenu(Context context, MenuBuilder menuBuilder) {
|
|
this.menu = menuBuilder;
|
|
this.menuView.initialize(menuBuilder);
|
|
}
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuPresenter
|
|
public void updateMenuView(boolean z) {
|
|
if (this.updateSuspended) {
|
|
return;
|
|
}
|
|
if (z) {
|
|
this.menuView.buildMenuView();
|
|
} else {
|
|
this.menuView.updateMenuView();
|
|
}
|
|
}
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuPresenter
|
|
public Parcelable onSaveInstanceState() {
|
|
SavedState savedState = new SavedState();
|
|
savedState.selectedItemId = this.menuView.getSelectedItemId();
|
|
savedState.badgeSavedStates = BadgeUtils.createParcelableBadgeStates(this.menuView.getBadgeDrawables());
|
|
return savedState;
|
|
}
|
|
|
|
@Override // androidx.appcompat.view.menu.MenuPresenter
|
|
public void onRestoreInstanceState(Parcelable parcelable) {
|
|
if (parcelable instanceof SavedState) {
|
|
SavedState savedState = (SavedState) parcelable;
|
|
this.menuView.tryRestoreSelectedItemId(savedState.selectedItemId);
|
|
this.menuView.restoreBadgeDrawables(BadgeUtils.createBadgeDrawablesFromSavedStates(this.menuView.getContext(), savedState.badgeSavedStates));
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes2.dex */
|
|
public static class SavedState implements Parcelable {
|
|
public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.Creator<SavedState>() { // from class: com.google.android.material.navigation.NavigationBarPresenter.SavedState.1
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // android.os.Parcelable.Creator
|
|
public SavedState createFromParcel(Parcel parcel) {
|
|
return new SavedState(parcel);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // android.os.Parcelable.Creator
|
|
public SavedState[] newArray(int i) {
|
|
return new SavedState[i];
|
|
}
|
|
};
|
|
ParcelableSparseArray badgeSavedStates;
|
|
int selectedItemId;
|
|
|
|
@Override // android.os.Parcelable
|
|
public int describeContents() {
|
|
return 0;
|
|
}
|
|
|
|
SavedState() {
|
|
}
|
|
|
|
SavedState(Parcel parcel) {
|
|
this.selectedItemId = parcel.readInt();
|
|
this.badgeSavedStates = (ParcelableSparseArray) parcel.readParcelable(getClass().getClassLoader());
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
parcel.writeInt(this.selectedItemId);
|
|
parcel.writeParcelable(this.badgeSavedStates, 0);
|
|
}
|
|
}
|
|
}
|