From 5240556965ae5621420e563030dea8d456b4ceec Mon Sep 17 00:00:00 2001 From: Jacqueline Bronger Date: Mon, 22 Aug 2022 16:15:41 +0200 Subject: [PATCH 1/2] TV: Add PiP content sized views to one FrameLayout Restructuring of the tv pip menu layout to improve readability. Also includes some extra comments. Bug: 241744433 Test: manual - start a PiP and open the menu to see if the views including the edu text are still shown properly Change-Id: I2b39b3d251500de4d62d80829affbd8d2b6af42a --- .../Shell/res/layout/tv_pip_menu.xml | 136 +++++++++--------- .../wm/shell/pip/tv/TvPipMenuView.java | 8 +- 2 files changed, 75 insertions(+), 69 deletions(-) diff --git a/libs/WindowManager/Shell/res/layout/tv_pip_menu.xml b/libs/WindowManager/Shell/res/layout/tv_pip_menu.xml index 8533a5994d33c..75011957e4d8b 100644 --- a/libs/WindowManager/Shell/res/layout/tv_pip_menu.xml +++ b/libs/WindowManager/Shell/res/layout/tv_pip_menu.xml @@ -16,92 +16,91 @@ --> + android:id="@+id/tv_pip_menu" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="center|top"> - + android:layout_marginEnd="@dimen/pip_menu_outer_space"> - + - + - + - - - + android:orientation="horizontal" + android:alpha="0"> - + - + - + - + - + - - + + + + + + + + + + - + Date: Tue, 9 Aug 2022 17:48:55 +0200 Subject: [PATCH 2/2] 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 --- libs/WindowManager/Shell/res/layout/tv_pip_menu.xml | 7 +++++++ libs/WindowManager/Shell/res/values/colors_tv.xml | 1 + .../src/com/android/wm/shell/pip/tv/TvPipMenuView.java | 3 +++ 3 files changed, 11 insertions(+) diff --git a/libs/WindowManager/Shell/res/layout/tv_pip_menu.xml b/libs/WindowManager/Shell/res/layout/tv_pip_menu.xml index 75011957e4d8b..b0dab90b6add6 100644 --- a/libs/WindowManager/Shell/res/layout/tv_pip_menu.xml +++ b/libs/WindowManager/Shell/res/layout/tv_pip_menu.xml @@ -37,6 +37,13 @@ android:background="@color/tv_pip_menu_background" android:alpha="0"/> + + #990E0E0F #E8EAED + #990E0E0F #1E232C #99D2E3FC diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipMenuView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipMenuView.java index ef20a86d518e4..97e017a65b04a 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipMenuView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipMenuView.java @@ -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) {