Loading packages/SystemUI/src/com/android/systemui/assist/AssistHandleViewController.java +20 −1 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class AssistHandleViewController implements NavigationBarTransitions.Dark private Handler mHandler; private CornerHandleView mAssistHintLeft; private CornerHandleView mAssistHintRight; private int mBottomOffset; @VisibleForTesting boolean mAssistHintVisible; Loading @@ -61,6 +62,23 @@ public class AssistHandleViewController implements NavigationBarTransitions.Dark mAssistHintRight.updateDarkness(darkIntensity); } /** * Set the bottom offset. * * @param bottomOffset the bottom offset to translate. */ public void setBottomOffset(int bottomOffset) { if (mBottomOffset != bottomOffset) { mBottomOffset = bottomOffset; if (mAssistHintVisible) { // If assist handles are visible, hide them without animation and then make them // show once again (with corrected bottom offset). hideAssistHandles(); setAssistHintVisible(true); } } } /** * Controls the visibility of the assist gesture handles. * Loading Loading @@ -126,7 +144,8 @@ public class AssistHandleViewController implements NavigationBarTransitions.Dark xDirection * translationStart * view.getWidth(), xDirection * translationEnd * view.getWidth()); Animator translateY = ObjectAnimator.ofFloat(view, View.TRANSLATION_Y, translationStart * view.getHeight(), translationEnd * view.getHeight()); translationStart * view.getHeight() + mBottomOffset, translationEnd * view.getHeight() + mBottomOffset); AnimatorSet set = new AnimatorSet(); set.play(scaleX).with(scaleY); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +15 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ import com.android.systemui.DockedStackExistsListener; import com.android.systemui.Interpolators; import com.android.systemui.R; import com.android.systemui.SysUiServiceProvider; import com.android.systemui.assist.AssistHandleViewController; import com.android.systemui.assist.AssistManager; import com.android.systemui.model.SysUiState; import com.android.systemui.recents.OverviewProxyService; Loading @@ -75,6 +76,7 @@ import com.android.systemui.recents.RecentsOnboarding; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.shared.system.WindowManagerWrapper; import com.android.systemui.statusbar.NavigationBarController; import com.android.systemui.statusbar.policy.DeadZone; import com.android.systemui.statusbar.policy.KeyButtonDrawable; Loading Loading @@ -1198,6 +1200,19 @@ public class NavigationBarView extends FrameLayout implements // we're passing the insets onto the gesture handler since the back arrow is only // conditionally added and doesn't always get all the insets. mEdgeBackGestureHandler.setInsets(leftInset, rightInset); // this allows assist handle to be drawn outside its bound so that it can align screen // bottom by translating its y position. final boolean shouldClip = !isGesturalMode(mNavBarMode) || insets.getSystemWindowInsetBottom() == 0; setClipChildren(shouldClip); setClipToPadding(shouldClip); AssistHandleViewController controller = Dependency.get(NavigationBarController.class) .getAssistHandlerViewController(); if (controller != null) { controller.setBottomOffset(insets.getSystemWindowInsetBottom()); } return super.onApplyWindowInsets(insets); } Loading Loading
packages/SystemUI/src/com/android/systemui/assist/AssistHandleViewController.java +20 −1 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class AssistHandleViewController implements NavigationBarTransitions.Dark private Handler mHandler; private CornerHandleView mAssistHintLeft; private CornerHandleView mAssistHintRight; private int mBottomOffset; @VisibleForTesting boolean mAssistHintVisible; Loading @@ -61,6 +62,23 @@ public class AssistHandleViewController implements NavigationBarTransitions.Dark mAssistHintRight.updateDarkness(darkIntensity); } /** * Set the bottom offset. * * @param bottomOffset the bottom offset to translate. */ public void setBottomOffset(int bottomOffset) { if (mBottomOffset != bottomOffset) { mBottomOffset = bottomOffset; if (mAssistHintVisible) { // If assist handles are visible, hide them without animation and then make them // show once again (with corrected bottom offset). hideAssistHandles(); setAssistHintVisible(true); } } } /** * Controls the visibility of the assist gesture handles. * Loading Loading @@ -126,7 +144,8 @@ public class AssistHandleViewController implements NavigationBarTransitions.Dark xDirection * translationStart * view.getWidth(), xDirection * translationEnd * view.getWidth()); Animator translateY = ObjectAnimator.ofFloat(view, View.TRANSLATION_Y, translationStart * view.getHeight(), translationEnd * view.getHeight()); translationStart * view.getHeight() + mBottomOffset, translationEnd * view.getHeight() + mBottomOffset); AnimatorSet set = new AnimatorSet(); set.play(scaleX).with(scaleY); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +15 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,7 @@ import com.android.systemui.DockedStackExistsListener; import com.android.systemui.Interpolators; import com.android.systemui.R; import com.android.systemui.SysUiServiceProvider; import com.android.systemui.assist.AssistHandleViewController; import com.android.systemui.assist.AssistManager; import com.android.systemui.model.SysUiState; import com.android.systemui.recents.OverviewProxyService; Loading @@ -75,6 +76,7 @@ import com.android.systemui.recents.RecentsOnboarding; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.shared.system.WindowManagerWrapper; import com.android.systemui.statusbar.NavigationBarController; import com.android.systemui.statusbar.policy.DeadZone; import com.android.systemui.statusbar.policy.KeyButtonDrawable; Loading Loading @@ -1198,6 +1200,19 @@ public class NavigationBarView extends FrameLayout implements // we're passing the insets onto the gesture handler since the back arrow is only // conditionally added and doesn't always get all the insets. mEdgeBackGestureHandler.setInsets(leftInset, rightInset); // this allows assist handle to be drawn outside its bound so that it can align screen // bottom by translating its y position. final boolean shouldClip = !isGesturalMode(mNavBarMode) || insets.getSystemWindowInsetBottom() == 0; setClipChildren(shouldClip); setClipToPadding(shouldClip); AssistHandleViewController controller = Dependency.get(NavigationBarController.class) .getAssistHandlerViewController(); if (controller != null) { controller.setBottomOffset(insets.getSystemWindowInsetBottom()); } return super.onApplyWindowInsets(insets); } Loading