Loading core/java/android/app/Notification.java +17 −14 Original line number Diff line number Diff line Loading @@ -1379,7 +1379,7 @@ public class Notification implements Parcelable } } private RemoteViews applyStandardTemplate(int resId) { private RemoteViews applyStandardTemplate(int resId, boolean fitIn1U) { RemoteViews contentView = new RemoteViews(mContext.getPackageName(), resId); boolean showLine3 = false; boolean showLine2 = false; Loading Loading @@ -1432,7 +1432,6 @@ public class Notification implements Parcelable contentView.setTextViewText(R.id.text, mSubText); if (mContentText != null) { contentView.setTextViewText(R.id.text2, mContentText); // need to shrink all the type to make sure everything fits contentView.setViewVisibility(R.id.text2, View.VISIBLE); showLine2 = true; } else { Loading @@ -1450,10 +1449,13 @@ public class Notification implements Parcelable } } if (showLine2) { if (fitIn1U) { // need to shrink all the type to make sure everything fits final Resources res = mContext.getResources(); final float subTextSize = res.getDimensionPixelSize( R.dimen.notification_subtext_size); contentView.setTextViewTextSize(R.id.text, TypedValue.COMPLEX_UNIT_PX, subTextSize); } // vertical centering contentView.setViewPadding(R.id.line1, 0, 0, 0, 0); } Loading @@ -1470,16 +1472,18 @@ public class Notification implements Parcelable } } contentView.setViewVisibility(R.id.line3, showLine3 ? View.VISIBLE : View.GONE); contentView.setViewVisibility(R.id.overflow_divider, showLine3 ? View.VISIBLE : View.GONE); return contentView; } private RemoteViews applyStandardTemplateWithActions(int layoutId) { RemoteViews big = applyStandardTemplate(layoutId); RemoteViews big = applyStandardTemplate(layoutId, false); int N = mActions.size(); if (N > 0) { // Log.d("Notification", "has actions: " + mContentText); big.setViewVisibility(R.id.actions, View.VISIBLE); big.setViewVisibility(R.id.action_divider, View.VISIBLE); if (N>MAX_ACTION_BUTTONS) N=MAX_ACTION_BUTTONS; big.removeAllViews(R.id.actions); for (int i=0; i<N; i++) { Loading @@ -1495,7 +1499,7 @@ public class Notification implements Parcelable if (mContentView != null) { return mContentView; } else { return applyStandardTemplate(R.layout.notification_template_base); // no more special large_icon flavor return applyStandardTemplate(R.layout.notification_template_base, true); // no more special large_icon flavor } } Loading @@ -1506,7 +1510,7 @@ public class Notification implements Parcelable if (mContentView == null) { return applyStandardTemplate(mLargeIcon == null ? R.layout.status_bar_latest_event_ticker : R.layout.status_bar_latest_event_ticker_large_icon); : R.layout.status_bar_latest_event_ticker_large_icon, true); } else { return null; } Loading Loading @@ -1655,12 +1659,9 @@ public class Notification implements Parcelable contentView.setViewVisibility(R.id.line1, View.VISIBLE); } // The last line defaults to the content text or subtext, but can be replaced by mSummaryText if (mSummaryText != null && !mSummaryText.equals("")) { contentView.setViewVisibility(R.id.overflow_title, View.VISIBLE); contentView.setTextViewText(R.id.overflow_title, mSummaryText); contentView.setViewVisibility(R.id.line3, View.GONE); } else { contentView.setViewVisibility(R.id.overflow_title, View.GONE); contentView.setTextViewText(R.id.text, mSummaryText); contentView.setViewVisibility(R.id.line3, View.VISIBLE); } Loading Loading @@ -1801,6 +1802,8 @@ public class Notification implements Parcelable } private RemoteViews makeBigContentView() { // Remove the content text so line3 disappears entirely mBuilder.mContentText = null; RemoteViews contentView = getStandardView(R.layout.notification_template_big_text); contentView.setTextViewText(R.id.big_text, mBigText); contentView.setViewVisibility(R.id.big_text, View.VISIBLE); Loading core/res/res/layout/notification_action_list.xml +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ android:visibility="gone" android:showDividers="middle" android:divider="?android:attr/listDivider" android:dividerPadding="12dp" > <!-- actions will be added here --> </LinearLayout> core/res/res/layout/notification_template_base.xml +10 −16 Original line number Diff line number Diff line Loading @@ -36,8 +36,7 @@ android:layout_marginLeft="@dimen/notification_large_icon_width" android:minHeight="@dimen/notification_large_icon_height" android:orientation="vertical" android:paddingLeft="12dp" android:paddingRight="12dp" android:paddingRight="8dp" android:paddingTop="2dp" android:paddingBottom="2dp" android:gravity="top" Loading @@ -47,6 +46,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="6dp" android:layout_marginLeft="8dp" android:orientation="horizontal" > <TextView android:id="@+id/title" Loading Loading @@ -81,6 +81,7 @@ android:layout_height="wrap_content" android:layout_marginTop="-2dp" android:layout_marginBottom="-2dp" android:layout_marginLeft="8dp" android:singleLine="true" android:fadingEdge="horizontal" android:ellipsize="marquee" Loading @@ -90,24 +91,17 @@ android:id="@android:id/progress" android:layout_width="match_parent" android:layout_height="12dp" android:layout_marginLeft="8dp" android:visibility="gone" style="?android:attr/progressBarStyleHorizontal" /> <TextView android:id="@+id/overflow_title" android:textAppearance="@style/TextAppearance.StatusBar.EventContent" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="marquee" android:fadingEdge="horizontal" android:visibility="gone" android:layout_weight="1" /> <LinearLayout android:id="@+id/line3" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_vertical" android:layout_marginLeft="8dp" > <TextView android:id="@+id/text" android:textAppearance="@style/TextAppearance.StatusBar.EventContent" Loading @@ -130,14 +124,14 @@ android:paddingLeft="8dp" /> <ImageView android:id="@+id/right_icon" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_width="16dp" android:layout_height="16dp" android:layout_gravity="center" android:layout_weight="0" android:layout_marginLeft="8dp" android:scaleType="centerInside" android:paddingLeft="8dp" android:visibility="gone" android:drawableAlpha="180" android:drawableAlpha="153" /> </LinearLayout> </LinearLayout> Loading core/res/res/layout/notification_template_big_base.xml +25 −10 Original line number Diff line number Diff line Loading @@ -33,19 +33,16 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="fill_vertical" android:layout_marginLeft="@dimen/notification_large_icon_width" android:minHeight="@dimen/notification_large_icon_height" android:orientation="vertical" android:paddingLeft="12dp" android:paddingRight="12dp" android:paddingTop="2dp" android:paddingBottom="2dp" android:gravity="top" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/notification_large_icon_width" android:minHeight="@dimen/notification_large_icon_height" android:paddingTop="2dp" android:orientation="vertical" > <LinearLayout Loading @@ -53,6 +50,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="6dp" android:layout_marginRight="8dp" android:layout_marginLeft="8dp" android:orientation="horizontal" > <TextView android:id="@+id/title" Loading Loading @@ -87,6 +86,8 @@ android:layout_height="wrap_content" android:layout_marginTop="-2dp" android:layout_marginBottom="-2dp" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:singleLine="true" android:fadingEdge="horizontal" android:ellipsize="marquee" Loading @@ -96,6 +97,8 @@ android:textAppearance="@style/TextAppearance.StatusBar.EventContent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:singleLine="false" android:visibility="gone" /> Loading @@ -103,7 +106,10 @@ android:id="@+id/line3" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:orientation="horizontal" android:gravity="center_vertical" > <TextView android:id="@+id/text" android:textAppearance="@style/TextAppearance.StatusBar.EventContent" Loading @@ -126,29 +132,38 @@ android:paddingLeft="8dp" /> <ImageView android:id="@+id/right_icon" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_width="16dp" android:layout_height="16dp" android:layout_gravity="center" android:layout_weight="0" android:layout_marginLeft="8dp" android:scaleType="centerInside" android:paddingLeft="8dp" android:visibility="gone" android:drawableAlpha="180" android:drawableAlpha="153" /> </LinearLayout> <ProgressBar android:id="@android:id/progress" android:layout_width="match_parent" android:layout_height="12dp" android:layout_marginBottom="8dp" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:visibility="gone" style="?android:attr/progressBarStyleHorizontal" /> </LinearLayout> <ImageView android:layout_width="match_parent" android:layout_height="1px" android:id="@+id/action_divider" android:visibility="gone" android:background="?android:attr/dividerHorizontal" /> <include layout="@layout/notification_action_list" android:id="@+id/actions" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/notification_large_icon_width" /> </LinearLayout> </FrameLayout> core/res/res/layout/notification_template_big_picture.xml +0 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ <include layout="@layout/notification_action_list" android:id="@+id/actions" android:layout_marginLeft="8dp" android:layout_gravity="bottom" android:layout_width="match_parent" android:layout_height="wrap_content" Loading Loading
core/java/android/app/Notification.java +17 −14 Original line number Diff line number Diff line Loading @@ -1379,7 +1379,7 @@ public class Notification implements Parcelable } } private RemoteViews applyStandardTemplate(int resId) { private RemoteViews applyStandardTemplate(int resId, boolean fitIn1U) { RemoteViews contentView = new RemoteViews(mContext.getPackageName(), resId); boolean showLine3 = false; boolean showLine2 = false; Loading Loading @@ -1432,7 +1432,6 @@ public class Notification implements Parcelable contentView.setTextViewText(R.id.text, mSubText); if (mContentText != null) { contentView.setTextViewText(R.id.text2, mContentText); // need to shrink all the type to make sure everything fits contentView.setViewVisibility(R.id.text2, View.VISIBLE); showLine2 = true; } else { Loading @@ -1450,10 +1449,13 @@ public class Notification implements Parcelable } } if (showLine2) { if (fitIn1U) { // need to shrink all the type to make sure everything fits final Resources res = mContext.getResources(); final float subTextSize = res.getDimensionPixelSize( R.dimen.notification_subtext_size); contentView.setTextViewTextSize(R.id.text, TypedValue.COMPLEX_UNIT_PX, subTextSize); } // vertical centering contentView.setViewPadding(R.id.line1, 0, 0, 0, 0); } Loading @@ -1470,16 +1472,18 @@ public class Notification implements Parcelable } } contentView.setViewVisibility(R.id.line3, showLine3 ? View.VISIBLE : View.GONE); contentView.setViewVisibility(R.id.overflow_divider, showLine3 ? View.VISIBLE : View.GONE); return contentView; } private RemoteViews applyStandardTemplateWithActions(int layoutId) { RemoteViews big = applyStandardTemplate(layoutId); RemoteViews big = applyStandardTemplate(layoutId, false); int N = mActions.size(); if (N > 0) { // Log.d("Notification", "has actions: " + mContentText); big.setViewVisibility(R.id.actions, View.VISIBLE); big.setViewVisibility(R.id.action_divider, View.VISIBLE); if (N>MAX_ACTION_BUTTONS) N=MAX_ACTION_BUTTONS; big.removeAllViews(R.id.actions); for (int i=0; i<N; i++) { Loading @@ -1495,7 +1499,7 @@ public class Notification implements Parcelable if (mContentView != null) { return mContentView; } else { return applyStandardTemplate(R.layout.notification_template_base); // no more special large_icon flavor return applyStandardTemplate(R.layout.notification_template_base, true); // no more special large_icon flavor } } Loading @@ -1506,7 +1510,7 @@ public class Notification implements Parcelable if (mContentView == null) { return applyStandardTemplate(mLargeIcon == null ? R.layout.status_bar_latest_event_ticker : R.layout.status_bar_latest_event_ticker_large_icon); : R.layout.status_bar_latest_event_ticker_large_icon, true); } else { return null; } Loading Loading @@ -1655,12 +1659,9 @@ public class Notification implements Parcelable contentView.setViewVisibility(R.id.line1, View.VISIBLE); } // The last line defaults to the content text or subtext, but can be replaced by mSummaryText if (mSummaryText != null && !mSummaryText.equals("")) { contentView.setViewVisibility(R.id.overflow_title, View.VISIBLE); contentView.setTextViewText(R.id.overflow_title, mSummaryText); contentView.setViewVisibility(R.id.line3, View.GONE); } else { contentView.setViewVisibility(R.id.overflow_title, View.GONE); contentView.setTextViewText(R.id.text, mSummaryText); contentView.setViewVisibility(R.id.line3, View.VISIBLE); } Loading Loading @@ -1801,6 +1802,8 @@ public class Notification implements Parcelable } private RemoteViews makeBigContentView() { // Remove the content text so line3 disappears entirely mBuilder.mContentText = null; RemoteViews contentView = getStandardView(R.layout.notification_template_big_text); contentView.setTextViewText(R.id.big_text, mBigText); contentView.setViewVisibility(R.id.big_text, View.VISIBLE); Loading
core/res/res/layout/notification_action_list.xml +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ android:visibility="gone" android:showDividers="middle" android:divider="?android:attr/listDivider" android:dividerPadding="12dp" > <!-- actions will be added here --> </LinearLayout>
core/res/res/layout/notification_template_base.xml +10 −16 Original line number Diff line number Diff line Loading @@ -36,8 +36,7 @@ android:layout_marginLeft="@dimen/notification_large_icon_width" android:minHeight="@dimen/notification_large_icon_height" android:orientation="vertical" android:paddingLeft="12dp" android:paddingRight="12dp" android:paddingRight="8dp" android:paddingTop="2dp" android:paddingBottom="2dp" android:gravity="top" Loading @@ -47,6 +46,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="6dp" android:layout_marginLeft="8dp" android:orientation="horizontal" > <TextView android:id="@+id/title" Loading Loading @@ -81,6 +81,7 @@ android:layout_height="wrap_content" android:layout_marginTop="-2dp" android:layout_marginBottom="-2dp" android:layout_marginLeft="8dp" android:singleLine="true" android:fadingEdge="horizontal" android:ellipsize="marquee" Loading @@ -90,24 +91,17 @@ android:id="@android:id/progress" android:layout_width="match_parent" android:layout_height="12dp" android:layout_marginLeft="8dp" android:visibility="gone" style="?android:attr/progressBarStyleHorizontal" /> <TextView android:id="@+id/overflow_title" android:textAppearance="@style/TextAppearance.StatusBar.EventContent" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="marquee" android:fadingEdge="horizontal" android:visibility="gone" android:layout_weight="1" /> <LinearLayout android:id="@+id/line3" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_vertical" android:layout_marginLeft="8dp" > <TextView android:id="@+id/text" android:textAppearance="@style/TextAppearance.StatusBar.EventContent" Loading @@ -130,14 +124,14 @@ android:paddingLeft="8dp" /> <ImageView android:id="@+id/right_icon" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_width="16dp" android:layout_height="16dp" android:layout_gravity="center" android:layout_weight="0" android:layout_marginLeft="8dp" android:scaleType="centerInside" android:paddingLeft="8dp" android:visibility="gone" android:drawableAlpha="180" android:drawableAlpha="153" /> </LinearLayout> </LinearLayout> Loading
core/res/res/layout/notification_template_big_base.xml +25 −10 Original line number Diff line number Diff line Loading @@ -33,19 +33,16 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="fill_vertical" android:layout_marginLeft="@dimen/notification_large_icon_width" android:minHeight="@dimen/notification_large_icon_height" android:orientation="vertical" android:paddingLeft="12dp" android:paddingRight="12dp" android:paddingTop="2dp" android:paddingBottom="2dp" android:gravity="top" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/notification_large_icon_width" android:minHeight="@dimen/notification_large_icon_height" android:paddingTop="2dp" android:orientation="vertical" > <LinearLayout Loading @@ -53,6 +50,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="6dp" android:layout_marginRight="8dp" android:layout_marginLeft="8dp" android:orientation="horizontal" > <TextView android:id="@+id/title" Loading Loading @@ -87,6 +86,8 @@ android:layout_height="wrap_content" android:layout_marginTop="-2dp" android:layout_marginBottom="-2dp" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:singleLine="true" android:fadingEdge="horizontal" android:ellipsize="marquee" Loading @@ -96,6 +97,8 @@ android:textAppearance="@style/TextAppearance.StatusBar.EventContent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:singleLine="false" android:visibility="gone" /> Loading @@ -103,7 +106,10 @@ android:id="@+id/line3" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:orientation="horizontal" android:gravity="center_vertical" > <TextView android:id="@+id/text" android:textAppearance="@style/TextAppearance.StatusBar.EventContent" Loading @@ -126,29 +132,38 @@ android:paddingLeft="8dp" /> <ImageView android:id="@+id/right_icon" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_width="16dp" android:layout_height="16dp" android:layout_gravity="center" android:layout_weight="0" android:layout_marginLeft="8dp" android:scaleType="centerInside" android:paddingLeft="8dp" android:visibility="gone" android:drawableAlpha="180" android:drawableAlpha="153" /> </LinearLayout> <ProgressBar android:id="@android:id/progress" android:layout_width="match_parent" android:layout_height="12dp" android:layout_marginBottom="8dp" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:visibility="gone" style="?android:attr/progressBarStyleHorizontal" /> </LinearLayout> <ImageView android:layout_width="match_parent" android:layout_height="1px" android:id="@+id/action_divider" android:visibility="gone" android:background="?android:attr/dividerHorizontal" /> <include layout="@layout/notification_action_list" android:id="@+id/actions" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/notification_large_icon_width" /> </LinearLayout> </FrameLayout>
core/res/res/layout/notification_template_big_picture.xml +0 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ <include layout="@layout/notification_action_list" android:id="@+id/actions" android:layout_marginLeft="8dp" android:layout_gravity="bottom" android:layout_width="match_parent" android:layout_height="wrap_content" Loading