Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -3848,6 +3848,7 @@ package android.app { method public android.app.Notification.Builder setOnlyAlertOnce(boolean); method public android.app.Notification.Builder setPriority(int); method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setShowWhen(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 +16 −2 Original line number Diff line number Diff line Loading @@ -951,6 +951,7 @@ public class Notification implements Parcelable private ArrayList<Action> mActions = new ArrayList<Action>(MAX_ACTION_BUTTONS); private boolean mUseChronometer; private Style mStyle; private boolean mShowWhen = true; /** * Constructs a new Builder with the defaults: Loading Loading @@ -982,8 +983,9 @@ public class Notification implements Parcelable /** * Add a timestamp pertaining to the notification (usually the time the event occurred). * It will be shown in the notification content view by default; use * {@link Builder#setShowWhen(boolean) setShowWhen} to control this. * * @see Notification#when */ public Builder setWhen(long when) { Loading @@ -991,6 +993,15 @@ public class Notification implements Parcelable return this; } /** * Control whether the timestamp set with {@link Builder#setWhen(long) setWhen} is shown * in the content view. */ public Builder setShowWhen(boolean show) { mShowWhen = show; return this; } /** * Show the {@link Notification#when} field as a stopwatch. * Loading Loading @@ -1467,7 +1478,7 @@ public class Notification implements Parcelable contentView.setViewPadding(R.id.line1, 0, 0, 0, 0); } if (mWhen != 0) { if (mWhen != 0 && mShowWhen) { if (mUseChronometer) { contentView.setViewVisibility(R.id.chronometer, View.VISIBLE); contentView.setLong(R.id.chronometer, "setBase", Loading @@ -1477,7 +1488,10 @@ public class Notification implements Parcelable contentView.setViewVisibility(R.id.time, View.VISIBLE); contentView.setLong(R.id.time, "setTime", mWhen); } } else { contentView.setViewVisibility(R.id.time, View.GONE); } contentView.setViewVisibility(R.id.line3, showLine3 ? View.VISIBLE : View.GONE); contentView.setViewVisibility(R.id.overflow_divider, showLine3 ? View.VISIBLE : View.GONE); return contentView; Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -3848,6 +3848,7 @@ package android.app { method public android.app.Notification.Builder setOnlyAlertOnce(boolean); method public android.app.Notification.Builder setPriority(int); method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setShowWhen(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 +16 −2 Original line number Diff line number Diff line Loading @@ -951,6 +951,7 @@ public class Notification implements Parcelable private ArrayList<Action> mActions = new ArrayList<Action>(MAX_ACTION_BUTTONS); private boolean mUseChronometer; private Style mStyle; private boolean mShowWhen = true; /** * Constructs a new Builder with the defaults: Loading Loading @@ -982,8 +983,9 @@ public class Notification implements Parcelable /** * Add a timestamp pertaining to the notification (usually the time the event occurred). * It will be shown in the notification content view by default; use * {@link Builder#setShowWhen(boolean) setShowWhen} to control this. * * @see Notification#when */ public Builder setWhen(long when) { Loading @@ -991,6 +993,15 @@ public class Notification implements Parcelable return this; } /** * Control whether the timestamp set with {@link Builder#setWhen(long) setWhen} is shown * in the content view. */ public Builder setShowWhen(boolean show) { mShowWhen = show; return this; } /** * Show the {@link Notification#when} field as a stopwatch. * Loading Loading @@ -1467,7 +1478,7 @@ public class Notification implements Parcelable contentView.setViewPadding(R.id.line1, 0, 0, 0, 0); } if (mWhen != 0) { if (mWhen != 0 && mShowWhen) { if (mUseChronometer) { contentView.setViewVisibility(R.id.chronometer, View.VISIBLE); contentView.setLong(R.id.chronometer, "setBase", Loading @@ -1477,7 +1488,10 @@ public class Notification implements Parcelable contentView.setViewVisibility(R.id.time, View.VISIBLE); contentView.setLong(R.id.time, "setTime", mWhen); } } else { contentView.setViewVisibility(R.id.time, View.GONE); } contentView.setViewVisibility(R.id.line3, showLine3 ? View.VISIBLE : View.GONE); contentView.setViewVisibility(R.id.overflow_divider, showLine3 ? View.VISIBLE : View.GONE); return contentView; Loading