Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +31 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ public class NotificationContentView extends FrameLayout { private StatusBarNotification mStatusBarNotification; private NotificationGroupManager mGroupManager; private RemoteInputController mRemoteInputController; private Runnable mExpandedVisibleListener; private final ViewTreeObserver.OnPreDrawListener mEnableAnimationPredrawListener = new ViewTreeObserver.OnPreDrawListener() { Loading Loading @@ -712,11 +713,21 @@ public class NotificationContentView extends FrameLayout { forceUpdateVisibility(VISIBLE_TYPE_HEADSUP, mHeadsUpChild, mHeadsUpWrapper); forceUpdateVisibility(VISIBLE_TYPE_SINGLELINE, mSingleLineView, mSingleLineView); forceUpdateVisibility(VISIBLE_TYPE_AMBIENT, mAmbientChild, mAmbientWrapper); fireExpandedVisibleListenerIfVisible(); // forceUpdateVisibilities cancels outstanding animations without updating the // mAnimationStartVisibleType. Do so here instead. mAnimationStartVisibleType = UNDEFINED; } private void fireExpandedVisibleListenerIfVisible() { if (mExpandedVisibleListener != null && mExpandedChild != null && isShown() && mExpandedChild.getVisibility() == VISIBLE) { Runnable listener = mExpandedVisibleListener; mExpandedVisibleListener = null; listener.run(); } } private void forceUpdateVisibility(int type, View view, TransformableView wrapper) { if (view == null) { return; Loading Loading @@ -770,6 +781,7 @@ public class NotificationContentView extends FrameLayout { mSingleLineView, mSingleLineView); updateViewVisibility(visibleType, VISIBLE_TYPE_AMBIENT, mAmbientChild, mAmbientWrapper); fireExpandedVisibleListenerIfVisible(); // updateViewVisibilities cancels outstanding animations without updating the // mAnimationStartVisibleType. Do so here instead. mAnimationStartVisibleType = UNDEFINED; Loading Loading @@ -801,6 +813,7 @@ public class NotificationContentView extends FrameLayout { mAnimationStartVisibleType = UNDEFINED; } }); fireExpandedVisibleListenerIfVisible(); } private void transferRemoteInputFocus(int visibleType) { Loading Loading @@ -1304,6 +1317,24 @@ public class NotificationContentView extends FrameLayout { } } @Override public void onVisibilityAggregated(boolean isVisible) { super.onVisibilityAggregated(isVisible); if (isVisible) { fireExpandedVisibleListenerIfVisible(); } } /** * Sets a one-shot listener for when the expanded view becomes visible. * * This will fire the listener immediately if the expanded view is already visible. */ public void setOnExpandedVisibleListener(Runnable r) { mExpandedVisibleListener = r; fireExpandedVisibleListenerIfVisible(); } public void setIsLowPriority(boolean isLowPriority) { mIsLowPriority = isLowPriority; } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +29 −2 Original line number Diff line number Diff line Loading @@ -4704,6 +4704,16 @@ public class StatusBar extends SystemUI implements DemoMode, mPendingRemoteInputView = clicked; } protected void onMakeExpandedVisibleForRemoteInput(ExpandableNotificationRow row, View clickedView) { if (isKeyguardShowing()) { onLockedRemoteInput(row, clickedView); } else { row.setUserExpanded(true); row.getPrivateLayout().setOnExpandedVisibleListener(clickedView::performClick); } } protected boolean startWorkChallengeIfNecessary(int userId, IntentSender intendSender, String notificationKey) { // Clear pending remote view, as we do not want to trigger pending remote input view when Loading Loading @@ -5463,7 +5473,7 @@ public class StatusBar extends SystemUI implements DemoMode, if (p instanceof View) { View pv = (View) p; if (pv.isRootNamespace()) { riv = (RemoteInputView) pv.findViewWithTag(RemoteInputView.VIEW_TAG); riv = findRemoteInputView(pv); break; } } Loading @@ -5478,7 +5488,7 @@ public class StatusBar extends SystemUI implements DemoMode, p = p.getParent(); } if (riv == null || row == null) { if (row == null) { return false; } Loading @@ -5497,6 +5507,17 @@ public class StatusBar extends SystemUI implements DemoMode, } } if (riv == null) { riv = findRemoteInputView(row.getPrivateLayout().getExpandedChild()); if (riv == null) { return false; } if (!row.getPrivateLayout().getExpandedChild().isShown()) { onMakeExpandedVisibleForRemoteInput(row, view); return true; } } int width = view.getWidth(); if (view instanceof TextView) { // Center the reveal on the text which might be off-center from the TextView Loading @@ -5523,6 +5544,12 @@ public class StatusBar extends SystemUI implements DemoMode, return true; } private RemoteInputView findRemoteInputView(View v) { if (v == null) { return null; } return (RemoteInputView) v.findViewWithTag(RemoteInputView.VIEW_TAG); } }; private final BroadcastReceiver mBaseBroadcastReceiver = new BroadcastReceiver() { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +31 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ public class NotificationContentView extends FrameLayout { private StatusBarNotification mStatusBarNotification; private NotificationGroupManager mGroupManager; private RemoteInputController mRemoteInputController; private Runnable mExpandedVisibleListener; private final ViewTreeObserver.OnPreDrawListener mEnableAnimationPredrawListener = new ViewTreeObserver.OnPreDrawListener() { Loading Loading @@ -712,11 +713,21 @@ public class NotificationContentView extends FrameLayout { forceUpdateVisibility(VISIBLE_TYPE_HEADSUP, mHeadsUpChild, mHeadsUpWrapper); forceUpdateVisibility(VISIBLE_TYPE_SINGLELINE, mSingleLineView, mSingleLineView); forceUpdateVisibility(VISIBLE_TYPE_AMBIENT, mAmbientChild, mAmbientWrapper); fireExpandedVisibleListenerIfVisible(); // forceUpdateVisibilities cancels outstanding animations without updating the // mAnimationStartVisibleType. Do so here instead. mAnimationStartVisibleType = UNDEFINED; } private void fireExpandedVisibleListenerIfVisible() { if (mExpandedVisibleListener != null && mExpandedChild != null && isShown() && mExpandedChild.getVisibility() == VISIBLE) { Runnable listener = mExpandedVisibleListener; mExpandedVisibleListener = null; listener.run(); } } private void forceUpdateVisibility(int type, View view, TransformableView wrapper) { if (view == null) { return; Loading Loading @@ -770,6 +781,7 @@ public class NotificationContentView extends FrameLayout { mSingleLineView, mSingleLineView); updateViewVisibility(visibleType, VISIBLE_TYPE_AMBIENT, mAmbientChild, mAmbientWrapper); fireExpandedVisibleListenerIfVisible(); // updateViewVisibilities cancels outstanding animations without updating the // mAnimationStartVisibleType. Do so here instead. mAnimationStartVisibleType = UNDEFINED; Loading Loading @@ -801,6 +813,7 @@ public class NotificationContentView extends FrameLayout { mAnimationStartVisibleType = UNDEFINED; } }); fireExpandedVisibleListenerIfVisible(); } private void transferRemoteInputFocus(int visibleType) { Loading Loading @@ -1304,6 +1317,24 @@ public class NotificationContentView extends FrameLayout { } } @Override public void onVisibilityAggregated(boolean isVisible) { super.onVisibilityAggregated(isVisible); if (isVisible) { fireExpandedVisibleListenerIfVisible(); } } /** * Sets a one-shot listener for when the expanded view becomes visible. * * This will fire the listener immediately if the expanded view is already visible. */ public void setOnExpandedVisibleListener(Runnable r) { mExpandedVisibleListener = r; fireExpandedVisibleListenerIfVisible(); } public void setIsLowPriority(boolean isLowPriority) { mIsLowPriority = isLowPriority; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +29 −2 Original line number Diff line number Diff line Loading @@ -4704,6 +4704,16 @@ public class StatusBar extends SystemUI implements DemoMode, mPendingRemoteInputView = clicked; } protected void onMakeExpandedVisibleForRemoteInput(ExpandableNotificationRow row, View clickedView) { if (isKeyguardShowing()) { onLockedRemoteInput(row, clickedView); } else { row.setUserExpanded(true); row.getPrivateLayout().setOnExpandedVisibleListener(clickedView::performClick); } } protected boolean startWorkChallengeIfNecessary(int userId, IntentSender intendSender, String notificationKey) { // Clear pending remote view, as we do not want to trigger pending remote input view when Loading Loading @@ -5463,7 +5473,7 @@ public class StatusBar extends SystemUI implements DemoMode, if (p instanceof View) { View pv = (View) p; if (pv.isRootNamespace()) { riv = (RemoteInputView) pv.findViewWithTag(RemoteInputView.VIEW_TAG); riv = findRemoteInputView(pv); break; } } Loading @@ -5478,7 +5488,7 @@ public class StatusBar extends SystemUI implements DemoMode, p = p.getParent(); } if (riv == null || row == null) { if (row == null) { return false; } Loading @@ -5497,6 +5507,17 @@ public class StatusBar extends SystemUI implements DemoMode, } } if (riv == null) { riv = findRemoteInputView(row.getPrivateLayout().getExpandedChild()); if (riv == null) { return false; } if (!row.getPrivateLayout().getExpandedChild().isShown()) { onMakeExpandedVisibleForRemoteInput(row, view); return true; } } int width = view.getWidth(); if (view instanceof TextView) { // Center the reveal on the text which might be off-center from the TextView Loading @@ -5523,6 +5544,12 @@ public class StatusBar extends SystemUI implements DemoMode, return true; } private RemoteInputView findRemoteInputView(View v) { if (v == null) { return null; } return (RemoteInputView) v.findViewWithTag(RemoteInputView.VIEW_TAG); } }; private final BroadcastReceiver mBaseBroadcastReceiver = new BroadcastReceiver() { Loading