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

Commit 83281ad1 authored by Selim Cinek's avatar Selim Cinek Committed by android-build-merger
Browse files

Merge "Fixed the paddings in inbox style to match the rest of the templates" into nyc-dev

am: 14d8be72

* commit '14d8be72':
  Fixed the paddings in inbox style to match the rest of the templates

Change-Id: I1416909ca0a3580f2ce2aaa1ab7265efa0c6ba4d
parents d8078911 14d8be72
Loading
Loading
Loading
Loading
+21 −17
Original line number Diff line number Diff line
@@ -4826,33 +4826,37 @@ public class Notification implements Parcelable
                contentView.setViewVisibility(rowId, View.GONE);
            }

            final boolean largeText =
                    mBuilder.mContext.getResources().getConfiguration().fontScale > 1f;
            final float subTextSize = mBuilder.mContext.getResources().getDimensionPixelSize(
                    R.dimen.notification_subtext_size);
            int i=0;
            final float density = mBuilder.mContext.getResources().getDisplayMetrics().density;
            int topPadding = (int) (5 * density);
            int bottomPadding = mBuilder.mContext.getResources().getDimensionPixelSize(
                    com.android.internal.R.dimen.notification_content_margin_bottom);
            int topPadding = mBuilder.mContext.getResources().getDimensionPixelSize(
                    R.dimen.notification_inbox_item_top_padding);
            boolean first = true;
            while (i < mTexts.size() && i < rowIds.length) {
            int onlyViewId = 0;
            int maxRows = rowIds.length;
            if (mBuilder.mActions.size() > 0) {
                maxRows--;
            }
            while (i < mTexts.size() && i < maxRows) {
                CharSequence str = mTexts.get(i);
                if (str != null && !str.equals("")) {
                if (!TextUtils.isEmpty(str)) {
                    contentView.setViewVisibility(rowIds[i], View.VISIBLE);
                    contentView.setTextViewText(rowIds[i], mBuilder.processLegacyText(str));
                    if (largeText) {
                        contentView.setTextViewTextSize(rowIds[i], TypedValue.COMPLEX_UNIT_PX,
                                subTextSize);
                    }
                    contentView.setViewPadding(rowIds[i], 0, topPadding, 0,
                            i == rowIds.length - 1 || i == mTexts.size() - 1 ? bottomPadding : 0);
                    contentView.setViewPadding(rowIds[i], 0, topPadding, 0, 0);
                    handleInboxImageMargin(contentView, rowIds[i], first);
                    if (first) {
                        onlyViewId = rowIds[i];
                    } else {
                        onlyViewId = 0;
                    }
                    first = false;
                }
                i++;
            }

            if (onlyViewId != 0) {
                // We only have 1 entry, lets make it look like the normal Text of a Bigtext
                topPadding = mBuilder.mContext.getResources().getDimensionPixelSize(
                        R.dimen.notification_text_margin_top);
                contentView.setViewPadding(onlyViewId, 0, topPadding, 0, 0);
            }

            return contentView;
        }
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@
            <com.android.internal.widget.ImageFloatingTextView android:id="@+id/big_text"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_marginTop="0.5dp"
                android:layout_marginTop="@dimen/notification_text_margin_top"
                android:paddingBottom="@dimen/notification_content_margin_bottom"
                android:textAppearance="@style/TextAppearance.Material.Notification"
                android:singleLine="false"
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
            android:layout_gravity="top"
            android:paddingStart="@dimen/notification_content_margin_start"
            android:paddingEnd="@dimen/notification_content_margin_end"
            android:paddingBottom="@dimen/notification_content_margin_bottom"
            android:minHeight="@dimen/notification_min_content_height"
            android:clipToPadding="false"
            android:orientation="vertical"
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="top"
    android:layout_marginTop="0.5dp"
    android:layout_marginTop="@dimen/notification_text_margin_top"
    android:ellipsize="marquee"
    android:fadingEdge="horizontal"
    android:gravity="top"
+6 −0
Original line number Diff line number Diff line
@@ -290,6 +290,12 @@
    <!-- Padding for notification icon when drawn with circle around it -->
    <dimen name="notification_large_icon_circle_padding">11dp</dimen>

    <!-- The margin on top of the text of the notification -->
    <dimen name="notification_text_margin_top">0.5dp</dimen>

    <!-- The padding on top of inbox style elements -->
    <dimen name="notification_inbox_item_top_padding">5dp</dimen>

    <!-- Size of the profile badge for notifications -->
    <dimen name="notification_badge_size">12dp</dimen>

Loading