Skip to content

Commit

Permalink
Document overriding of drawables for PlayerControlView
Browse files Browse the repository at this point in the history
Issue: #6779
PiperOrigin-RevId: 287828273
  • Loading branch information
ojw28 committed Jan 17, 2020
1 parent b36c5e9 commit 0e1670b
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
* A view for controlling {@link Player} instances.
*
* <p>A PlayerControlView can be customized by setting attributes (or calling corresponding
* methods), overriding the view's layout file or by specifying a custom view layout file, as
* outlined below.
* methods), overriding drawables, overriding the view's layout file, or by specifying a custom view
* layout file.
*
* <h3>Attributes</h3>
*
Expand Down Expand Up @@ -104,6 +104,30 @@
* layout is overridden to specify a custom {@code exo_progress} (see below).
* </ul>
*
* <h3>Overriding drawables</h3>
*
* The drawables used by PlayerControlView (with its default layout file) can be overridden by
* drawables with the same names defined in your application. The drawables that can be overridden
* are:
*
* <ul>
* <li><b>{@code exo_controls_play}</b> - The play icon.
* <li><b>{@code exo_controls_pause}</b> - The pause icon.
* <li><b>{@code exo_controls_rewind}</b> - The rewind icon.
* <li><b>{@code exo_controls_fastforward}</b> - The fast forward icon.
* <li><b>{@code exo_controls_previous}</b> - The previous icon.
* <li><b>{@code exo_controls_next}</b> - The next icon.
* <li><b>{@code exo_controls_repeat_off}</b> - The repeat icon for {@link
* Player#REPEAT_MODE_OFF}.
* <li><b>{@code exo_controls_repeat_one}</b> - The repeat icon for {@link
* Player#REPEAT_MODE_ONE}.
* <li><b>{@code exo_controls_repeat_all}</b> - The repeat icon for {@link
* Player#REPEAT_MODE_ALL}.
* <li><b>{@code exo_controls_shuffle_off}</b> - The shuffle icon when shuffling is disabled.
* <li><b>{@code exo_controls_shuffle_on}</b> - The shuffle icon when shuffling is enabled.
* <li><b>{@code exo_controls_vr}</b> - The VR icon.
* </ul>
*
* <h3>Overriding the layout file</h3>
*
* To customize the layout of PlayerControlView throughout your app, or just for certain
Expand All @@ -123,29 +147,38 @@
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_ffwd}</b> - The fast forward button.
* <li><b>{@code exo_rew}</b> - The rewind button.
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_rew}</b> - The rewind button.
* <li><b>{@code exo_ffwd}</b> - The fast forward button.
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_prev}</b> - The previous track button.
* <li><b>{@code exo_prev}</b> - The previous button.
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_next}</b> - The next track button.
* <li><b>{@code exo_next}</b> - The next button.
* <ul>
* <li>Type: {@link View}
* </ul>
* <li><b>{@code exo_repeat_toggle}</b> - The repeat toggle button.
* <ul>
* <li>Type: {@link View}
* <li>Type: {@link ImageView}
* <li>Note: PlayerControlView will programmatically set the drawable on the repeat toggle
* button according to the player's current repeat mode. The drawables used are {@code
* exo_controls_repeat_off}, {@code exo_controls_repeat_one} and {@code
* exo_controls_repeat_all}. See the section above for information on overriding these
* drawables.
* </ul>
* <li><b>{@code exo_shuffle}</b> - The shuffle button.
* <ul>
* <li>Type: {@link View}
* <li>Type: {@link ImageView}
* <li>Note: PlayerControlView will programmatically set the drawable on the shuffle button
* according to the player's current repeat mode. The drawables used are {@code
* exo_controls_shuffle_off} and {@code exo_controls_shuffle_on}. See the section above
* for information on overriding these drawables.
* </ul>
* <li><b>{@code exo_vr}</b> - The VR mode button.
* <ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
* during playback, and displays playback controls using a {@link PlayerControlView}.
*
* <p>A PlayerView can be customized by setting attributes (or calling corresponding methods),
* overriding the view's layout file or by specifying a custom view layout file, as outlined below.
* overriding drawables, overriding the view's layout file, or by specifying a custom view layout
* file.
*
* <h3>Attributes</h3>
*
Expand Down Expand Up @@ -172,6 +173,12 @@
* exo_controller} (see below).
* </ul>
*
* <h3>Overriding drawables</h3>
*
* The drawables used by {@link PlayerControlView} (with its default layout file) can be overridden
* by drawables with the same names defined in your application. See the {@link PlayerControlView}
* documentation for a list of drawables that can be overridden.
*
* <h3>Overriding the layout file</h3>
*
* To customize the layout of PlayerView throughout your app, or just for certain configurations,
Expand Down

0 comments on commit 0e1670b

Please sign in to comment.