Add dim layer to PiP menu below buttons

Only show the dim when the menu buttons are shown to improve their
visibility.

Bug: 241744433
Test: manual - open a PiP and go to the menu. PiP content should get
darker. After pressing the back button or when entering the move menu
the dim should disappear.

Change-Id: I67256421994931467f2bc499bad5d5785213304a
This commit is contained in:
Jacqueline Bronger
2022-08-09 17:48:55 +02:00
parent 5240556965
commit 894e5b9577
3 changed files with 11 additions and 0 deletions

View File

@@ -37,6 +37,13 @@
android:background="@color/tv_pip_menu_background"
android:alpha="0"/>
<View
android:id="@+id/tv_pip_menu_dim_layer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/tv_pip_menu_dim_layer"
android:alpha="0"/>
<ScrollView
android:id="@+id/tv_pip_menu_scroll"
android:layout_width="match_parent"

View File

@@ -25,6 +25,7 @@
<color name="tv_window_menu_icon_bg_unfocused">#990E0E0F</color>
<color name="tv_pip_menu_focus_border">#E8EAED</color>
<color name="tv_pip_menu_dim_layer">#990E0E0F</color>
<color name="tv_pip_menu_background">#1E232C</color>
<color name="tv_pip_edu_text">#99D2E3FC</color>

View File

@@ -98,6 +98,7 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener {
private final TvWindowMenuActionButton mA11yDoneButton;
private final View mPipBackground;
private final View mDimLayer;
private final ScrollView mScrollView;
private final HorizontalScrollView mHorizontalScrollView;
@@ -151,6 +152,7 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener {
mExpandButton.setOnClickListener(this);
mPipBackground = findViewById(R.id.tv_pip_menu_background);
mDimLayer = findViewById(R.id.tv_pip_menu_dim_layer);
mScrollView = findViewById(R.id.tv_pip_menu_scroll);
mHorizontalScrollView = findViewById(R.id.tv_pip_menu_horizontal_scroll);
@@ -774,6 +776,7 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener {
refocusPreviousButton();
}
animateAlphaTo(show ? 1 : 0, mActionButtonsContainer);
animateAlphaTo(show ? 1 : 0, mDimLayer);
}
private void setFrameHighlighted(boolean highlighted) {