AdGuard v3.6.45版本的 MD5 值为:ce30a13dcef92cf942973fffcc6d20fb
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.pierfrancescosoffritti.androidyoutubeplayer.core.ui;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import com.pierfrancescosoffritti.androidyoutubeplayer.R;
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.PlayerConstants;
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.LegacyYouTubePlayerView;
import com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.views.YouTubePlayerSeekBar;
import kotlin.b.b.j;
public final class a implements com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a.c, com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a.d, com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.c, com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.views.b {
com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.a.b f1080a;
final ImageView b;
final ImageView c;
final ImageView d;
final YouTubePlayerSeekBar e;
View.OnClickListener f;
View.OnClickListener g;
final com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.b.a h;
boolean i;
final LegacyYouTubePlayerView j;
final com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a k;
private final View l;
private final View m;
private final LinearLayout n;
private final TextView o;
private final TextView p;
private final ProgressBar q;
private final ImageView r;
private final ImageView s;
private final ImageView t;
private boolean u;
private boolean v;
private boolean w;
static final class View$OnClickListenerC0076a implements View.OnClickListener {
View$OnClickListenerC0076a() {
}
@Override
public final void onClick(View view) {
com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.b.a aVar = a.this.h;
aVar.a(aVar.f1093a ? 0.0f : 1.0f);
}
}
static final class b implements View.OnClickListener {
b() {
}
@Override
public final void onClick(View view) {
a aVar = a.this;
if (aVar.i) {
aVar.k.pause();
} else {
aVar.k.play();
}
}
}
static final class c implements View.OnClickListener {
c() {
}
@Override
public final void onClick(View view) {
a.this.f.onClick(a.this.d);
}
}
static final class d implements View.OnClickListener {
d() {
}
@Override
public final void onClick(View view) {
a.this.g.onClick(a.this.b);
}
}
static final class e implements View.OnClickListener {
final String b;
e(String str) {
this.b = str;
}
@Override
public final void onClick(View view) {
try {
a.this.c.getContext().startActivity(new Intent("android.intent.action.VIEW", Uri.parse("http://www.youtube.com/watch?v=" + this.b + "#t=" + a.this.e.getSeekBar().getProgress())));
} catch (Exception e) {
String simpleName = a.this.getClass().getSimpleName();
String message = e.getMessage();
if (message == null) {
message = "Can't open url to YouTube";
}
Log.e(simpleName, message);
}
}
}
public a(LegacyYouTubePlayerView legacyYouTubePlayerView, com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a aVar) {
j.b(legacyYouTubePlayerView, "youTubePlayerView");
j.b(aVar, "youTubePlayer");
this.j = legacyYouTubePlayerView;
this.k = aVar;
this.u = true;
View inflate = View.inflate(legacyYouTubePlayerView.getContext(), R.d.ayp_default_player_ui, this.j);
Context context = this.j.getContext();
j.a((Object) context, "youTubePlayerView.context");
this.f1080a = new com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.a.a.a(context);
View findViewById = inflate.findViewById(R.c.panel);
j.a((Object) findViewById, "controlsView.findViewById(R.id.panel)");
this.l = findViewById;
View findViewById2 = inflate.findViewById(R.c.controls_container);
j.a((Object) findViewById2, "controlsView.findViewById(R.id.controls_container)");
this.m = findViewById2;
View findViewById3 = inflate.findViewById(R.c.extra_views_container);
j.a((Object) findViewById3, "controlsView.findViewByI…id.extra_views_container)");
this.n = (LinearLayout) findViewById3;
View findViewById4 = inflate.findViewById(R.c.video_title);
j.a((Object) findViewById4, "controlsView.findViewById(R.id.video_title)");
this.o = (TextView) findViewById4;
View findViewById5 = inflate.findViewById(R.c.live_video_indicator);
j.a((Object) findViewById5, "controlsView.findViewByI….id.live_video_indicator)");
this.p = (TextView) findViewById5;
View findViewById6 = inflate.findViewById(R.c.progress);
j.a((Object) findViewById6, "controlsView.findViewById(R.id.progress)");
this.q = (ProgressBar) findViewById6;
View findViewById7 = inflate.findViewById(R.c.menu_button);
j.a((Object) findViewById7, "controlsView.findViewById(R.id.menu_button)");
this.b = (ImageView) findViewById7;
View findViewById8 = inflate.findViewById(R.c.play_pause_button);
j.a((Object) findViewById8, "controlsView.findViewById(R.id.play_pause_button)");
this.r = (ImageView) findViewById8;
View findViewById9 = inflate.findViewById(R.c.youtube_button);
j.a((Object) findViewById9, "controlsView.findViewById(R.id.youtube_button)");
this.c = (ImageView) findViewById9;
View findViewById10 = inflate.findViewById(R.c.fullscreen_button);
j.a((Object) findViewById10, "controlsView.findViewById(R.id.fullscreen_button)");
this.d = (ImageView) findViewById10;
View findViewById11 = inflate.findViewById(R.c.custom_action_left_button);
j.a((Object) findViewById11, "controlsView.findViewByI…ustom_action_left_button)");
this.s = (ImageView) findViewById11;
View findViewById12 = inflate.findViewById(R.c.custom_action_right_button);
j.a((Object) findViewById12, "controlsView.findViewByI…stom_action_right_button)");
this.t = (ImageView) findViewById12;
View findViewById13 = inflate.findViewById(R.c.youtube_player_seekbar);
j.a((Object) findViewById13, "controlsView.findViewByI…d.youtube_player_seekbar)");
this.e = (YouTubePlayerSeekBar) findViewById13;
this.h = new com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.b.a(this.m);
this.f = new View.OnClickListener() {
@Override
public final void onClick(View view) {
a.this.j.toggleFullScreen();
}
};
this.g = new View.OnClickListener() {
@Override
public final void onClick(View view) {
a.this.f1080a.a(a.this.b);
}
};
this.k.addListener(this.e);
this.k.addListener(this.h);
this.e.setYoutubePlayerSeekBarListener(this);
this.l.setOnClickListener(new View$OnClickListenerC0076a());
this.r.setOnClickListener(new b());
this.d.setOnClickListener(new c());
this.b.setOnClickListener(new d());
}
private final void g(boolean z) {
this.r.setImageResource(z ? R.drawable.ayp_ic_pause_36dp : R.drawable.ayp_ic_play_36dp);
}
@Override
public final com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.c a(boolean z) {
this.e.setVisibility(z ? 4 : 0);
this.p.setVisibility(z ? 0 : 8);
return this;
}
@Override
public final void a() {
this.d.setImageResource(R.drawable.ayp_ic_fullscreen_exit_24dp);
}
@Override
public final void a(float f) {
this.k.seekTo(f);
}
@Override
public final com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.c b(boolean z) {
this.e.getVideoCurrentTimeTextView().setVisibility(z ? 0 : 8);
return this;
}
@Override
public final void b() {
this.d.setImageResource(R.drawable.ayp_ic_fullscreen_24dp);
}
@Override
public final com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.c c() {
this.o.setVisibility(0);
return this;
}
@Override
public final com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.c c(boolean z) {
this.e.getVideoDurationTextView().setVisibility(z ? 0 : 8);
return this;
}
@Override
public final com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.c d() {
this.b.setVisibility(8);
return this;
}
@Override
public final com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.c d(boolean z) {
this.e.getSeekBar().setVisibility(z ? 0 : 4);
return this;
}
@Override
public final com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.c e(boolean z) {
this.c.setVisibility(z ? 0 : 8);
return this;
}
@Override
public final com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.c f(boolean z) {
this.d.setVisibility(z ? 0 : 8);
return this;
}
@Override
public final void onApiChange(com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a aVar) {
j.b(aVar, "youTubePlayer");
}
@Override
public final void onCurrentSecond(com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a aVar, float f) {
j.b(aVar, "youTubePlayer");
}
@Override
public final void onError(com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a aVar, PlayerConstants.PlayerError playerError) {
j.b(aVar, "youTubePlayer");
j.b(playerError, "error");
}
@Override
public final void onPlaybackQualityChange(com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a aVar, PlayerConstants.PlaybackQuality playbackQuality) {
j.b(aVar, "youTubePlayer");
j.b(playbackQuality, "playbackQuality");
}
@Override
public final void onPlaybackRateChange(com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a aVar, PlayerConstants.PlaybackRate playbackRate) {
j.b(aVar, "youTubePlayer");
j.b(playbackRate, "playbackRate");
}
@Override
public final void onReady(com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a aVar) {
j.b(aVar, "youTubePlayer");
}
@Override
public final void onStateChange(com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a aVar, PlayerConstants.PlayerState playerState) {
j.b(aVar, "youTubePlayer");
j.b(playerState, "state");
int i = com.pierfrancescosoffritti.androidyoutubeplayer.core.ui.b.f1092a[playerState.ordinal()];
if (i == 1) {
this.i = false;
} else if (i == 2) {
this.i = false;
} else if (i == 3) {
this.i = true;
}
g(!this.i);
if (playerState == PlayerConstants.PlayerState.PLAYING || playerState == PlayerConstants.PlayerState.PAUSED || playerState == PlayerConstants.PlayerState.VIDEO_CUED) {
View view = this.l;
view.setBackgroundColor(ContextCompat.getColor(view.getContext(), 17170445));
this.q.setVisibility(8);
if (this.u) {
this.r.setVisibility(0);
}
if (this.v) {
this.s.setVisibility(0);
}
if (this.w) {
this.t.setVisibility(0);
}
g(playerState == PlayerConstants.PlayerState.PLAYING);
return;
}
g(false);
if (playerState == PlayerConstants.PlayerState.BUFFERING) {
this.q.setVisibility(0);
View view2 = this.l;
view2.setBackgroundColor(ContextCompat.getColor(view2.getContext(), 17170445));
if (this.u) {
this.r.setVisibility(4);
}
this.s.setVisibility(8);
this.t.setVisibility(8);
}
if (playerState == PlayerConstants.PlayerState.UNSTARTED) {
this.q.setVisibility(8);
if (this.u) {
this.r.setVisibility(0);
}
}
}
@Override
public final void onVideoDuration(com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a aVar, float f) {
j.b(aVar, "youTubePlayer");
}
@Override
public final void onVideoId(com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a aVar, String str) {
j.b(aVar, "youTubePlayer");
j.b(str, "videoId");
this.c.setOnClickListener(new e(str));
}
@Override
public final void onVideoLoadedFraction(com.pierfrancescosoffritti.androidyoutubeplayer.core.player.a aVar, float f) {
j.b(aVar, "youTubePlayer");
}
}