CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 NextPlayAdapter.java 源代码,内容仅作参考
package org.godfootsteps.video.player;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.ViewFlipper;
import androidx.fragment.app.FragmentActivity;
import carbon.custom.ExpandTextView;
import carbon.custom.RotateButton;
import com.blankj.utilcode.util.NetworkUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView;
import d.c.i.d;
import d.c.k.t0.v;
import e.q.j;
import i.c.a.c.m0;
import i.c.a.c.n0;
import i.c.a.c.w;
import i.c.a.c.y;
import java.util.Objects;
import java.util.regex.Pattern;
import k.a.a.a.a;
import kotlin.Metadata;
import n.e;
import n.i.b.h;
import org.commons.screenadapt.recyclerview.FastScreenListAdapter;
import org.commons.screenadapt.recyclerview.ScreenViewHolder;
import org.commons.sharedialog.ShareBottomDialog;
import org.godfootsteps.arch.api.model.NewsReadData;
import org.godfootsteps.arch.customSystemViews.CustomThumbnailView;
import org.godfootsteps.arch.dialog.AlertDialogBuilder;
import org.godfootsteps.arch.util.GAEventSendUtil;
import org.godfootsteps.router.model.Video;
import org.godfootsteps.video.R$dimen;
import org.godfootsteps.video.R$drawable;
import org.godfootsteps.video.R$id;
import org.godfootsteps.video.R$layout;
import org.godfootsteps.video.R$string;
import org.godfootsteps.video.helper.VideoAddToSheetDialog;
import org.godfootsteps.video.player.NextPlayAdapter;
@Metadata(d1 = {"\u0000T\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0016\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0019\u0012\b\b\u0002\u0010\u0003\u001a\u00020\u0004\u0012\b\b\u0002\u0010\u0005\u001a\u00020\u0006¢\u0006\u0002\u0010\u0007J\u000f\u0010&\u001a\u0004\u0018\u00010'H\u0014¢\u0006\u0002\u0010(J\b\u0010)\u001a\u00020'H\u0016J\b\u0010*\u001a\u00020'H\u0014J\u0006\u0010+\u001a\u00020,J\u001a\u0010-\u001a\u00020,2\b\u0010.\u001a\u0004\u0018\u00010/2\u0006\u00100\u001a\u00020\u0002H\u0014J\u0010\u00101\u001a\u00020,2\u0006\u0010.\u001a\u00020/H\u0014J\u0006\u00102\u001a\u00020,J\u0016\u00103\u001a\u00020,2\u0006\u00104\u001a\u00020\u00022\u0006\u00105\u001a\u000206J\u000e\u00107\u001a\u00020,2\u0006\u00108\u001a\u00020\u0004R\u001c\u0010\b\u001a\u0004\u0018\u00010\u0002X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\t\u0010\n\"\u0004\b\u000b\u0010\fR\u001c\u0010\r\u001a\u0004\u0018\u00010\u000eX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000f\u0010\u0010\"\u0004\b\u0011\u0010\u0012R\u001a\u0010\u0013\u001a\u00020\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0013\u0010\u0014\"\u0004\b\u0015\u0010\u0016R\u001a\u0010\u0003\u001a\u00020\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0003\u0010\u0014\"\u0004\b\u0017\u0010\u0016R\u001a\u0010\u0018\u001a\u00020\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0018\u0010\u0014\"\u0004\b\u0019\u0010\u0016R\u0010\u0010\u001a\u001a\u0004\u0018\u00010\u001bX\u0082\u000e¢\u0006\u0002\n\u0000R\u001a\u0010\u0005\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u001c\u0010\u001d\"\u0004\b\u001e\u0010\u001fR\u001a\u0010 \u001a\u00020!X\u0086.¢\u0006\u000e\n\u0000\u001a\u0004\b\"\u0010#\"\u0004\b$\u0010%¨\u00069"}, d2 = {"Lorg/godfootsteps/video/player/NextPlayAdapter;", "Lorg/commons/screenadapt/recyclerview/FastScreenListAdapter;", "Lorg/godfootsteps/router/model/Video;", "isLand", "", "upNextStr", "", "(ZLjava/lang/String;)V", "headItem", "getHeadItem", "()Lorg/godfootsteps/router/model/Video;", "setHeadItem", "(Lorg/godfootsteps/router/model/Video;)V", "headView", "Landroid/view/ViewGroup;", "getHeadView", "()Landroid/view/ViewGroup;", "setHeadView", "(Landroid/view/ViewGroup;)V", "isExpand", "()Z", "setExpand", "(Z)V", "setLand", "isShowList", "setShowList", "shareDialog", "Lorg/commons/sharedialog/ShareBottomDialog;", "getUpNextStr", "()Ljava/lang/String;", "setUpNextStr", "(Ljava/lang/String;)V", "videoAddToHelper", "Lorg/godfootsteps/video/helper/VideoAddToHelper;", "getVideoAddToHelper", "()Lorg/godfootsteps/video/helper/VideoAddToHelper;", "setVideoAddToHelper", "(Lorg/godfootsteps/video/helper/VideoAddToHelper;)V", "getHeaderLayoutId", "", "()Ljava/lang/Integer;", "getItemCount", "getLayoutId", "onBackPress", "", "onBind", "holder", "Lorg/commons/screenadapt/recyclerview/ScreenViewHolder;", "item", "onBindHeader", "onConfigurationChanged", "setHead", "video", "fragment", "Lorg/godfootsteps/video/player/BottomFragment;", "showList", "isShow", "video_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public class NextPlayAdapter extends FastScreenListAdapter<Video> {
public boolean b;
public String c;
public v f16313d;
public ShareBottomDialog f16314e;
public Video f16315f;
public ViewGroup f16316g;
public boolean f16317h;
public boolean f16318i;
public NextPlayAdapter() {
this(false, null, 3);
}
public NextPlayAdapter(boolean z, String str, int i2) {
super(null, 1);
z = (i2 & 1) != 0 ? false : z;
if ((i2 & 2) != 0) {
str = w.c().getString(R$string.video_next_play);
h.d(str, "activityOrAppContext.getString(resId)");
}
h.e(str, "upNextStr");
this.b = z;
this.c = str;
this.f16317h = true;
}
@Override
public Integer f() {
Integer valueOf = Integer.valueOf(R$layout.item_player_video_header);
valueOf.intValue();
if ((this.b || this.f16315f == null) ? false : true) {
return valueOf;
}
return null;
}
@Override
public int g() {
Integer valueOf = Integer.valueOf(R$layout.item_thumbnail_title);
valueOf.intValue();
if (!d.c.a.j.v.j()) {
valueOf = null;
}
return valueOf == null ? R$layout.item_video_tb : valueOf.intValue();
}
@Override
public int getItemCount() {
return this.f16317h ? super.getItemCount() : f() != null ? 1 : 0;
}
@Override
public void j(ScreenViewHolder screenViewHolder) {
d dVar;
h.e(screenViewHolder, "holder");
final View view = screenViewHolder.itemView;
this.f16316g = (ViewGroup) view;
int i2 = R$id.tv_next_play;
((TextView) view.findViewById(i2)).setText(this.c);
if (this.f16317h) {
TextView textView = (TextView) view.findViewById(i2);
h.d(textView, "tv_next_play");
n0.t(textView);
LinearLayout linearLayout = (LinearLayout) view.findViewById(R$id.ll_chat);
h.d(linearLayout, "ll_chat");
n0.p(linearLayout, 0);
} else {
TextView textView2 = (TextView) view.findViewById(i2);
h.d(textView2, "tv_next_play");
n0.c(textView2, false, 1);
LinearLayout linearLayout2 = (LinearLayout) view.findViewById(R$id.ll_chat);
h.d(linearLayout2, "ll_chat");
n0.p(linearLayout2, y.E(56.0f));
}
if ((m0.c() instanceof j) && (dVar = (d) a.b(d.class)) != null) {
Activity c = m0.c();
Objects.requireNonNull(c, "null cannot be cast to non-null type androidx.lifecycle.LifecycleOwner");
LinearLayout linearLayout3 = (LinearLayout) view.findViewById(R$id.ll_chat);
h.d(linearLayout3, "ll_chat");
View findViewById = view.findViewById(R$id.divider_chat);
h.d(findViewById, "divider_chat");
dVar.e((j) c, linearLayout3, findViewById, null);
}
((ImageView) view.findViewById(R$id.iv_share)).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
final NextPlayAdapter nextPlayAdapter = NextPlayAdapter.this;
View view3 = view;
n.i.b.h.e(nextPlayAdapter, "this$0");
n.i.b.h.e(view3, "$this_apply");
nextPlayAdapter.f16314e = n.m.t.a.p.m.e1.a.u2(new n.i.a.a<String>() {
{
super(0);
}
@Override
public final String invoke() {
NewsReadData.PostBean post;
String share;
Activity c2 = m0.c();
if (c2 instanceof NewsVideoActivity) {
NewsReadData newsReadData = ((NewsVideoActivity) c2).f16312r;
return (newsReadData == null || (post = newsReadData.getPost()) == null || (share = post.getShare()) == null) ? "" : share;
}
Video video = NextPlayAdapter.this.f16315f;
h.c(video);
String id = video.getId();
h.d(id, "headItem!!.id");
h.e(id, "<this>");
boolean z = true;
if (!n.o.a.B(id, "Vimeo_", true) && !Pattern.matches("^[0-9]+$", id)) {
z = false;
}
if (z) {
Video video2 = NextPlayAdapter.this.f16315f;
h.c(video2);
return h.j("https://vimeo.com/", video2.getId());
}
Video video3 = NextPlayAdapter.this.f16315f;
h.c(video3);
return h.j("https://youtu.be/", video3.getId());
}
});
GAEventSendUtil.Companion companion = GAEventSendUtil.a;
String obj = ((TextView) view3.findViewById(R$id.tv_video_title)).getText().toString();
Bundle bundle = new Bundle();
i.a.b.a.a.x0(bundle, "语言", "名称", obj).a.zzx("视频分享", bundle);
}
});
int i3 = R$id.ll_video_title;
((LinearLayout) view.findViewById(i3)).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
View view3 = view;
NextPlayAdapter nextPlayAdapter = this;
n.i.b.h.e(view3, "$this_apply");
n.i.b.h.e(nextPlayAdapter, "this$0");
((RotateButton) view3.findViewById(R$id.rb_btn)).toggle();
ExpandTextView expandTextView = (ExpandTextView) view3.findViewById(R$id.tv_video_description);
ValueAnimator valueAnimator = expandTextView.f1876u;
if (valueAnimator != null && expandTextView.f1874s) {
valueAnimator.cancel();
}
if (expandTextView.getMaxLines() != expandTextView.f1870o) {
expandTextView.a();
} else {
expandTextView.b();
}
nextPlayAdapter.f16318i = !nextPlayAdapter.f16318i;
}
});
Video video = this.f16315f;
h.c(video);
((TextView) view.findViewById(R$id.tv_video_title)).setText(video.getTitle());
Video video2 = this.f16315f;
h.c(video2);
String viewCount = video2.getViewCount();
if (viewCount == null || viewCount.length() == 0) {
TextView textView3 = (TextView) view.findViewById(R$id.tv_video_count);
h.d(textView3, "tv_video_count");
n0.c(textView3, false, 1);
TextView textView4 = (TextView) view.findViewById(R$id.tv_video_publish_date);
h.d(textView4, "tv_video_publish_date");
n0.m(textView4, (int) w.c().getResources().getDimension(R$dimen.dp16_12_x));
} else {
TextView textView5 = (TextView) view.findViewById(R$id.tv_video_publish_date);
h.d(textView5, "tv_video_publish_date");
n0.m(textView5, (int) w.c().getResources().getDimension(R$dimen.dp12_16_x));
int i4 = R$id.tv_video_count;
Video video3 = this.f16315f;
h.c(video3);
((TextView) view.findViewById(i4)).setText(video3.getViewCount());
TextView textView6 = (TextView) view.findViewById(i4);
h.d(textView6, "tv_video_count");
n0.t(textView6);
}
Video video4 = this.f16315f;
h.c(video4);
((TextView) view.findViewById(R$id.tv_video_publish_date)).setText(video4.getPublishedDate());
Video video5 = this.f16315f;
h.c(video5);
String description = video5.getDescription();
String obj = description != null ? n.o.a.M(description).toString() : null;
if (obj == null || obj.length() == 0) {
ViewFlipper viewFlipper = (ViewFlipper) view.findViewById(R$id.vp_description);
h.d(viewFlipper, "vp_description");
n0.c(viewFlipper, false, 1);
RotateButton rotateButton = (RotateButton) view.findViewById(R$id.rb_btn);
h.d(rotateButton, "rb_btn");
n0.c(rotateButton, false, 1);
View findViewById2 = view.findViewById(R$id.divider_description);
h.d(findViewById2, "divider_description");
n0.c(findViewById2, false, 1);
LinearLayout linearLayout4 = (LinearLayout) view.findViewById(i3);
h.d(linearLayout4, "ll_video_title");
n0.q(linearLayout4, (int) w.c().getResources().getDimension(R$dimen.dp16_12_x));
} else {
ViewFlipper viewFlipper2 = (ViewFlipper) view.findViewById(R$id.vp_description);
h.d(viewFlipper2, "vp_description");
n0.t(viewFlipper2);
RotateButton rotateButton2 = (RotateButton) view.findViewById(R$id.rb_btn);
h.d(rotateButton2, "rb_btn");
n0.t(rotateButton2);
View findViewById3 = view.findViewById(R$id.divider_description);
h.d(findViewById3, "divider_description");
n0.t(findViewById3);
((LinearLayout) view.findViewById(i3)).setPaddingRelative((int) w.c().getResources().getDimension(R$dimen.dp16_12_x), 0, 0, 0);
}
Video video6 = this.f16315f;
h.c(video6);
final String j2 = n.m.t.a.p.m.e1.a.j(video6.getDescription());
int i5 = R$id.tv_video_description;
((ExpandTextView) view.findViewById(i5)).setText(j2);
((TextView) view.findViewById(R$id.tv_video_description_full)).setText(j2);
((ViewFlipper) view.findViewById(R$id.vp_description)).setDisplayedChild(this.f16318i ? 1 : 0);
((ExpandTextView) view.findViewById(i5)).setStarExpandAnimListener(new n.i.a.a<e>() {
{
super(0);
}
@Override
public e invoke() {
invoke2();
return e.a;
}
public final void invoke2() {
((ViewFlipper) view.findViewById(R$id.vp_description)).setDisplayedChild(1);
}
});
((ExpandTextView) view.findViewById(i5)).setAnimEndListener(new n.i.a.a<e>() {
{
super(0);
}
@Override
public e invoke() {
invoke2();
return e.a;
}
public final void invoke2() {
if (((ExpandTextView) view.findViewById(R$id.tv_video_description)).y) {
return;
}
((ViewFlipper) view.findViewById(R$id.vp_description)).setDisplayedChild(0);
TextView textView7 = (TextView) view.findViewById(R$id.tv_video_description_full);
String str = j2;
r2.intValue();
r2 = d.c.a.j.v.j() ? 3 : null;
n.m.t.a.p.m.e1.a.n2(textView7, str, r2 == null ? 5 : r2.intValue());
}
});
n.i.a.a<e> animEndListener = ((ExpandTextView) view.findViewById(i5)).getAnimEndListener();
if (animEndListener != null) {
animEndListener.invoke();
}
if (this.f16318i) {
((ExpandTextView) view.findViewById(i5)).b();
} else {
((ExpandTextView) view.findViewById(i5)).a();
}
((RotateButton) view.findViewById(R$id.rb_btn)).setExpand(this.f16318i);
((ImageView) view.findViewById(R$id.iv_add)).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
YouTubePlayerView I;
i.p.a.a.a.a youtubePlayer;
NextPlayAdapter nextPlayAdapter = NextPlayAdapter.this;
n.i.b.h.e(nextPlayAdapter, "this$0");
final d.c.k.t0.v l2 = nextPlayAdapter.l();
Video video7 = nextPlayAdapter.f16315f;
n.i.b.h.c(video7);
String id = video7.getId();
if (id == null) {
id = "";
}
if (d.c.a.j.v.i()) {
int f0 = i.c.a.c.y.f0();
int e0 = i.c.a.c.y.e0();
int E = i.c.a.c.y.z0() ? (int) (e0 * 0.62d) : i.c.a.c.y.E(500.0f);
int min = (int) (Math.min(f0, e0) * 0.73d);
boolean z = false;
AlertDialogBuilder alertDialogBuilder = new AlertDialogBuilder(l2.a, 0, 2);
alertDialogBuilder.f15256n = E;
alertDialogBuilder.f15257o = min;
alertDialogBuilder.f15263u = Integer.valueOf(R$drawable.bg_dialog_round);
Activity activity = l2.a;
n.i.b.h.c(id);
alertDialogBuilder.f98i.f94t = d.c.a.m.a.x(activity, l2, id);
l2.f7130d = alertDialogBuilder.a();
YouTubePlayerView I2 = l2.b.I();
n.i.b.h.c(I2);
String videoId = I2.getVideoId();
n.i.b.h.e(videoId, "<this>");
if (!((n.o.a.B(videoId, "Vimeo_", true) || Pattern.matches("^[0-9]+$", videoId)) ? true : true) && (I = l2.b.I()) != null && (youtubePlayer = I.getYoutubePlayer()) != null) {
youtubePlayer.pause();
}
} else {
Activity activity2 = l2.a;
n.i.b.h.c(id);
l2.f7130d = new VideoAddToSheetDialog(activity2, l2, id);
}
Dialog dialog = l2.f7130d;
n.i.b.h.c(dialog);
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public final void onDismiss(DialogInterface dialogInterface) {
v vVar = v.this;
n.i.b.h.e(vVar, "this$0");
vVar.b.f16289n.a = false;
}
});
Dialog dialog2 = l2.f7130d;
n.i.b.h.c(dialog2);
dialog2.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public final void onCancel(DialogInterface dialogInterface) {
v vVar = v.this;
n.i.b.h.e(vVar, "this$0");
vVar.b.f16289n.a = false;
}
});
Dialog dialog3 = l2.f7130d;
n.i.b.h.c(dialog3);
dialog3.show();
l2.b.f16289n.a = true;
}
});
}
public final v l() {
v vVar = this.f16313d;
if (vVar != null) {
return vVar;
}
h.l("videoAddToHelper");
throw null;
}
@Override
public void i(final ScreenViewHolder screenViewHolder, Video video) {
h.e(video, "item");
h.c(screenViewHolder);
int i2 = R$id.iv_thumbnail;
h.e(screenViewHolder, "<this>");
CustomThumbnailView customThumbnailView = (CustomThumbnailView) screenViewHolder.itemView.findViewById(i2);
String thumbnailURL = video.getThumbnailURL();
if (thumbnailURL == null) {
thumbnailURL = "";
}
customThumbnailView.e(thumbnailURL, R$drawable.ic_video_default, (r14 & 4) != 0 ? -1 : 0, (r14 & 8) != 0 ? -1 : 0, (r14 & 16) != 0 ? false : true);
customThumbnailView.setDuration(video.getDuration());
int i3 = R$id.tv_title;
h.e(screenViewHolder, "<this>");
((TextView) screenViewHolder.itemView.findViewById(i3)).setText(video.getTitle());
screenViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
NextPlayAdapter nextPlayAdapter = NextPlayAdapter.this;
ScreenViewHolder screenViewHolder2 = screenViewHolder;
n.i.b.h.e(nextPlayAdapter, "this$0");
if (!NetworkUtils.c()) {
ToastUtils.b(R$string.app_no_internet);
} else if (m0.c() instanceof y) {
Activity c = m0.c();
Objects.requireNonNull(c, "null cannot be cast to non-null type org.godfootsteps.video.player.INextPlay");
((y) c).n(nextPlayAdapter.b ? screenViewHolder2.getLayoutPosition() : Math.max(0, screenViewHolder2.getLayoutPosition() - 1));
}
}
});
}
public final void n(Video video, BottomFragment bottomFragment) {
h.e(video, "video");
h.e(bottomFragment, "fragment");
FragmentActivity requireActivity = bottomFragment.requireActivity();
h.d(requireActivity, "fragment.requireActivity()");
v vVar = new v(requireActivity, bottomFragment);
h.e(vVar, "<set-?>");
this.f16313d = vVar;
this.f16315f = video;
this.f16318i = false;
notifyItemChanged(0);
}
public final void o(boolean z) {
if (this.f16317h == z) {
return;
}
ViewGroup viewGroup = this.f16316g;
if (viewGroup != null) {
if (z) {
TextView textView = (TextView) viewGroup.findViewById(R$id.tv_next_play);
h.d(textView, "tv_next_play");
n0.t(textView);
LinearLayout linearLayout = (LinearLayout) viewGroup.findViewById(R$id.ll_chat);
h.d(linearLayout, "ll_chat");
n0.p(linearLayout, 0);
} else {
TextView textView2 = (TextView) viewGroup.findViewById(R$id.tv_next_play);
h.d(textView2, "tv_next_play");
n0.c(textView2, false, 1);
LinearLayout linearLayout2 = (LinearLayout) viewGroup.findViewById(R$id.ll_chat);
h.d(linearLayout2, "ll_chat");
n0.p(linearLayout2, y.E(56.0f));
}
}
if (z) {
notifyItemInserted(0);
} else if (getItemCount() > 1) {
notifyItemRangeRemoved(1, getItemCount() - 1);
}
this.f16317h = z;
}
public NextPlayAdapter(boolean z, String str) {
super(null, 1);
h.e(str, "upNextStr");
this.b = z;
this.c = str;
this.f16317h = true;
}
}