diff --git a/api/current.txt b/api/current.txt index ab1819677ae17..d22a5909c05ea 100644 --- a/api/current.txt +++ b/api/current.txt @@ -22539,6 +22539,7 @@ package android.view { method public abstract java.lang.CharSequence getSubtitle(); method public java.lang.Object getTag(); method public abstract java.lang.CharSequence getTitle(); + method public boolean getTitleOptionalHint(); method public abstract void invalidate(); method public boolean isTitleOptional(); method public abstract void setCustomView(android.view.View); diff --git a/core/java/android/view/ActionMode.java b/core/java/android/view/ActionMode.java index 0ba5fdbc4f1af..a359952ddcf2d 100644 --- a/core/java/android/view/ActionMode.java +++ b/core/java/android/view/ActionMode.java @@ -30,6 +30,7 @@ package android.view; */ public abstract class ActionMode { private Object mTag; + private boolean mTitleOptionalHint; /** * Set a tag object associated with this ActionMode. @@ -119,6 +120,18 @@ public abstract class ActionMode { * @param titleOptional true if the title only presents optional information. */ public void setTitleOptionalHint(boolean titleOptional) { + mTitleOptionalHint = titleOptional; + } + + /** + * @return true if this action mode has been given a hint to consider the + * title/subtitle display to be optional. + * + * @see #setTitleOptionalHint(boolean) + * @see #isTitleOptional() + */ + public boolean getTitleOptionalHint() { + return mTitleOptionalHint; } /** diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 092bcbd4b4ef2..2f67481aba221 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -5423,6 +5423,11 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * app should not need to concern itself with saving and restoring, but that * the framework should take special note to preserve when possible. * + *
A view with transient state cannot be trivially rebound from an external + * data source, such as an adapter binding item views in a list. This may be + * because the view is performing an animation, tracking user selection + * of content, or similar.
+ * * @return true if the view has transient state */ @ViewDebug.ExportedProperty(category = "layout") @@ -5436,6 +5441,11 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * so every call to setHasTransientState(true) should be paired with a later call * to setHasTransientState(false). * + *A view with transient state cannot be trivially rebound from an external + * data source, such as an adapter binding item views in a list. This may be + * because the view is performing an animation, tracking user selection + * of content, or similar.
+ * * @param hasTransientState true if this view has transient state */ public void setHasTransientState(boolean hasTransientState) { diff --git a/core/java/com/android/internal/app/ActionBarImpl.java b/core/java/com/android/internal/app/ActionBarImpl.java index ed711f3ecc274..805c0a93ee498 100644 --- a/core/java/com/android/internal/app/ActionBarImpl.java +++ b/core/java/com/android/internal/app/ActionBarImpl.java @@ -817,6 +817,7 @@ public class ActionBarImpl extends ActionBar { @Override public void setTitleOptionalHint(boolean titleOptional) { + super.setTitleOptionalHint(titleOptional); mContextView.setTitleOptional(titleOptional); } diff --git a/core/java/com/android/internal/view/StandaloneActionMode.java b/core/java/com/android/internal/view/StandaloneActionMode.java index 4b681ec3a44c6..fae7ea12fd832 100644 --- a/core/java/com/android/internal/view/StandaloneActionMode.java +++ b/core/java/com/android/internal/view/StandaloneActionMode.java @@ -73,6 +73,7 @@ public class StandaloneActionMode extends ActionMode implements MenuBuilder.Call @Override public void setTitleOptionalHint(boolean titleOptional) { + super.setTitleOptionalHint(titleOptional); mContextView.setTitleOptional(titleOptional); }