Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 AboutShopFragment.java 源代码,内容仅作参考
package by.kufar.userpofile.ui.shop.about;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.autofill.HintConstants;
import androidx.core.os.BundleKt;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentViewModelLazyKt;
import androidx.lifecycle.HasDefaultViewModelProviderFactory;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.lifecycle.viewmodel.CreationExtras;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import by.kufar.core.android.fragment.BaseFragment;
import by.kufar.re.ui.widget.webview.WebViewActivity;
import by.kufar.userpofile.R$id;
import by.kufar.userpofile.R$layout;
import by.kufar.userpofile.ui.shop.ShopActivity;
import by.kufar.userpofile.ui.shop.about.adapter.AboutShopController;
import com.ironsource.mediationsdk.adunit.data.DataKeys;
import d80.j;
import d80.k;
import d80.u;
import java.util.List;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.g0;
import kotlin.jvm.internal.m;
import kotlin.jvm.internal.o0;
import kotlin.jvm.internal.s;
import kotlin.reflect.KProperty;
import to.a;
import to.b;
@Metadata(d1 = {"\u0000\u008c\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\t\n\u0002\b\t\u0018\u0000 J2\u00020\u00012\u00020\u0002:\u0001KB\u0007¢\u0006\u0004\bH\u0010IJ\b\u0010\u0004\u001a\u00020\u0003H\u0002J\b\u0010\u0005\u001a\u00020\u0003H\u0002J\b\u0010\u0006\u001a\u00020\u0003H\u0016J&\u0010\u000e\u001a\u0004\u0018\u00010\r2\u0006\u0010\b\u001a\u00020\u00072\b\u0010\n\u001a\u0004\u0018\u00010\t2\b\u0010\f\u001a\u0004\u0018\u00010\u000bH\u0016J\u001a\u0010\u0010\u001a\u00020\u00032\u0006\u0010\u000f\u001a\u00020\r2\b\u0010\f\u001a\u0004\u0018\u00010\u000bH\u0016J\u0010\u0010\u0013\u001a\u00020\u00032\u0006\u0010\u0012\u001a\u00020\u0011H\u0016J\u0010\u0010\u0016\u001a\u00020\u00032\u0006\u0010\u0015\u001a\u00020\u0014H\u0016J\u0010\u0010\u0018\u001a\u00020\u00032\u0006\u0010\u0012\u001a\u00020\u0017H\u0016J\b\u0010\u0019\u001a\u00020\u0003H\u0016J\u0012\u0010\u001c\u001a\u00020\u00032\b\u0010\u001b\u001a\u0004\u0018\u00010\u001aH\u0016J\u0010\u0010\u001e\u001a\u00020\u00032\u0006\u0010\u0012\u001a\u00020\u001dH\u0016R\"\u0010 \u001a\u00020\u001f8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b \u0010!\u001a\u0004\b\"\u0010#\"\u0004\b$\u0010%R\"\u0010'\u001a\u00020&8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b'\u0010(\u001a\u0004\b)\u0010*\"\u0004\b+\u0010,R\"\u0010.\u001a\u00020-8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b.\u0010/\u001a\u0004\b0\u00101\"\u0004\b2\u00103R\u001b\u00109\u001a\u0002048BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b5\u00106\u001a\u0004\b7\u00108R\u0016\u0010;\u001a\u00020:8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\b;\u0010<R\u001b\u0010B\u001a\u00020=8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b>\u0010?\u001a\u0004\b@\u0010AR\u001b\u0010G\u001a\u00020C8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bD\u00106\u001a\u0004\bE\u0010F¨\u0006L"}, d2 = {"Lby/kufar/userpofile/ui/shop/about/AboutShopFragment;", "Lby/kufar/core/android/fragment/BaseFragment;", "Lby/kufar/userpofile/ui/shop/about/adapter/AboutShopController$a;", "", "setUpRecycler", "setUpViewModel", "onInject", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroid/view/View;", "onCreateView", "view", "onViewCreated", "Lto/a$g;", "item", "onGeoAddressClick", "Lto/a$j;", "map", "onMapClick", "Lto/b$d;", "onWebLinkClicked", "onEcomTextClicked", "", HintConstants.AUTOFILL_HINT_PHONE, "onPhoneClick", "Lto/b$b;", "onExpandableListClick", "Landroidx/lifecycle/ViewModelProvider$Factory;", "viewModelProvider", "Landroidx/lifecycle/ViewModelProvider$Factory;", "getViewModelProvider", "()Landroidx/lifecycle/ViewModelProvider$Factory;", "setViewModelProvider", "(Landroidx/lifecycle/ViewModelProvider$Factory;)V", "Lcb/b;", "mediator", "Lcb/b;", "getMediator", "()Lcb/b;", "setMediator", "(Lcb/b;)V", "Lqo/a;", "tracker", "Lqo/a;", "getTracker", "()Lqo/a;", "setTracker", "(Lqo/a;)V", "Lby/kufar/userpofile/ui/shop/about/AboutShopVM;", "viewModel$delegate", "Ld80/j;", "getViewModel", "()Lby/kufar/userpofile/ui/shop/about/AboutShopVM;", "viewModel", "Lby/kufar/userpofile/ui/shop/about/adapter/AboutShopController;", "controller", "Lby/kufar/userpofile/ui/shop/about/adapter/AboutShopController;", "Landroidx/recyclerview/widget/RecyclerView;", "recycler$delegate", "Li6/c;", "getRecycler", "()Landroidx/recyclerview/widget/RecyclerView;", "recycler", "", "userId$delegate", "getUserId", "()J", DataKeys.USER_ID, "<init>", "()V", "Companion", "a", "feature-user-profile_googleRelease"}, k = 1, mv = {1, 9, 0})
public final class AboutShopFragment extends BaseFragment implements AboutShopController.a {
static final KProperty<Object>[] $$delegatedProperties = {o0.i(new g0(AboutShopFragment.class, "recycler", "getRecycler()Landroidx/recyclerview/widget/RecyclerView;", 0))};
public static final Companion INSTANCE = new Companion(null);
private static final String KEY_USER_ID = "KEY_ACCOUNT_ID";
private AboutShopController controller;
public cb.b mediator;
private final i6.c recycler;
public qo.a tracker;
private final j userId;
private final j viewModel;
public ViewModelProvider.Factory viewModelProvider;
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0005\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\t\u0010\nJ\u000e\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002R\u0014\u0010\u0007\u001a\u00020\u00068\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0007\u0010\b¨\u0006\u000b"}, d2 = {"Lby/kufar/userpofile/ui/shop/about/AboutShopFragment$a;", "", "", DataKeys.USER_ID, "Landroidx/fragment/app/Fragment;", "a", "", "KEY_USER_ID", "Ljava/lang/String;", "<init>", "()V", "feature-user-profile_googleRelease"}, k = 1, mv = {1, 9, 0})
public static final class Companion {
public Companion() {
}
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final Fragment a(long userId) {
AboutShopFragment aboutShopFragment = new AboutShopFragment();
aboutShopFragment.setArguments(BundleKt.bundleOf(u.a(AboutShopFragment.KEY_USER_ID, Long.valueOf(userId))));
return aboutShopFragment;
}
}
@Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
public static final class b implements Observer, m {
public final Function1 f19222b;
public b(Function1 function) {
s.j(function, "function");
this.f19222b = function;
}
public final boolean equals(Object obj) {
if (!(obj instanceof Observer) || !(obj instanceof m)) {
return false;
}
return s.e(getFunctionDelegate(), ((m) obj).getFunctionDelegate());
}
@Override
public final d80.f<?> getFunctionDelegate() {
return this.f19222b;
}
public final int hashCode() {
return getFunctionDelegate().hashCode();
}
@Override
public final void onChanged(Object obj) {
this.f19222b.invoke(obj);
}
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\u0010\u0007\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"", "Lto/b;", "kotlin.jvm.PlatformType", "it", "", "invoke", "(Ljava/util/List;)V", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class c extends kotlin.jvm.internal.u implements Function1<List<? extends to.b>, Unit> {
public c() {
super(1);
}
@Override
public Unit invoke(List<? extends to.b> list) {
invoke2(list);
return Unit.f82492a;
}
public final void invoke2(List<? extends to.b> list) {
AboutShopController aboutShopController = AboutShopFragment.this.controller;
if (aboutShopController == null) {
s.B("controller");
aboutShopController = null;
}
s.g(list);
aboutShopController.setItems(list);
}
}
@Metadata(d1 = {"\u0000\u0004\n\u0002\b\u0004\u0010\u0003\u001a\u00028\u0000\"\u0004\b\u0000\u0010\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"T", "invoke", "()Ljava/lang/Object;", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class d extends kotlin.jvm.internal.u implements Function0<Long> {
public d() {
super(0);
}
@Override
public final Long invoke() {
Bundle arguments = AboutShopFragment.this.getArguments();
if (arguments != null) {
return Long.valueOf(arguments.getLong(AboutShopFragment.KEY_USER_ID, -1L));
}
throw new IllegalStateException("AboutShopFragment must be used with userId");
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001\"\n\b\u0000\u0010\u0002\u0018\u0001*\u00020\u0003H\n¢\u0006\u0002\b\u0004¨\u0006\u0005"}, d2 = {"<anonymous>", "Landroidx/fragment/app/Fragment;", "VM", "Landroidx/lifecycle/ViewModel;", "invoke", "androidx/fragment/app/FragmentViewModelLazyKt$viewModels$5"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class e extends kotlin.jvm.internal.u implements Function0<Fragment> {
public final Fragment f19225d;
public e(Fragment fragment) {
super(0);
this.f19225d = fragment;
}
@Override
public final Fragment invoke() {
return this.f19225d;
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001\"\n\b\u0000\u0010\u0002\u0018\u0001*\u00020\u0003H\n¢\u0006\u0002\b\u0004¨\u0006\u0005"}, d2 = {"<anonymous>", "Landroidx/lifecycle/ViewModelStoreOwner;", "VM", "Landroidx/lifecycle/ViewModel;", "invoke", "androidx/fragment/app/FragmentViewModelLazyKt$viewModels$owner$4"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class f extends kotlin.jvm.internal.u implements Function0<ViewModelStoreOwner> {
public final Function0 f19226d;
public f(Function0 function0) {
super(0);
this.f19226d = function0;
}
@Override
public final ViewModelStoreOwner invoke() {
return (ViewModelStoreOwner) this.f19226d.invoke();
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001\"\n\b\u0000\u0010\u0002\u0018\u0001*\u00020\u0003H\n¢\u0006\u0002\b\u0004¨\u0006\u0005"}, d2 = {"<anonymous>", "Landroidx/lifecycle/ViewModelStore;", "VM", "Landroidx/lifecycle/ViewModel;", "invoke", "androidx/fragment/app/FragmentViewModelLazyKt$viewModels$6"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class g extends kotlin.jvm.internal.u implements Function0<ViewModelStore> {
public final j f19227d;
public g(j jVar) {
super(0);
this.f19227d = jVar;
}
@Override
public final ViewModelStore invoke() {
ViewModelStoreOwner m4202viewModels$lambda1;
m4202viewModels$lambda1 = FragmentViewModelLazyKt.m4202viewModels$lambda1(this.f19227d);
ViewModelStore viewModelStore = m4202viewModels$lambda1.getViewModelStore();
s.i(viewModelStore, "owner.viewModelStore");
return viewModelStore;
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001\"\n\b\u0000\u0010\u0002\u0018\u0001*\u00020\u0003H\n¢\u0006\u0002\b\u0004¨\u0006\u0005"}, d2 = {"<anonymous>", "Landroidx/lifecycle/viewmodel/CreationExtras;", "VM", "Landroidx/lifecycle/ViewModel;", "invoke", "androidx/fragment/app/FragmentViewModelLazyKt$viewModels$7"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class h extends kotlin.jvm.internal.u implements Function0<CreationExtras> {
public final Function0 f19228d;
public final j f19229e;
public h(Function0 function0, j jVar) {
super(0);
this.f19228d = function0;
this.f19229e = jVar;
}
@Override
public final CreationExtras invoke() {
ViewModelStoreOwner m4202viewModels$lambda1;
CreationExtras creationExtras;
Function0 function0 = this.f19228d;
if (function0 != null && (creationExtras = (CreationExtras) function0.invoke()) != null) {
return creationExtras;
}
m4202viewModels$lambda1 = FragmentViewModelLazyKt.m4202viewModels$lambda1(this.f19229e);
HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactory = m4202viewModels$lambda1 instanceof HasDefaultViewModelProviderFactory ? (HasDefaultViewModelProviderFactory) m4202viewModels$lambda1 : null;
CreationExtras defaultViewModelCreationExtras = hasDefaultViewModelProviderFactory != null ? hasDefaultViewModelProviderFactory.getDefaultViewModelCreationExtras() : null;
return defaultViewModelCreationExtras == null ? CreationExtras.Empty.INSTANCE : defaultViewModelCreationExtras;
}
}
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "Landroidx/lifecycle/ViewModelProvider$Factory;", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class i extends kotlin.jvm.internal.u implements Function0<ViewModelProvider.Factory> {
public i() {
super(0);
}
@Override
public final ViewModelProvider.Factory invoke() {
return AboutShopFragment.this.getViewModelProvider();
}
}
public AboutShopFragment() {
i iVar = new i();
e eVar = new e(this);
d80.m mVar = d80.m.f73493d;
j a11 = k.a(mVar, new f(eVar));
this.viewModel = FragmentViewModelLazyKt.createViewModelLazy(this, o0.b(AboutShopVM.class), new g(a11), new h(null, a11), iVar);
this.recycler = bindView(R$id.M);
this.userId = k.a(mVar, new d());
}
private final RecyclerView getRecycler() {
return (RecyclerView) this.recycler.getValue(this, $$delegatedProperties[0]);
}
private final long getUserId() {
return ((Number) this.userId.getValue()).longValue();
}
private final AboutShopVM getViewModel() {
return (AboutShopVM) this.viewModel.getValue();
}
private final void setUpRecycler() {
Context context = getContext();
if (context == null) {
return;
}
this.controller = new AboutShopController(context, this);
getRecycler().setLayoutManager(new LinearLayoutManager(context));
RecyclerView recycler = getRecycler();
AboutShopController aboutShopController = this.controller;
if (aboutShopController == null) {
s.B("controller");
aboutShopController = null;
}
recycler.setAdapter(aboutShopController.getAdapter());
}
private final void setUpViewModel() {
getViewModel().getItems().observe(getViewLifecycleOwner(), new b(new c()));
getViewModel().init(getUserId());
}
public final cb.b getMediator() {
cb.b bVar = this.mediator;
if (bVar != null) {
return bVar;
}
s.B("mediator");
return null;
}
public final qo.a getTracker() {
qo.a aVar = this.tracker;
if (aVar != null) {
return aVar;
}
s.B("tracker");
return null;
}
public final ViewModelProvider.Factory getViewModelProvider() {
ViewModelProvider.Factory factory = this.viewModelProvider;
if (factory != null) {
return factory;
}
s.B("viewModelProvider");
return null;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
s.j(inflater, "inflater");
return inflater.inflate(R$layout.f19031b, container, false);
}
@Override
public void onEcomTextClicked() {
Context context = getContext();
if (context == null) {
return;
}
startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://mart.gov.by/sites/mart/home/activities/crp.html", false, null, false, false, 60, null));
}
@Override
public void onExpandableListClick(b.ExpandableList item) {
s.j(item, "item");
getTracker().m(getUserId(), item.getId());
}
@Override
public void onGeoAddressClick(a.GeoAddress item) {
String b11;
s.j(item, "item");
Context context = getContext();
if (context == null || (b11 = item.getAddress().b()) == null) {
return;
}
startActivity(getMediator().k().c(context, b11));
}
@Override
public void onInject() {
ShopActivity shopActivity;
so.d component;
super.onInject();
FragmentActivity activity = getActivity();
if (activity instanceof ShopActivity) {
shopActivity = (ShopActivity) activity;
} else {
shopActivity = null;
}
if (shopActivity != null && (component = shopActivity.getComponent()) != null) {
component.b(this);
}
}
@Override
public void onMapClick(a.Map map) {
s.j(map, "map");
Context context = getContext();
if (context == null) {
return;
}
startActivity(getMediator().k().c(context, map.getCoordinates()));
}
@Override
public void onPhoneClick(String phone) {
Context context;
if (phone == null || (context = getContext()) == null) {
return;
}
a6.k.f289a.d(context, phone);
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
s.j(view, "view");
super.onViewCreated(view, savedInstanceState);
setUpRecycler();
setUpViewModel();
}
@Override
public void onWebLinkClicked(b.WebLink item) {
s.j(item, "item");
Context context = getContext();
if (context == null) {
return;
}
startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, item.getLink(), false, null, false, false, 60, null));
}
public final void setMediator(cb.b bVar) {
s.j(bVar, "<set-?>");
this.mediator = bVar;
}
public final void setTracker(qo.a aVar) {
s.j(aVar, "<set-?>");
this.tracker = aVar;
}
public final void setViewModelProvider(ViewModelProvider.Factory factory) {
s.j(factory, "<set-?>");
this.viewModelProvider = factory;
}
}