CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 NewsVideoActivity.java 源代码,内容仅作参考
package org.godfootsteps.video.player;
import android.app.Activity;
import android.content.Intent;
import android.text.Html;
import android.text.Spannable;
import android.view.View;
import android.widget.TextView;
import carbon.custom.LoadingLayout;
import com.blankj.utilcode.util.NetworkUtils;
import com.blankj.utilcode.util.ToastUtils;
import d.c.a.j.z;
import d.c.k.u0.a0;
import d.c.k.u0.y;
import i.c.a.c.m0;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.regex.Pattern;
import kotlin.Metadata;
import n.e;
import n.f.g;
import n.i.a.l;
import n.i.b.h;
import n.m.t.a.p.m.e1.a;
import org.godfootsteps.arch.api.model.HomeNormalModel;
import org.godfootsteps.arch.api.model.NewsReadData;
import org.godfootsteps.arch.videoApi.VideoClient;
import org.godfootsteps.router.model.Video;
import org.godfootsteps.video.R$anim;
import org.godfootsteps.video.R$id;
import org.godfootsteps.video.R$string;
import org.godfootsteps.video.player.NewsVideoActivity;
@Metadata(d1 = {"\u0000D\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0007\n\u0002\u0010\b\n\u0002\b\u0003\u0018\u0000 #2\u00020\u00012\u00020\u0002:\u0001#B\u0005¢\u0006\u0002\u0010\u0003J\t\u0010\u0016\u001a\u00020\u0017H\u0096\u0001J\t\u0010\u0018\u001a\u00020\u0019H\u0096\u0001J\u0011\u0010\u001a\u001a\u00020\u00172\u0006\u0010\u001b\u001a\u00020\u0013H\u0096\u0001J\b\u0010\u001c\u001a\u00020\u0017H\u0014J\b\u0010\u001d\u001a\u00020\u0019H\u0014J\t\u0010\u001e\u001a\u00020\u0017H\u0096\u0001J\u0011\u0010\u001f\u001a\u00020\u00172\u0006\u0010 \u001a\u00020!H\u0096\u0001J\b\u0010\"\u001a\u00020\u0017H\u0014R\u001a\u0010\u0004\u001a\u0004\u0018\u00010\u0005X\u0096\u000f¢\u0006\f\u001a\u0004\b\u0006\u0010\u0007\"\u0004\b\b\u0010\tR\u0010\u0010\n\u001a\u0004\u0018\u00010\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u001a\u0010\f\u001a\u0004\u0018\u00010\rX\u0096\u000f¢\u0006\f\u001a\u0004\b\u000e\u0010\u000f\"\u0004\b\u0010\u0010\u0011R\u0011\u0010\u0012\u001a\u00020\u00138F¢\u0006\u0006\u001a\u0004\b\u0014\u0010\u0015¨\u0006$"}, d2 = {"Lorg/godfootsteps/video/player/NewsVideoActivity;", "Lorg/godfootsteps/video/player/BaseVideoPlayerActivity;", "Lorg/godfootsteps/video/player/INextPlay;", "()V", "dataLoadListener", "Lorg/godfootsteps/video/player/OnDataLoad;", "getDataLoadListener", "()Lorg/godfootsteps/video/player/OnDataLoad;", "setDataLoadListener", "(Lorg/godfootsteps/video/player/OnDataLoad;)V", "newsReadData", "Lorg/godfootsteps/arch/api/model/NewsReadData;", "playNextParams", "Landroid/os/Bundle;", "getPlayNextParams", "()Landroid/os/Bundle;", "setPlayNextParams", "(Landroid/os/Bundle;)V", "shareUrl", "", "getShareUrl", "()Ljava/lang/String;", "autoPlayNext", "", "haveNext", "", "initPlayNext", "videoId", "initView", "isSingleVideo", "loadMore", "playNext", "pos", "", "reloadData", "Companion", "video_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class NewsVideoActivity extends BaseVideoPlayerActivity implements y {
public static final int f16310s = 0;
public final NewsNextPlay f16311q = new NewsNextPlay();
public NewsReadData f16312r;
public static final void h0(String str, String str2) {
h.e(str, "id");
h.e(str2, "videoId");
if (Math.abs(System.currentTimeMillis() - ListVideoPlayerActivity.f16303r) < 750) {
return;
}
ListVideoPlayerActivity.f16303r = System.currentTimeMillis();
if (!NetworkUtils.c()) {
ToastUtils.b(R$string.app_no_internet);
return;
}
Activity c = m0.c();
if (c == null) {
return;
}
Intent intent = new Intent(c, NewsVideoActivity.class);
intent.setFlags(67108864);
intent.putExtra("id", str);
intent.putExtra("videoId", str2);
c.startActivity(intent);
c.overridePendingTransition(R$anim.anim_slide_in_down, 0);
}
@Override
public void H() {
Objects.requireNonNull(this.f16311q);
}
@Override
public void W() {
TextView textView;
super.W();
a.f2(new NewsVideoActivity$reloadData$1(this, getIntent().getStringExtra("id")));
SideFragment b0 = b0();
if (b0 == null) {
textView = null;
} else {
View view = b0.getView();
textView = (TextView) (view == null ? null : view.findViewById(R$id.tv_next_play_land));
}
if (textView != null) {
textView.setText("");
}
View view2 = Z().getView();
((LoadingLayout) (view2 == null ? null : view2.findViewById(R$id.loading_layout))).setButtonRetryClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view3) {
NewsVideoActivity newsVideoActivity = NewsVideoActivity.this;
int i2 = NewsVideoActivity.f16310s;
n.i.b.h.e(newsVideoActivity, "this$0");
String videoId = newsVideoActivity.a0().getVideoId();
if (videoId == null) {
videoId = "";
}
newsVideoActivity.g0(videoId);
}
});
SideFragment b02 = b0();
if (b02 != null) {
View view3 = b02.getView();
LoadingLayout loadingLayout = (LoadingLayout) (view3 != null ? view3.findViewById(R$id.loading_layout) : null);
if (loadingLayout != null) {
loadingLayout.setButtonRetryClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view4) {
NewsVideoActivity newsVideoActivity = NewsVideoActivity.this;
int i2 = NewsVideoActivity.f16310s;
n.i.b.h.e(newsVideoActivity, "this$0");
String videoId = newsVideoActivity.a0().getVideoId();
if (videoId == null) {
videoId = "";
}
newsVideoActivity.g0(videoId);
}
});
}
}
f0();
}
@Override
public boolean d0() {
List<HomeNormalModel.ListBean> recommList;
NewsReadData newsReadData = this.f16312r;
if (newsReadData == null) {
return false;
}
if (newsReadData == null || (recommList = newsReadData.getRecommList()) == null) {
return true;
}
return recommList.isEmpty();
}
@Override
public void e0() {
a.f2(new NewsVideoActivity$reloadData$1(this, getIntent().getStringExtra("id")));
}
public void g0(String str) {
List<HomeNormalModel.ListBean> recommList;
List<HomeNormalModel.ListBean> recommList2;
List<HomeNormalModel.ListBean> recommList3;
NewsReadData.PostBean post;
String str2;
List A;
boolean z;
boolean z2;
String obj;
h.e(str, "videoId");
final NewsNextPlay newsNextPlay = this.f16311q;
Objects.requireNonNull(newsNextPlay);
h.e(str, "videoId");
NewsReadData a = newsNextPlay.a();
if (a != null && (post = a.getPost()) != null) {
if (!post.isEmpty()) {
Video video = new Video();
video.setId(str);
video.setResId(post.getId());
video.setTitle(post.getTitle());
CharSequence fromHtml = Html.fromHtml(post.getContent());
int length = fromHtml.length();
if (length > 0) {
while (true) {
int i2 = length - 1;
if (fromHtml.charAt(i2) != '\n' && fromHtml.charAt(i2) != 12288 && fromHtml.charAt(i2) != ' ' && fromHtml.charAt(i2) != '\r' && fromHtml.charAt(i2) != 65279) {
break;
}
length = i2;
}
int i3 = 0;
while (true) {
if (fromHtml.charAt(i3) != '\n' && fromHtml.charAt(i3) != 12288 && fromHtml.charAt(i3) != ' ' && fromHtml.charAt(i3) != '\r' && fromHtml.charAt(i3) != 65279) {
break;
}
i3++;
}
if (length > i3) {
fromHtml = (Spannable) fromHtml.subSequence(i3, length);
}
}
if (fromHtml == null || (obj = fromHtml.toString()) == null) {
str2 = null;
} else {
int length2 = obj.length() - 1;
int i4 = 0;
boolean z3 = false;
while (i4 <= length2) {
char charAt = obj.charAt(!z3 ? i4 : length2);
boolean z4 = charAt == ' ' || charAt == '\n';
if (z3) {
if (!z4) {
break;
}
length2--;
} else if (z4) {
i4++;
} else {
z3 = true;
}
}
str2 = obj.subSequence(i4, length2 + 1).toString();
}
if (str2 == null) {
A = null;
} else {
try {
A = n.o.a.A(str2, new String[]{"\n\n"}, false, 0, 6);
} catch (Exception e2) {
e2.printStackTrace();
}
}
if (A != null && A.size() > 2) {
CharSequence charSequence = (CharSequence) A.get(0);
String title = post.getTitle();
if (title == null) {
title = "";
}
if (!n.o.a.c(charSequence, title, false, 2)) {
CharSequence charSequence2 = (CharSequence) A.get(1);
String title2 = post.getTitle();
if (title2 == null) {
title2 = "";
}
}
if (str2 != null) {
String t2 = n.o.a.t(str2, (CharSequence) A.get(0));
int length3 = t2.length() - 1;
int i5 = 0;
boolean z5 = false;
while (i5 <= length3) {
char charAt2 = t2.charAt(!z5 ? i5 : length3);
if (charAt2 != ' ' && charAt2 != '\n') {
z2 = false;
if (z5) {
if (z2) {
i5++;
} else {
z5 = true;
}
} else if (!z2) {
break;
} else {
length3--;
}
}
z2 = true;
if (z5) {
}
}
String obj2 = t2.subSequence(i5, length3 + 1).toString();
if (obj2 != null) {
String t3 = n.o.a.t(obj2, (CharSequence) A.get(1));
int length4 = t3.length() - 1;
int i6 = 0;
boolean z6 = false;
while (i6 <= length4) {
char charAt3 = t3.charAt(!z6 ? i6 : length4);
if (charAt3 != ' ' && charAt3 != '\n') {
z = false;
if (z6) {
if (z) {
i6++;
} else {
z6 = true;
}
} else if (!z) {
break;
} else {
length4--;
}
}
z = true;
if (z6) {
}
}
str2 = t3.subSequence(i6, length4 + 1).toString();
}
}
str2 = null;
}
video.setDescription(str2);
video.setPublishedDate(z.b(post.getDate()));
video.setResShare(post.getShare());
a0 a0Var = newsNextPlay.f16308k;
if (a0Var != null) {
a0Var.e(video);
}
} else {
a0 a0Var2 = newsNextPlay.f16308k;
if (a0Var2 != null) {
a0Var2.a();
}
}
}
NewsReadData a2 = newsNextPlay.a();
if ((a2 == null || (recommList3 = a2.getRecommList()) == null || recommList3.isEmpty()) ? false : true) {
newsNextPlay.f16307j.clear();
NewsReadData a3 = newsNextPlay.a();
if (((a3 == null || (recommList2 = a3.getRecommList()) == null) ? 0 : recommList2.size()) > 0) {
NewsReadData a4 = newsNextPlay.a();
h.c(a4);
List<HomeNormalModel.ListBean> recommList4 = a4.getRecommList();
h.c(recommList4);
String videoId = recommList4.get(0).getVideoId();
h.e(videoId, "<this>");
if (n.o.a.B(videoId, "Vimeo_", true) || Pattern.matches("^[0-9]+$", videoId)) {
final LinkedHashMap linkedHashMap = new LinkedHashMap();
final LinkedHashMap linkedHashMap2 = new LinkedHashMap();
NewsReadData a5 = newsNextPlay.a();
h.c(a5);
List<HomeNormalModel.ListBean> recommList5 = a5.getRecommList();
h.c(recommList5);
for (HomeNormalModel.ListBean listBean : recommList5) {
linkedHashMap.put(listBean.getVideoId(), listBean.getShare());
linkedHashMap2.put(listBean.getVideoId(), Integer.valueOf(listBean.getId()));
}
VideoClient videoClient = VideoClient.a;
NewsReadData a6 = newsNextPlay.a();
h.c(a6);
List<HomeNormalModel.ListBean> recommList6 = a6.getRecommList();
h.c(recommList6);
videoClient.c(g.y(recommList6, ",", null, null, 0, null, null, 62), new l<List<? extends Video>, e>() {
{
super(1);
}
@Override
public e invoke(List<? extends Video> list) {
invoke2(list);
return e.a;
}
public final void invoke2(List<? extends Video> list) {
h.e(list, "list");
Map<String, Integer> map = linkedHashMap2;
Map<String, String> map2 = linkedHashMap;
for (Video video2 : list) {
video2.setResId(String.valueOf(map.get(video2.getId())));
String str3 = map2.get(video2.getId());
if (str3 == null) {
str3 = "";
}
video2.setResShare(str3);
}
NewsNextPlay.this.f16307j.addAll(list);
NewsNextPlay newsNextPlay2 = NewsNextPlay.this;
a0 a0Var3 = newsNextPlay2.f16308k;
if (a0Var3 != null) {
a0Var3.c(newsNextPlay2.f16307j);
}
a0 a0Var4 = NewsNextPlay.this.f16308k;
if (a0Var4 == null) {
return;
}
a0Var4.d();
}
}, new l<Integer, e>() {
{
super(1);
}
@Override
public e invoke(Integer num) {
invoke(num.intValue());
return e.a;
}
public final void invoke(int i7) {
NewsNextPlay newsNextPlay2 = NewsNextPlay.this;
a0 a0Var3 = newsNextPlay2.f16308k;
if (a0Var3 != null) {
a0Var3.c(newsNextPlay2.f16307j);
}
a0 a0Var4 = NewsNextPlay.this.f16308k;
if (a0Var4 == null) {
return;
}
a0Var4.d();
}
});
return;
}
NewsReadData a7 = newsNextPlay.a();
if (a7 != null && (recommList = a7.getRecommList()) != null) {
for (HomeNormalModel.ListBean listBean2 : recommList) {
Video video2 = new Video();
video2.setResId(String.valueOf(listBean2.getId()));
video2.setId(listBean2.getVideoId());
video2.setTitle(listBean2.getTitle());
video2.setDuration(z.c(listBean2.getDuration()));
video2.setPublishedDate(z.b(listBean2.getDate()));
String videoId2 = listBean2.getVideoId();
h.e(videoId2, "<this>");
if (!(n.o.a.B(videoId2, "Vimeo_", true) || Pattern.matches("^[0-9]+$", videoId2))) {
StringBuilder J = i.a.b.a.a.J("https://img.youtube.com/vi/");
J.append(listBean2.getVideoId());
J.append("/mqdefault.jpg");
video2.setThumbnailURL(J.toString());
video2.setHqThumbnailURL("https://img.youtube.com/vi/" + listBean2.getVideoId() + "/hqdefault.jpg");
} else {
video2.setThumbnailURL("");
video2.setHqThumbnailURL("");
}
video2.setResShare(listBean2.getShare());
newsNextPlay.f16307j.add(video2);
}
}
a0 a0Var3 = newsNextPlay.f16308k;
if (a0Var3 != null) {
a0Var3.c(newsNextPlay.f16307j);
}
a0 a0Var4 = newsNextPlay.f16308k;
if (a0Var4 == null) {
return;
}
a0Var4.d();
return;
}
a0 a0Var5 = newsNextPlay.f16308k;
if (a0Var5 != null) {
a0Var5.c(newsNextPlay.f16307j);
}
a0 a0Var6 = newsNextPlay.f16308k;
if (a0Var6 == null) {
return;
}
a0Var6.d();
return;
}
a0 a0Var7 = newsNextPlay.f16308k;
if (a0Var7 != null) {
a0Var7.c(newsNextPlay.f16307j);
}
a0 a0Var8 = newsNextPlay.f16308k;
if (a0Var8 == null) {
return;
}
a0Var8.d();
}
@Override
public void n(int i2) {
this.f16311q.n(i2);
}
}