From bcef557a909f781ec0750a9b422a29c6508d30bc Mon Sep 17 00:00:00 2001 From: Matt Casey Date: Wed, 29 May 2019 12:13:00 -0400 Subject: [PATCH] Hide and re-show assist handles when phone is rotated. Not getting fancy with the animation for the moment, just making sure they show and hide in the right places. Test: Show handles, verify that they show when the phone is rotated. Bug: 133836023 Change-Id: I7cda1e3f0cf9a46993bfd3e8da67311e55fb6189 --- .../com/android/systemui/ScreenDecorations.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java index 390a9e65c1b4a..d81f636a54407 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java @@ -378,10 +378,26 @@ public class ScreenDecorations extends SystemUI implements Tunable { if (mOverlay != null) { updateLayoutParams(); updateViews(); + if (mAssistHintVisible) { + // If assist handles are visible, hide them without animation and then make them + // show once again (with corrected rotation). + hideAssistHandles(); + setAssistHintVisible(true); + } } } } + private void hideAssistHandles() { + if (mOverlay != null && mBottomOverlay != null) { + mOverlay.findViewById(R.id.assist_hint_left).setVisibility(View.GONE); + mOverlay.findViewById(R.id.assist_hint_right).setVisibility(View.GONE); + mBottomOverlay.findViewById(R.id.assist_hint_left).setVisibility(View.GONE); + mBottomOverlay.findViewById(R.id.assist_hint_right).setVisibility(View.GONE); + mAssistHintVisible = false; + } + } + private void updateRoundedCornerRadii() { final int newRoundedDefault = mContext.getResources().getDimensionPixelSize( com.android.internal.R.dimen.rounded_corner_radius);