Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0e1670bb
authored
Jan 02, 2020
by
olly
Committed by
Oliver Woodman
Jan 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Document overriding of drawables for PlayerControlView
Issue: #6779 PiperOrigin-RevId: 287828273
parent
b36c5e99
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
9 deletions
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java
View file @
0e1670bb
...
@@ -49,8 +49,8 @@ import java.util.concurrent.CopyOnWriteArrayList;
...
@@ -49,8 +49,8 @@ import java.util.concurrent.CopyOnWriteArrayList;
* A view for controlling {@link Player} instances.
* A view for controlling {@link Player} instances.
*
*
* <p>A PlayerControlView can be customized by setting attributes (or calling corresponding
* <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
* methods), overriding
drawables, overriding the view's layout file, or by specifying a custom view
*
outlined below
.
*
layout file
.
*
*
* <h3>Attributes</h3>
* <h3>Attributes</h3>
*
*
...
@@ -104,6 +104,30 @@ import java.util.concurrent.CopyOnWriteArrayList;
...
@@ -104,6 +104,30 @@ import java.util.concurrent.CopyOnWriteArrayList;
* layout is overridden to specify a custom {@code exo_progress} (see below).
* layout is overridden to specify a custom {@code exo_progress} (see below).
* </ul>
* </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>
* <h3>Overriding the layout file</h3>
*
*
* To customize the layout of PlayerControlView throughout your app, or just for certain
* To customize the layout of PlayerControlView throughout your app, or just for certain
...
@@ -123,29 +147,38 @@ import java.util.concurrent.CopyOnWriteArrayList;
...
@@ -123,29 +147,38 @@ import java.util.concurrent.CopyOnWriteArrayList;
* <ul>
* <ul>
* <li>Type: {@link View}
* <li>Type: {@link View}
* </ul>
* </ul>
* <li><b>{@code exo_
ffwd}</b> - The fast forwar
d button.
* <li><b>{@code exo_
rew}</b> - The rewin
d button.
* <ul>
* <ul>
* <li>Type: {@link View}
* <li>Type: {@link View}
* </ul>
* </ul>
* <li><b>{@code exo_
rew}</b> - The rewin
d button.
* <li><b>{@code exo_
ffwd}</b> - The fast forwar
d button.
* <ul>
* <ul>
* <li>Type: {@link View}
* <li>Type: {@link View}
* </ul>
* </ul>
* <li><b>{@code exo_prev}</b> - The previous
track
button.
* <li><b>{@code exo_prev}</b> - The previous button.
* <ul>
* <ul>
* <li>Type: {@link View}
* <li>Type: {@link View}
* </ul>
* </ul>
* <li><b>{@code exo_next}</b> - The next
track
button.
* <li><b>{@code exo_next}</b> - The next button.
* <ul>
* <ul>
* <li>Type: {@link View}
* <li>Type: {@link View}
* </ul>
* </ul>
* <li><b>{@code exo_repeat_toggle}</b> - The repeat toggle button.
* <li><b>{@code exo_repeat_toggle}</b> - The repeat toggle button.
* <ul>
* <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>
* </ul>
* <li><b>{@code exo_shuffle}</b> - The shuffle button.
* <li><b>{@code exo_shuffle}</b> - The shuffle button.
* <ul>
* <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>
* </ul>
* <li><b>{@code exo_vr}</b> - The VR mode button.
* <li><b>{@code exo_vr}</b> - The VR mode button.
* <ul>
* <ul>
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
View file @
0e1670bb
...
@@ -79,7 +79,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -79,7 +79,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
* during playback, and displays playback controls using a {@link PlayerControlView}.
* during playback, and displays playback controls using a {@link PlayerControlView}.
*
*
* <p>A PlayerView can be customized by setting attributes (or calling corresponding methods),
* <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>
* <h3>Attributes</h3>
*
*
...
@@ -172,6 +173,12 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -172,6 +173,12 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
* exo_controller} (see below).
* exo_controller} (see below).
* </ul>
* </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>
* <h3>Overriding the layout file</h3>
*
*
* To customize the layout of PlayerView throughout your app, or just for certain configurations,
* To customize the layout of PlayerView throughout your app, or just for certain configurations,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment