Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc2889cb authored by Jeff DeCew's avatar Jeff DeCew Committed by Automerger Merge Worker
Browse files

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14647511

Change-Id: I785ca68144cbd103cd35137c9eccbeae316a1ff2
parents 5c28f6e3 fd4d01d8
Loading
Loading
Loading
Loading
+3 −24
Original line number Diff line number Diff line
@@ -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);
        }
    }

+7 −2
Original line number Diff line number Diff line
@@ -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) {
        if (mCollapsibleIndentDimen != collapsibleIndentDimen) {
            mCollapsibleIndentDimen = collapsibleIndentDimen;
            requestLayout();
        }
    }

    /**
+0 −1
Original line number Diff line number Diff line
@@ -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 -->
+1 −0
Original line number Diff line number Diff line
@@ -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" />