APKPure.apk分析 / HashtagDetailActivity.java
package com.apkpure.aegon.cms.activity;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import com.apkpure.aegon.R;
import com.apkpure.aegon.cms.adapter.MultipleItemCMSAdapter;
import com.apkpure.aegon.widgets.CustomSwipeRefreshLayout;
import com.apkpure.aegon.widgets.DisableRecyclerView;
import com.apkpure.aegon.widgets.button.FocusButton;
import com.apkpure.aegon.widgets.floating.FloatingActionButton;
import com.apkpure.aegon.widgets.floating.FloatingActionsMenu;
import com.apkpure.aegon.widgets.textview.ExpressionTextView;
import com.apkpure.aegon.widgets.textview.RoundFrameLayout;
import com.apkpure.proto.nano.AIHeadlineInfoProtos;
import com.apkpure.proto.nano.BannerImageProtos;
import com.apkpure.proto.nano.CommentInfoProtos;
import com.apkpure.proto.nano.HashtagDetailInfoProtos;
import com.apkpure.proto.nano.ImageInfoProtos;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.google.android.material.appbar.AppBarLayout;
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView;
import e.g.a.e.f.d2;
import e.g.a.i.b0.i1;
import e.g.a.i.b0.j1;
import e.g.a.i.b0.k1;
import e.g.a.i.e0.e;
import e.g.a.i.g0.a;
import e.g.a.i.k0.b1;
import e.g.a.i.k0.d1;
import e.g.a.i.k0.e1;
import e.g.a.i.k0.m;
import e.g.a.i.k0.n;
import e.g.a.i.z.i0;
import e.g.a.i.z.j0;
import e.g.a.i.z.k0;
import e.g.a.i.z.l0;
import e.g.a.i.z.m0;
import e.g.a.i.z.n0;
import e.g.a.i.z.o0;
import e.g.a.i.z.p0;
import e.g.a.i.z.q0;
import e.g.a.i.z.r0;
import e.g.a.i.z.s0;
import e.g.a.i0.a1;
import e.g.a.i0.b2.e;
import e.g.a.i0.p1;
import e.g.a.i0.r1;
import e.g.a.i0.t1;
import e.g.a.m0.b0.j;
import e.g.a.n0.d;
import e.g.a.s.f;
import e.g.a.z.k.g;
import e.g.a.z.n.h;
import e.w.e.a.b.l.b;
import i.b.c.i;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
public class HashtagDetailActivity extends e.g.a.t.b.a implements BaseQuickAdapter.RequestLoadMoreListener, e {
public static final /* synthetic */ int N = 0;
public e1 A = new e1();
public MultipleItemCMSAdapter B;
public i1 C;
public j1 H;
public k1 I;
public a.b J;
public d K;
public YouTubePlayerView L;
public e.g.a.n0.c M;
/* renamed from: g reason: collision with root package name */
public AppBarLayout f1256g;
/* renamed from: h reason: collision with root package name */
public Toolbar f1257h;
/* renamed from: i reason: collision with root package name */
public TextView f1258i;
/* renamed from: j reason: collision with root package name */
public RoundFrameLayout f1259j;
/* renamed from: k reason: collision with root package name */
public LinearLayout f1260k;
/* renamed from: l reason: collision with root package name */
public TextView f1261l;
/* renamed from: m reason: collision with root package name */
public TextView f1262m;
/* renamed from: n reason: collision with root package name */
public TextView f1263n;
/* renamed from: o reason: collision with root package name */
public FocusButton f1264o;
/* renamed from: p reason: collision with root package name */
public ImageView f1265p;
/* renamed from: q reason: collision with root package name */
public ImageView f1266q;
/* renamed from: r reason: collision with root package name */
public ExpressionTextView f1267r;
/* renamed from: s reason: collision with root package name */
public CustomSwipeRefreshLayout f1268s;
/* renamed from: t reason: collision with root package name */
public DisableRecyclerView f1269t;
public FloatingActionsMenu u;
public FloatingActionButton v;
public FloatingActionButton w;
public FloatingActionButton x;
public j y;
public String z;
public class a extends e.g.a.i0.b2.e {
public a() {
}
@Override // e.g.a.i0.b2.e
public void b(AppBarLayout appBarLayout, e.a aVar) {
HashtagDetailActivity hashtagDetailActivity;
if (aVar == e.a.EXPANDED) {
hashtagDetailActivity = HashtagDetailActivity.this;
} else if (aVar == e.a.COLLAPSED) {
HashtagDetailActivity hashtagDetailActivity2 = HashtagDetailActivity.this;
hashtagDetailActivity2.f1258i.setText(String.format("#%s#", hashtagDetailActivity2.z));
return;
} else {
hashtagDetailActivity = HashtagDetailActivity.this;
}
hashtagDetailActivity.f1258i.setText("");
}
}
public class b extends a.C0107a {
/* renamed from: a reason: collision with root package name */
public final /* synthetic */ HashtagDetailInfoProtos.HashtagDetailInfo f1270a;
public b(HashtagDetailInfoProtos.HashtagDetailInfo hashtagDetailInfo) {
this.f1270a = hashtagDetailInfo;
}
@Override // e.g.a.i.g0.a.C0107a
public void b(Context context, e.g.a.i.d dVar, CommentInfoProtos.CommentInfo commentInfo) {
String[] strArr;
MultipleItemCMSAdapter multipleItemCMSAdapter = HashtagDetailActivity.this.B;
HashtagDetailInfoProtos.HashtagDetailInfo hashtagDetailInfo = this.f1270a;
j0 j0Var = new j0(this);
if (hashtagDetailInfo != null && multipleItemCMSAdapter != null && (strArr = commentInfo.hashtags) != null && strArr.length > 0 && TextUtils.equals(hashtagDetailInfo.name, strArr[0])) {
e.f.a.e.c.f0(multipleItemCMSAdapter, dVar, j0Var);
}
}
@Override // e.g.a.i.g0.a.C0107a
public void c(Context context, CommentInfoProtos.CommentInfo commentInfo) {
String[] strArr;
MultipleItemCMSAdapter multipleItemCMSAdapter = HashtagDetailActivity.this.B;
HashtagDetailInfoProtos.HashtagDetailInfo hashtagDetailInfo = this.f1270a;
k0 k0Var = new k0(this);
if (hashtagDetailInfo != null && multipleItemCMSAdapter != null && (strArr = commentInfo.hashtags) != null && strArr.length > 0 && TextUtils.equals(hashtagDetailInfo.name, strArr[0])) {
e.f.a.e.c.g0(multipleItemCMSAdapter, commentInfo, k0Var);
}
}
}
public class c extends e.g.a.s.k.e {
/* renamed from: j reason: collision with root package name */
public final /* synthetic */ HashtagDetailInfoProtos.HashtagDetailInfo f1271j;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public c(Context context, AIHeadlineInfoProtos.AIHeadlineInfo aIHeadlineInfo, boolean z, boolean z2, HashtagDetailInfoProtos.HashtagDetailInfo hashtagDetailInfo) {
super(context, aIHeadlineInfo, z, z2);
this.f1271j = hashtagDetailInfo;
}
@Override // e.g.a.s.k.e
public void c(View view) {
HashtagDetailActivity hashtagDetailActivity = HashtagDetailActivity.this;
e1 e1Var = hashtagDetailActivity.A;
Context context = hashtagDetailActivity.c;
boolean z = !hashtagDetailActivity.f1264o.isChecked();
HashtagDetailInfoProtos.HashtagDetailInfo hashtagDetailInfo = this.f1271j;
if (e1Var.f7130a != null && hashtagDetailInfo != null) {
e.d.a.a.a.g(context, e.g.a.s.l.a.t(context, hashtagDetailInfo.name, z).f(new m(e1Var)).e(e.g.a.i0.c2.a.f6490a)).a(new d1(e1Var, hashtagDetailInfo, z));
}
}
}
public static Intent h2(Context context, String str) {
Intent intent = new Intent(context, HashtagDetailActivity.class);
intent.putExtra("params_cms_data", str);
return intent;
}
@Override // e.g.a.i.e0.e
public void C1(HashtagDetailInfoProtos.HashtagDetailInfo hashtagDetailInfo) {
e.g.a.i0.d1.b(this.c, hashtagDetailInfo.isFollow ? R.string.arg_RES_2131821011 : R.string.arg_RES_2131821012);
j2(hashtagDetailInfo);
}
@Override // e.g.a.i.e0.e
public void H0(HashtagDetailInfoProtos.HashtagDetailInfo hashtagDetailInfo) {
if (hashtagDetailInfo != null) {
j2(hashtagDetailInfo);
}
}
@Override // e.g.a.t.b.a
public int K1() {
return R.layout.arg_RES_2131492933;
}
@Override // e.g.a.t.b.a
@SuppressLint({"ClickableViewAccessibility"})
public void O1() {
i iVar = this.d;
Toolbar toolbar = this.f1257h;
if (toolbar != null) {
iVar.setSupportActionBar(toolbar);
i.b.c.a supportActionBar = iVar.getSupportActionBar();
if (supportActionBar != null) {
supportActionBar.n(false);
supportActionBar.o(false);
}
if (!TextUtils.isEmpty(null)) {
toolbar.setTitle((CharSequence) null);
}
}
String stringExtra = getIntent().getStringExtra("params_cms_data");
this.z = stringExtra;
this.z = TextUtils.isEmpty(stringExtra) ? this.c.getString(R.string.arg_RES_2131821836) : this.z;
this.f1257h.setPopupTheme(e.g.a.s.l.a.J0(this));
this.f1257h.setNavigationIcon(p1.j(this.c, R.drawable.arg_RES_2131231177));
this.f1257h.setNavigationOnClickListener(new l0(this));
ViewGroup.LayoutParams layoutParams = this.f1257h.getLayoutParams();
if (layoutParams instanceof FrameLayout.LayoutParams) {
((FrameLayout.LayoutParams) layoutParams).setMargins(0, a1.c(this.c), 0, 0);
}
TypedArray obtainStyledAttributes = this.c.obtainStyledAttributes(new int[]{R.attr.arg_RES_2130968581});
int dimensionPixelSize = obtainStyledAttributes.getDimensionPixelSize(0, 0);
obtainStyledAttributes.recycle();
int c2 = a1.c(this.c) + dimensionPixelSize;
LinearLayout linearLayout = this.f1260k;
if (linearLayout != null) {
linearLayout.setPaddingRelative(0, c2, 0, 0);
}
this.f1256g.a(new a());
if (i.i.g.c.Q()) {
this.u.setLabelsPosition(1);
} else {
this.u.setLabelsPosition(0);
}
HashtagDetailInfoProtos.HashtagDetailInfo hashtagDetailInfo = new HashtagDetailInfoProtos.HashtagDetailInfo();
hashtagDetailInfo.name = this.z;
this.B = new MultipleItemCMSAdapter(this.d, this.c, new ArrayList());
this.f1269t.setLayoutManager(e.f.a.e.c.w(this.c));
MultipleItemCMSAdapter multipleItemCMSAdapter = this.B;
multipleItemCMSAdapter.setSpanSizeLookup(new e.g.a.i.m0.e(multipleItemCMSAdapter));
this.B.setLoadMoreView(new r1());
this.f1269t.setAdapter(this.B);
d dVar = new d(this.L, this.f1269t, this.d);
this.K = dVar;
dVar.c();
e.g.a.n0.c cVar = new e.g.a.n0.c(this.d, this.K);
this.M = cVar;
cVar.d(this.f1269t, false);
MultipleItemCMSAdapter multipleItemCMSAdapter2 = this.B;
multipleItemCMSAdapter2.f1358j = this.K;
multipleItemCMSAdapter2.setOnLoadMoreListener(this, this.f1269t);
this.B.setHeaderFooterEmpty(true, true);
this.f1268s.setOnRefreshListener(new q0(this));
if (this.y == null) {
this.y = new j(3, this.c.getString(R.string.arg_RES_2131820624), 0);
}
if (this.I == null) {
k1 k1Var = new k1(this.c, this.y);
this.I = k1Var;
k1Var.f6126e = new r0(this);
}
this.B.setHeaderView(this.I.b);
this.f1269t.k(new t1(this.u));
this.v.setOnTouchListener(new g(this.d));
this.w.setOnTouchListener(new g(this.d));
this.x.setOnTouchListener(new g(this.d));
this.v.setOnClickListener(new i0(this, hashtagDetailInfo));
this.w.setOnClickListener(new o0(this, hashtagDetailInfo));
this.x.setOnClickListener(new p0(this, hashtagDetailInfo));
if (this.J == null) {
a.b bVar = new a.b(this.c, new b(hashtagDetailInfo));
this.J = bVar;
bVar.a();
}
this.f1260k.getLayoutParams().height = Math.max((int) (((float) p1.c(this.c)) * 0.3f), p1.B(this.f1260k)[1]);
e.f.a.e.c.Y(this, "https://projecta-common-1258344701.file.myqcloud.com/xy/aprojectadmin/ZEwzjnKB.webp", (ImageView) findViewById(R.id.arg_RES_2131298553), new e.h.a.q.g());
j2(hashtagDetailInfo);
i2(true);
}
@Override // e.g.a.t.b.a
public void R1() {
this.A.b(this);
this.f1256g = (AppBarLayout) findViewById(R.id.arg_RES_2131296444);
this.f1257h = (Toolbar) findViewById(R.id.arg_RES_2131298663);
this.f1258i = (TextView) findViewById(R.id.arg_RES_2131298669);
this.f1259j = (RoundFrameLayout) findViewById(R.id.arg_RES_2131297396);
this.f1261l = (TextView) findViewById(R.id.arg_RES_2131297856);
this.f1262m = (TextView) findViewById(R.id.arg_RES_2131296916);
this.f1263n = (TextView) findViewById(R.id.arg_RES_2131297254);
this.f1264o = (FocusButton) findViewById(R.id.arg_RES_2131297340);
this.f1268s = (CustomSwipeRefreshLayout) findViewById(R.id.arg_RES_2131296993);
this.f1269t = (DisableRecyclerView) findViewById(R.id.arg_RES_2131298234);
this.u = (FloatingActionsMenu) findViewById(R.id.arg_RES_2131297248);
this.v = (FloatingActionButton) findViewById(R.id.arg_RES_2131297246);
this.w = (FloatingActionButton) findViewById(R.id.arg_RES_2131297247);
this.x = (FloatingActionButton) findViewById(R.id.arg_RES_2131297245);
this.f1260k = (LinearLayout) findViewById(R.id.arg_RES_2131298552);
this.f1265p = (ImageView) findViewById(R.id.arg_RES_2131297341);
this.f1266q = (ImageView) findViewById(R.id.arg_RES_2131297343);
this.f1267r = (ExpressionTextView) findViewById(R.id.arg_RES_2131297019);
FrameLayout frameLayout = (FrameLayout) findViewById(R.id.arg_RES_2131297342);
if (this.L == null) {
YouTubePlayerView youTubePlayerView = new YouTubePlayerView(this.c);
this.L = youTubePlayerView;
youTubePlayerView.setLayoutParams(new FrameLayout.LayoutParams(-1, -2));
this.L.setBackgroundResource(R.color.arg_RES_2131099826);
this.L.setVisibility(4);
frameLayout.addView(this.L);
}
}
@Override // e.g.a.i.e0.e
public void S(boolean z2, int i2, e.g.a.v.p.a aVar) {
this.f1268s.setRefreshing(false);
this.B.loadMoreFail();
if (this.B.getData().isEmpty()) {
if (this.H == null) {
this.H = new j1(this.d, new s0(this));
}
MultipleItemCMSAdapter multipleItemCMSAdapter = this.B;
j1 j1Var = this.H;
String str = aVar.displayMessage;
Objects.requireNonNull(j1Var);
if (!TextUtils.isEmpty(str)) {
j1Var.b.setText(str);
} else {
j1Var.b.setText(R.string.arg_RES_2131821182);
}
multipleItemCMSAdapter.setEmptyView(j1Var.f6124a);
}
}
@Override // e.g.a.t.b.a
public void S1() {
String str = this.z;
if (str == null) {
str = "";
}
f.h(this.d, this.c.getString(R.string.arg_RES_2131821557), str, 0);
}
@Override // androidx.activity.ComponentActivity, i.o.c.l, i.i.c.g, e.g.a.t.b.a, i.b.c.i
@Override
public boolean dispatchTouchEvent(MotionEvent motionEvent) {
b.C0315b.f12266a.c(this, motionEvent, false, true);
boolean dispatchTouchEvent = super.dispatchTouchEvent(motionEvent);
b.C0315b.f12266a.c(this, motionEvent, dispatchTouchEvent, false);
return dispatchTouchEvent;
}
@Override // e.g.a.t.b.a
public void f2() {
e.g.a.s.l.a.t1(this, true);
}
@Override // e.g.a.t.b.a
public void g2() {
k.g.c.y0(this, true);
}
public final void i2(boolean z2) {
e1 e1Var = this.A;
Context context = this.c;
String str = this.z;
int i2 = this.y.f6780a;
if (e1Var.f7130a != null) {
e.d.a.a.a.g(context, new l.a.n.e.b.d(new n(e1Var, z2, i2, str, context)).f(new m(e1Var)).e(e.g.a.i.c.f6179a).e(e.g.a.i0.c2.a.f6490a)).a(new b1(e1Var, z2, i2));
}
}
/* JADX WARNING: Removed duplicated region for block: B:15:0x005d */
/* JADX WARNING: Removed duplicated region for block: B:16:0x0069 */
public final void j2(HashtagDetailInfoProtos.HashtagDetailInfo hashtagDetailInfo) {
int i2;
ImageInfoProtos.ImageInfo imageInfo;
this.f1261l.setText(String.format("#%s#", hashtagDetailInfo.name));
BannerImageProtos.BannerImage bannerImage = hashtagDetailInfo.icon;
if (bannerImage == null || (imageInfo = bannerImage.original) == null || TextUtils.isEmpty(imageInfo.url)) {
this.f1265p.setVisibility(0);
this.f1266q.setVisibility(8);
if (!TextUtils.isEmpty(hashtagDetailInfo.color)) {
try {
i2 = Color.parseColor(hashtagDetailInfo.color);
} catch (Exception e2) {
e2.printStackTrace();
}
if (i2 == 0) {
e.g.a.m0.k0.f delegate = this.f1259j.getDelegate();
delegate.f6856e = i2;
delegate.b();
} else {
e.g.a.m0.k0.f delegate2 = this.f1259j.getDelegate();
delegate2.f6856e = 0;
delegate2.b();
}
}
i2 = 0;
if (i2 == 0) {
}
} else {
this.f1265p.setVisibility(8);
this.f1266q.setVisibility(0);
Context context = this.c;
e.d.a.a.a.u0(context, 1, context, hashtagDetailInfo.icon.original.url, this.f1266q);
}
long j2 = hashtagDetailInfo.postCount;
if (j2 > 0) {
this.f1262m.setText(String.valueOf(j2));
} else {
this.f1262m.setText(R.string.arg_RES_2131820880);
}
long j3 = hashtagDetailInfo.followCount;
if (j3 > 0) {
this.f1263n.setText(String.valueOf(j3));
} else {
this.f1263n.setText(R.string.arg_RES_2131820880);
}
FocusButton focusButton = this.f1264o;
e.g.a.e.j.c f2 = e.g.a.e.j.c.f(hashtagDetailInfo);
Objects.requireNonNull(focusButton);
String string = f2.a() != 0 ? focusButton.b.getString(f2.a()) : !TextUtils.isEmpty(f2.b()) ? f2.b() : "";
int i3 = f2 == e.g.a.e.j.c.FollowEach ? R.drawable.arg_RES_2131231223 : f2 == e.g.a.e.j.c.FollowOff ? R.drawable.arg_RES_2131231167 : f2 == e.g.a.e.j.c.FollowOn ? R.drawable.arg_RES_2131231285 : 0;
if (i3 != 0) {
focusButton.c(f2, string, -1);
focusButton.d(i3, -1);
}
this.f1264o.setOnClickListener(new c(this.c, hashtagDetailInfo.aiHeadlineInfo, true, false, hashtagDetailInfo));
if (!TextUtils.isEmpty(hashtagDetailInfo.description)) {
this.f1267r.setVisibility(0);
this.f1267r.setHtmlText(hashtagDetailInfo.description);
} else {
this.f1267r.setVisibility(8);
}
this.f1267r.setOnClickListener(new n0(this));
}
@Override // e.g.a.i.e0.e
public void l(boolean z2, int i2, List<e.g.a.i.d> list, boolean z3) {
this.B.loadMoreComplete();
this.f1268s.setRefreshing(false);
if (z2) {
this.B.setNewData(list);
} else {
this.B.addData((Collection) list);
}
if (this.B.getData().isEmpty()) {
if (this.C == null) {
this.C = new i1(this.d, new m0(this));
}
this.B.setEmptyView(this.C.b);
}
if (z3) {
this.B.loadMoreEnd();
}
}
@Override // e.g.a.i.e0.e
public void o1(boolean z2, int i2) {
if (z2) {
this.f1268s.setRefreshing(true);
}
}
@Override // androidx.activity.ComponentActivity, i.o.c.l, i.i.c.g, e.g.a.t.b.a, i.b.c.i
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
e.g.a.n0.c cVar = this.M;
if (cVar != null) {
cVar.a(configuration, this.f1269t, this.f1268s);
}
b.C0315b.f12266a.b(this, configuration);
}
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.arg_RES_2131558414, menu);
return true;
}
@Override // i.o.c.l, e.g.a.t.b.a, i.b.c.i
public void onDestroy() {
a.b bVar = this.J;
if (bVar != null) {
i.i.d.c.h0(bVar.b, bVar);
}
e1 e1Var = this.A;
if (e1Var != null) {
e1Var.c();
}
MultipleItemCMSAdapter multipleItemCMSAdapter = this.B;
if (multipleItemCMSAdapter != null) {
multipleItemCMSAdapter.release();
}
d dVar = this.K;
if (dVar != null) {
dVar.e();
}
super.onDestroy();
}
@Override // com.chad.library.adapter.base.BaseQuickAdapter.RequestLoadMoreListener
public void onLoadMoreRequested() {
i2(false);
}
@Override // e.g.a.t.b.a
public boolean onOptionsItemSelected(MenuItem menuItem) {
if (this.B.getData().isEmpty()) {
return false;
}
if (menuItem.getItemId() != R.id.arg_RES_2131296350) {
return super.onOptionsItemSelected(menuItem);
}
Context context = this.c;
String str = this.z;
Object obj = h.f7767a;
d2 d2Var = d2.f5385e;
h.e(getSupportFragmentManager(), context.getString(R.string.arg_RES_2131821815, String.format("%s/hashtag/%s", "https://apkpure.com", str)), null, null);
return true;
}
@Override // i.o.c.l, e.g.a.t.b.a
public void onPause() {
super.onPause();
d dVar = this.K;
if (dVar != null) {
dVar.d(false);
}
}
@Override // i.o.c.l, e.g.a.t.b.a
public void onResume() {
super.onResume();
d dVar = this.K;
if (dVar != null) {
dVar.a(this.L);
}
}
@Override // e.g.a.i.e0.e
public void y0(e.g.a.v.p.a aVar) {
e.g.a.i0.d1.b(this.c, R.string.arg_RES_2131820989);
}
}