Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -3558,6 +3558,7 @@ package android.app { method public android.app.Notification.Builder setNumber(int); method public android.app.Notification.Builder setOngoing(boolean); method public android.app.Notification.Builder setOnlyAlertOnce(boolean); method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setSmallIcon(int); method public android.app.Notification.Builder setSmallIcon(int, int); method public android.app.Notification.Builder setSound(android.net.Uri); core/java/android/app/Notification.java +32 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; import android.view.View; import android.widget.ProgressBar; import android.widget.RemoteViews; import java.text.NumberFormat; Loading Loading @@ -645,6 +646,9 @@ public class Notification implements Parcelable private int mLedOffMs; private int mDefaults; private int mFlags; private int mProgressMax; private int mProgress; private boolean mProgressIndeterminate; /** * Constructor. Loading Loading @@ -735,6 +739,17 @@ public class Notification implements Parcelable return this; } /** * Set the progress this notification represents, which may be * represented as a {@link ProgressBar}. */ public Builder setProgress(int max, int progress, boolean indeterminate) { mProgressMax = max; mProgress = progress; mProgressIndeterminate = indeterminate; return this; } /** * Supply a custom RemoteViews to use instead of the standard one. */ Loading Loading @@ -917,17 +932,24 @@ public class Notification implements Parcelable private RemoteViews makeRemoteViews(int resId) { RemoteViews contentView = new RemoteViews(mContext.getPackageName(), resId); boolean hasLine3 = false; if (mSmallIcon != 0) { contentView.setImageViewResource(R.id.icon, mSmallIcon); contentView.setViewVisibility(R.id.icon, View.VISIBLE); } else { contentView.setViewVisibility(R.id.icon, View.GONE); } if (mContentTitle != null) { contentView.setTextViewText(R.id.title, mContentTitle); } if (mContentText != null) { contentView.setTextViewText(R.id.text, mContentText); hasLine3 = true; } if (mContentInfo != null) { contentView.setTextViewText(R.id.info, mContentInfo); contentView.setViewVisibility(R.id.info, View.VISIBLE); hasLine3 = true; } else if (mNumber > 0) { final int tooBig = mContext.getResources().getInteger( R.integer.status_bar_notification_info_maxnum); Loading @@ -938,12 +960,22 @@ public class Notification implements Parcelable NumberFormat f = NumberFormat.getIntegerInstance(); contentView.setTextViewText(R.id.info, f.format(mNumber)); } contentView.setViewVisibility(R.id.info, View.VISIBLE); hasLine3 = true; } else { contentView.setViewVisibility(R.id.info, View.GONE); } if (mProgressMax != 0 || mProgressIndeterminate) { contentView.setProgressBar( R.id.progress, mProgressMax, mProgress, mProgressIndeterminate); contentView.setViewVisibility(R.id.progress, View.VISIBLE); } else { contentView.setViewVisibility(R.id.progress, View.GONE); } if (mWhen != 0) { contentView.setLong(R.id.time, "setTime", mWhen); } contentView.setViewVisibility(R.id.line3, hasLine3 ? View.VISIBLE : View.GONE); return contentView; } Loading core/res/res/layout/status_bar_latest_event_content_large_icon.xml +9 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ android:alpha="0.7" /> <LinearLayout android:id="@+id/line3" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" Loading Loading @@ -60,6 +61,14 @@ android:layout_weight="0" android:scaleType="center" android:paddingLeft="8dp" android:visibility="gone" /> </LinearLayout> <ProgressBar android:id="@android:id/progress" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" style="?android:attr/progressBarStyleHorizontal" /> </LinearLayout> Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -3558,6 +3558,7 @@ package android.app { method public android.app.Notification.Builder setNumber(int); method public android.app.Notification.Builder setOngoing(boolean); method public android.app.Notification.Builder setOnlyAlertOnce(boolean); method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setSmallIcon(int); method public android.app.Notification.Builder setSmallIcon(int, int); method public android.app.Notification.Builder setSound(android.net.Uri);
core/java/android/app/Notification.java +32 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; import android.view.View; import android.widget.ProgressBar; import android.widget.RemoteViews; import java.text.NumberFormat; Loading Loading @@ -645,6 +646,9 @@ public class Notification implements Parcelable private int mLedOffMs; private int mDefaults; private int mFlags; private int mProgressMax; private int mProgress; private boolean mProgressIndeterminate; /** * Constructor. Loading Loading @@ -735,6 +739,17 @@ public class Notification implements Parcelable return this; } /** * Set the progress this notification represents, which may be * represented as a {@link ProgressBar}. */ public Builder setProgress(int max, int progress, boolean indeterminate) { mProgressMax = max; mProgress = progress; mProgressIndeterminate = indeterminate; return this; } /** * Supply a custom RemoteViews to use instead of the standard one. */ Loading Loading @@ -917,17 +932,24 @@ public class Notification implements Parcelable private RemoteViews makeRemoteViews(int resId) { RemoteViews contentView = new RemoteViews(mContext.getPackageName(), resId); boolean hasLine3 = false; if (mSmallIcon != 0) { contentView.setImageViewResource(R.id.icon, mSmallIcon); contentView.setViewVisibility(R.id.icon, View.VISIBLE); } else { contentView.setViewVisibility(R.id.icon, View.GONE); } if (mContentTitle != null) { contentView.setTextViewText(R.id.title, mContentTitle); } if (mContentText != null) { contentView.setTextViewText(R.id.text, mContentText); hasLine3 = true; } if (mContentInfo != null) { contentView.setTextViewText(R.id.info, mContentInfo); contentView.setViewVisibility(R.id.info, View.VISIBLE); hasLine3 = true; } else if (mNumber > 0) { final int tooBig = mContext.getResources().getInteger( R.integer.status_bar_notification_info_maxnum); Loading @@ -938,12 +960,22 @@ public class Notification implements Parcelable NumberFormat f = NumberFormat.getIntegerInstance(); contentView.setTextViewText(R.id.info, f.format(mNumber)); } contentView.setViewVisibility(R.id.info, View.VISIBLE); hasLine3 = true; } else { contentView.setViewVisibility(R.id.info, View.GONE); } if (mProgressMax != 0 || mProgressIndeterminate) { contentView.setProgressBar( R.id.progress, mProgressMax, mProgress, mProgressIndeterminate); contentView.setViewVisibility(R.id.progress, View.VISIBLE); } else { contentView.setViewVisibility(R.id.progress, View.GONE); } if (mWhen != 0) { contentView.setLong(R.id.time, "setTime", mWhen); } contentView.setViewVisibility(R.id.line3, hasLine3 ? View.VISIBLE : View.GONE); return contentView; } Loading
core/res/res/layout/status_bar_latest_event_content_large_icon.xml +9 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ android:alpha="0.7" /> <LinearLayout android:id="@+id/line3" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" Loading Loading @@ -60,6 +61,14 @@ android:layout_weight="0" android:scaleType="center" android:paddingLeft="8dp" android:visibility="gone" /> </LinearLayout> <ProgressBar android:id="@android:id/progress" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" style="?android:attr/progressBarStyleHorizontal" /> </LinearLayout>