Merge "Revert "Remove NOTIFICATION_INLINE_REPLY_ANIMATION flag"" into udc-dev
This commit is contained in:
@@ -79,6 +79,11 @@ object Flags {
|
|||||||
// TODO(b/257315550): Tracking Bug
|
// TODO(b/257315550): Tracking Bug
|
||||||
val NO_HUN_FOR_OLD_WHEN = releasedFlag(118, "no_hun_for_old_when")
|
val NO_HUN_FOR_OLD_WHEN = releasedFlag(118, "no_hun_for_old_when")
|
||||||
|
|
||||||
|
// TODO(b/260335638): Tracking Bug
|
||||||
|
@JvmField
|
||||||
|
val NOTIFICATION_INLINE_REPLY_ANIMATION =
|
||||||
|
unreleasedFlag(174148361, "notification_inline_reply_animation")
|
||||||
|
|
||||||
/** Makes sure notification panel is updated before the user switch is complete. */
|
/** Makes sure notification panel is updated before the user switch is complete. */
|
||||||
// TODO(b/278873737): Tracking Bug
|
// TODO(b/278873737): Tracking Bug
|
||||||
@JvmField
|
@JvmField
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.systemui.statusbar.notification.collection.inflation;
|
package com.android.systemui.statusbar.notification.collection.inflation;
|
||||||
|
|
||||||
|
import static com.android.systemui.flags.Flags.NOTIFICATION_INLINE_REPLY_ANIMATION;
|
||||||
import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_CONTRACTED;
|
import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_CONTRACTED;
|
||||||
import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_EXPANDED;
|
import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_EXPANDED;
|
||||||
import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_PUBLIC;
|
import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_PUBLIC;
|
||||||
@@ -30,6 +31,7 @@ import android.view.ViewGroup;
|
|||||||
|
|
||||||
import com.android.internal.util.NotificationMessagingUtil;
|
import com.android.internal.util.NotificationMessagingUtil;
|
||||||
import com.android.systemui.dagger.SysUISingleton;
|
import com.android.systemui.dagger.SysUISingleton;
|
||||||
|
import com.android.systemui.flags.FeatureFlags;
|
||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||||
import com.android.systemui.statusbar.NotificationPresenter;
|
import com.android.systemui.statusbar.NotificationPresenter;
|
||||||
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
||||||
@@ -71,6 +73,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
|
|||||||
private NotificationListContainer mListContainer;
|
private NotificationListContainer mListContainer;
|
||||||
private BindRowCallback mBindRowCallback;
|
private BindRowCallback mBindRowCallback;
|
||||||
private NotificationClicker mNotificationClicker;
|
private NotificationClicker mNotificationClicker;
|
||||||
|
private FeatureFlags mFeatureFlags;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public NotificationRowBinderImpl(
|
public NotificationRowBinderImpl(
|
||||||
@@ -82,7 +85,8 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
|
|||||||
RowContentBindStage rowContentBindStage,
|
RowContentBindStage rowContentBindStage,
|
||||||
Provider<RowInflaterTask> rowInflaterTaskProvider,
|
Provider<RowInflaterTask> rowInflaterTaskProvider,
|
||||||
ExpandableNotificationRowComponent.Builder expandableNotificationRowComponentBuilder,
|
ExpandableNotificationRowComponent.Builder expandableNotificationRowComponentBuilder,
|
||||||
IconManager iconManager) {
|
IconManager iconManager,
|
||||||
|
FeatureFlags featureFlags) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mNotifBindPipeline = notifBindPipeline;
|
mNotifBindPipeline = notifBindPipeline;
|
||||||
mRowContentBindStage = rowContentBindStage;
|
mRowContentBindStage = rowContentBindStage;
|
||||||
@@ -92,6 +96,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
|
|||||||
mRowInflaterTaskProvider = rowInflaterTaskProvider;
|
mRowInflaterTaskProvider = rowInflaterTaskProvider;
|
||||||
mExpandableNotificationRowComponentBuilder = expandableNotificationRowComponentBuilder;
|
mExpandableNotificationRowComponentBuilder = expandableNotificationRowComponentBuilder;
|
||||||
mIconManager = iconManager;
|
mIconManager = iconManager;
|
||||||
|
mFeatureFlags = featureFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -175,6 +180,8 @@ public class NotificationRowBinderImpl implements NotificationRowBinder {
|
|||||||
entry.setRow(row);
|
entry.setRow(row);
|
||||||
mNotifBindPipeline.manageRow(entry, row);
|
mNotifBindPipeline.manageRow(entry, row);
|
||||||
mBindRowCallback.onBindRow(row);
|
mBindRowCallback.onBindRow(row);
|
||||||
|
row.setInlineReplyAnimationFlagEnabled(
|
||||||
|
mFeatureFlags.isEnabled(NOTIFICATION_INLINE_REPLY_ANIMATION));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -271,6 +271,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
private OnExpandClickListener mOnExpandClickListener;
|
private OnExpandClickListener mOnExpandClickListener;
|
||||||
private View.OnClickListener mOnFeedbackClickListener;
|
private View.OnClickListener mOnFeedbackClickListener;
|
||||||
private Path mExpandingClipPath;
|
private Path mExpandingClipPath;
|
||||||
|
private boolean mIsInlineReplyAnimationFlagEnabled = false;
|
||||||
|
|
||||||
// Listener will be called when receiving a long click event.
|
// Listener will be called when receiving a long click event.
|
||||||
// Use #setLongPressPosition to optionally assign positional data with the long press.
|
// Use #setLongPressPosition to optionally assign positional data with the long press.
|
||||||
@@ -3054,6 +3055,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
return showingLayout != null && showingLayout.requireRowToHaveOverlappingRendering();
|
return showingLayout != null && showingLayout.requireRowToHaveOverlappingRendering();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setInlineReplyAnimationFlagEnabled(boolean isEnabled) {
|
||||||
|
mIsInlineReplyAnimationFlagEnabled = isEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setActualHeight(int height, boolean notifyListeners) {
|
public void setActualHeight(int height, boolean notifyListeners) {
|
||||||
boolean changed = height != getActualHeight();
|
boolean changed = height != getActualHeight();
|
||||||
@@ -3073,7 +3078,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
}
|
}
|
||||||
int contentHeight = Math.max(getMinHeight(), height);
|
int contentHeight = Math.max(getMinHeight(), height);
|
||||||
for (NotificationContentView l : mLayouts) {
|
for (NotificationContentView l : mLayouts) {
|
||||||
l.setContentHeight(height);
|
if (mIsInlineReplyAnimationFlagEnabled) {
|
||||||
|
l.setContentHeight(height);
|
||||||
|
} else {
|
||||||
|
l.setContentHeight(contentHeight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (mIsSummaryWithChildren) {
|
if (mIsSummaryWithChildren) {
|
||||||
mChildrenContainer.setActualHeight(height);
|
mChildrenContainer.setActualHeight(height);
|
||||||
|
|||||||
@@ -635,7 +635,8 @@ public class NotificationContentView extends FrameLayout implements Notification
|
|||||||
int hint;
|
int hint;
|
||||||
if (mHeadsUpChild != null && isVisibleOrTransitioning(VISIBLE_TYPE_HEADSUP)) {
|
if (mHeadsUpChild != null && isVisibleOrTransitioning(VISIBLE_TYPE_HEADSUP)) {
|
||||||
hint = getViewHeight(VISIBLE_TYPE_HEADSUP);
|
hint = getViewHeight(VISIBLE_TYPE_HEADSUP);
|
||||||
if (mHeadsUpRemoteInput != null && mHeadsUpRemoteInput.isAnimatingAppearance()) {
|
if (mHeadsUpRemoteInput != null && mHeadsUpRemoteInput.isAnimatingAppearance()
|
||||||
|
&& mHeadsUpRemoteInputController.isFocusAnimationFlagActive()) {
|
||||||
// While the RemoteInputView is animating its appearance, it should be allowed
|
// While the RemoteInputView is animating its appearance, it should be allowed
|
||||||
// to overlap the hint, therefore no space is reserved for the hint during the
|
// to overlap the hint, therefore no space is reserved for the hint during the
|
||||||
// appearance animation of the RemoteInputView
|
// appearance animation of the RemoteInputView
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import static android.view.WindowInsetsAnimation.Callback.DISPATCH_MODE_STOP;
|
|||||||
import static com.android.systemui.statusbar.notification.stack.StackStateAnimator.ANIMATION_DURATION_STANDARD;
|
import static com.android.systemui.statusbar.notification.stack.StackStateAnimator.ANIMATION_DURATION_STANDARD;
|
||||||
|
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
|
import android.app.Notification;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
@@ -134,6 +135,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
|
|||||||
@Nullable
|
@Nullable
|
||||||
private RevealParams mRevealParams;
|
private RevealParams mRevealParams;
|
||||||
private Rect mContentBackgroundBounds;
|
private Rect mContentBackgroundBounds;
|
||||||
|
private boolean mIsFocusAnimationFlagActive;
|
||||||
private boolean mIsAnimatingAppearance = false;
|
private boolean mIsAnimatingAppearance = false;
|
||||||
|
|
||||||
// TODO(b/193539698): move these to a Controller
|
// TODO(b/193539698): move these to a Controller
|
||||||
@@ -431,7 +433,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
|
|||||||
// case to prevent flicker.
|
// case to prevent flicker.
|
||||||
if (!mRemoved) {
|
if (!mRemoved) {
|
||||||
ViewGroup parent = (ViewGroup) getParent();
|
ViewGroup parent = (ViewGroup) getParent();
|
||||||
if (animate && parent != null) {
|
if (animate && parent != null && mIsFocusAnimationFlagActive) {
|
||||||
|
|
||||||
ViewGroup grandParent = (ViewGroup) parent.getParent();
|
ViewGroup grandParent = (ViewGroup) parent.getParent();
|
||||||
ViewGroupOverlay overlay = parent.getOverlay();
|
ViewGroupOverlay overlay = parent.getOverlay();
|
||||||
@@ -595,11 +597,25 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
|
|||||||
mEditText.setText(editTextContent);
|
mEditText.setText(editTextContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether the feature flag for the revised inline reply animation is active or not.
|
||||||
|
* @param active
|
||||||
|
*/
|
||||||
|
public void setIsFocusAnimationFlagActive(boolean active) {
|
||||||
|
mIsFocusAnimationFlagActive = active;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Focuses the RemoteInputView and animates its appearance
|
* Focuses the RemoteInputView and animates its appearance
|
||||||
*/
|
*/
|
||||||
public void focusAnimated() {
|
public void focusAnimated() {
|
||||||
if (getVisibility() != VISIBLE) {
|
if (!mIsFocusAnimationFlagActive && getVisibility() != VISIBLE
|
||||||
|
&& mRevealParams != null) {
|
||||||
|
android.animation.Animator animator = mRevealParams.createCircularRevealAnimator(this);
|
||||||
|
animator.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD);
|
||||||
|
animator.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
|
||||||
|
animator.start();
|
||||||
|
} else if (mIsFocusAnimationFlagActive && getVisibility() != VISIBLE) {
|
||||||
mIsAnimatingAppearance = true;
|
mIsAnimatingAppearance = true;
|
||||||
setAlpha(0f);
|
setAlpha(0f);
|
||||||
Animator focusAnimator = getFocusAnimator(getActionsContainerLayout());
|
Animator focusAnimator = getFocusAnimator(getActionsContainerLayout());
|
||||||
@@ -654,19 +670,37 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void reset() {
|
private void reset() {
|
||||||
mProgressBar.setVisibility(INVISIBLE);
|
if (mIsFocusAnimationFlagActive) {
|
||||||
|
mProgressBar.setVisibility(INVISIBLE);
|
||||||
|
mResetting = true;
|
||||||
|
mSending = false;
|
||||||
|
onDefocus(true /* animate */, false /* logClose */, () -> {
|
||||||
|
mEntry.remoteInputTextWhenReset = SpannedString.valueOf(mEditText.getText());
|
||||||
|
mEditText.getText().clear();
|
||||||
|
mEditText.setEnabled(isAggregatedVisible());
|
||||||
|
mSendButton.setVisibility(VISIBLE);
|
||||||
|
mController.removeSpinning(mEntry.getKey(), mToken);
|
||||||
|
updateSendButton();
|
||||||
|
setAttachment(null);
|
||||||
|
mResetting = false;
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mResetting = true;
|
mResetting = true;
|
||||||
mSending = false;
|
mSending = false;
|
||||||
onDefocus(true /* animate */, false /* logClose */, () -> {
|
mEntry.remoteInputTextWhenReset = SpannedString.valueOf(mEditText.getText());
|
||||||
mEntry.remoteInputTextWhenReset = SpannedString.valueOf(mEditText.getText());
|
|
||||||
mEditText.getText().clear();
|
mEditText.getText().clear();
|
||||||
mEditText.setEnabled(isAggregatedVisible());
|
mEditText.setEnabled(isAggregatedVisible());
|
||||||
mSendButton.setVisibility(VISIBLE);
|
mSendButton.setVisibility(VISIBLE);
|
||||||
mController.removeSpinning(mEntry.getKey(), mToken);
|
mProgressBar.setVisibility(INVISIBLE);
|
||||||
updateSendButton();
|
mController.removeSpinning(mEntry.getKey(), mToken);
|
||||||
setAttachment(null);
|
updateSendButton();
|
||||||
mResetting = false;
|
onDefocus(false /* animate */, false /* logClose */, null /* doAfterDefocus */);
|
||||||
});
|
setAttachment(null);
|
||||||
|
|
||||||
|
mResetting = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -810,7 +844,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene
|
|||||||
@Override
|
@Override
|
||||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
super.onLayout(changed, l, t, r, b);
|
super.onLayout(changed, l, t, r, b);
|
||||||
setPivotY(getMeasuredHeight());
|
if (mIsFocusAnimationFlagActive) setPivotY(getMeasuredHeight());
|
||||||
if (mContentBackgroundBounds != null) {
|
if (mContentBackgroundBounds != null) {
|
||||||
mContentBackground.setBounds(mContentBackgroundBounds);
|
mContentBackground.setBounds(mContentBackgroundBounds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ import android.util.Log
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import com.android.internal.logging.UiEventLogger
|
import com.android.internal.logging.UiEventLogger
|
||||||
import com.android.systemui.R
|
import com.android.systemui.R
|
||||||
|
import com.android.systemui.flags.FeatureFlags
|
||||||
|
import com.android.systemui.flags.Flags.NOTIFICATION_INLINE_REPLY_ANIMATION
|
||||||
import com.android.systemui.statusbar.NotificationRemoteInputManager
|
import com.android.systemui.statusbar.NotificationRemoteInputManager
|
||||||
import com.android.systemui.statusbar.RemoteInputController
|
import com.android.systemui.statusbar.RemoteInputController
|
||||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry
|
import com.android.systemui.statusbar.notification.collection.NotificationEntry
|
||||||
@@ -61,6 +63,8 @@ interface RemoteInputViewController {
|
|||||||
|
|
||||||
var revealParams: RevealParams?
|
var revealParams: RevealParams?
|
||||||
|
|
||||||
|
val isFocusAnimationFlagActive: Boolean
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the smart reply that should be inserted in the remote input, or `null` if the user is
|
* Sets the smart reply that should be inserted in the remote input, or `null` if the user is
|
||||||
* not editing a smart reply.
|
* not editing a smart reply.
|
||||||
@@ -118,6 +122,7 @@ class RemoteInputViewControllerImpl @Inject constructor(
|
|||||||
private val remoteInputController: RemoteInputController,
|
private val remoteInputController: RemoteInputController,
|
||||||
private val shortcutManager: ShortcutManager,
|
private val shortcutManager: ShortcutManager,
|
||||||
private val uiEventLogger: UiEventLogger,
|
private val uiEventLogger: UiEventLogger,
|
||||||
|
private val mFlags: FeatureFlags
|
||||||
) : RemoteInputViewController {
|
) : RemoteInputViewController {
|
||||||
|
|
||||||
private val onSendListeners = ArraySet<OnSendRemoteInputListener>()
|
private val onSendListeners = ArraySet<OnSendRemoteInputListener>()
|
||||||
@@ -149,6 +154,9 @@ class RemoteInputViewControllerImpl @Inject constructor(
|
|||||||
|
|
||||||
override val isActive: Boolean get() = view.isActive
|
override val isActive: Boolean get() = view.isActive
|
||||||
|
|
||||||
|
override val isFocusAnimationFlagActive: Boolean
|
||||||
|
get() = mFlags.isEnabled(NOTIFICATION_INLINE_REPLY_ANIMATION)
|
||||||
|
|
||||||
override fun bind() {
|
override fun bind() {
|
||||||
if (isBound) return
|
if (isBound) return
|
||||||
isBound = true
|
isBound = true
|
||||||
@@ -159,6 +167,7 @@ class RemoteInputViewControllerImpl @Inject constructor(
|
|||||||
view.setSupportedMimeTypes(it.allowedDataTypes)
|
view.setSupportedMimeTypes(it.allowedDataTypes)
|
||||||
}
|
}
|
||||||
view.setRevealParameters(revealParams)
|
view.setRevealParameters(revealParams)
|
||||||
|
view.setIsFocusAnimationFlagActive(isFocusAnimationFlagActive)
|
||||||
|
|
||||||
view.addOnEditTextFocusChangedListener(onFocusChangeListener)
|
view.addOnEditTextFocusChangedListener(onFocusChangeListener)
|
||||||
view.addOnSendRemoteInputListener(onSendRemoteInputListener)
|
view.addOnSendRemoteInputListener(onSendRemoteInputListener)
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ import com.android.internal.logging.testing.UiEventLoggerFake;
|
|||||||
import com.android.systemui.Dependency;
|
import com.android.systemui.Dependency;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.SysuiTestCase;
|
import com.android.systemui.SysuiTestCase;
|
||||||
|
import com.android.systemui.flags.FakeFeatureFlags;
|
||||||
|
import com.android.systemui.flags.Flags;
|
||||||
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
import com.android.systemui.statusbar.NotificationRemoteInputManager;
|
||||||
import com.android.systemui.statusbar.RemoteInputController;
|
import com.android.systemui.statusbar.RemoteInputController;
|
||||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||||
@@ -451,13 +453,17 @@ public class RemoteInputViewTest extends SysuiTestCase {
|
|||||||
private RemoteInputViewController bindController(
|
private RemoteInputViewController bindController(
|
||||||
RemoteInputView view,
|
RemoteInputView view,
|
||||||
NotificationEntry entry) {
|
NotificationEntry entry) {
|
||||||
|
FakeFeatureFlags fakeFeatureFlags = new FakeFeatureFlags();
|
||||||
|
fakeFeatureFlags.set(Flags.NOTIFICATION_INLINE_REPLY_ANIMATION, true);
|
||||||
RemoteInputViewControllerImpl viewController = new RemoteInputViewControllerImpl(
|
RemoteInputViewControllerImpl viewController = new RemoteInputViewControllerImpl(
|
||||||
view,
|
view,
|
||||||
entry,
|
entry,
|
||||||
mRemoteInputQuickSettingsDisabler,
|
mRemoteInputQuickSettingsDisabler,
|
||||||
mController,
|
mController,
|
||||||
mShortcutManager,
|
mShortcutManager,
|
||||||
mUiEventLoggerFake);
|
mUiEventLoggerFake,
|
||||||
|
fakeFeatureFlags
|
||||||
|
);
|
||||||
viewController.bind();
|
viewController.bind();
|
||||||
return viewController;
|
return viewController;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user