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

Commit f6adbe0d authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge "Fix vertical height of emphasized action buttons" into udc-dev

parents d27cba9d 588b7223
Loading
Loading
Loading
Loading
+13 −16
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ public class NotificationActionListLayout extends LinearLayout {
    private boolean mEmphasizedMode;
    private int mDefaultPaddingBottom;
    private int mDefaultPaddingTop;
    private int mEmphasizedPaddingTop;
    private int mEmphasizedPaddingBottom;
    private int mEmphasizedHeight;
    private int mRegularHeight;
    @DimenRes private int mCollapsibleIndentDimen = R.dimen.notification_actions_padding_start;
@@ -322,12 +324,15 @@ public class NotificationActionListLayout extends LinearLayout {
    }

    private void updateHeights() {
        int paddingTop = getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.notification_content_margin);
        int inset = getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.button_inset_vertical_material);
        mEmphasizedPaddingTop = getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.notification_content_margin) - inset;
        // same padding on bottom and at end
        int paddingBottom = getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.notification_content_margin_end);
        mEmphasizedHeight = paddingBottom + paddingTop + getResources().getDimensionPixelSize(
        mEmphasizedPaddingBottom = getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.notification_content_margin_end) - inset;
        mEmphasizedHeight = mEmphasizedPaddingTop + mEmphasizedPaddingBottom
                + getResources().getDimensionPixelSize(
                        com.android.internal.R.dimen.notification_action_emphasized_height);
        mRegularHeight = getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.notification_action_list_height);
@@ -356,18 +361,10 @@ public class NotificationActionListLayout extends LinearLayout {
        mEmphasizedMode = emphasizedMode;
        int height;
        if (emphasizedMode) {
            int paddingTop = getResources().getDimensionPixelSize(
                    com.android.internal.R.dimen.notification_content_margin);
            // same padding on bottom and at end
            int paddingBottom = getResources().getDimensionPixelSize(
                    com.android.internal.R.dimen.notification_content_margin_end);
            int buttonPaddingInternal = getResources().getDimensionPixelSize(
                    com.android.internal.R.dimen.button_inset_vertical_material);
            setPaddingRelative(getPaddingStart(),
                    paddingTop - buttonPaddingInternal,
                    mEmphasizedPaddingTop,
                    getPaddingEnd(),
                    paddingBottom - buttonPaddingInternal);

                    mEmphasizedPaddingBottom);
            setMinimumHeight(mEmphasizedHeight);
            height = ViewGroup.LayoutParams.WRAP_CONTENT;
        } else {
+2 −2
Original line number Diff line number Diff line
@@ -257,8 +257,8 @@
    <!-- The margin of the notification action list at the top -->
    <dimen name="notification_action_list_margin_top">0dp</dimen>

    <!-- The visual height of the emphasized notification action -->
    <dimen name="notification_action_emphasized_height">36dp</dimen>
    <!-- The overall height of the emphasized notification action -->
    <dimen name="notification_action_emphasized_height">48dp</dimen>

    <!-- The padding of the actions in non-conversation layout. For conversations, the analogous
         value is calculated in ConversationLayout#updateActionListPadding() -->