Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +7 −4 Original line number Diff line number Diff line Loading @@ -992,7 +992,6 @@ public class NotificationContentView extends FrameLayout { mStatusBarNotification = entry.notification; mBeforeN = entry.targetSdk < Build.VERSION_CODES.N; updateSingleLineView(); applyRemoteInput(entry); if (mContractedChild != null) { mContractedWrapper.notifyContentUpdated(entry.notification, mIsLowPriority); } Loading @@ -1005,6 +1004,7 @@ public class NotificationContentView extends FrameLayout { if (mAmbientChild != null) { mAmbientWrapper.notifyContentUpdated(entry.notification, mIsLowPriority); } applyRemoteInput(entry); updateShowingLegacyBackground(); mForceSelectNextLayout = true; setDark(mDark, false /* animate */, 0 /* delay */); Loading Loading @@ -1046,7 +1046,8 @@ public class NotificationContentView extends FrameLayout { View bigContentView = mExpandedChild; if (bigContentView != null) { mExpandedRemoteInput = applyRemoteInput(bigContentView, entry, hasRemoteInput, mPreviousExpandedRemoteInputIntent, mCachedExpandedRemoteInput); mPreviousExpandedRemoteInputIntent, mCachedExpandedRemoteInput, mExpandedWrapper); } else { mExpandedRemoteInput = null; } Loading @@ -1060,7 +1061,7 @@ public class NotificationContentView extends FrameLayout { View headsUpContentView = mHeadsUpChild; if (headsUpContentView != null) { mHeadsUpRemoteInput = applyRemoteInput(headsUpContentView, entry, hasRemoteInput, mPreviousHeadsUpRemoteInputIntent, mCachedHeadsUpRemoteInput); mPreviousHeadsUpRemoteInputIntent, mCachedHeadsUpRemoteInput, mHeadsUpWrapper); } else { mHeadsUpRemoteInput = null; } Loading @@ -1074,7 +1075,7 @@ public class NotificationContentView extends FrameLayout { private RemoteInputView applyRemoteInput(View view, NotificationData.Entry entry, boolean hasRemoteInput, PendingIntent existingPendingIntent, RemoteInputView cachedView) { RemoteInputView cachedView, NotificationViewWrapper wrapper) { View actionContainerCandidate = view.findViewById( com.android.internal.R.id.actions_container); if (actionContainerCandidate instanceof FrameLayout) { Loading Loading @@ -1113,6 +1114,8 @@ public class NotificationContentView extends FrameLayout { mContext.getColor(R.color.remote_input_text_enabled), mContext.getColor(R.color.remote_input_hint))); existing.setWrapper(wrapper); if (existingPendingIntent != null || existing.isActive()) { // The current action could be gone, or the pending intent no longer valid. // If we find a matching action in the new notification, focus, otherwise close. Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationMessagingTemplateViewWrapper.java +21 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,11 @@ import com.android.systemui.statusbar.TransformableView; import android.content.Context; import android.service.notification.StatusBarNotification; import android.text.TextUtils; import android.view.View; import android.widget.TextView; import java.util.ArrayList; /** * Wraps a notification containing a messaging template Loading @@ -30,6 +34,7 @@ import android.view.View; public class NotificationMessagingTemplateViewWrapper extends NotificationTemplateViewWrapper { private View mContractedMessage; private ArrayList<View> mHistoricMessages = new ArrayList<View>(); protected NotificationMessagingTemplateViewWrapper(Context ctx, View view, ExpandableNotificationRow row) { Loading @@ -44,11 +49,18 @@ public class NotificationMessagingTemplateViewWrapper extends NotificationTempla && ((MessagingLinearLayout) container).getChildCount() > 0) { MessagingLinearLayout messagingContainer = (MessagingLinearLayout) container; // Only consider the first visible child - transforming to a position other than the // first looks bad because we have to move across other messages that are fading in. int childCount = messagingContainer.getChildCount(); for (int i = 0; i < childCount; i++) { View child = messagingContainer.getChildAt(i); if (child.getVisibility() == View.GONE && child instanceof TextView && !TextUtils.isEmpty(((TextView) child).getText())) { mHistoricMessages.add(child); } // Only consider the first visible child - transforming to a position other than the // first looks bad because we have to move across other messages that are fading in. if (child.getId() == messagingContainer.getContractedChildId()) { mContractedMessage = child; } else if (child.getVisibility() == View.VISIBLE) { Loading @@ -75,4 +87,11 @@ public class NotificationMessagingTemplateViewWrapper extends NotificationTempla mContractedMessage); } } @Override public void setRemoteInputVisible(boolean visible) { for (int i = 0; i < mHistoricMessages.size(); i++) { mHistoricMessages.get(i).setVisibility(visible ? View.VISIBLE : View.GONE); } } } packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationViewWrapper.java +3 −0 Original line number Diff line number Diff line Loading @@ -164,4 +164,7 @@ public abstract class NotificationViewWrapper implements TransformableView { public void setContentHeight(int contentHeight, int minHeightHint) { } public void setRemoteInputVisible(boolean visible) { } } packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +19 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import com.android.systemui.R; import com.android.systemui.statusbar.ExpandableView; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.RemoteInputController; import com.android.systemui.statusbar.notification.NotificationViewWrapper; import com.android.systemui.statusbar.stack.ScrollContainer; import com.android.systemui.statusbar.stack.StackStateAnimator; Loading Loading @@ -90,6 +91,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene private int mRevealR; private boolean mResetting; private NotificationViewWrapper mWrapper; public RemoteInputView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -210,11 +212,17 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene @Override public void onAnimationEnd(Animator animation) { setVisibility(INVISIBLE); if (mWrapper != null) { mWrapper.setRemoteInputVisible(false); } } }); reveal.start(); } else { setVisibility(INVISIBLE); if (mWrapper != null) { mWrapper.setRemoteInputVisible(false); } } } MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_REMOTE_INPUT_CLOSE, Loading Loading @@ -267,6 +275,9 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene mEntry.notification.getPackageName()); setVisibility(VISIBLE); if (mWrapper != null) { mWrapper.setRemoteInputVisible(true); } mController.addRemoteInput(mEntry, mToken); mEditText.setInnerFocusable(true); mEditText.mShowImeOnInputConnection = true; Loading @@ -283,6 +294,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene // Update came in after we sent the reply, time to reset. reset(); } if (isActive() && mWrapper != null) { mWrapper.setRemoteInputVisible(true); } } private void reset() { Loading Loading @@ -452,6 +467,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene super.dispatchFinishTemporaryDetach(); } public void setWrapper(NotificationViewWrapper wrapper) { mWrapper = wrapper; } /** * An EditText that changes appearance based on whether it's focusable and becomes * un-focusable whenever the user navigates away from it or it becomes invisible. Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java +7 −4 Original line number Diff line number Diff line Loading @@ -992,7 +992,6 @@ public class NotificationContentView extends FrameLayout { mStatusBarNotification = entry.notification; mBeforeN = entry.targetSdk < Build.VERSION_CODES.N; updateSingleLineView(); applyRemoteInput(entry); if (mContractedChild != null) { mContractedWrapper.notifyContentUpdated(entry.notification, mIsLowPriority); } Loading @@ -1005,6 +1004,7 @@ public class NotificationContentView extends FrameLayout { if (mAmbientChild != null) { mAmbientWrapper.notifyContentUpdated(entry.notification, mIsLowPriority); } applyRemoteInput(entry); updateShowingLegacyBackground(); mForceSelectNextLayout = true; setDark(mDark, false /* animate */, 0 /* delay */); Loading Loading @@ -1046,7 +1046,8 @@ public class NotificationContentView extends FrameLayout { View bigContentView = mExpandedChild; if (bigContentView != null) { mExpandedRemoteInput = applyRemoteInput(bigContentView, entry, hasRemoteInput, mPreviousExpandedRemoteInputIntent, mCachedExpandedRemoteInput); mPreviousExpandedRemoteInputIntent, mCachedExpandedRemoteInput, mExpandedWrapper); } else { mExpandedRemoteInput = null; } Loading @@ -1060,7 +1061,7 @@ public class NotificationContentView extends FrameLayout { View headsUpContentView = mHeadsUpChild; if (headsUpContentView != null) { mHeadsUpRemoteInput = applyRemoteInput(headsUpContentView, entry, hasRemoteInput, mPreviousHeadsUpRemoteInputIntent, mCachedHeadsUpRemoteInput); mPreviousHeadsUpRemoteInputIntent, mCachedHeadsUpRemoteInput, mHeadsUpWrapper); } else { mHeadsUpRemoteInput = null; } Loading @@ -1074,7 +1075,7 @@ public class NotificationContentView extends FrameLayout { private RemoteInputView applyRemoteInput(View view, NotificationData.Entry entry, boolean hasRemoteInput, PendingIntent existingPendingIntent, RemoteInputView cachedView) { RemoteInputView cachedView, NotificationViewWrapper wrapper) { View actionContainerCandidate = view.findViewById( com.android.internal.R.id.actions_container); if (actionContainerCandidate instanceof FrameLayout) { Loading Loading @@ -1113,6 +1114,8 @@ public class NotificationContentView extends FrameLayout { mContext.getColor(R.color.remote_input_text_enabled), mContext.getColor(R.color.remote_input_hint))); existing.setWrapper(wrapper); if (existingPendingIntent != null || existing.isActive()) { // The current action could be gone, or the pending intent no longer valid. // If we find a matching action in the new notification, focus, otherwise close. Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationMessagingTemplateViewWrapper.java +21 −2 Original line number Diff line number Diff line Loading @@ -22,7 +22,11 @@ import com.android.systemui.statusbar.TransformableView; import android.content.Context; import android.service.notification.StatusBarNotification; import android.text.TextUtils; import android.view.View; import android.widget.TextView; import java.util.ArrayList; /** * Wraps a notification containing a messaging template Loading @@ -30,6 +34,7 @@ import android.view.View; public class NotificationMessagingTemplateViewWrapper extends NotificationTemplateViewWrapper { private View mContractedMessage; private ArrayList<View> mHistoricMessages = new ArrayList<View>(); protected NotificationMessagingTemplateViewWrapper(Context ctx, View view, ExpandableNotificationRow row) { Loading @@ -44,11 +49,18 @@ public class NotificationMessagingTemplateViewWrapper extends NotificationTempla && ((MessagingLinearLayout) container).getChildCount() > 0) { MessagingLinearLayout messagingContainer = (MessagingLinearLayout) container; // Only consider the first visible child - transforming to a position other than the // first looks bad because we have to move across other messages that are fading in. int childCount = messagingContainer.getChildCount(); for (int i = 0; i < childCount; i++) { View child = messagingContainer.getChildAt(i); if (child.getVisibility() == View.GONE && child instanceof TextView && !TextUtils.isEmpty(((TextView) child).getText())) { mHistoricMessages.add(child); } // Only consider the first visible child - transforming to a position other than the // first looks bad because we have to move across other messages that are fading in. if (child.getId() == messagingContainer.getContractedChildId()) { mContractedMessage = child; } else if (child.getVisibility() == View.VISIBLE) { Loading @@ -75,4 +87,11 @@ public class NotificationMessagingTemplateViewWrapper extends NotificationTempla mContractedMessage); } } @Override public void setRemoteInputVisible(boolean visible) { for (int i = 0; i < mHistoricMessages.size(); i++) { mHistoricMessages.get(i).setVisibility(visible ? View.VISIBLE : View.GONE); } } }
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationViewWrapper.java +3 −0 Original line number Diff line number Diff line Loading @@ -164,4 +164,7 @@ public abstract class NotificationViewWrapper implements TransformableView { public void setContentHeight(int contentHeight, int minHeightHint) { } public void setRemoteInputVisible(boolean visible) { } }
packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +19 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import com.android.systemui.R; import com.android.systemui.statusbar.ExpandableView; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.RemoteInputController; import com.android.systemui.statusbar.notification.NotificationViewWrapper; import com.android.systemui.statusbar.stack.ScrollContainer; import com.android.systemui.statusbar.stack.StackStateAnimator; Loading Loading @@ -90,6 +91,7 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene private int mRevealR; private boolean mResetting; private NotificationViewWrapper mWrapper; public RemoteInputView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -210,11 +212,17 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene @Override public void onAnimationEnd(Animator animation) { setVisibility(INVISIBLE); if (mWrapper != null) { mWrapper.setRemoteInputVisible(false); } } }); reveal.start(); } else { setVisibility(INVISIBLE); if (mWrapper != null) { mWrapper.setRemoteInputVisible(false); } } } MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_REMOTE_INPUT_CLOSE, Loading Loading @@ -267,6 +275,9 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene mEntry.notification.getPackageName()); setVisibility(VISIBLE); if (mWrapper != null) { mWrapper.setRemoteInputVisible(true); } mController.addRemoteInput(mEntry, mToken); mEditText.setInnerFocusable(true); mEditText.mShowImeOnInputConnection = true; Loading @@ -283,6 +294,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene // Update came in after we sent the reply, time to reset. reset(); } if (isActive() && mWrapper != null) { mWrapper.setRemoteInputVisible(true); } } private void reset() { Loading Loading @@ -452,6 +467,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene super.dispatchFinishTemporaryDetach(); } public void setWrapper(NotificationViewWrapper wrapper) { mWrapper = wrapper; } /** * An EditText that changes appearance based on whether it's focusable and becomes * un-focusable whenever the user navigates away from it or it becomes invisible. Loading