From bee1003618b02c5d81b8123d8b62caebc966657b Mon Sep 17 00:00:00 2001 From: Jacqueline Bronger Date: Mon, 13 Feb 2023 22:29:14 +0100 Subject: [PATCH] Fix TV PiP custom action style Bug: 269156537 Test: manual - open PiP with custom close action -> close button should be red (darker when not focused). Change-Id: I4ae7f7b0b13446d29572fa93faffd575c23e8364 (cherry picked from commit 2f27e357b049f2b6ddbc2aadf1c75824f629e834) --- libs/WindowManager/Shell/res/drawable/tv_window_button_bg.xml | 2 +- .../com/android/wm/shell/common/TvWindowMenuActionButton.java | 2 ++ .../src/com/android/wm/shell/pip/tv/TvPipCustomAction.java | 1 + .../src/com/android/wm/shell/pip/tv/TvPipSystemAction.java | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/res/drawable/tv_window_button_bg.xml b/libs/WindowManager/Shell/res/drawable/tv_window_button_bg.xml index 2dba37daf0599..4c28e519afa71 100644 --- a/libs/WindowManager/Shell/res/drawable/tv_window_button_bg.xml +++ b/libs/WindowManager/Shell/res/drawable/tv_window_button_bg.xml @@ -17,5 +17,5 @@ - + \ No newline at end of file diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/TvWindowMenuActionButton.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/TvWindowMenuActionButton.java index 8ba785a1f03ab..931cf0cee28c1 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/TvWindowMenuActionButton.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/TvWindowMenuActionButton.java @@ -70,6 +70,8 @@ public class TvWindowMenuActionButton extends RelativeLayout { setTextAndDescription(textResId); } typedArray.recycle(); + + setIsCustomCloseAction(false); } /** diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipCustomAction.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipCustomAction.java index 449a2bf098818..49d40d3c26119 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipCustomAction.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipCustomAction.java @@ -60,6 +60,7 @@ public class TvPipCustomAction extends TvPipAction { } button.setImageIconAsync(mRemoteAction.getIcon(), mainHandler); button.setEnabled(isCloseAction() || mRemoteAction.isEnabled()); + button.setIsCustomCloseAction(isCloseAction()); } PendingIntent getPendingIntent() { diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipSystemAction.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipSystemAction.java index 93b6a908e3f48..4b82e4bdb64a0 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipSystemAction.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipSystemAction.java @@ -61,6 +61,7 @@ public class TvPipSystemAction extends TvPipAction { button.setTextAndDescription(mTitleResource); button.setImageResource(mIconResource); button.setEnabled(true); + button.setIsCustomCloseAction(false); } PendingIntent getPendingIntent() {