Merge "Use "collapsible indent" for actions of any notification type." into sc-dev

This commit is contained in:
Jeff DeCew
2021-05-20 18:56:27 +00:00
committed by Android (Google) Code Review
4 changed files with 11 additions and 27 deletions

View File

@@ -137,9 +137,7 @@ public class ConversationLayout extends FrameLayout
private int mContentMarginEnd;
private Rect mMessagingClipRect;
private ObservableTextView mAppName;
private ViewGroup mActions;
private int mConversationContentStart;
private int mInternalButtonPadding;
private NotificationActionListLayout mActions;
private boolean mAppNameGone;
private int mFacePileAvatarSize;
private int mFacePileAvatarSizeExpandedGroup;
@@ -286,11 +284,6 @@ public class ConversationLayout extends FrameLayout
mAppName.setOnVisibilityChangedListener((visibility) -> {
onAppNameVisibilityChanged();
});
mConversationContentStart = getResources().getDimensionPixelSize(
R.dimen.conversation_content_start);
mInternalButtonPadding
= getResources().getDimensionPixelSize(R.dimen.button_padding_horizontal_material)
+ getResources().getDimensionPixelSize(R.dimen.button_inset_horizontal_material);
mNotificationHeaderSeparatingMargin = getResources().getDimensionPixelSize(
R.dimen.notification_header_separating_margin);
}
@@ -547,22 +540,8 @@ public class ConversationLayout extends FrameLayout
}
private void updateActionListPadding() {
if (mActions == null) {
return;
}
View firstAction = mActions.getChildAt(0);
if (firstAction != null) {
// Let's visually position the first action where the content starts
int paddingStart = mConversationContentStart;
MarginLayoutParams layoutParams = (MarginLayoutParams) firstAction.getLayoutParams();
paddingStart -= layoutParams.getMarginStart();
paddingStart -= mInternalButtonPadding;
mActions.setPaddingRelative(paddingStart,
mActions.getPaddingTop(),
mActions.getPaddingEnd(),
mActions.getPaddingBottom());
if (mActions != null) {
mActions.setCollapsibleIndentDimen(R.dimen.call_notification_collapsible_indent);
}
}

View File

@@ -30,6 +30,8 @@ import android.widget.LinearLayout;
import android.widget.RemoteViews;
import android.widget.TextView;
import com.android.internal.R;
import java.util.ArrayList;
import java.util.Comparator;
@@ -50,7 +52,7 @@ public class NotificationActionListLayout extends LinearLayout {
private int mDefaultPaddingTop;
private int mEmphasizedHeight;
private int mRegularHeight;
@DimenRes private int mCollapsibleIndentDimen;
@DimenRes private int mCollapsibleIndentDimen = R.dimen.notification_actions_padding_start;
public NotificationActionListLayout(Context context, AttributeSet attrs) {
this(context, attrs, 0);
@@ -313,7 +315,10 @@ public class NotificationActionListLayout extends LinearLayout {
*/
@RemotableViewMethod
public void setCollapsibleIndentDimen(@DimenRes int collapsibleIndentDimen) {
mCollapsibleIndentDimen = collapsibleIndentDimen;
if (mCollapsibleIndentDimen != collapsibleIndentDimen) {
mCollapsibleIndentDimen = collapsibleIndentDimen;
requestLayout();
}
}
/**

View File

@@ -38,7 +38,6 @@
android:layout_height="@dimen/notification_action_list_height"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingStart="@dimen/notification_actions_padding_start"
android:visibility="gone"
>
<!-- actions will be added here -->

View File

@@ -3163,6 +3163,7 @@
<java-symbol type="bool" name="config_supportPreRebootSecurityLogs" />
<java-symbol type="id" name="notification_action_list_margin_target" />
<java-symbol type="dimen" name="notification_actions_padding_start"/>
<java-symbol type="dimen" name="notification_action_disabled_alpha" />
<java-symbol type="id" name="tag_margin_end_when_icon_visible" />
<java-symbol type="id" name="tag_margin_end_when_icon_gone" />