Inbox and bigtext style are adapted.
Change-Id: I85b33f7387a2bde46fc73d2bc82538d6d13f0a70
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);
}
// 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;
}
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 {
- // 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);
+ 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.line3, View.GONE);
+
return contentView;
}
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("")) {
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);
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" />
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" />
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"
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" />
<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"
<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>
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:minHeight="@dimen/notification_min_content_height"
android:orientation="vertical"
>
<include layout="@layout/notification_template_part_line1" />
android:visibility="gone"
android:layout_weight="1"
/>
- <TextView android:id="@+id/inbox_more"
- android:textAppearance="@style/TextAppearance.Material.Notification"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:singleLine="true"
- android:ellipsize="end"
- android:visibility="gone"
- android:layout_weight="1"
- android:text="@android:string/notification_inbox_ellipsis"
- />
<FrameLayout
android:id="@+id/inbox_end_pad"
android:layout_width="match_parent"
- android:layout_height="10dp"
+ android:layout_height="13dp"
android:visibility="gone"
android:layout_weight="0"
/>
android:layout_height="1dip"
android:id="@+id/action_divider"
android:visibility="gone"
+ android:layout_marginStart="-16dp"
+ android:layout_marginEnd="-16dp"
+ android:clipChildren="false"
android:background="@drawable/notification_template_divider" />
<include
layout="@layout/notification_material_action_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginLeft="-8dp"
- android:layout_marginRight="-8dp"
+ android:layout_marginStart="-16dp"
+ android:layout_marginEnd="-16dp"
+ android:clipChildren="false"
android:layout_weight="0"
/>
- <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>
<LinearLayout
android:id="@+id/notification_main_column"
android:layout_width="match_parent"
- android:layout_height="54dp"
+ android:layout_height="@dimen/notification_min_content_height"
android:background="#00000000"
android:orientation="horizontal"
android:layout_marginStart="@dimen/notification_content_margin_start"
android:layout_height="wrap_content"
android:layout_gravity="fill_vertical"
android:layout_weight="1"
- android:minHeight="54dp"
+ android:minHeight="@dimen/notification_min_content_height"
android:orientation="vertical"
>
<include layout="@layout/notification_template_part_line1"/>
<!-- The width of the big icons in notifications. -->
<dimen name="notification_large_icon_height">64dp</dimen>
+ <!-- Min height of the notification content. -->
+ <dimen name="notification_min_content_height">54dp</dimen>
+
<!-- The minimum with of the app name in the header if it shrinks -->
<dimen name="notification_header_shrink_min_width">72dp</dimen>
<java-symbol type="id" name="inbox_text4" />
<java-symbol type="id" name="inbox_text5" />
<java-symbol type="id" name="inbox_text6" />
- <java-symbol type="id" name="inbox_more" />
- <java-symbol type="id" name="inbox_end_pad" />
<java-symbol type="id" name="status_bar_latest_event_content" />
<java-symbol type="id" name="action_divider" />
- <java-symbol type="id" name="overflow_divider" />
<java-symbol type="id" name="notification_main_column" />
<java-symbol type="id" name="sms_short_code_confirm_message" />
<java-symbol type="id" name="sms_short_code_detail_layout" />
private TextView mSubText;
private TextView mInfoText;
private View mProfileBadge;
- private View mThirdLineDivider;
private View mThirdLine;
private ImageView mExpandButton;
private View mNotificationHeader;
mSubText = (TextView) mView.findViewById(com.android.internal.R.id.text);
mInfoText = (TextView) mView.findViewById(com.android.internal.R.id.info);
mProfileBadge = mView.findViewById(com.android.internal.R.id.profile_badge_line3);
- mThirdLineDivider = mView.findViewById(com.android.internal.R.id.overflow_divider);
mThirdLine = mView.findViewById(com.android.internal.R.id.line3);
mExpandButton = (ImageView) mView.findViewById(com.android.internal.R.id.expand_button);
mColor = resolveColor(mExpandButton);
}
boolean showThirdLine = (visible && (infoAvailable || subTextAvailable))
|| mProfileBadge.getVisibility() == View.VISIBLE;
- if (mThirdLineDivider != null) {
- if (showThirdLine) {
- mThirdLineDivider.setVisibility(View.VISIBLE);
- } else {
- mThirdLineDivider.setVisibility(View.GONE);
- }
- }
if (mThirdLine != null) {
if (showThirdLine) {
mThirdLine.setVisibility(View.VISIBLE);