diff options
| author | 2023-02-17 14:47:25 -0800 | |
|---|---|---|
| committer | 2023-02-17 14:47:25 -0800 | |
| commit | 7609f84b26035aa7e8cf4a358776eba15c6e11d1 (patch) | |
| tree | 6901700a0ab2810ce39a62e9c1529b956e56d85c | |
| parent | e397435f1aca7f912f30a76c18b1572a12b44eaa (diff) | |
Fix close and back buttons in caption proto 1.
Restores click listeners to back and close buttons and adjusts their
tint in the same fashion as handle.
Bug: 269660870
Test: Manual testing - confirm buttons function and display correctly in
proto 1, confirm proto 2 is unaffected.
Change-Id: I8a6dcd10d8816ae59e6551e77aef1b2753be3c33
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java index 245cc8d7ee87..0779f1d72551 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java @@ -213,6 +213,12 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin final View handle = caption.findViewById(R.id.caption_handle); handle.setOnTouchListener(mOnCaptionTouchListener); handle.setOnClickListener(mOnCaptionButtonClickListener); + if (DesktopModeStatus.isProto1Enabled()) { + final View back = caption.findViewById(R.id.back_button); + back.setOnClickListener(mOnCaptionButtonClickListener); + final View close = caption.findViewById(R.id.close_window); + close.setOnClickListener(mOnCaptionButtonClickListener); + } updateButtonVisibility(); } @@ -319,6 +325,14 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin final View handle = caption.findViewById(R.id.caption_handle); final Drawable handleBackground = handle.getBackground(); handleBackground.setTintList(buttonTintColor); + if (DesktopModeStatus.isProto1Enabled()) { + final View back = caption.findViewById(R.id.back_button); + final Drawable backBackground = back.getBackground(); + backBackground.setTintList(buttonTintColor); + final View close = caption.findViewById(R.id.close_window); + final Drawable closeBackground = close.getBackground(); + closeBackground.setTintList(buttonTintColor); + } } private void closeDragResizeListener() { |