Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove uses of setBottomSheetCallback(). #8669

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public final class VideoDetailFragment
private Disposable positionSubscriber = null;

private BottomSheetBehavior<FrameLayout> bottomSheetBehavior;
private BottomSheetBehavior.BottomSheetCallback bottomSheetCallback;
private BroadcastReceiver broadcastReceiver;

/*//////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -386,7 +387,7 @@ public void onDestroy() {
disposables.clear();
positionSubscriber = null;
currentWorker = null;
bottomSheetBehavior.setBottomSheetCallback(null);
bottomSheetBehavior.removeBottomSheetCallback(bottomSheetCallback);
Stypox marked this conversation as resolved.
Show resolved Hide resolved

if (activity.isFinishing()) {
playQueue = null;
Expand Down Expand Up @@ -2289,7 +2290,7 @@ private void setupBottomPlayer() {
}
}

bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
bottomSheetCallback = new BottomSheetBehavior.BottomSheetCallback() {
@Override
public void onStateChanged(@NonNull final View bottomSheet, final int newState) {
bottomSheetState = newState;
Expand Down Expand Up @@ -2343,20 +2344,24 @@ && isPlayerAvailable()
}
if (isPlayerAvailable()) {
player.UIs().get(MainPlayerUi.class).ifPresent(ui -> {
if (ui.isControlsVisible()) {
ui.hideControls(0, 0);
}
if (ui.isControlsVisible()) {
ui.hideControls(0, 0);
}
});
}
break;
case BottomSheetBehavior.STATE_HALF_EXPANDED:
break;
}
}

@Override
public void onSlide(@NonNull final View bottomSheet, final float slideOffset) {
setOverlayLook(binding.appBarLayout, behavior, slideOffset);
}
});
};

bottomSheetBehavior.addBottomSheetCallback(bottomSheetCallback);

// User opened a new page and the player will hide itself
activity.getSupportFragmentManager().addOnBackStackChangedListener(() -> {
Expand Down