Skip to content

Commit f9e5bfd

Browse files
committed
Remove unreleased deprecated method BottomSheetBehavior.getBottomSheetCallback before release
PiperOrigin-RevId: 272934464 (cherry picked from commit 8b90f02)
1 parent 53e181b commit f9e5bfd

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,6 @@ public abstract static class BottomSheetCallback {
246246

247247
@NonNull private final ArrayList<BottomSheetCallback> callbacks = new ArrayList<>();
248248

249-
private BottomSheetCallback callback; // Maintained for backward compatibility
250-
251249
@Nullable private VelocityTracker velocityTracker;
252250

253251
int activePointerId;
@@ -889,26 +887,11 @@ public void setBottomSheetCallback(BottomSheetCallback callback) {
889887
+ " `addBottomSheetCallback()` and `removeBottomSheetCallback()` instead to set your"
890888
+ " own callbacks.");
891889
callbacks.clear();
892-
this.callback = callback;
893890
if (callback != null) {
894891
callbacks.add(callback);
895892
}
896893
}
897894

898-
/**
899-
* Gets the {@link BottomSheetCallback} that was attached with {@link
900-
* #setBottomSheetCallback(BottomSheetCallback)}.
901-
*
902-
* @return {@link BottomSheetCallback} The attached callback that will be notified when bottom
903-
* sheet events occur.
904-
* @deprecated use {@link #addBottomSheetCallback(BottomSheetCallback)} and {@link
905-
* #removeBottomSheetCallback(BottomSheetCallback)} instead
906-
*/
907-
@Deprecated
908-
public BottomSheetCallback getBottomSheetCallback() {
909-
return callback;
910-
}
911-
912895
/**
913896
* Adds a callback to be notified of bottom sheet events.
914897
*
@@ -1414,7 +1397,7 @@ public SavedState(@NonNull Parcel source, ClassLoader loader) {
14141397
skipCollapsed = source.readInt() == 1;
14151398
}
14161399

1417-
public SavedState(Parcelable superState, @NonNull BottomSheetBehavior behavior) {
1400+
public SavedState(Parcelable superState, @NonNull BottomSheetBehavior<?> behavior) {
14181401
super(superState);
14191402
this.state = behavior.state;
14201403
this.peekHeight = behavior.peekHeight;
@@ -1482,7 +1465,8 @@ public static <V extends View> BottomSheetBehavior<V> from(@NonNull V view) {
14821465
if (!(params instanceof CoordinatorLayout.LayoutParams)) {
14831466
throw new IllegalArgumentException("The view is not a child of CoordinatorLayout");
14841467
}
1485-
CoordinatorLayout.Behavior behavior = ((CoordinatorLayout.LayoutParams) params).getBehavior();
1468+
CoordinatorLayout.Behavior<?> behavior =
1469+
((CoordinatorLayout.LayoutParams) params).getBehavior();
14861470
if (!(behavior instanceof BottomSheetBehavior)) {
14871471
throw new IllegalArgumentException("The view is not associated with BottomSheetBehavior");
14881472
}

0 commit comments

Comments
 (0)