正在查看: Uptodown App Store v6.80 应用的 UserCommentsActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Uptodown App Store v6.80 应用的 UserCommentsActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.uptodown.activities;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.viewmodel.CreationExtras;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import b2.C0560i;
import c2.R0;
import com.google.android.material.snackbar.Snackbar;
import com.uptodown.UptodownApp;
import com.uptodown.activities.UserCommentsActivity;
import com.uptodown.activities.Y;
import f2.InterfaceC0934q;
import g2.C0955f;
import g2.L;
import java.util.Arrays;
import u2.H;
public final class UserCommentsActivity extends AbstractC0740a {
private M1.N L;
private final R2.g J = R2.h.a(new d3.a() {
@Override
public final Object invoke() {
c2.R0 i32;
i32 = UserCommentsActivity.i3(UserCommentsActivity.this);
return i32;
}
});
private final R2.g K = new ViewModelLazy(kotlin.jvm.internal.D.b(Y.class), new f(this), new e(this), new g(null, this));
private b M = new b();
public static final class a extends RecyclerView.OnScrollListener {
final LinearLayoutManager a;
final UserCommentsActivity b;
a(LinearLayoutManager linearLayoutManager, UserCommentsActivity userCommentsActivity) {
this.a = linearLayoutManager;
this.b = userCommentsActivity;
}
public void onScrolled(RecyclerView recyclerView, int i, int i4) {
kotlin.jvm.internal.m.e(recyclerView, "recyclerView");
if (i4 > 0) {
int findFirstVisibleItemPosition = this.a.findFirstVisibleItemPosition();
int childCount = this.a.getChildCount();
int itemCount = this.a.getItemCount();
if (this.b.m3().h() || ((Boolean) this.b.m3().f().getValue()).booleanValue() || childCount + findFirstVisibleItemPosition < itemCount) {
return;
}
M1.N n = this.b.L;
if (n != null) {
n.c(true);
}
this.b.m3().e(this.b);
}
}
}
public static final class b implements f2.I {
public static final class a implements InterfaceC0934q {
final UserCommentsActivity a;
a(UserCommentsActivity userCommentsActivity) {
this.a = userCommentsActivity;
}
@Override
public void c(int i) {
}
@Override
public void d(C0955f appInfo) {
kotlin.jvm.internal.m.e(appInfo, "appInfo");
Intent intent = new Intent((Context) this.a, (Class<?>) AppDetailActivity.class);
intent.putExtra("appInfo", appInfo);
AppCompatActivity appCompatActivity = this.a;
appCompatActivity.startActivity(intent, UptodownApp.F.a(appCompatActivity));
}
}
b() {
}
@Override
public void a(int i) {
if (UptodownApp.F.a0()) {
u2.I i4 = u2.I.a;
M1.N n = UserCommentsActivity.this.L;
kotlin.jvm.internal.m.b(n);
if (i4.i(((g2.L) n.b().get(i)).f())) {
return;
}
Y m32 = UserCommentsActivity.this.m3();
?? r12 = UserCommentsActivity.this;
M1.N n4 = ((UserCommentsActivity) r12).L;
kotlin.jvm.internal.m.b(n4);
Object obj = n4.b().get(i);
kotlin.jvm.internal.m.d(obj, "get(...)");
m32.l(r12, (g2.L) obj);
}
}
@Override
public void b(int i) {
Intent intent = new Intent((Context) UserCommentsActivity.this, (Class<?>) RepliesActivity.class);
M1.N n = UserCommentsActivity.this.L;
kotlin.jvm.internal.m.b(n);
Object obj = n.b().get(i);
g2.L l = (g2.L) obj;
l.t(((g2.S) UserCommentsActivity.this.m3().k().getValue()).a());
kotlin.jvm.internal.m.d(obj, "apply(...)");
l.z(((g2.S) UserCommentsActivity.this.m3().k().getValue()).n() ? 1 : 0);
l.C(((g2.S) UserCommentsActivity.this.m3().k().getValue()).l());
l.A(((g2.S) UserCommentsActivity.this.m3().k().getValue()).g());
intent.putExtra("review", l);
intent.putExtra("username", ((g2.S) UserCommentsActivity.this.m3().k().getValue()).h());
AppCompatActivity appCompatActivity = UserCommentsActivity.this;
appCompatActivity.startActivity(intent, UptodownApp.F.a(appCompatActivity));
}
@Override
public void c(int i) {
if (UptodownApp.F.a0()) {
?? r22 = UserCommentsActivity.this;
M1.N n = ((UserCommentsActivity) r22).L;
kotlin.jvm.internal.m.b(n);
new C0560i(r22, ((g2.L) n.b().get(i)).b(), new a(UserCommentsActivity.this), LifecycleOwnerKt.getLifecycleScope(UserCommentsActivity.this));
}
}
}
static final class c extends kotlin.coroutines.jvm.internal.l implements d3.p {
int a;
static final class a implements r3.f {
final UserCommentsActivity a;
a(UserCommentsActivity userCommentsActivity) {
this.a = userCommentsActivity;
}
public final Object emit(u2.H h, V2.d dVar) {
if (h instanceof H.a) {
this.a.j3().b.setVisibility(0);
} else if (h instanceof H.c) {
H.c cVar = (H.c) h;
if (((Y.a) cVar.a()).b() == null || !((Y.a) cVar.a()).c()) {
this.a.j3().e.setTypeface(N1.k.g.x());
this.a.j3().e.setVisibility(0);
} else {
g2.S e = g2.S.m.e(this.a);
if (kotlin.jvm.internal.m.a(e != null ? e.g() : null, ((Y.a) cVar.a()).b().g())) {
this.a.j3().f.setText(this.a.getString(2131952528));
} else {
TextView textView = this.a.j3().f;
kotlin.jvm.internal.F f = kotlin.jvm.internal.F.a;
String string = this.a.getString(2131952804);
kotlin.jvm.internal.m.d(string, "getString(...)");
String format = String.format(string, Arrays.copyOf(new Object[]{((Y.a) cVar.a()).b().h()}, 1));
kotlin.jvm.internal.m.d(format, "format(...)");
textView.setText(format);
}
if (!((Y.a) cVar.a()).a().isEmpty()) {
if (this.a.L == null) {
this.a.L = new M1.N(((Y.a) cVar.a()).a(), this.a.M);
this.a.j3().c.setAdapter(this.a.L);
} else {
M1.N n = this.a.L;
kotlin.jvm.internal.m.b(n);
n.a(((Y.a) cVar.a()).a());
}
}
M1.N n4 = this.a.L;
if (n4 != null) {
n4.c(false);
}
}
this.a.j3().b.setVisibility(8);
} else if (!(h instanceof H.b)) {
throw new R2.k();
}
return R2.s.a;
}
}
c(V2.d dVar) {
super(2, dVar);
}
@Override
public final V2.d create(Object obj, V2.d dVar) {
return UserCommentsActivity.this.new c(dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
Object c = W2.b.c();
int i = this.a;
if (i == 0) {
R2.n.b(obj);
r3.I g = UserCommentsActivity.this.m3().g();
a aVar = new a(UserCommentsActivity.this);
this.a = 1;
if (g.collect(aVar, this) == c) {
return c;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
R2.n.b(obj);
}
throw new R2.d();
}
@Override
public final Object invoke(o3.J j, V2.d dVar) {
return ((c) create(j, dVar)).invokeSuspend(R2.s.a);
}
}
static final class d extends kotlin.coroutines.jvm.internal.l implements d3.p {
int a;
static final class a implements r3.f {
final UserCommentsActivity a;
a(UserCommentsActivity userCommentsActivity) {
this.a = userCommentsActivity;
}
public final Object emit(u2.H h, V2.d dVar) {
if (h instanceof H.c) {
H.c cVar = (H.c) h;
if (((L.c) cVar.a()).b() == 1) {
M1.N n = this.a.L;
if (n != null) {
n.d(((L.c) cVar.a()).a());
}
} else {
Snackbar.make((View) this.a.j3().c, 2131952006, -1).show();
?? r22 = this.a;
String string = r22.getString(2131952006);
kotlin.jvm.internal.m.d(string, "getString(...)");
r22.r0(string);
}
}
return R2.s.a;
}
}
d(V2.d dVar) {
super(2, dVar);
}
@Override
public final V2.d create(Object obj, V2.d dVar) {
return UserCommentsActivity.this.new d(dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
Object c = W2.b.c();
int i = this.a;
if (i == 0) {
R2.n.b(obj);
r3.I j = UserCommentsActivity.this.m3().j();
a aVar = new a(UserCommentsActivity.this);
this.a = 1;
if (j.collect(aVar, this) == c) {
return c;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
R2.n.b(obj);
}
throw new R2.d();
}
@Override
public final Object invoke(o3.J j, V2.d dVar) {
return ((d) create(j, dVar)).invokeSuspend(R2.s.a);
}
}
public static final class e extends kotlin.jvm.internal.n implements d3.a {
final ComponentActivity a;
public e(ComponentActivity componentActivity) {
super(0);
this.a = componentActivity;
}
@Override
public final ViewModelProvider.Factory invoke() {
return this.a.getDefaultViewModelProviderFactory();
}
}
public static final class f extends kotlin.jvm.internal.n implements d3.a {
final ComponentActivity a;
public f(ComponentActivity componentActivity) {
super(0);
this.a = componentActivity;
}
@Override
public final ViewModelStore invoke() {
return this.a.getViewModelStore();
}
}
public static final class g extends kotlin.jvm.internal.n implements d3.a {
final d3.a a;
final ComponentActivity b;
public g(d3.a aVar, ComponentActivity componentActivity) {
super(0);
this.a = aVar;
this.b = componentActivity;
}
@Override
public final CreationExtras invoke() {
CreationExtras creationExtras;
d3.a aVar = this.a;
return (aVar == null || (creationExtras = (CreationExtras) aVar.invoke()) == null) ? this.b.getDefaultViewModelCreationExtras() : creationExtras;
}
}
public static final R0 i3(UserCommentsActivity userCommentsActivity) {
return R0.c(userCommentsActivity.getLayoutInflater());
}
public final R0 j3() {
return (R0) this.J.getValue();
}
private final void k3() {
String g4 = ((g2.S) m3().k().getValue()).g();
if (g4 == null || g4.length() == 0) {
return;
}
m3().e(this);
}
private final String l3() {
Bundle extras;
if (getIntent() == null || (extras = getIntent().getExtras()) == null || !extras.containsKey("userID")) {
return null;
}
return extras.getString("userID");
}
public final Y m3() {
return (Y) this.K.getValue();
}
private final void n3() {
j3().d.setNavigationIcon(ContextCompat.getDrawable(this, N1.e.c));
j3().d.setNavigationContentDescription(getString(2131951721));
j3().d.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
UserCommentsActivity.o3(UserCommentsActivity.this, view);
}
});
j3().f.setTypeface(N1.k.g.w());
int dimension = (int) getResources().getDimension(2131166020);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, 1, false);
j3().c.addItemDecoration(new w2.o(dimension, dimension, dimension, dimension));
j3().c.setLayoutManager(linearLayoutManager);
j3().c.setItemAnimator((RecyclerView.ItemAnimator) null);
j3().c.addOnScrollListener(new a(linearLayoutManager, this));
k3();
}
public static final void o3(UserCommentsActivity userCommentsActivity, View view) {
userCommentsActivity.getOnBackPressedDispatcher().onBackPressed();
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(j3().getRoot());
((g2.S) m3().k().getValue()).t(l3());
n3();
o3.g.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), (o3.L) null, new c(null), 2, (Object) null);
o3.g.d(LifecycleOwnerKt.getLifecycleScope(this), o3.Y.c(), (o3.L) null, new d(null), 2, (Object) null);
}
}