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

Commit f4b91ee0 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Fix DecoratedCustomViewStyle

* Fix HUN state's end margins
* Restore previous max height of collapsed state
* Restore previous behavior of hiding the progress
  bar if content is greater than ~25dp
* Remove min height which isn't necessary now that
  the largeIcon has moved up a line.
* Fix headerless title's padding with the separator.

Bug: 163626038
Test: manual
Change-Id: I1fa1efa76192f081ac801a732812eef7f5bfa536
parent bcbda696
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -91672,7 +91672,6 @@ Lcom/android/internal/R$dimen;->notification_media_image_max_height_low_ram:I
Lcom/android/internal/R$dimen;->notification_media_image_max_width:I
Lcom/android/internal/R$dimen;->notification_media_image_max_width_low_ram:I
Lcom/android/internal/R$dimen;->notification_messaging_spacing:I
Lcom/android/internal/R$dimen;->notification_min_content_height:I
Lcom/android/internal/R$dimen;->notification_reply_inset:I
Lcom/android/internal/R$dimen;->notification_right_icon_size:I
Lcom/android/internal/R$dimen;->notification_right_icon_size_low_ram:I
+2 −21
Original line number Diff line number Diff line
@@ -4922,8 +4922,6 @@ public class Notification implements Parcelable
                contentView.setViewVisibility(textId, View.VISIBLE);
            }

            setContentMinHeight(contentView, showProgress || mN.hasLargeIcon());

            return contentView;
        }

@@ -5081,21 +5079,6 @@ public class Notification implements Parcelable
            }
        }

        /**
         * @param remoteView the remote view to update the minheight in
         * @param hasMinHeight does it have a mimHeight
         * @hide
         */
        void setContentMinHeight(RemoteViews remoteView, boolean hasMinHeight) {
            int minHeight = 0;
            if (hasMinHeight) {
                // we need to set the minHeight of the notification
                minHeight = mContext.getResources().getDimensionPixelSize(
                        com.android.internal.R.dimen.notification_min_content_height);
            }
            remoteView.setInt(R.id.notification_main_column, "setMinimumHeight", minHeight);
        }

        private boolean handleProgressBar(RemoteViews contentView, Bundle ex,
                StandardTemplateParams p) {
            final int max = ex.getInt(EXTRA_PROGRESS_MAX, 0);
@@ -6942,7 +6925,6 @@ public class Notification implements Parcelable
                mBuilder.setTextViewColorSecondary(contentView, R.id.text, p);
                contentView.setViewVisibility(R.id.text, View.VISIBLE);
            }
            mBuilder.setContentMinHeight(contentView, mBuilder.mN.hasLargeIcon());

            if (mBigLargeIconSet) {
                mBuilder.mN.mLargeIcon = oldLargeIcon;
@@ -8710,7 +8692,7 @@ public class Notification implements Parcelable
            RemoteViews remoteViews = mBuilder.applyStandardTemplateWithActions(
                    mBuilder.getHeadsUpBaseLayoutResource(),
                    StandardTemplateParams.VIEW_TYPE_HEADS_UP, result);
            buildIntoRemoteViewContent(remoteViews, headsUpContentView, result, false);
            buildIntoRemoteViewContent(remoteViews, headsUpContentView, result, true);
            return remoteViews;
        }

@@ -8755,8 +8737,7 @@ public class Notification implements Parcelable
                Resources resources = mBuilder.mContext.getResources();
                int endMargin = resources.getDimensionPixelSize(
                        R.dimen.notification_content_margin_end) + result.getTitleMarginEnd();
                remoteViews.setViewLayoutMarginEnd(R.id.notification_main_column,
                        endMargin);
                remoteViews.setViewLayoutMarginEnd(R.id.notification_main_column, endMargin);
            }
        }

+36 −6
Original line number Diff line number Diff line
@@ -33,16 +33,30 @@
        android:padding="@dimen/notification_icon_circle_padding"
        />

    <com.android.internal.widget.RemeasuringLinearLayout
    <LinearLayout
        android:id="@+id/notification_standard_view_column"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_marginBottom="@dimen/notification_headerless_margin_vertical"
        android:layout_marginTop="@dimen/notification_headerless_margin_vertical"
        android:layout_marginBottom="@dimen/notification_headerless_margin_minimum"
        android:layout_marginTop="@dimen/notification_headerless_margin_minimum"
        android:orientation="vertical"
        >

        <!--
        This invisible FrameLayout is here as a collapsible padding.  Having a layout_weight=1 is
        what causes this view (and it's counterpart at the opposite end) to collapse before the
        actual content views do.
        This pair of 10dp collapsible paddings (plus the 16dp fixed margins) allow us to support
        headerless notifications of 1-3 lines (where each line is 20dp tall) where the 1-line
        variant is 56dp and the 2- and 3-line variants are both 76dp.
        -->
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="@dimen/notification_headerless_margin_extra"
            android:layout_weight="1"
            />

        <!-- extends ViewGroup -->
        <NotificationTopLineView
            android:id="@+id/notification_top_line"
@@ -58,6 +72,7 @@
                android:id="@+id/title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="@dimen/notification_header_separating_margin"
                android:ellipsize="marquee"
                android:fadingEdge="horizontal"
                android:singleLine="true"
@@ -69,7 +84,7 @@

        </NotificationTopLineView>

        <com.android.internal.widget.RemeasuringLinearLayout
        <LinearLayout
            android:id="@+id/notification_main_column"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
@@ -91,8 +106,23 @@
                android:layout_height="@dimen/notification_headerless_line_height"
                />

        </com.android.internal.widget.RemeasuringLinearLayout>
    </com.android.internal.widget.RemeasuringLinearLayout>
        </LinearLayout>

        <!--
        This invisible FrameLayout is here as a collapsible padding.  Having a layout_weight=1 is
        what causes this view (and it's counterpart at the opposite end) to collapse before the
        actual content views do.
        This pair of 10dp collapsible paddings (plus the 16dp fixed margins) allow us to support
        headerless notifications of 1-3 lines (where each line is 20dp tall) where the 1-line
        variant is 56dp and the 2- and 3-line variants are both 76dp.
        -->
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="@dimen/notification_headerless_margin_extra"
            android:layout_weight="1"
            />

    </LinearLayout>

    <ImageView
        android:id="@+id/right_icon"
+0 −1
Original line number Diff line number Diff line
@@ -54,7 +54,6 @@
            android:layout_marginStart="@dimen/notification_content_margin_start"
            android:layout_marginBottom="@dimen/notification_content_margin"
            android:layout_marginEnd="@dimen/notification_content_margin_end"
            android:minHeight="@dimen/notification_min_content_height"
            android:orientation="vertical"
            >

+0 −1
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@
            android:paddingStart="@dimen/notification_content_margin_start"
            android:paddingEnd="@dimen/notification_content_margin_end"
            android:clipToPadding="false"
            android:minHeight="@dimen/notification_min_content_height"
            android:orientation="vertical"
            android:layout_weight="1"
            >
Loading