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

Commit 9d9fc6e9 authored by Selim Cinek's avatar Selim Cinek
Browse files

Improved notification templates further

Inbox and bigtext style are adapted.

Change-Id: I85b33f7387a2bde46fc73d2bc82538d6d13f0a70
parent 850a854c
Loading
Loading
Loading
Loading
+11 −19
Original line number Diff line number Diff line
@@ -3009,7 +3009,6 @@ public class Notification implements Parcelable
            contentView.setViewVisibility(R.id.text2, View.GONE);
            contentView.setViewVisibility(R.id.info, View.GONE);
            contentView.setViewVisibility(R.id.line3, View.GONE);
            contentView.setViewVisibility(R.id.overflow_divider, View.GONE);
            contentView.setViewVisibility(R.id.progress, View.GONE);
        }

@@ -3117,7 +3116,6 @@ public class Notification implements Parcelable

            // Note getStandardView may hide line 3 again.
            contentView.setViewVisibility(R.id.line3, showLine3 ? View.VISIBLE : View.GONE);
            contentView.setViewVisibility(R.id.overflow_divider, showLine3 ? View.VISIBLE : View.GONE);
            return contentView;
        }

@@ -3597,18 +3595,13 @@ public class Notification implements Parcelable

            final CharSequence overflowText = mSummaryTextSet ? mSummaryText : null;
            final CharSequence subText = mBuilder.mN.extras.getCharSequence(EXTRA_SUB_TEXT);
            boolean showSummaryOnBottom = overflowText != null && !overflowText.equals(subText);
            if (showSummaryOnBottom) {
                contentView
                        .setTextViewText(R.id.text, mBuilder.processLegacyText(overflowText));
                contentView.setViewVisibility(R.id.overflow_divider, View.VISIBLE);
                contentView.setViewVisibility(R.id.line3, View.VISIBLE);
            } else {
            if (overflowText != null && !overflowText.equals(subText)) {
                mBuilder.bindHeaderSubText(contentView, overflowText);
            }

            // Clear text in case we use the line to show the profile badge.
            contentView.setTextViewText(com.android.internal.R.id.text, "");
                contentView.setViewVisibility(com.android.internal.R.id.overflow_divider, View.GONE);
            contentView.setViewVisibility(com.android.internal.R.id.line3, View.GONE);
            }

            return contentView;
        }
@@ -4076,6 +4069,9 @@ public class Notification implements Parcelable
            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 = (int) (13 * density);
            while (i < mTexts.size() && i < rowIds.length) {
                CharSequence str = mTexts.get(i);
                if (str != null && !str.equals("")) {
@@ -4085,16 +4081,12 @@ public class Notification implements Parcelable
                        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);
                }
                i++;
            }

            contentView.setViewVisibility(R.id.inbox_end_pad,
                    mTexts.size() > 0 ? View.VISIBLE : View.GONE);

            contentView.setViewVisibility(R.id.inbox_more,
                    mTexts.size() > rowIds.length ? View.VISIBLE : View.GONE);

            mBuilder.shrinkLine3Text(contentView);

            mBuilder.addProfileBadge(contentView, R.id.profile_badge_large_template);
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
        android:layout_marginStart="@dimen/notification_content_margin_start"
        android:layout_marginEnd="@dimen/notification_content_margin_end"
        android:layout_marginTop="@dimen/notification_content_margin_top"
        android:minHeight="@dimen/notification_large_icon_height"
        android:minHeight="@dimen/notification_min_content_height"
        android:orientation="vertical"
        >
        <include layout="@layout/notification_template_part_line1" />
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@
        android:layout_marginStart="@dimen/notification_content_margin_start"
        android:layout_marginEnd="24dp"
        android:layout_toStartOf="@id/right_icon"
        android:minHeight="54dp"
        android:minHeight="@dimen/notification_min_content_height"
        android:orientation="vertical"
        >
        <include layout="@layout/notification_template_part_line1" />
+0 −7
Original line number Diff line number Diff line
@@ -29,13 +29,6 @@
        android:layout_gravity="bottom"
        android:scaleType="centerCrop"
        />
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="6dp"
        android:layout_marginTop="@dimen/notification_min_height"
        android:scaleType="fitXY"
        android:src="@drawable/title_bar_shadow"
        />
    <include layout="@layout/notification_template_material_base"
        android:layout_width="match_parent"
        android:layout_height="@dimen/notification_min_height"
+9 −15
Original line number Diff line number Diff line
@@ -30,7 +30,8 @@
        android:layout_marginStart="@dimen/notification_content_margin_start"
        android:layout_marginTop="@dimen/notification_content_margin_top"
        android:layout_marginEnd="@dimen/notification_content_margin_end"
        android:minHeight="@dimen/notification_large_icon_height"
        android:clipChildren="false"
        android:minHeight="@dimen/notification_min_content_height"
        android:orientation="vertical"
        >
        <include layout="@layout/notification_template_part_line1" />
@@ -38,7 +39,7 @@
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginBottom="10dp"
            android:paddingBottom="13dp"
            android:orientation="horizontal"
            android:gravity="top"
            android:layout_weight="1"
@@ -64,27 +65,20 @@
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:layout_marginStart="-16dp"
            android:layout_marginEnd="-16dp"
            android:clipChildren="false"
            android:id="@+id/action_divider"
            android:visibility="gone"
            android:background="@drawable/notification_template_divider" />
        <include
            layout="@layout/notification_material_action_list"
            android:layout_marginStart="-8dp"
            android:layout_marginStart="-16dp"
            android:layout_marginEnd="-16dp"
            android:clipChildren="false"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            />
        <ImageView
            android:layout_width="match_parent"
            android:layout_height="1dip"
            android:id="@+id/overflow_divider"
            android:visibility="visible"
            android:background="@drawable/notification_template_divider" />
        <include
            layout="@layout/notification_template_part_line3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:layout_marginBottom="10dp" />
    </LinearLayout>
    <include layout="@layout/notification_template_right_icon" />
</FrameLayout>
Loading