|
30 | 30 | import android.graphics.drawable.Drawable;
|
31 | 31 | import android.os.Build.VERSION;
|
32 | 32 | import android.os.Build.VERSION_CODES;
|
33 |
| -import android.os.Parcel; |
34 |
| -import android.os.Parcelable; |
35 | 33 | import androidx.annotation.ColorInt;
|
36 | 34 | import androidx.annotation.ColorRes;
|
37 | 35 | import androidx.annotation.DimenRes;
|
|
43 | 41 | import androidx.annotation.RequiresApi;
|
44 | 42 | import androidx.annotation.RestrictTo;
|
45 | 43 | import androidx.core.graphics.drawable.DrawableCompat;
|
46 |
| -import androidx.customview.view.AbsSavedState; |
47 | 44 | import androidx.core.view.ViewCompat;
|
48 | 45 | import androidx.core.widget.TextViewCompat;
|
49 | 46 | import androidx.appcompat.content.res.AppCompatResources;
|
@@ -250,26 +247,6 @@ public void onInitializeAccessibilityEvent(@NonNull AccessibilityEvent accessibi
|
250 | 247 | accessibilityEvent.setChecked(isChecked());
|
251 | 248 | }
|
252 | 249 |
|
253 |
| - @NonNull |
254 |
| - @Override |
255 |
| - public Parcelable onSaveInstanceState() { |
256 |
| - Parcelable superState = super.onSaveInstanceState(); |
257 |
| - SavedState savedState = new SavedState(superState); |
258 |
| - savedState.checked = checked; |
259 |
| - return savedState; |
260 |
| - } |
261 |
| - |
262 |
| - @Override |
263 |
| - public void onRestoreInstanceState(@Nullable Parcelable state) { |
264 |
| - if (!(state instanceof SavedState)) { |
265 |
| - super.onRestoreInstanceState(state); |
266 |
| - return; |
267 |
| - } |
268 |
| - SavedState savedState = (SavedState) state; |
269 |
| - super.onRestoreInstanceState(savedState.getSuperState()); |
270 |
| - setChecked(savedState.checked); |
271 |
| - } |
272 |
| - |
273 | 250 | /**
|
274 | 251 | * This should be accessed via {@link
|
275 | 252 | * androidx.core.view.ViewCompat#setBackgroundTintList(android.view.View, ColorStateList)}
|
@@ -1074,49 +1051,4 @@ void setShouldDrawSurfaceColorStroke(boolean shouldDrawSurfaceColorStroke) {
|
1074 | 1051 | materialButtonHelper.setShouldDrawSurfaceColorStroke(shouldDrawSurfaceColorStroke);
|
1075 | 1052 | }
|
1076 | 1053 | }
|
1077 |
| - |
1078 |
| - static class SavedState extends AbsSavedState { |
1079 |
| - |
1080 |
| - boolean checked; |
1081 |
| - |
1082 |
| - public SavedState(Parcelable superState) { |
1083 |
| - super(superState); |
1084 |
| - } |
1085 |
| - |
1086 |
| - public SavedState(@NonNull Parcel source, ClassLoader loader) { |
1087 |
| - super(source, loader); |
1088 |
| - readFromParcel(source); |
1089 |
| - } |
1090 |
| - |
1091 |
| - @Override |
1092 |
| - public void writeToParcel(@NonNull Parcel out, int flags) { |
1093 |
| - super.writeToParcel(out, flags); |
1094 |
| - out.writeInt(checked ? 1 : 0); |
1095 |
| - } |
1096 |
| - |
1097 |
| - private void readFromParcel(@NonNull Parcel in) { |
1098 |
| - checked = in.readInt() == 1; |
1099 |
| - } |
1100 |
| - |
1101 |
| - public static final Creator<SavedState> CREATOR = |
1102 |
| - new ClassLoaderCreator<SavedState>() { |
1103 |
| - @NonNull |
1104 |
| - @Override |
1105 |
| - public SavedState createFromParcel(@NonNull Parcel in, ClassLoader loader) { |
1106 |
| - return new SavedState(in, loader); |
1107 |
| - } |
1108 |
| - |
1109 |
| - @NonNull |
1110 |
| - @Override |
1111 |
| - public SavedState createFromParcel(@NonNull Parcel in) { |
1112 |
| - return new SavedState(in, null); |
1113 |
| - } |
1114 |
| - |
1115 |
| - @NonNull |
1116 |
| - @Override |
1117 |
| - public SavedState[] newArray(int size) { |
1118 |
| - return new SavedState[size]; |
1119 |
| - } |
1120 |
| - }; |
1121 |
| - } |
1122 | 1054 | }
|
0 commit comments