diff options
| -rw-r--r-- | api/current.txt | 1 | ||||
| -rw-r--r-- | core/java/android/widget/TextView.java | 17 |
2 files changed, 15 insertions, 3 deletions
diff --git a/api/current.txt b/api/current.txt index df09868b5184..0f05aa9eec28 100644 --- a/api/current.txt +++ b/api/current.txt @@ -56358,6 +56358,7 @@ package android.widget { method public boolean isCursorVisible(); method public boolean isElegantTextHeight(); method public boolean isFallbackLineSpacing(); + method public final boolean isHorizontallyScrolling(); method public boolean isInputMethodTarget(); method public boolean isSingleLine(); method public boolean isSuggestionsEnabled(); diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 90da81276ba3..ddf119097027 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -719,7 +719,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener @ViewDebug.ExportedProperty(category = "text") @UnsupportedAppUsage private int mGravity = Gravity.TOP | Gravity.START; - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) private boolean mHorizontallyScrolling; private int mAutoLinkMask; @@ -5095,13 +5095,24 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } /** - * Returns whether the text is allowed to be wider than the View is. + * Returns whether the text is allowed to be wider than the View. + * If false, the text will be wrapped to the width of the View. + * + * @attr ref android.R.styleable#TextView_scrollHorizontally + * @see #setHorizontallyScrolling(boolean) + */ + public final boolean isHorizontallyScrolling() { + return mHorizontallyScrolling; + } + + /** + * Returns whether the text is allowed to be wider than the View. * If false, the text will be wrapped to the width of the View. * * @attr ref android.R.styleable#TextView_scrollHorizontally * @hide */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) public boolean getHorizontallyScrolling() { return mHorizontallyScrolling; } |