CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 PlanHomeFragment.java 源代码,内容仅作参考
package org.godfootsteps.plan;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.view.View;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.exoplayer2.metadata.icy.IcyHeaders;
import com.google.android.gms.common.internal.ServiceSpecificExtraArgs;
import d.c.a.a.b.b;
import d.c.a.j.s;
import d.c.a.j.v;
import i.c.a.c.a0;
import i.c.a.c.m;
import i.c.a.c.m0;
import i.j.a.e.t.d;
import java.util.List;
import java.util.Objects;
import kotlin.Metadata;
import kotlin.coroutines.intrinsics.CoroutineSingletons;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import n.e;
import n.g.f.a.c;
import n.i.a.l;
import n.i.a.p;
import n.i.b.h;
import n.m.t.a.p.m.e1.a;
import org.godfootsteps.arch.api.AppClient;
import org.godfootsteps.arch.api.entity.PlanEntity;
import org.godfootsteps.arch.api.model.BaseModel;
import org.godfootsteps.arch.api.model.PlanHomeJsonModel;
import org.godfootsteps.arch.api.model.PlanHomeModel;
import org.godfootsteps.arch.api.util.Request;
import org.godfootsteps.arch.dao.PlanDatabase;
import org.godfootsteps.base.BaseFragment;
import org.godfootsteps.plan.PlanHomeFragment;
import org.godfootsteps.plan.adapter.PlanHomeAdapter;
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\u0018\u0000 \u00122\u00020\u0001:\u0002\u0012\u0013B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0007\u001a\u00020\bH\u0014J\b\u0010\t\u001a\u00020\nH\u0016J\b\u0010\u000b\u001a\u00020\nH\u0014J\u0010\u0010\f\u001a\u00020\n2\u0006\u0010\r\u001a\u00020\u000eH\u0016J\u0006\u0010\u000f\u001a\u00020\nJ\u0010\u0010\u0010\u001a\u00020\n2\b\u0010\u0011\u001a\u0004\u0018\u00010\u0006R\u0010\u0010\u0003\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0005\u001a\u0004\u0018\u00010\u0006X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u0014"}, d2 = {"Lorg/godfootsteps/plan/PlanHomeFragment;", "Lorg/godfootsteps/base/BaseFragment;", "()V", "mAdapter", "Lorg/godfootsteps/plan/adapter/PlanHomeAdapter;", "mListener", "Lorg/godfootsteps/plan/PlanHomeFragment$DataStatusListener;", "getLayoutId", "", "initData", "", "initView", "onConfigurationChanged", "newConfig", "Landroid/content/res/Configuration;", "reload", "setListener", ServiceSpecificExtraArgs.CastExtraArgs.LISTENER, "Companion", "DataStatusListener", "plan_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class PlanHomeFragment extends BaseFragment {
public static final PlanHomeFragment f16145m = null;
public static PlanHomeModel f16146n;
public PlanHomeAdapter f16147k = new PlanHomeAdapter();
public a f16148l;
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\bf\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H&J\b\u0010\u0004\u001a\u00020\u0003H&J\b\u0010\u0005\u001a\u00020\u0003H&¨\u0006\u0006"}, d2 = {"Lorg/godfootsteps/plan/PlanHomeFragment$DataStatusListener;", "", "onChildError", "", "onChildLoaded", "onChildLoading", "plan_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public interface a {
void a();
void b();
void c();
}
static {
String e2 = new b("planHomeV2").e();
if (n.o.a.o(e2)) {
return;
}
try {
f16146n = ((PlanHomeJsonModel) m.a(e2, PlanHomeJsonModel.class)).getResult();
} catch (Exception unused) {
}
}
public static final String I(String str) {
Intent intent;
PlanHomeModel planHomeModel = f16146n;
String str2 = null;
String imageUrl = planHomeModel == null ? null : planHomeModel.getImageUrl();
boolean z = false;
if (imageUrl == null || n.o.a.o(imageUrl)) {
Activity c = m0.c();
if (c != null && (intent = c.getIntent()) != null) {
str2 = intent.getStringExtra("imageUrl");
}
imageUrl = str2;
}
if ((imageUrl == null || n.o.a.o(imageUrl)) ? true : true) {
StringBuilder J = i.a.b.a.a.J("/medias/");
J.append((Object) s.a());
J.append("/pictures/xPlan");
imageUrl = J.toString();
}
StringBuilder sb = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb.append("https://appservercn.kingdomsalvation.org");
sb.append((Object) imageUrl);
sb.append("/ld/");
sb.append((Object) str);
return sb.toString();
}
public static final boolean J(PlanEntity planEntity) {
List<String> planIdList;
h.e(planEntity, "plan");
PlanHomeModel planHomeModel = f16146n;
if (planHomeModel != null) {
h.c(planHomeModel);
List<String> planIdList2 = planHomeModel.getPlanIdList();
if (!(planIdList2 == null || planIdList2.isEmpty())) {
PlanHomeModel planHomeModel2 = f16146n;
if (planHomeModel2 != null && (planIdList = planHomeModel2.getPlanIdList()) != null) {
for (String str : planIdList) {
if (h.a(planEntity.getId(), str) || !h.a(planEntity.getLan(), s.a())) {
return false;
}
while (r0.hasNext()) {
}
}
}
return true;
}
}
return false;
}
@Override
public int E() {
return R.layout.fragment_plan_home;
}
@Override
public void G() {
a aVar;
View view = getView();
if ((view == null ? null : view.findViewById(R.id.recycler_view)) != null) {
View view2 = getView();
View findViewById = view2 != null ? view2.findViewById(R.id.recycler_view) : null;
h.c(findViewById);
if (((RecyclerView) findViewById).getAdapter() == null && (aVar = this.f16148l) != null) {
h.c(aVar);
aVar.b();
}
}
n.m.t.a.p.m.e1.a.f2(new l<Request<PlanHomeModel, BaseModel<PlanHomeModel>>, e>() {
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001H\u008a@"}, d2 = {"<anonymous>", "Lorg/godfootsteps/arch/api/model/BaseModel;", "Lorg/godfootsteps/arch/api/model/PlanHomeModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
@c(c = "org.godfootsteps.plan.PlanHomeFragment$initData$1$1", f = "PlanHomeFragment.kt", l = {59}, m = "invokeSuspend")
public static final class AnonymousClass1 extends SuspendLambda implements l<n.g.c<? super BaseModel<PlanHomeModel>>, Object> {
public int label;
public AnonymousClass1(n.g.c<? super AnonymousClass1> cVar) {
super(1, cVar);
}
@Override
public final n.g.c<e> create(n.g.c<?> cVar) {
return new AnonymousClass1(cVar);
}
@Override
public final Object invoke(n.g.c<? super BaseModel<PlanHomeModel>> cVar) {
return ((AnonymousClass1) create(cVar)).invokeSuspend(e.a);
}
@Override
public final Object invokeSuspend(Object obj) {
CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
int i2 = this.label;
if (i2 == 0) {
d.Q4(obj);
Objects.requireNonNull(AppClient.a);
AppClient appClient = AppClient.Companion.f15176d;
this.label = 1;
String str = v.i() ? "pad" : null;
if (str == null) {
str = "phone";
}
obj = appClient.d0(str, this);
if (obj == coroutineSingletons) {
return coroutineSingletons;
}
} else if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
d.Q4(obj);
}
return obj;
}
}
{
super(1);
}
@Override
public e invoke(Request<PlanHomeModel, BaseModel<PlanHomeModel>> request) {
invoke2(request);
return e.a;
}
public final void invoke2(Request<PlanHomeModel, BaseModel<PlanHomeModel>> request) {
h.e(request, "$this$request");
request.f(new AnonymousClass1(null));
final PlanHomeFragment planHomeFragment = PlanHomeFragment.this;
request.f15180l = new l<PlanHomeModel, e>() {
{
super(1);
}
@Override
public e invoke(PlanHomeModel planHomeModel) {
invoke2(planHomeModel);
return e.a;
}
public final void invoke2(PlanHomeModel planHomeModel) {
boolean z;
Fragment parentFragment;
FragmentManager childFragmentManager;
List<Fragment> K;
h.e(planHomeModel, "planHomeModel");
try {
PlanHomeFragment.a aVar2 = PlanHomeFragment.this.f16148l;
if (aVar2 != null) {
aVar2.a();
}
PlanHomeFragment planHomeFragment2 = PlanHomeFragment.f16145m;
PlanHomeFragment.f16146n = planHomeModel;
if (a.n1()) {
PlanHomeAdapter planHomeAdapter = PlanHomeFragment.this.f16147k;
h.c(planHomeAdapter);
planHomeAdapter.a = planHomeModel;
planHomeAdapter.b.clear();
planHomeAdapter.notifyDataSetChanged();
} else {
PlanHomeAdapter planHomeAdapter2 = PlanHomeFragment.this.f16147k;
h.c(planHomeAdapter2);
planHomeAdapter2.f(planHomeModel.trimInside());
}
View view3 = PlanHomeFragment.this.getView();
if (((RecyclerView) (view3 == null ? null : view3.findViewById(R.id.recycler_view))).getAdapter() == null) {
View view4 = PlanHomeFragment.this.getView();
View findViewById2 = view4 == null ? null : view4.findViewById(R.id.recycler_view);
h.c(findViewById2);
((RecyclerView) findViewById2).setAdapter(PlanHomeFragment.this.f16147k);
}
View view5 = PlanHomeFragment.this.getView();
View findViewById3 = view5 == null ? null : view5.findViewById(R.id.recycler_view);
PlanHomeAdapter planHomeAdapter3 = PlanHomeFragment.this.f16147k;
h.c(planHomeAdapter3);
((RecyclerView) findViewById3).setItemViewCacheSize(planHomeAdapter3.getItemCount());
final List<PlanHomeModel.DeleteBean> delete = planHomeModel.getDelete();
if (delete != null && !delete.isEmpty()) {
z = false;
if (!z) {
PlanDatabase.a aVar3 = PlanDatabase.f15245n;
PlanDatabase.f15247p.n(new Runnable() {
@Override
public final void run() {
for (PlanHomeModel.DeleteBean deleteBean : delete) {
PlanDatabase.a aVar4 = PlanDatabase.f15245n;
PlanDatabase planDatabase = PlanDatabase.f15247p;
d.c.a.f.z r2 = planDatabase.r();
String planId = deleteBean.getPlanId();
n.i.b.h.d(planId, "bean.planId");
n.i.b.h.e(r2, "<this>");
n.i.b.h.e(planId, "planId");
PlanEntity c = r2.c(planId);
if (c != null && c.getStatus() == 1) {
c.setNeedDelete(true);
r2.i(c);
} else {
r2.a(planId);
planDatabase.q().h(planId);
n.m.t.a.p.m.e1.a.I(planDatabase.s(), planId, null, false, 6);
}
}
}
});
delete.clear();
}
parentFragment = PlanHomeFragment.this.getParentFragment();
if (parentFragment != null && (childFragmentManager = parentFragment.getChildFragmentManager()) != null && (K = childFragmentManager.K()) != null) {
for (Fragment fragment : K) {
if (fragment instanceof PlanMyPlanFragment) {
PlanMyPlanFragment planMyPlanFragment = (PlanMyPlanFragment) fragment;
Objects.requireNonNull(planMyPlanFragment);
PlanDatabase.a aVar4 = PlanDatabase.f15245n;
planMyPlanFragment.I(a.u0(PlanDatabase.f15247p.r(), null, 1, null));
}
}
}
PlanHomeJsonModel planHomeJsonModel = new PlanHomeJsonModel();
planHomeJsonModel.setResult(planHomeModel);
planHomeJsonModel.setStatus(IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE);
b bVar = new b("planHomeV2");
String e2 = m.e(planHomeJsonModel);
h.d(e2, "toJson(jsonObj)");
bVar.g(e2);
}
z = true;
if (!z) {
}
parentFragment = PlanHomeFragment.this.getParentFragment();
if (parentFragment != null) {
while (r0.hasNext()) {
}
}
PlanHomeJsonModel planHomeJsonModel2 = new PlanHomeJsonModel();
planHomeJsonModel2.setResult(planHomeModel);
planHomeJsonModel2.setStatus(IcyHeaders.REQUEST_HEADER_ENABLE_METADATA_VALUE);
b bVar2 = new b("planHomeV2");
String e22 = m.e(planHomeJsonModel2);
h.d(e22, "toJson(jsonObj)");
bVar2.g(e22);
} catch (Exception e3) {
e3.printStackTrace();
PlanHomeFragment.a aVar5 = PlanHomeFragment.this.f16148l;
if (aVar5 != null) {
h.c(aVar5);
aVar5.c();
}
}
}
};
final PlanHomeFragment planHomeFragment2 = PlanHomeFragment.this;
request.f15181m = new p<Integer, String, e>() {
{
super(2);
}
@Override
public e invoke(Integer num, String str) {
invoke(num.intValue(), str);
return e.a;
}
public final void invoke(int i2, String str) {
h.e(str, "s");
PlanHomeAdapter planHomeAdapter = PlanHomeFragment.this.f16147k;
if (planHomeAdapter != null) {
h.c(planHomeAdapter);
if (planHomeAdapter.getItemCount() != 0) {
return;
}
}
PlanHomeFragment.a aVar2 = PlanHomeFragment.this.f16148l;
if (aVar2 == null) {
return;
}
aVar2.c();
}
};
}
});
}
@Override
public void H() {
}
@Override
public void onConfigurationChanged(Configuration configuration) {
h.e(configuration, "newConfig");
super.onConfigurationChanged(configuration);
if (v.i()) {
View view = getView();
RecyclerView recyclerView = (RecyclerView) (view == null ? null : view.findViewById(R.id.recycler_view));
boolean z = false;
if (recyclerView != null && recyclerView.isComputingLayout()) {
z = true;
}
if (z) {
a0.a(new Runnable() {
@Override
public final void run() {
PlanHomeFragment planHomeFragment = PlanHomeFragment.this;
PlanHomeFragment planHomeFragment2 = PlanHomeFragment.f16145m;
n.i.b.h.e(planHomeFragment, "this$0");
PlanHomeAdapter planHomeAdapter = planHomeFragment.f16147k;
if (planHomeAdapter == null) {
return;
}
planHomeAdapter.notifyDataSetChanged();
}
});
return;
}
PlanHomeAdapter planHomeAdapter = this.f16147k;
if (planHomeAdapter == null) {
return;
}
planHomeAdapter.notifyDataSetChanged();
}
}
}