Merge pull request #6043 from ByteHamster/fix-miniplayer
Fix miniplayer sometimes showing toolbar
This commit is contained in:
commit
0ea69e4063
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue