fix underfull content bug in inbox and big text templates.
Bug: 7172721 Change-Id: I22019009eec31ca18b54eec5f6ed5b626cee1540
This commit is contained in:
@ -1923,6 +1923,7 @@ public class Notification implements Parcelable
|
|||||||
contentView.setViewVisibility(rowId, View.GONE);
|
contentView.setViewVisibility(rowId, View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int i=0;
|
int i=0;
|
||||||
while (i < mTexts.size() && i < rowIds.length) {
|
while (i < mTexts.size() && i < rowIds.length) {
|
||||||
CharSequence str = mTexts.get(i);
|
CharSequence str = mTexts.get(i);
|
||||||
@ -1933,11 +1934,11 @@ public class Notification implements Parcelable
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mTexts.size() > rowIds.length) {
|
contentView.setViewVisibility(R.id.inbox_end_pad,
|
||||||
contentView.setViewVisibility(R.id.inbox_more, View.VISIBLE);
|
mTexts.size() > 0 ? View.VISIBLE : View.GONE);
|
||||||
} else {
|
|
||||||
contentView.setViewVisibility(R.id.inbox_more, View.GONE);
|
contentView.setViewVisibility(R.id.inbox_more,
|
||||||
}
|
mTexts.size() > rowIds.length ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
return contentView;
|
return contentView;
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
android:showDividers="middle"
|
android:showDividers="middle"
|
||||||
android:divider="?android:attr/listDivider"
|
android:divider="?android:attr/listDivider"
|
||||||
android:dividerPadding="12dp"
|
android:dividerPadding="12dp"
|
||||||
|
@ -34,13 +34,14 @@
|
|||||||
android:layout_gravity="fill_vertical"
|
android:layout_gravity="fill_vertical"
|
||||||
android:layout_marginStart="@dimen/notification_large_icon_width"
|
android:layout_marginStart="@dimen/notification_large_icon_width"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="2dp"
|
android:paddingTop="0dp"
|
||||||
android:paddingBottom="2dp"
|
android:paddingBottom="2dp"
|
||||||
android:gravity="top"
|
android:gravity="top"
|
||||||
>
|
>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:minHeight="@dimen/notification_large_icon_height"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
@ -50,7 +51,7 @@
|
|||||||
android:id="@+id/line1"
|
android:id="@+id/line1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="6dp"
|
android:paddingTop="8dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_gravity="top"
|
android:layout_gravity="top"
|
||||||
android:layout_weight="0"
|
android:layout_weight="0"
|
||||||
|
@ -36,163 +36,178 @@
|
|||||||
android:layout_marginStart="@dimen/notification_large_icon_width"
|
android:layout_marginStart="@dimen/notification_large_icon_width"
|
||||||
android:minHeight="@dimen/notification_large_icon_height"
|
android:minHeight="@dimen/notification_large_icon_height"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="2dp"
|
android:paddingTop="0dp"
|
||||||
android:paddingBottom="2dp"
|
android:paddingBottom="2dp"
|
||||||
android:gravity="top"
|
android:gravity="top"
|
||||||
>
|
>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/line1"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:minHeight="@dimen/notification_large_icon_height"
|
||||||
android:layout_marginEnd="8dp"
|
android:paddingTop="2dp"
|
||||||
android:paddingTop="6dp"
|
android:orientation="vertical"
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_weight="0"
|
|
||||||
>
|
>
|
||||||
<TextView android:id="@+id/title"
|
<LinearLayout
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Title"
|
android:id="@+id/line1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:paddingTop="6dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_weight="0"
|
||||||
|
>
|
||||||
|
<TextView android:id="@+id/title"
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="marquee"
|
||||||
|
android:fadingEdge="horizontal"
|
||||||
|
android:layout_weight="1"
|
||||||
|
/>
|
||||||
|
<ViewStub android:id="@+id/time"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout="@layout/notification_template_part_time"
|
||||||
|
/>
|
||||||
|
<ViewStub android:id="@+id/chronometer"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout="@layout/notification_template_part_chronometer"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
<TextView android:id="@+id/text2"
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Line2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="-2dp"
|
||||||
|
android:layout_marginBottom="-2dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="marquee"
|
|
||||||
android:fadingEdge="horizontal"
|
android:fadingEdge="horizontal"
|
||||||
|
android:ellipsize="marquee"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_weight="0"
|
||||||
|
/>
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@android:id/progress"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="12dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_weight="0"
|
||||||
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
|
/>
|
||||||
|
<TextView android:id="@+id/inbox_text0"
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:visibility="gone"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
/>
|
/>
|
||||||
<ViewStub android:id="@+id/time"
|
<TextView android:id="@+id/inbox_text1"
|
||||||
android:layout_width="wrap_content"
|
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_gravity="center"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="0"
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:layout="@layout/notification_template_part_time"
|
android:layout_weight="1"
|
||||||
/>
|
/>
|
||||||
<ViewStub android:id="@+id/chronometer"
|
<TextView android:id="@+id/inbox_text2"
|
||||||
android:layout_width="wrap_content"
|
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_gravity="center"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="0"
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:layout="@layout/notification_template_part_chronometer"
|
android:layout_weight="1"
|
||||||
/>
|
/>
|
||||||
|
<TextView android:id="@+id/inbox_text3"
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_weight="1"
|
||||||
|
/>
|
||||||
|
<TextView android:id="@+id/inbox_text4"
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_weight="1"
|
||||||
|
/>
|
||||||
|
<TextView android:id="@+id/inbox_text5"
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_weight="1"
|
||||||
|
/>
|
||||||
|
<TextView android:id="@+id/inbox_text6"
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_weight="1"
|
||||||
|
/>
|
||||||
|
<TextView android:id="@+id/inbox_more"
|
||||||
|
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="@android:string/ellipsis"
|
||||||
|
/>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/inbox_end_pad"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="8dip"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_weight="0"
|
||||||
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<TextView android:id="@+id/text2"
|
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Line2"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="-2dp"
|
|
||||||
android:layout_marginBottom="-2dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:fadingEdge="horizontal"
|
|
||||||
android:ellipsize="marquee"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_weight="0"
|
|
||||||
/>
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@android:id/progress"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="12dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_weight="0"
|
|
||||||
style="?android:attr/progressBarStyleHorizontal"
|
|
||||||
/>
|
|
||||||
<TextView android:id="@+id/inbox_text0"
|
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_weight="1"
|
|
||||||
/>
|
|
||||||
<TextView android:id="@+id/inbox_text1"
|
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_weight="1"
|
|
||||||
/>
|
|
||||||
<TextView android:id="@+id/inbox_text2"
|
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_weight="1"
|
|
||||||
/>
|
|
||||||
<TextView android:id="@+id/inbox_text3"
|
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_weight="1"
|
|
||||||
/>
|
|
||||||
<TextView android:id="@+id/inbox_text4"
|
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_weight="1"
|
|
||||||
/>
|
|
||||||
<TextView android:id="@+id/inbox_text5"
|
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_weight="1"
|
|
||||||
/>
|
|
||||||
<TextView android:id="@+id/inbox_text6"
|
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_weight="1"
|
|
||||||
/>
|
|
||||||
<TextView android:id="@+id/inbox_more"
|
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.EventContent"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:text="@android:string/ellipsis"
|
|
||||||
/>
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1px"
|
android:layout_height="1dip"
|
||||||
|
android:layout_marginTop="-1px"
|
||||||
android:id="@+id/action_divider"
|
android:id="@+id/action_divider"
|
||||||
android:visibility="gone"
|
|
||||||
android:background="?android:attr/dividerHorizontal" />
|
android:background="?android:attr/dividerHorizontal" />
|
||||||
<include
|
<include
|
||||||
layout="@layout/notification_action_list"
|
layout="@layout/notification_action_list"
|
||||||
@ -202,9 +217,9 @@
|
|||||||
/>
|
/>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1px"
|
android:layout_height="1dip"
|
||||||
|
android:layout_marginTop="-1px"
|
||||||
android:id="@+id/overflow_divider"
|
android:id="@+id/overflow_divider"
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
android:background="?android:attr/dividerHorizontal" />
|
android:background="?android:attr/dividerHorizontal" />
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -208,6 +208,7 @@
|
|||||||
<java-symbol type="id" name="inbox_text5" />
|
<java-symbol type="id" name="inbox_text5" />
|
||||||
<java-symbol type="id" name="inbox_text6" />
|
<java-symbol type="id" name="inbox_text6" />
|
||||||
<java-symbol type="id" name="inbox_more" />
|
<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="status_bar_latest_event_content" />
|
||||||
<java-symbol type="id" name="action_divider" />
|
<java-symbol type="id" name="action_divider" />
|
||||||
<java-symbol type="id" name="overflow_divider" />
|
<java-symbol type="id" name="overflow_divider" />
|
||||||
|
Reference in New Issue
Block a user