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
ce4225f8
authored
Feb 07, 2022
by
ibaker
Committed by
Ian Baker
Feb 07, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix some missed StyledPlayerView -> PlayerView rename sites
PiperOrigin-RevId: 426868804
parent
16891425
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
29 deletions
libraries/ui/src/main/java/androidx/media3/ui/PlayerControlView.java
libraries/ui/src/main/java/androidx/media3/ui/PlayerView.java
libraries/ui/src/main/res/values/attrs.xml
libraries/ui/src/main/java/androidx/media3/ui/PlayerControlView.java
View file @
ce4225f8
...
...
@@ -89,12 +89,12 @@ import java.util.concurrent.CopyOnWriteArrayList;
/**
* A view for controlling {@link Player} instances.
*
* <p>A
Styled
PlayerControlView can be customized by setting attributes (or calling corresponding
* <p>A PlayerControlView can be customized by setting attributes (or calling corresponding
* methods), or overriding drawables.
*
* <h2>Attributes</h2>
*
* The following attributes can be set on a
Styled
PlayerControlView when used in a layout XML file:
* The following attributes can be set on a PlayerControlView when used in a layout XML file:
*
* <ul>
* <li><b>{@code show_timeout}</b> - The time between the last user interaction and the controls
...
...
@@ -160,13 +160,13 @@ import java.util.concurrent.CopyOnWriteArrayList;
* <li>Default: {@code R.layout.exo_player_control_view}
* </ul>
* <li>All attributes that can be set on {@link DefaultTimeBar} can also be set on a
*
StyledPlayerControlView, and will be propagated to the inflated {@link DefaultTimeBar}
*
unless the
layout is overridden to specify a custom {@code exo_progress} (see below).
*
PlayerControlView, and will be propagated to the inflated {@link DefaultTimeBar} unless the
* layout is overridden to specify a custom {@code exo_progress} (see below).
* </ul>
*
* <h2>Overriding drawables</h2>
*
* The drawables used by
Styled
PlayerControlView (with its default layout file) can be overridden by
* 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:
*
...
...
@@ -375,40 +375,32 @@ public class PlayerControlView extends FrameLayout {
context
.
getTheme
()
.
obtainStyledAttributes
(
playbackAttrs
,
R
.
styleable
.
StyledPlayerControlView
,
defStyleAttr
,
/* defStyleRes= */
0
);
playbackAttrs
,
R
.
styleable
.
PlayerControlView
,
defStyleAttr
,
/* defStyleRes= */
0
);
try
{
controllerLayoutId
=
a
.
getResourceId
(
R
.
styleable
.
StyledPlayerControlView_controller_layout_id
,
controllerLayoutId
);
showTimeoutMs
=
a
.
getInt
(
R
.
styleable
.
StyledPlayerControlView_show_timeout
,
showTimeoutMs
);
a
.
getResourceId
(
R
.
styleable
.
PlayerControlView_controller_layout_id
,
controllerLayoutId
);
showTimeoutMs
=
a
.
getInt
(
R
.
styleable
.
PlayerControlView_show_timeout
,
showTimeoutMs
);
repeatToggleModes
=
getRepeatToggleModes
(
a
,
repeatToggleModes
);
showRewindButton
=
a
.
getBoolean
(
R
.
styleable
.
Styled
PlayerControlView_show_rewind_button
,
showRewindButton
);
a
.
getBoolean
(
R
.
styleable
.
PlayerControlView_show_rewind_button
,
showRewindButton
);
showFastForwardButton
=
a
.
getBoolean
(
R
.
styleable
.
Styled
PlayerControlView_show_fastforward_button
,
showFastForwardButton
);
R
.
styleable
.
PlayerControlView_show_fastforward_button
,
showFastForwardButton
);
showPreviousButton
=
a
.
getBoolean
(
R
.
styleable
.
StyledPlayerControlView_show_previous_button
,
showPreviousButton
);
a
.
getBoolean
(
R
.
styleable
.
PlayerControlView_show_previous_button
,
showPreviousButton
);
showNextButton
=
a
.
getBoolean
(
R
.
styleable
.
Styled
PlayerControlView_show_next_button
,
showNextButton
);
a
.
getBoolean
(
R
.
styleable
.
PlayerControlView_show_next_button
,
showNextButton
);
showShuffleButton
=
a
.
getBoolean
(
R
.
styleable
.
StyledPlayerControlView_show_shuffle_button
,
showShuffleButton
);
a
.
getBoolean
(
R
.
styleable
.
PlayerControlView_show_shuffle_button
,
showShuffleButton
);
showSubtitleButton
=
a
.
getBoolean
(
R
.
styleable
.
StyledPlayerControlView_show_subtitle_button
,
showSubtitleButton
);
showVrButton
=
a
.
getBoolean
(
R
.
styleable
.
StyledPlayerControlView_show_vr_button
,
showVrButton
);
a
.
getBoolean
(
R
.
styleable
.
PlayerControlView_show_subtitle_button
,
showSubtitleButton
);
showVrButton
=
a
.
getBoolean
(
R
.
styleable
.
PlayerControlView_show_vr_button
,
showVrButton
);
setTimeBarMinUpdateInterval
(
a
.
getInt
(
R
.
styleable
.
Styled
PlayerControlView_time_bar_min_update_interval
,
R
.
styleable
.
PlayerControlView_time_bar_min_update_interval
,
timeBarMinUpdateIntervalMs
));
animationEnabled
=
a
.
getBoolean
(
R
.
styleable
.
Styled
PlayerControlView_animation_enabled
,
animationEnabled
);
a
.
getBoolean
(
R
.
styleable
.
PlayerControlView_animation_enabled
,
animationEnabled
);
}
finally
{
a
.
recycle
();
}
...
...
@@ -1572,7 +1564,7 @@ public class PlayerControlView extends FrameLayout {
@SuppressWarnings
(
"ResourceType"
)
private
static
@RepeatModeUtil
.
RepeatToggleModes
int
getRepeatToggleModes
(
TypedArray
a
,
@RepeatModeUtil
.
RepeatToggleModes
int
defaultValue
)
{
return
a
.
getInt
(
R
.
styleable
.
Styled
PlayerControlView_repeat_toggle_modes
,
defaultValue
);
return
a
.
getInt
(
R
.
styleable
.
PlayerControlView_repeat_toggle_modes
,
defaultValue
);
}
private
final
class
ComponentListener
...
...
libraries/ui/src/main/java/androidx/media3/ui/PlayerView.java
View file @
ce4225f8
...
...
@@ -424,7 +424,7 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
if
(
customController
!=
null
)
{
this
.
controller
=
customController
;
}
else
if
(
controllerPlaceholder
!=
null
)
{
// Propagate attrs as playbackAttrs so that
Styled
PlayerControlView's custom attributes are
// Propagate attrs as playbackAttrs so that PlayerControlView's custom attributes are
// transferred, but standard attributes (e.g. background) are not.
this
.
controller
=
new
PlayerControlView
(
context
,
null
,
0
,
attrs
);
controller
.
setId
(
R
.
id
.
exo_controller
);
...
...
@@ -1522,7 +1522,7 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
toggleControllerVisibility
();
}
//
Styled
PlayerControlView.VisibilityListener implementation
// PlayerControlView.VisibilityListener implementation
@Override
public
void
onVisibilityChange
(
int
visibility
)
{
...
...
libraries/ui/src/main/res/values/attrs.xml
View file @
ce4225f8
...
...
@@ -162,7 +162,7 @@
<attr
name=
"played_ad_marker_color"
/>
</declare-styleable>
<declare-styleable
name=
"
Styled
PlayerControlView"
>
<declare-styleable
name=
"PlayerControlView"
>
<attr
name=
"show_timeout"
/>
<attr
name=
"repeat_toggle_modes"
/>
<attr
name=
"show_rewind_button"
/>
...
...
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