Skip to content

Commit

Permalink
Improve background dimming when entering video fullscreen mode
Browse files Browse the repository at this point in the history
This was already implemented but it looked like not working because
the default selected alpha for dimming was 50% which is not that
easy to perceive. The fullscreen mode already implements 3 default
brightness levels: 100%, 50% and 0%, for normal, dark and void. We
have replaced them by 50%, 2.5% and 0%.

Apart from that we're removing an extra call to pushWorldBrightness
that happened before the pushWorldBrightness triggered by the
brightness widget as it makes no sense to do it twice. Same happened
with a popWorldBrightness done before the one done by the same
brightness widget.

Last but not least, the length of the animation was increased from
40 to 100 as it was too fast.
  • Loading branch information
svillar committed Oct 26, 2022
1 parent 960fc74 commit 19d0de5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,6 @@ private void enterFullScreenMode() {
mWidgetManager.setControllersVisible(false);
AnimationHelper.fadeOut(mBinding.navigationBarNavigation.navigationBarContainer, 0, null);

mWidgetManager.pushWorldBrightness(this, WidgetManagerDelegate.DEFAULT_DIM_BRIGHTNESS);

mTrayViewModel.setShouldBeVisible(false);

if (mProjectionMenu == null) {
Expand Down Expand Up @@ -718,8 +716,6 @@ private void exitFullScreenMode() {
mWidgetManager.popBackHandler(mFullScreenBackHandler);

AnimationHelper.fadeIn(mBinding.navigationBarNavigation.navigationBarContainer, AnimationHelper.FADE_ANIMATION_DURATION, null);

mWidgetManager.popWorldBrightness(this);
AnimationHelper.fadeOut(mBinding.navigationBarFullscreen.fullScreenModeContainer, 0, null);
// if we are in kiosk mode, don't show the tray
mTrayViewModel.setShouldBeVisible(!mAttachedWindow.isKioskMode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ private void createMenuItems() {
mItems.add(new MenuItem(getContext().getString(R.string.brightness_mode_dark), 0, action));
mItems.add(new MenuItem(getContext().getString(R.string.brightness_mode_void), 0, action));


super.updateMenuItems(mItems);
super.setSelectedItem(1);

Expand All @@ -69,8 +68,8 @@ private void createMenuItems() {

public float getSelectedBrightness() {
switch (super.getSelectedItem()) {
case 0: return 1.0f;
case 1: return 0.5f;
case 0: return 0.5f;
case 1: return 0.05f;
case 2: return 0.0f;
}
return 1.0f;
Expand Down

0 comments on commit 19d0de5

Please sign in to comment.