Loading core/res/res/layout/notification_template_material_call.xml +11 −6 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginStart="@dimen/conversation_content_start" android:layout_marginEnd="@dimen/notification_content_margin_end" android:orientation="vertical" android:minHeight="68dp" > Loading @@ -71,13 +70,19 @@ /> </LinearLayout> <!-- TODO(b/179178086): remove padding from main column when this is visible --> <FrameLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:minWidth="@dimen/notification_content_margin_end" > <include layout="@layout/notification_expand_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="top|end" /> </FrameLayout> </LinearLayout> <include layout="@layout/notification_material_action_list" /> Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java +11 −4 Original line number Diff line number Diff line Loading @@ -349,7 +349,9 @@ public class NotificationContentView extends FrameLayout { invalidateOutline(); selectLayout(false /* animate */, mForceSelectNextLayout /* force */); mForceSelectNextLayout = false; updateExpandButtons(mExpandable); // TODO(b/182314698): move this to onMeasure. This requires switching to getMeasuredHeight, // and also requires revisiting all of the logic called earlier in this method. updateExpandButtonsDuringLayout(mExpandable, true /* duringLayout */); } @Override Loading Loading @@ -1589,6 +1591,10 @@ public class NotificationContentView extends FrameLayout { } public void updateExpandButtons(boolean expandable) { updateExpandButtonsDuringLayout(expandable, false /* duringLayout */); } private void updateExpandButtonsDuringLayout(boolean expandable, boolean duringLayout) { mExpandable = expandable; // if the expanded child has the same height as the collapsed one we hide it. if (mExpandedChild != null && mExpandedChild.getHeight() != 0) { Loading @@ -1602,14 +1608,15 @@ public class NotificationContentView extends FrameLayout { expandable = false; } } boolean requestLayout = duringLayout && mIsContentExpandable != expandable; if (mExpandedChild != null) { mExpandedWrapper.updateExpandability(expandable, mExpandClickListener); mExpandedWrapper.updateExpandability(expandable, mExpandClickListener, requestLayout); } if (mContractedChild != null) { mContractedWrapper.updateExpandability(expandable, mExpandClickListener); mContractedWrapper.updateExpandability(expandable, mExpandClickListener, requestLayout); } if (mHeadsUpChild != null) { mHeadsUpWrapper.updateExpandability(expandable, mExpandClickListener); mHeadsUpWrapper.updateExpandability(expandable, mExpandClickListener, requestLayout); } mIsContentExpandable = expandable; } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt +5 −2 Original line number Diff line number Diff line Loading @@ -147,8 +147,11 @@ class NotificationConversationTemplateViewWrapper constructor( override fun setRemoteInputVisible(visible: Boolean) = conversationLayout.showHistoricMessages(visible) override fun updateExpandability(expandable: Boolean, onClickListener: View.OnClickListener?) = conversationLayout.updateExpandability(expandable, onClickListener) override fun updateExpandability( expandable: Boolean, onClickListener: View.OnClickListener, requestLayout: Boolean ) = conversationLayout.updateExpandability(expandable, onClickListener) override fun disallowSingleClick(x: Float, y: Float): Boolean { val isOnExpandButton = expandBtnContainer.visibility == View.VISIBLE && Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java +9 −1 Original line number Diff line number Diff line Loading @@ -261,7 +261,8 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper { } @Override public void updateExpandability(boolean expandable, View.OnClickListener onClickListener) { public void updateExpandability(boolean expandable, View.OnClickListener onClickListener, boolean requestLayout) { mExpandButton.setVisibility(expandable ? View.VISIBLE : View.GONE); mExpandButton.setOnClickListener(expandable ? onClickListener : null); if (mAltExpandTarget != null) { Loading @@ -273,6 +274,13 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper { if (mNotificationHeader != null) { mNotificationHeader.setOnClickListener(expandable ? onClickListener : null); } // Unfortunately, the NotificationContentView has to layout its children in order to // determine their heights, and that affects the button visibility. If that happens // (thankfully it is rare) then we need to request layout of the expand button's parent // in order to ensure it gets laid out correctly. if (requestLayout) { mExpandButton.getParent().requestLayout(); } } @Override Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java +3 −1 Original line number Diff line number Diff line Loading @@ -291,8 +291,10 @@ public abstract class NotificationViewWrapper implements TransformableView { * * @param expandable should this view be expandable * @param onClickListener the listener to invoke when the expand affordance is clicked on * @param requestLayout the expandability changed during onLayout, so a requestLayout required */ public void updateExpandability(boolean expandable, View.OnClickListener onClickListener) {} public void updateExpandability(boolean expandable, View.OnClickListener onClickListener, boolean requestLayout) {} /** Set the expanded state on the view wrapper */ public void setExpanded(boolean expanded) {} Loading Loading
core/res/res/layout/notification_template_material_call.xml +11 −6 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginStart="@dimen/conversation_content_start" android:layout_marginEnd="@dimen/notification_content_margin_end" android:orientation="vertical" android:minHeight="68dp" > Loading @@ -71,13 +70,19 @@ /> </LinearLayout> <!-- TODO(b/179178086): remove padding from main column when this is visible --> <FrameLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:minWidth="@dimen/notification_content_margin_end" > <include layout="@layout/notification_expand_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="top|end" /> </FrameLayout> </LinearLayout> <include layout="@layout/notification_material_action_list" /> Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java +11 −4 Original line number Diff line number Diff line Loading @@ -349,7 +349,9 @@ public class NotificationContentView extends FrameLayout { invalidateOutline(); selectLayout(false /* animate */, mForceSelectNextLayout /* force */); mForceSelectNextLayout = false; updateExpandButtons(mExpandable); // TODO(b/182314698): move this to onMeasure. This requires switching to getMeasuredHeight, // and also requires revisiting all of the logic called earlier in this method. updateExpandButtonsDuringLayout(mExpandable, true /* duringLayout */); } @Override Loading Loading @@ -1589,6 +1591,10 @@ public class NotificationContentView extends FrameLayout { } public void updateExpandButtons(boolean expandable) { updateExpandButtonsDuringLayout(expandable, false /* duringLayout */); } private void updateExpandButtonsDuringLayout(boolean expandable, boolean duringLayout) { mExpandable = expandable; // if the expanded child has the same height as the collapsed one we hide it. if (mExpandedChild != null && mExpandedChild.getHeight() != 0) { Loading @@ -1602,14 +1608,15 @@ public class NotificationContentView extends FrameLayout { expandable = false; } } boolean requestLayout = duringLayout && mIsContentExpandable != expandable; if (mExpandedChild != null) { mExpandedWrapper.updateExpandability(expandable, mExpandClickListener); mExpandedWrapper.updateExpandability(expandable, mExpandClickListener, requestLayout); } if (mContractedChild != null) { mContractedWrapper.updateExpandability(expandable, mExpandClickListener); mContractedWrapper.updateExpandability(expandable, mExpandClickListener, requestLayout); } if (mHeadsUpChild != null) { mHeadsUpWrapper.updateExpandability(expandable, mExpandClickListener); mHeadsUpWrapper.updateExpandability(expandable, mExpandClickListener, requestLayout); } mIsContentExpandable = expandable; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt +5 −2 Original line number Diff line number Diff line Loading @@ -147,8 +147,11 @@ class NotificationConversationTemplateViewWrapper constructor( override fun setRemoteInputVisible(visible: Boolean) = conversationLayout.showHistoricMessages(visible) override fun updateExpandability(expandable: Boolean, onClickListener: View.OnClickListener?) = conversationLayout.updateExpandability(expandable, onClickListener) override fun updateExpandability( expandable: Boolean, onClickListener: View.OnClickListener, requestLayout: Boolean ) = conversationLayout.updateExpandability(expandable, onClickListener) override fun disallowSingleClick(x: Float, y: Float): Boolean { val isOnExpandButton = expandBtnContainer.visibility == View.VISIBLE && Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java +9 −1 Original line number Diff line number Diff line Loading @@ -261,7 +261,8 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper { } @Override public void updateExpandability(boolean expandable, View.OnClickListener onClickListener) { public void updateExpandability(boolean expandable, View.OnClickListener onClickListener, boolean requestLayout) { mExpandButton.setVisibility(expandable ? View.VISIBLE : View.GONE); mExpandButton.setOnClickListener(expandable ? onClickListener : null); if (mAltExpandTarget != null) { Loading @@ -273,6 +274,13 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper { if (mNotificationHeader != null) { mNotificationHeader.setOnClickListener(expandable ? onClickListener : null); } // Unfortunately, the NotificationContentView has to layout its children in order to // determine their heights, and that affects the button visibility. If that happens // (thankfully it is rare) then we need to request layout of the expand button's parent // in order to ensure it gets laid out correctly. if (requestLayout) { mExpandButton.getParent().requestLayout(); } } @Override Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java +3 −1 Original line number Diff line number Diff line Loading @@ -291,8 +291,10 @@ public abstract class NotificationViewWrapper implements TransformableView { * * @param expandable should this view be expandable * @param onClickListener the listener to invoke when the expand affordance is clicked on * @param requestLayout the expandability changed during onLayout, so a requestLayout required */ public void updateExpandability(boolean expandable, View.OnClickListener onClickListener) {} public void updateExpandability(boolean expandable, View.OnClickListener onClickListener, boolean requestLayout) {} /** Set the expanded state on the view wrapper */ public void setExpanded(boolean expanded) {} Loading