diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2018-02-05 02:07:55 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-02-05 02:07:55 +0000 |
| commit | 00f255e795439ef9e1ff86d3a7ee4f43b42d7bc2 (patch) | |
| tree | 31efb37eca465ec093366879c6e12ea9ddb8592f /core/java/android | |
| parent | fbbd75839d05cb9a09f60d52c870d36e4902091a (diff) | |
| parent | 682483d1652bda42e653ea8aa4cbb9f8572c53e7 (diff) | |
Merge "VideoView2: Replace showSubtitle with setSubtitleEnabled"
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/widget/VideoView2.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/core/java/android/widget/VideoView2.java b/core/java/android/widget/VideoView2.java index 30811803bf9a..bd2656747422 100644 --- a/core/java/android/widget/VideoView2.java +++ b/core/java/android/widget/VideoView2.java @@ -181,11 +181,21 @@ public class VideoView2 extends ViewGroupHelper<VideoView2Provider> { /** * Shows or hides closed caption or subtitles if there is any. - * The first subtitle track will be chosen by default if there multiple subtitle tracks exist. - * @param show shows closed caption or subtitles if this value is true, or hides. + * The first subtitle track will be chosen if there multiple subtitle tracks exist. + * Default behavior of VideoView2 is not showing subtitle. + * @param enable shows closed caption or subtitles if this value is true, or hides. */ - public void showSubtitle(boolean show) { - mProvider.showSubtitle_impl(show); + public void setSubtitleEnabled(boolean enable) { + mProvider.setSubtitleEnabled_impl(enable); + } + + /** + * Returns true if showing subtitle feature is enabled or returns false. + * Although there is no subtitle track or closed caption, it can return true, if the feature + * has been enabled by {@link #setSubtitleEnabled}. + */ + public boolean isSubtitleEnabled() { + return mProvider.isSubtitleEnabled_impl(); } /** |
