Fix some missed StyledPlayerView -> PlayerView rename sites

PiperOrigin-RevId: 426868804
This commit is contained in:
ibaker 2022-02-07 11:08:04 +00:00 committed by Ian Baker
parent 168914256d
commit ce4225f864
3 changed files with 21 additions and 29 deletions

View File

@ -89,12 +89,12 @@ import java.util.concurrent.CopyOnWriteArrayList;
/** /**
* A view for controlling {@link Player} instances. * A view for controlling {@link Player} instances.
* *
* <p>A StyledPlayerControlView 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. * methods), or overriding drawables.
* *
* <h2>Attributes</h2> * <h2>Attributes</h2>
* *
* The following attributes can be set on a StyledPlayerControlView when used in a layout XML file: * The following attributes can be set on a PlayerControlView when used in a layout XML file:
* *
* <ul> * <ul>
* <li><b>{@code show_timeout}</b> - The time between the last user interaction and the controls * <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} * <li>Default: {@code R.layout.exo_player_control_view}
* </ul> * </ul>
* <li>All attributes that can be set on {@link DefaultTimeBar} can also be set on a * <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} * PlayerControlView, and will be propagated to the inflated {@link DefaultTimeBar} unless the
* unless the 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>
* *
* <h2>Overriding drawables</h2> * <h2>Overriding drawables</h2>
* *
* The drawables used by StyledPlayerControlView (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 * drawables with the same names defined in your application. The drawables that can be overridden
* are: * are:
* *
@ -375,40 +375,32 @@ public class PlayerControlView extends FrameLayout {
context context
.getTheme() .getTheme()
.obtainStyledAttributes( .obtainStyledAttributes(
playbackAttrs, playbackAttrs, R.styleable.PlayerControlView, defStyleAttr, /* defStyleRes= */ 0);
R.styleable.StyledPlayerControlView,
defStyleAttr,
/* defStyleRes= */ 0);
try { try {
controllerLayoutId = controllerLayoutId =
a.getResourceId( a.getResourceId(R.styleable.PlayerControlView_controller_layout_id, controllerLayoutId);
R.styleable.StyledPlayerControlView_controller_layout_id, controllerLayoutId); showTimeoutMs = a.getInt(R.styleable.PlayerControlView_show_timeout, showTimeoutMs);
showTimeoutMs = a.getInt(R.styleable.StyledPlayerControlView_show_timeout, showTimeoutMs);
repeatToggleModes = getRepeatToggleModes(a, repeatToggleModes); repeatToggleModes = getRepeatToggleModes(a, repeatToggleModes);
showRewindButton = showRewindButton =
a.getBoolean(R.styleable.StyledPlayerControlView_show_rewind_button, showRewindButton); a.getBoolean(R.styleable.PlayerControlView_show_rewind_button, showRewindButton);
showFastForwardButton = showFastForwardButton =
a.getBoolean( a.getBoolean(
R.styleable.StyledPlayerControlView_show_fastforward_button, showFastForwardButton); R.styleable.PlayerControlView_show_fastforward_button, showFastForwardButton);
showPreviousButton = showPreviousButton =
a.getBoolean( a.getBoolean(R.styleable.PlayerControlView_show_previous_button, showPreviousButton);
R.styleable.StyledPlayerControlView_show_previous_button, showPreviousButton);
showNextButton = showNextButton =
a.getBoolean(R.styleable.StyledPlayerControlView_show_next_button, showNextButton); a.getBoolean(R.styleable.PlayerControlView_show_next_button, showNextButton);
showShuffleButton = showShuffleButton =
a.getBoolean( a.getBoolean(R.styleable.PlayerControlView_show_shuffle_button, showShuffleButton);
R.styleable.StyledPlayerControlView_show_shuffle_button, showShuffleButton);
showSubtitleButton = showSubtitleButton =
a.getBoolean( a.getBoolean(R.styleable.PlayerControlView_show_subtitle_button, showSubtitleButton);
R.styleable.StyledPlayerControlView_show_subtitle_button, showSubtitleButton); showVrButton = a.getBoolean(R.styleable.PlayerControlView_show_vr_button, showVrButton);
showVrButton =
a.getBoolean(R.styleable.StyledPlayerControlView_show_vr_button, showVrButton);
setTimeBarMinUpdateInterval( setTimeBarMinUpdateInterval(
a.getInt( a.getInt(
R.styleable.StyledPlayerControlView_time_bar_min_update_interval, R.styleable.PlayerControlView_time_bar_min_update_interval,
timeBarMinUpdateIntervalMs)); timeBarMinUpdateIntervalMs));
animationEnabled = animationEnabled =
a.getBoolean(R.styleable.StyledPlayerControlView_animation_enabled, animationEnabled); a.getBoolean(R.styleable.PlayerControlView_animation_enabled, animationEnabled);
} finally { } finally {
a.recycle(); a.recycle();
} }
@ -1572,7 +1564,7 @@ public class PlayerControlView extends FrameLayout {
@SuppressWarnings("ResourceType") @SuppressWarnings("ResourceType")
private static @RepeatModeUtil.RepeatToggleModes int getRepeatToggleModes( private static @RepeatModeUtil.RepeatToggleModes int getRepeatToggleModes(
TypedArray a, @RepeatModeUtil.RepeatToggleModes int defaultValue) { TypedArray a, @RepeatModeUtil.RepeatToggleModes int defaultValue) {
return a.getInt(R.styleable.StyledPlayerControlView_repeat_toggle_modes, defaultValue); return a.getInt(R.styleable.PlayerControlView_repeat_toggle_modes, defaultValue);
} }
private final class ComponentListener private final class ComponentListener

View File

@ -424,7 +424,7 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
if (customController != null) { if (customController != null) {
this.controller = customController; this.controller = customController;
} else if (controllerPlaceholder != null) { } else if (controllerPlaceholder != null) {
// Propagate attrs as playbackAttrs so that StyledPlayerControlView's custom attributes are // Propagate attrs as playbackAttrs so that PlayerControlView's custom attributes are
// transferred, but standard attributes (e.g. background) are not. // transferred, but standard attributes (e.g. background) are not.
this.controller = new PlayerControlView(context, null, 0, attrs); this.controller = new PlayerControlView(context, null, 0, attrs);
controller.setId(R.id.exo_controller); controller.setId(R.id.exo_controller);
@ -1522,7 +1522,7 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
toggleControllerVisibility(); toggleControllerVisibility();
} }
// StyledPlayerControlView.VisibilityListener implementation // PlayerControlView.VisibilityListener implementation
@Override @Override
public void onVisibilityChange(int visibility) { public void onVisibilityChange(int visibility) {

View File

@ -162,7 +162,7 @@
<attr name="played_ad_marker_color"/> <attr name="played_ad_marker_color"/>
</declare-styleable> </declare-styleable>
<declare-styleable name="StyledPlayerControlView"> <declare-styleable name="PlayerControlView">
<attr name="show_timeout"/> <attr name="show_timeout"/>
<attr name="repeat_toggle_modes"/> <attr name="repeat_toggle_modes"/>
<attr name="show_rewind_button"/> <attr name="show_rewind_button"/>