Commit 1f5992f2 authored by 石松洲's avatar 石松洲 Committed by John Wu

Fix classloader when restoring bottom nav state

parent abfd3c3e
...@@ -7,10 +7,10 @@ import android.content.Context; ...@@ -7,10 +7,10 @@ import android.content.Context;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.customview.view.AbsSavedState;
import androidx.interpolator.view.animation.FastOutLinearInInterpolator; import androidx.interpolator.view.animation.FastOutLinearInInterpolator;
import com.google.android.material.bottomnavigation.BottomNavigationView; import com.google.android.material.bottomnavigation.BottomNavigationView;
...@@ -101,12 +101,12 @@ public class ConcealableBottomNavigationView extends BottomNavigationView { ...@@ -101,12 +101,12 @@ public class ConcealableBottomNavigationView extends BottomNavigationView {
} }
} }
static class SavedState extends View.BaseSavedState { static class SavedState extends AbsSavedState {
public boolean isHidden; public boolean isHidden;
public SavedState(Parcel source) { public SavedState(Parcel source) {
super(source); super(source, ConcealableBottomNavigationView.class.getClassLoader());
isHidden = source.readByte() != 0; isHidden = source.readByte() != 0;
} }
...@@ -120,7 +120,7 @@ public class ConcealableBottomNavigationView extends BottomNavigationView { ...@@ -120,7 +120,7 @@ public class ConcealableBottomNavigationView extends BottomNavigationView {
out.writeByte(isHidden ? (byte) 1 : (byte) 0); out.writeByte(isHidden ? (byte) 1 : (byte) 0);
} }
public static final Creator<SavedState> CREATOR = new Creator<SavedState>() { public static final Creator<SavedState> CREATOR = new Creator<>() {
@Override @Override
public SavedState createFromParcel(Parcel source) { public SavedState createFromParcel(Parcel source) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment