chore(android): fix various warnings (#3810)

* chore: add missing annotation
* chore: remove unused import
* chore: add final on members
* chore: remove unused
* chore: add missing annotations
* chore: remove unused
* chore: replace switch by if
* chore: simplify lamba declaration
* chore: more beautifull declaration
* chore: rename variable considered as a typo
* chore: remove deprecated & avoid multiple calls to the same function
This commit is contained in:
Olivier Bouillet
2024-05-22 14:02:55 +02:00
committed by GitHub
parent cad5c4624c
commit d987525b6d
5 changed files with 53 additions and 64 deletions

View File

@@ -1,6 +1,8 @@
package com.brentvatne.exoplayer;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.media3.common.AdViewProvider;
import androidx.media3.common.C;
@@ -209,16 +211,6 @@ public final class ExoPlayerView extends FrameLayout implements AdViewProvider {
}
}
/**
* Get the view onto which video is rendered. This is either a {@link SurfaceView} (default)
* or a {@link TextureView} if the {@code use_texture_view} view attribute has been set to true.
*
* @return either a {@link SurfaceView} or a {@link TextureView}.
*/
public View getVideoSurfaceView() {
return surfaceView;
}
public void setUseTextureView(boolean useTextureView) {
if (useTextureView != this.useTextureView) {
this.useTextureView = useTextureView;
@@ -272,7 +264,7 @@ public final class ExoPlayerView extends FrameLayout implements AdViewProvider {
private final class ComponentListener implements Player.Listener {
@Override
public void onCues(List<Cue> cues) {
public void onCues(@NonNull List<Cue> cues) {
subtitleLayout.setCues(cues);
}
@@ -298,7 +290,7 @@ public final class ExoPlayerView extends FrameLayout implements AdViewProvider {
}
@Override
public void onTracksChanged(Tracks tracks) {
public void onTracksChanged(@NonNull Tracks tracks) {
updateForCurrentTrackSelections(tracks);
}
}