Merge pull request #6043 from ByteHamster/fix-miniplayer

Fix miniplayer sometimes showing toolbar
This commit is contained in:
ByteHamster 2022-08-27 18:35:37 +02:00 committed by GitHub
commit 0ea69e4063
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -239,6 +239,11 @@ public class MainActivity extends CastEnabledActivity {
public void setPlayerVisible(boolean visible) {
getBottomSheet().setLocked(!visible);
if (visible) {
bottomSheetCallback.onStateChanged(null, getBottomSheet().getState()); // Update toolbar visibility
} else {
getBottomSheet().setState(BottomSheetBehavior.STATE_COLLAPSED);
}
FragmentContainerView mainView = findViewById(R.id.main_view);
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mainView.getLayoutParams();
params.setMargins(0, 0, 0, visible ? (int) getResources().getDimension(R.dimen.external_player_height) : 0);