Commit bfce8f54 by ibaker Committed by Ian Baker

Rename StyledPlayerView to PlayerView

This commit leaves some 'styled' references, specifically:
* exo_styled_XXX dimension names
* exo_styled_controls_XXX drawable IDs
* exo_styled_XXX color names
* ExoStyledControls.XXX style names

PiperOrigin-RevId: 421576554
parent 4d5bf7c0
Showing with 60 additions and 60 deletions
......@@ -36,7 +36,7 @@ import androidx.media3.common.MediaItem;
import androidx.media3.common.util.Assertions;
import androidx.media3.common.util.Util;
import androidx.media3.exoplayer.ExoPlayer;
import androidx.media3.ui.StyledPlayerView;
import androidx.media3.ui.PlayerView;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
......@@ -52,7 +52,7 @@ import com.google.android.gms.dynamite.DynamiteModule;
public class MainActivity extends AppCompatActivity
implements OnClickListener, PlayerManager.Listener {
private StyledPlayerView playerView;
private PlayerView playerView;
private PlayerManager playerManager;
private RecyclerView mediaQueueList;
private MediaQueueListAdapter mediaQueueListAdapter;
......
......@@ -28,8 +28,8 @@ import androidx.media3.common.Player.TimelineChangeReason;
import androidx.media3.common.Timeline;
import androidx.media3.common.TracksInfo;
import androidx.media3.exoplayer.ExoPlayer;
import androidx.media3.ui.StyledPlayerControlView;
import androidx.media3.ui.StyledPlayerView;
import androidx.media3.ui.PlayerControlView;
import androidx.media3.ui.PlayerView;
import com.google.android.gms.cast.framework.CastContext;
import java.util.ArrayList;
......@@ -51,7 +51,7 @@ import java.util.ArrayList;
}
private final Context context;
private final StyledPlayerView playerView;
private final PlayerView playerView;
private final Player localPlayer;
private final CastPlayer castPlayer;
private final ArrayList<MediaItem> mediaQueue;
......@@ -66,11 +66,11 @@ import java.util.ArrayList;
*
* @param context A {@link Context}.
* @param listener A {@link Listener} for queue position changes.
* @param playerView The {@link StyledPlayerView} for playback.
* @param playerView The {@link PlayerView} for playback.
* @param castContext The {@link CastContext}.
*/
public PlayerManager(
Context context, Listener listener, StyledPlayerView playerView, CastContext castContext) {
Context context, Listener listener, PlayerView playerView, CastContext castContext) {
this.context = context;
this.listener = listener;
this.playerView = playerView;
......@@ -270,7 +270,7 @@ import java.util.ArrayList;
R.drawable.ic_baseline_cast_connected_400,
/* theme= */ null));
} else { // currentPlayer == localPlayer
playerView.setControllerShowTimeoutMs(StyledPlayerControlView.DEFAULT_SHOW_TIMEOUT_MS);
playerView.setControllerShowTimeoutMs(PlayerControlView.DEFAULT_SHOW_TIMEOUT_MS);
playerView.setDefaultArtwork(null);
}
......
......@@ -20,7 +20,7 @@
android:layout_height="match_parent"
android:keepScreenOn="true">
<androidx.media3.ui.StyledPlayerView android:id="@+id/player_view"
<androidx.media3.ui.PlayerView android:id="@+id/player_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
......
......@@ -42,7 +42,7 @@ import androidx.media3.exoplayer.drm.HttpMediaDrmCallback;
import androidx.media3.exoplayer.source.MediaSource;
import androidx.media3.exoplayer.source.ProgressiveMediaSource;
import androidx.media3.exoplayer.util.EventLogger;
import androidx.media3.ui.StyledPlayerView;
import androidx.media3.ui.PlayerView;
import java.util.UUID;
/**
......@@ -61,7 +61,7 @@ public final class MainActivity extends Activity {
private static final String DRM_SCHEME_EXTRA = "drm_scheme";
private static final String DRM_LICENSE_URL_EXTRA = "drm_license_url";
@Nullable private StyledPlayerView playerView;
@Nullable private PlayerView playerView;
@Nullable private VideoProcessingGLSurfaceView videoProcessingGLSurfaceView;
@Nullable private ExoPlayer player;
......
......@@ -20,7 +20,7 @@
android:layout_height="match_parent"
android:keepScreenOn="true">
<androidx.media3.ui.StyledPlayerView
<androidx.media3.ui.PlayerView
android:id="@+id/player_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......
......@@ -52,15 +52,15 @@ import androidx.media3.exoplayer.source.ads.AdsLoader;
import androidx.media3.exoplayer.trackselection.DefaultTrackSelector;
import androidx.media3.exoplayer.util.DebugTextViewHelper;
import androidx.media3.exoplayer.util.EventLogger;
import androidx.media3.ui.StyledPlayerControlView;
import androidx.media3.ui.StyledPlayerView;
import androidx.media3.ui.PlayerControlView;
import androidx.media3.ui.PlayerView;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/** An activity that plays media using {@link ExoPlayer}. */
public class PlayerActivity extends AppCompatActivity
implements OnClickListener, StyledPlayerControlView.VisibilityListener {
implements OnClickListener, PlayerControlView.VisibilityListener {
// Saved instance state keys.
......@@ -69,7 +69,7 @@ public class PlayerActivity extends AppCompatActivity
private static final String KEY_POSITION = "position";
private static final String KEY_AUTO_PLAY = "auto_play";
protected StyledPlayerView playerView;
protected PlayerView playerView;
protected LinearLayout debugRootView;
protected TextView debugTextView;
protected @Nullable ExoPlayer player;
......@@ -234,7 +234,7 @@ public class PlayerActivity extends AppCompatActivity
}
}
// StyledPlayerControlView.VisibilityListener implementation
// PlayerControlView.VisibilityListener implementation
@Override
public void onVisibilityChange(int visibility) {
......
......@@ -21,7 +21,7 @@
android:layout_height="match_parent"
android:keepScreenOn="true">
<androidx.media3.ui.StyledPlayerView android:id="@+id/player_view"
<androidx.media3.ui.PlayerView android:id="@+id/player_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:show_shuffle_button="true"
......
......@@ -34,7 +34,7 @@ import androidx.media3.common.MediaMetadata
import androidx.media3.common.Player
import androidx.media3.session.MediaController
import androidx.media3.session.SessionToken
import androidx.media3.ui.StyledPlayerView
import androidx.media3.ui.PlayerView
import com.google.common.util.concurrent.ListenableFuture
import com.google.common.util.concurrent.MoreExecutors
......@@ -43,7 +43,7 @@ class PlayerActivity : AppCompatActivity() {
private val controller: MediaController?
get() = if (controllerFuture.isDone) controllerFuture.get() else null
private lateinit var playerView: StyledPlayerView
private lateinit var playerView: PlayerView
private lateinit var mediaList: ListView
private lateinit var mediaListAdapter: PlayingMediaItemArrayAdapter
private val subItemMediaList: MutableList<MediaItem> = mutableListOf()
......
......@@ -26,7 +26,7 @@
android:layout_height="300dp"
android:layout_width="match_parent"
>
<androidx.media3.ui.StyledPlayerView
<androidx.media3.ui.PlayerView
android:id="@+id/player_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
......
......@@ -104,20 +104,20 @@ gets from the libgav1 decoder:
* GL rendering using GL shader for color space conversion
* If you are using `ExoPlayer` with `LegacyPlayerView` or
`StyledPlayerView`, enable this option by setting `surface_type` of view
to be `video_decoder_gl_surface_view`.
* If you are using `ExoPlayer` with `LegacyPlayerView` or `PlayerView`,
enable this option by setting `surface_type` of view to be
`video_decoder_gl_surface_view`.
* Otherwise, enable this option by sending `Libgav1VideoRenderer` a
message of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of
`VideoDecoderOutputBufferRenderer` as its object.
`VideoDecoderGLSurfaceView` is the concrete
`VideoDecoderOutputBufferRenderer` implementation used by
`StyledPlayerView` and `LegacyPlayerView`.
`VideoDecoderOutputBufferRenderer` implementation used by `PlayerView`
and `LegacyPlayerView`.
* Native rendering using `ANativeWindow`
* If you are using `ExoPlayer` with `LegacyPlayerView` or
`StyledPlayerView`, this option is enabled by default.
* If you are using `ExoPlayer` with `LegacyPlayerView` or `PlayerView`,
this option is enabled by default.
* Otherwise, enable this option by sending `Libgav1VideoRenderer` a
message of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of
`SurfaceView` as its object.
......
......@@ -117,20 +117,20 @@ gets from the libvpx decoder:
* GL rendering using GL shader for color space conversion
* If you are using `ExoPlayer` with `LegacyPlayerView` or
`StyledPlayerView`, enable this option by setting `surface_type` of view
to be `video_decoder_gl_surface_view`.
* If you are using `ExoPlayer` with `LegacyPlayerView` or `PlayerView`,
enable this option by setting `surface_type` of view to be
`video_decoder_gl_surface_view`.
* Otherwise, enable this option by sending `LibvpxVideoRenderer` a message
of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of
`VideoDecoderOutputBufferRenderer` as its object.
`VideoDecoderGLSurfaceView` is the concrete
`VideoDecoderOutputBufferRenderer` implementation used by
`StyledPlayerView` and `LegacyPlayerView`.
`VideoDecoderOutputBufferRenderer` implementation used by `PlayerView`
and `LegacyPlayerView`.
* Native rendering using `ANativeWindow`
* If you are using `ExoPlayer` with `LegacyPlayerView` or
`StyledPlayerView`, this option is enabled by default.
* If you are using `ExoPlayer` with `LegacyPlayerView` or `PlayerView`,
this option is enabled by default.
* Otherwise, enable this option by sending `LibvpxVideoRenderer` a message
of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of
`SurfaceView` as its object.
......
# Proguard rules specific to the UI module.
# Constructor method accessed via reflection in StyledPlayerView and LegacyPlayerView
# Constructor method accessed via reflection in PlayerView and LegacyPlayerView
-dontnote androidx.media3.exoplayer.video.spherical.SphericalGLSurfaceView
-keepclassmembers class androidx.media3.exoplayer.video.spherical.SphericalGLSurfaceView {
<init>(android.content.Context);
......
......@@ -158,7 +158,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
* below for more details.
* <ul>
* <li>Corresponding method: None
* <li>Default: {@code R.layout.exo_styled_player_control_view}
* <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}
......@@ -193,7 +193,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
* <h2>Overriding the layout file</h2>
*
* To customize the layout of StyledPlayerControlView throughout your app, or just for certain
* configurations, you can define {@code exo_styled_player_control_view.xml} layout files in your
* configurations, you can define {@code exo_player_control_view.xml} layout files in your
* application {@code res/layout*} directories. But, in this case, you need to be careful since the
* default animation implementation expects certain relative positions between children. See also <a
* href="CustomLayout">Specifying a custom layout file</a>.
......@@ -297,18 +297,18 @@ import java.util.concurrent.CopyOnWriteArrayList;
*
* <h2 id="CustomLayout">Specifying a custom layout file</h2>
*
* Defining your own {@code exo_styled_player_control_view.xml} is useful to customize the layout of
* Defining your own {@code exo_player_control_view.xml} is useful to customize the layout of
* StyledPlayerControlView throughout your application. It's also possible to customize the layout
* for a single instance in a layout file. This is achieved by setting the {@code
* controller_layout_id} attribute on a StyledPlayerControlView. This will cause the specified
* layout to be inflated instead of {@code exo_styled_player_control_view.xml} for only the instance
* on which the attribute is set.
* layout to be inflated instead of {@code exo_player_control_view.xml} for only the instance on
* which the attribute is set.
*
* <p>You need to be careful when you set the {@code controller_layout_id}, because the default
* animation implementation expects certain relative positions between children.
*/
@UnstableApi
public class StyledPlayerControlView extends FrameLayout {
public class PlayerControlView extends FrameLayout {
static {
MediaLibraryInfo.registerModule("media3.ui");
......@@ -426,7 +426,7 @@ public class StyledPlayerControlView extends FrameLayout {
private boolean[] extraPlayedAdGroups;
private long currentWindowOffset;
private StyledPlayerControlViewLayoutManager controlViewLayoutManager;
private PlayerControlViewLayoutManager controlViewLayoutManager;
private Resources resources;
private RecyclerView settingsView;
......@@ -448,15 +448,15 @@ public class StyledPlayerControlView extends FrameLayout {
@Nullable private View playbackSpeedButton;
@Nullable private View audioTrackButton;
public StyledPlayerControlView(Context context) {
public PlayerControlView(Context context) {
this(context, /* attrs= */ null);
}
public StyledPlayerControlView(Context context, @Nullable AttributeSet attrs) {
public PlayerControlView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, /* defStyleAttr= */ 0);
}
public StyledPlayerControlView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
public PlayerControlView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, attrs);
}
......@@ -466,13 +466,13 @@ public class StyledPlayerControlView extends FrameLayout {
"nullness:method.invocation",
"nullness:methodref.receiver.bound"
})
public StyledPlayerControlView(
public PlayerControlView(
Context context,
@Nullable AttributeSet attrs,
int defStyleAttr,
@Nullable AttributeSet playbackAttrs) {
super(context, attrs, defStyleAttr);
int controllerLayoutId = R.layout.exo_styled_player_control_view;
int controllerLayoutId = R.layout.exo_player_control_view;
showTimeoutMs = DEFAULT_SHOW_TIMEOUT_MS;
repeatToggleModes = DEFAULT_REPEAT_TOGGLE_MODES;
timeBarMinUpdateIntervalMs = DEFAULT_TIME_BAR_MIN_UPDATE_INTERVAL_MS;
......@@ -646,7 +646,7 @@ public class StyledPlayerControlView extends FrameLayout {
updateButton(/* enabled= */ false, vrButton);
}
controlViewLayoutManager = new StyledPlayerControlViewLayoutManager(this);
controlViewLayoutManager = new PlayerControlViewLayoutManager(this);
controlViewLayoutManager.setAnimationEnabled(animationEnabled);
String[] settingTexts = new String[2];
......@@ -1767,7 +1767,7 @@ public class StyledPlayerControlView extends FrameLayout {
@Override
public void onClick(View view) {
@Nullable Player player = StyledPlayerControlView.this.player;
@Nullable Player player = PlayerControlView.this.player;
if (player == null) {
return;
}
......
......@@ -31,7 +31,7 @@ import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
/* package */ final class StyledPlayerControlViewLayoutManager {
/* package */ final class PlayerControlViewLayoutManager {
private static final long ANIMATION_INTERVAL_MS = 2_000;
private static final long DURATION_FOR_HIDING_ANIMATION_MS = 250;
private static final long DURATION_FOR_SHOWING_ANIMATION_MS = 250;
......@@ -48,7 +48,7 @@ import java.util.List;
// Int for defining the UX state where the views are being animated to be shown.
private static final int UX_STATE_ANIMATING_SHOW = 4;
private final StyledPlayerControlView playerControlView;
private final PlayerControlView playerControlView;
@Nullable private final View controlsBackground;
@Nullable private final ViewGroup centerControls;
......@@ -84,7 +84,7 @@ import java.util.List;
private boolean animationEnabled;
@SuppressWarnings({"nullness:method.invocation", "nullness:methodref.receiver.bound"})
public StyledPlayerControlViewLayoutManager(StyledPlayerControlView playerControlView) {
public PlayerControlViewLayoutManager(PlayerControlView playerControlView) {
this.playerControlView = playerControlView;
showAllBarsRunnable = this::showAllBars;
hideAllBarsRunnable = this::hideAllBars;
......
......@@ -136,12 +136,12 @@
<ImageButton android:id="@id/exo_prev"
style="@style/ExoStyledControls.Button.Center.Previous"/>
<include layout="@layout/exo_styled_player_control_rewind_button" />
<include layout="@layout/exo_player_control_rewind_button" />
<ImageButton android:id="@id/exo_play_pause"
style="@style/ExoStyledControls.Button.Center.PlayPause"/>
<include layout="@layout/exo_styled_player_control_ffwd_button" />
<include layout="@layout/exo_player_control_ffwd_button" />
<ImageButton android:id="@id/exo_next"
style="@style/ExoStyledControls.Button.Center.Next"/>
......
......@@ -24,7 +24,7 @@
<enum name="zoom" value="4"/>
</attr>
<!-- Must be kept in sync with LegacyPlayerView and StyledPlayerView -->
<!-- Must be kept in sync with LegacyPlayerView and PlayerView -->
<attr name="surface_type" format="enum">
<enum name="none" value="0"/>
<enum name="surface_view" value="1"/>
......@@ -40,7 +40,7 @@
<flag name="all" value="2"/>
</attr>
<!-- LegacyPlayerView and StyledPlayerView attributes -->
<!-- LegacyPlayerView and PlayerView attributes -->
<attr name="use_artwork" format="boolean"/>
<attr name="shutter_background_color" format="color"/>
<attr name="default_artwork" format="reference"/>
......@@ -56,7 +56,7 @@
<attr name="keep_content_on_player_reset" format="boolean"/>
<attr name="player_layout_id" format="reference"/>
<!-- LegacyPlayerControlView and StyledPlayerControlView attributes -->
<!-- LegacyPlayerControlView and PlayerControlView attributes -->
<attr name="show_timeout" format="integer"/>
<attr name="show_rewind_button" format="boolean"/>
<attr name="show_fastforward_button" format="boolean"/>
......@@ -91,7 +91,7 @@
<attr name="ad_marker_color" format="color"/>
<attr name="played_ad_marker_color" format="color"/>
<declare-styleable name="StyledPlayerView">
<declare-styleable name="PlayerView">
<attr name="use_artwork"/>
<attr name="shutter_background_color"/>
<attr name="default_artwork"/>
......@@ -105,7 +105,7 @@
<attr name="surface_type"/>
<!-- AspectRatioFrameLayout attributes -->
<attr name="resize_mode"/>
<!-- StyledPlayerControlView attributes -->
<!-- PlayerControlView attributes -->
<attr name="show_timeout"/>
<attr name="repeat_toggle_modes"/>
<attr name="show_shuffle_button"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment