Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 MyAdsFragment.java 源代码,内容仅作参考
package by.kufar.newdesign.myads.internal.ui.ads;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.compose.runtime.Composable;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.internal.ComposableLambdaKt;
import androidx.core.os.BundleKt;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentResultListener;
import androidx.fragment.app.FragmentViewModelLazyKt;
import androidx.graphics.result.ActivityResult;
import androidx.graphics.result.ActivityResultCallback;
import androidx.graphics.result.ActivityResultLauncher;
import androidx.graphics.result.contract.ActivityResultContracts;
import androidx.lifecycle.HasDefaultViewModelProviderFactory;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.lifecycle.viewmodel.CreationExtras;
import by.kufar.core.android.fragment.BaseFragment;
import by.kufar.newdesign.myads.internal.ui.MyAdsContainerFragment;
import by.kufar.newdesign.myads.internal.ui.ads.MyAdsVM;
import by.kufar.newdesign.myads.internal.ui.ads.a;
import by.kufar.newdesign.myads.internal.ui.promote.PromoteBottomSheet;
import by.kufar.newdesign.myads.internal.ui.sorting.SortingBottomSheet;
import by.kufar.re.ui.widget.webview.WebViewActivity;
import com.google.android.material.snackbar.Snackbar;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.tapjoy.TapjoyAuctionFlags;
import com.yandex.mobile.ads.banner.AdSize;
import com.yandex.mobile.ads.banner.BannerAdEventListener;
import com.yandex.mobile.ads.banner.BannerAdView;
import com.yandex.mobile.ads.common.AdRequestError;
import com.yandex.mobile.ads.common.ImpressionData;
import d80.m;
import d80.q;
import d80.u;
import db.c;
import db.s0;
import e80.b0;
import java.io.Serializable;
import kotlin.C2712h;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.o0;
import kotlin.jvm.internal.s;
import kotlinx.coroutines.d2;
import kotlinx.coroutines.q0;
import me.MyAdsItem;
import oe.v;
@Metadata(d1 = {"\u0000¸\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010\t\n\u0000\n\u0002\u0018\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\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\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\u0004\n\u0002\u0018\u0002\n\u0002\b\u0005\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\t\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\t\b\u0000\u0018\u0000 o2\u00020\u0001:\u0001pB\u0007¢\u0006\u0004\bm\u0010nJ\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0002J\b\u0010\u0006\u001a\u00020\u0004H\u0002J\b\u0010\u0007\u001a\u00020\u0004H\u0002J\u0018\u0010\f\u001a\u00020\u00042\u0006\u0010\t\u001a\u00020\b2\u0006\u0010\u000b\u001a\u00020\nH\u0002J\b\u0010\r\u001a\u00020\u0004H\u0002J\u0010\u0010\u000f\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u000eH\u0002J\u0018\u0010\u0013\u001a\u00020\u00122\u0006\u0010\u0003\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\bH\u0002J \u0010\u001a\u001a\u00020\u00042\u0006\u0010\u0015\u001a\u00020\u00142\u0006\u0010\u0017\u001a\u00020\u00162\u0006\u0010\u0019\u001a\u00020\u0018H\u0002J\b\u0010\u001b\u001a\u00020\u0004H\u0002J$\u0010#\u001a\u00020\"2\u0006\u0010\u001d\u001a\u00020\u001c2\b\u0010\u001f\u001a\u0004\u0018\u00010\u001e2\b\u0010!\u001a\u0004\u0018\u00010 H\u0016J\b\u0010$\u001a\u00020\u0004H\u0016J\u001a\u0010&\u001a\u00020\u00042\u0006\u0010%\u001a\u00020\"2\b\u0010!\u001a\u0004\u0018\u00010 H\u0016R\u001b\u0010,\u001a\u00020'8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b(\u0010)\u001a\u0004\b*\u0010+R\"\u0010.\u001a\u00020-8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b.\u0010/\u001a\u0004\b0\u00101\"\u0004\b2\u00103R\"\u00105\u001a\u0002048\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b5\u00106\u001a\u0004\b7\u00108\"\u0004\b9\u0010:R\"\u0010<\u001a\u00020;8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b<\u0010=\u001a\u0004\b>\u0010?\"\u0004\b@\u0010AR\"\u0010C\u001a\u00020B8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\bC\u0010D\u001a\u0004\bE\u0010F\"\u0004\bG\u0010HR\"\u0010I\u001a\u00020B8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\bI\u0010D\u001a\u0004\bJ\u0010F\"\u0004\bK\u0010HR\"\u0010M\u001a\u00020L8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\bM\u0010N\u001a\u0004\bO\u0010P\"\u0004\bQ\u0010RR\"\u0010S\u001a\u00020B8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\bS\u0010D\u001a\u0004\bT\u0010F\"\u0004\bU\u0010HR\"\u0010W\u001a\u00020V8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\bW\u0010X\u001a\u0004\bY\u0010Z\"\u0004\b[\u0010\\R\u001b\u0010a\u001a\u00020]8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b^\u0010)\u001a\u0004\b_\u0010`R\"\u0010e\u001a\u0010\u0012\f\u0012\n d*\u0004\u0018\u00010c0c0b8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\be\u0010fR\"\u0010g\u001a\u0010\u0012\f\u0012\n d*\u0004\u0018\u00010c0c0b8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bg\u0010fR\u001b\u0010l\u001a\u00020h8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bi\u0010)\u001a\u0004\bj\u0010k¨\u0006q"}, d2 = {"Lby/kufar/newdesign/myads/internal/ui/ads/MyAdsFragment;", "Lby/kufar/core/android/fragment/BaseFragment;", "Lby/kufar/newdesign/myads/internal/ui/ads/a;", "action", "", "onActionClicked", "updateCounters", "setUp", "", "itemID", "Lby/kufar/newdesign/myads/internal/ui/promote/PromoteBottomSheet$a$a;", TapjoyAuctionFlags.AUCTION_TYPE, "showPromoteBottomSheet", "showSortingBottomSheet", "Lpe/a;", "onSortingClicked", "Loe/v;", "adID", "Lkotlinx/coroutines/d2;", "onPromoteClicked", "Landroid/content/Context;", "context", "Lan/a;", "vas", "Lme/b;", "item", "openVasScreen", "reloadPageAndCounters", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroid/view/View;", "onCreateView", "onInject", "view", "onViewCreated", "Lme/f;", "tab$delegate", "Ld80/j;", "getTab", "()Lme/f;", "tab", "Lby/kufar/newdesign/myads/internal/ui/ads/MyAdsVM$f;", "viewModelFactory", "Lby/kufar/newdesign/myads/internal/ui/ads/MyAdsVM$f;", "getViewModelFactory", "()Lby/kufar/newdesign/myads/internal/ui/ads/MyAdsVM$f;", "setViewModelFactory", "(Lby/kufar/newdesign/myads/internal/ui/ads/MyAdsVM$f;)V", "Ltk/a;", "ribbonsDecorator", "Ltk/a;", "getRibbonsDecorator", "()Ltk/a;", "setRibbonsDecorator", "(Ltk/a;)V", "Lcb/b;", "mediator", "Lcb/b;", "getMediator", "()Lcb/b;", "setMediator", "(Lcb/b;)V", "Lde/a;", "myAdsTracker", "Lde/a;", "getMyAdsTracker", "()Lde/a;", "setMyAdsTracker", "(Lde/a;)V", "tracker", "getTracker", "setTracker", "Lme/j;", "userAdvertisementsCache", "Lme/j;", "getUserAdvertisementsCache", "()Lme/j;", "setUserAdvertisementsCache", "(Lme/j;)V", "analytics", "getAnalytics", "setAnalytics", "Lwi/e;", "myAdsBannerHelper", "Lwi/e;", "getMyAdsBannerHelper", "()Lwi/e;", "setMyAdsBannerHelper", "(Lwi/e;)V", "Lby/kufar/newdesign/myads/internal/ui/ads/MyAdsVM;", "myAdsVM$delegate", "getMyAdsVM", "()Lby/kufar/newdesign/myads/internal/ui/ads/MyAdsVM;", "myAdsVM", "Landroidx/activity/result/ActivityResultLauncher;", "Landroid/content/Intent;", "kotlin.jvm.PlatformType", "startForRefresh", "Landroidx/activity/result/ActivityResultLauncher;", "deactivationResult", "Lcom/yandex/mobile/ads/banner/BannerAdView;", "bannerView$delegate", "getBannerView", "()Lcom/yandex/mobile/ads/banner/BannerAdView;", "bannerView", "<init>", "()V", "Companion", "a", "feature-my-ads_googleRelease"}, k = 1, mv = {1, 9, 0})
public final class MyAdsFragment extends BaseFragment {
public static final Companion INSTANCE = new Companion(null);
public static final String KEY_TAB_STATUS = "TAB_STATUS";
public de.a analytics;
private final d80.j bannerView;
private final ActivityResultLauncher<Intent> deactivationResult;
public cb.b mediator;
public wi.e myAdsBannerHelper;
public de.a myAdsTracker;
private final d80.j myAdsVM;
public tk.a ribbonsDecorator;
private final ActivityResultLauncher<Intent> startForRefresh;
private final d80.j tab;
public de.a tracker;
public me.j userAdvertisementsCache;
public MyAdsVM.f viewModelFactory;
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\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\u0010\u0010\u0005\u001a\u00020\u00042\b\b\u0002\u0010\u0003\u001a\u00020\u0002R\u0014\u0010\u0007\u001a\u00020\u00068\u0006X\u0086T¢\u0006\u0006\n\u0004\b\u0007\u0010\b¨\u0006\u000b"}, d2 = {"Lby/kufar/newdesign/myads/internal/ui/ads/MyAdsFragment$a;", "", "Lme/f;", "tab", "Lby/kufar/newdesign/myads/internal/ui/ads/MyAdsFragment;", "a", "", "KEY_TAB_STATUS", "Ljava/lang/String;", "<init>", "()V", "feature-my-ads_googleRelease"}, k = 1, mv = {1, 9, 0})
public static final class Companion {
public Companion() {
}
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final MyAdsFragment a(me.f tab) {
s.j(tab, "tab");
MyAdsFragment myAdsFragment = new MyAdsFragment();
myAdsFragment.setArguments(BundleKt.bundleOf(u.a(MyAdsFragment.KEY_TAB_STATUS, tab)));
return myAdsFragment;
}
}
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\n"}, d2 = {"Landroidx/activity/result/ActivityResult;", IronSourceConstants.EVENTS_RESULT, "", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class c implements ActivityResultCallback<ActivityResult> {
public c() {
}
@Override
public final void onActivityResult(ActivityResult result) {
s.j(result, "result");
if (result.getResultCode() == -1) {
MyAdsFragment.this.getMyAdsTracker().b();
MyAdsFragment.this.updateCounters();
}
}
}
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001H\u000b¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"<anonymous>", "", "invoke", "(Landroidx/compose/runtime/Composer;I)V"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class d extends kotlin.jvm.internal.u implements Function2<Composer, Integer, Unit> {
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Lby/kufar/newdesign/myads/internal/ui/ads/a;", "action", "", "a", "(Lby/kufar/newdesign/myads/internal/ui/ads/a;)V"}, k = 3, mv = {1, 9, 0})
public static final class a extends kotlin.jvm.internal.u implements Function1<by.kufar.newdesign.myads.internal.ui.ads.a, Unit> {
public final MyAdsFragment f12082d;
public a(MyAdsFragment myAdsFragment) {
super(1);
this.f12082d = myAdsFragment;
}
public final void a(by.kufar.newdesign.myads.internal.ui.ads.a action) {
s.j(action, "action");
this.f12082d.onActionClicked(action);
}
@Override
public Unit invoke(by.kufar.newdesign.myads.internal.ui.ads.a aVar) {
a(aVar);
return Unit.f82492a;
}
}
public d() {
super(2);
}
@Override
public Unit mo1invoke(Composer composer, Integer num) {
invoke(composer, num.intValue());
return Unit.f82492a;
}
@Composable
public final void invoke(Composer composer, int i11) {
if ((i11 & 11) == 2 && composer.getSkipping()) {
composer.skipToGroupEnd();
return;
}
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventStart(685970513, i11, -1, "by.kufar.newdesign.myads.internal.ui.ads.MyAdsFragment.onCreateView.<anonymous> (MyAdsFragment.kt:112)");
}
C2712h.a(MyAdsFragment.this.getTab(), MyAdsFragment.this.getMyAdsVM(), MyAdsFragment.this.getBannerView(), new a(MyAdsFragment.this), composer, 576);
if (ComposerKt.isTraceInProgress()) {
ComposerKt.traceEventEnd();
}
}
}
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/q0;", "", "<anonymous>"}, k = 3, mv = {1, 9, 0})
@l80.f(c = "by.kufar.newdesign.myads.internal.ui.ads.MyAdsFragment$onPromoteClicked$1", f = "MyAdsFragment.kt", l = {211}, m = "invokeSuspend")
public static final class e extends l80.l implements Function2<q0, j80.d<? super Unit>, Object> {
public int f12083b;
public final long f12085d;
public final v f12086e;
@Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
public class a {
public static final int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[v.values().length];
try {
iArr[v.f87507b.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[v.f87513h.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
iArr[v.f87508c.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
iArr[v.f87509d.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
iArr[v.f87510e.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
iArr[v.f87511f.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
iArr[v.f87517l.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
iArr[v.f87518m.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
iArr[v.f87520o.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
iArr[v.f87521p.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
iArr[v.f87514i.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
iArr[v.f87512g.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
try {
iArr[v.f87515j.ordinal()] = 13;
} catch (NoSuchFieldError unused13) {
}
try {
iArr[v.f87516k.ordinal()] = 14;
} catch (NoSuchFieldError unused14) {
}
try {
iArr[v.f87519n.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
$EnumSwitchMapping$0 = iArr;
}
}
public e(long j11, v vVar, j80.d<? super e> dVar) {
super(2, dVar);
this.f12085d = j11;
this.f12086e = vVar;
}
@Override
public final j80.d<Unit> create(Object obj, j80.d<?> dVar) {
return new e(this.f12085d, this.f12086e, dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
Object f11 = k80.c.f();
int i11 = this.f12083b;
if (i11 != 0) {
if (i11 == 1) {
q.b(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
} else {
q.b(obj);
me.j userAdvertisementsCache = MyAdsFragment.this.getUserAdvertisementsCache();
long j11 = this.f12085d;
this.f12083b = 1;
obj = userAdvertisementsCache.e(j11, this);
if (obj == f11) {
return f11;
}
}
MyAdsItem myAdsItem = (MyAdsItem) obj;
if (myAdsItem == null) {
return Unit.f82492a;
}
Context context = MyAdsFragment.this.getContext();
if (context == null) {
return Unit.f82492a;
}
switch (a.$EnumSwitchMapping$0[this.f12086e.ordinal()]) {
case 1:
case 2:
MyAdsFragment.this.openVasScreen(context, an.a.f749c, myAdsItem);
break;
case 3:
MyAdsFragment.this.openVasScreen(context, an.a.f751e, myAdsItem);
break;
case 4:
MyAdsFragment.this.openVasScreen(context, an.a.f750d, myAdsItem);
break;
case 5:
MyAdsFragment.this.openVasScreen(context, an.a.f752f, myAdsItem);
break;
case 6:
MyAdsFragment.this.openVasScreen(context, an.a.f753g, myAdsItem);
break;
case 7:
MyAdsFragment.this.getMyAdsVM().putAdInFreeSlot(myAdsItem.getAdID());
break;
case 8:
MyAdsFragment.this.getMyAdsVM().putAdInPaidSlot(myAdsItem.getAdID());
break;
case 9:
MyAdsFragment.this.getMyAdsVM().activateAdvert(myAdsItem.getListId(), myAdsItem.getAdID());
break;
case 10:
MyAdsFragment.this.getMyAdsVM().deleteAdvert(myAdsItem.getListId(), myAdsItem.getAdID());
break;
case 11:
MyAdsFragment myAdsFragment = MyAdsFragment.this;
myAdsFragment.startActivity(myAdsFragment.getMediator().r().c(context, myAdsItem.getSubCategory()));
break;
case 12:
MyAdsFragment.this.startForRefresh.launch(c.a.a(MyAdsFragment.this.getMediator().Q(), context, myAdsItem.getAdID(), true, myAdsItem.getListId(), false, 16, null));
break;
case 13:
MyAdsFragment.this.startForRefresh.launch(MyAdsFragment.this.getMediator().Q().a(context, myAdsItem.getAdID(), false, myAdsItem.getListId(), true));
break;
case 14:
MyAdsFragment.this.getMyAdsVM().deactivateAdvert(myAdsItem.getAdID(), myAdsItem.getName());
break;
case 15:
MyAdsFragment.this.getMyAdsVM().prolongAdvert(myAdsItem.getAdID(), myAdsItem.getListId());
break;
}
return Unit.f82492a;
}
@Override
public final Object mo1invoke(q0 q0Var, j80.d<? super Unit> dVar) {
return ((e) create(q0Var, dVar)).invokeSuspend(Unit.f82492a);
}
}
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\u008a@"}, d2 = {"Lby/kufar/newdesign/myads/internal/ui/ads/MyAdsVM$e;", "event", "", "<anonymous>"}, k = 3, mv = {1, 9, 0})
@l80.f(c = "by.kufar.newdesign.myads.internal.ui.ads.MyAdsFragment$setUp$1", f = "MyAdsFragment.kt", l = {}, m = "invokeSuspend")
public static final class f extends l80.l implements Function2<MyAdsVM.e, j80.d<? super Unit>, Object> {
public int f12087b;
public Object f12088c;
public f(j80.d<? super f> dVar) {
super(2, dVar);
}
@Override
public final Object mo1invoke(MyAdsVM.e eVar, j80.d<? super Unit> dVar) {
return ((f) create(eVar, dVar)).invokeSuspend(Unit.f82492a);
}
@Override
public final j80.d<Unit> create(Object obj, j80.d<?> dVar) {
f fVar = new f(dVar);
fVar.f12088c = obj;
return fVar;
}
@Override
public final Object invokeSuspend(Object obj) {
k80.c.f();
if (this.f12087b == 0) {
q.b(obj);
MyAdsVM.e eVar = (MyAdsVM.e) this.f12088c;
if (eVar instanceof MyAdsVM.e.ShowSnackBar) {
Snackbar s11 = ek.b.s(ek.b.f75340a, MyAdsFragment.this.getView(), ((MyAdsVM.e.ShowSnackBar) eVar).getText(), 0, null, 0, null, 56, null);
if (s11 != null) {
s11.W();
}
} else if (s.e(eVar, MyAdsVM.e.d.f12126a)) {
MyAdsFragment.this.updateCounters();
} else if (eVar instanceof MyAdsVM.e.OpenBuyMultipleVasScreen) {
ActivityResultLauncher activityResultLauncher = MyAdsFragment.this.startForRefresh;
s0 P = MyAdsFragment.this.getMediator().P();
Context requireContext = MyAdsFragment.this.requireContext();
s.i(requireContext, "requireContext(...)");
MyAdsVM.e.OpenBuyMultipleVasScreen openBuyMultipleVasScreen = (MyAdsVM.e.OpenBuyMultipleVasScreen) eVar;
activityResultLauncher.launch(P.b(requireContext, b0.o1(openBuyMultipleVasScreen.a()), openBuyMultipleVasScreen.getProductID()));
} else if (eVar instanceof MyAdsVM.e.OpenDeactivateScreen) {
ActivityResultLauncher activityResultLauncher2 = MyAdsFragment.this.deactivationResult;
db.l x11 = MyAdsFragment.this.getMediator().x();
Context requireContext2 = MyAdsFragment.this.requireContext();
s.i(requireContext2, "requireContext(...)");
MyAdsVM.e.OpenDeactivateScreen openDeactivateScreen = (MyAdsVM.e.OpenDeactivateScreen) eVar;
activityResultLauncher2.launch(x11.a(requireContext2, openDeactivateScreen.getAdID(), openDeactivateScreen.getName()));
}
return Unit.f82492a;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}
@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 g extends kotlin.jvm.internal.u implements Function0<me.f> {
public g() {
super(0);
}
@Override
public final me.f invoke() {
Serializable serializable;
Bundle arguments = MyAdsFragment.this.getArguments();
if (arguments != null) {
serializable = arguments.getSerializable(MyAdsFragment.KEY_TAB_STATUS);
} else {
serializable = null;
}
s.h(serializable, "null cannot be cast to non-null type by.kufar.newdesign.myads.internal.ui.data.MyAdsTab");
return (me.f) serializable;
}
}
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0005\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Landroidx/lifecycle/ViewModel;", "VM", "Landroidx/fragment/app/Fragment;", "invoke", "()Landroidx/fragment/app/Fragment;", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class h extends kotlin.jvm.internal.u implements Function0<Fragment> {
public final Fragment f12091d;
public h(Fragment fragment) {
super(0);
this.f12091d = fragment;
}
@Override
public final Fragment invoke() {
return this.f12091d;
}
}
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0005\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Landroidx/lifecycle/ViewModel;", "VM", "Landroidx/lifecycle/ViewModelStoreOwner;", "invoke", "()Landroidx/lifecycle/ViewModelStoreOwner;", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class i extends kotlin.jvm.internal.u implements Function0<ViewModelStoreOwner> {
public final Function0 f12092d;
public i(Function0 function0) {
super(0);
this.f12092d = function0;
}
@Override
public final ViewModelStoreOwner invoke() {
return (ViewModelStoreOwner) this.f12092d.invoke();
}
}
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0005\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Landroidx/lifecycle/ViewModel;", "VM", "Landroidx/lifecycle/ViewModelStore;", "invoke", "()Landroidx/lifecycle/ViewModelStore;", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class j extends kotlin.jvm.internal.u implements Function0<ViewModelStore> {
public final d80.j f12093d;
public j(d80.j jVar) {
super(0);
this.f12093d = jVar;
}
@Override
public final ViewModelStore invoke() {
ViewModelStoreOwner m4202viewModels$lambda1;
m4202viewModels$lambda1 = FragmentViewModelLazyKt.m4202viewModels$lambda1(this.f12093d);
ViewModelStore viewModelStore = m4202viewModels$lambda1.getViewModelStore();
s.i(viewModelStore, "owner.viewModelStore");
return viewModelStore;
}
}
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u0010\u0005\u001a\u00020\u0002\"\n\b\u0000\u0010\u0001\u0018\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Landroidx/lifecycle/ViewModel;", "VM", "Landroidx/lifecycle/viewmodel/CreationExtras;", "invoke", "()Landroidx/lifecycle/viewmodel/CreationExtras;", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class k extends kotlin.jvm.internal.u implements Function0<CreationExtras> {
public final Function0 f12094d;
public final d80.j f12095e;
public k(Function0 function0, d80.j jVar) {
super(0);
this.f12094d = function0;
this.f12095e = jVar;
}
@Override
public final CreationExtras invoke() {
ViewModelStoreOwner m4202viewModels$lambda1;
CreationExtras creationExtras;
Function0 function0 = this.f12094d;
if (function0 != null && (creationExtras = (CreationExtras) function0.invoke()) != null) {
return creationExtras;
}
m4202viewModels$lambda1 = FragmentViewModelLazyKt.m4202viewModels$lambda1(this.f12095e);
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\f\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\n"}, d2 = {"Landroidx/activity/result/ActivityResult;", IronSourceConstants.EVENTS_RESULT, "", "<anonymous>"}, k = 3, mv = {1, 9, 0})
public static final class l implements ActivityResultCallback<ActivityResult> {
public l() {
}
@Override
public final void onActivityResult(ActivityResult result) {
s.j(result, "result");
if (result.getResultCode() == -1) {
MyAdsFragment.this.reloadPageAndCounters();
}
}
}
public MyAdsFragment() {
m mVar = m.f73493d;
this.tab = d80.k.a(mVar, new g());
MyAdsFragment$special$$inlined$viewModel$default$1 myAdsFragment$special$$inlined$viewModel$default$1 = new MyAdsFragment$special$$inlined$viewModel$default$1(this, null, this);
d80.j a11 = d80.k.a(mVar, new i(new h(this)));
this.myAdsVM = FragmentViewModelLazyKt.createViewModelLazy(this, o0.b(MyAdsVM.class), new j(a11), new k(null, a11), myAdsFragment$special$$inlined$viewModel$default$1);
ActivityResultLauncher<Intent> registerForActivityResult = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new l());
s.i(registerForActivityResult, "registerForActivityResult(...)");
this.startForRefresh = registerForActivityResult;
ActivityResultLauncher<Intent> registerForActivityResult2 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new c());
s.i(registerForActivityResult2, "registerForActivityResult(...)");
this.deactivationResult = registerForActivityResult2;
this.bannerView = d80.k.b(new b());
}
public final BannerAdView getBannerView() {
return (BannerAdView) this.bannerView.getValue();
}
public final MyAdsVM getMyAdsVM() {
return (MyAdsVM) this.myAdsVM.getValue();
}
public final me.f getTab() {
return (me.f) this.tab.getValue();
}
public final void onActionClicked(a action) {
Context context = getContext();
if (context == null) {
return;
}
if (s.e(action, a.m.f12228a)) {
getAnalytics().f();
startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://www.kufar.by/account/promotion_services", false, null, false, false, 60, null));
return;
}
if (s.e(action, a.n.f12229a)) {
startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://helpcenter.kufar.by/knowledge_base/item/275359?sid=58789", false, null, false, false, 60, null));
return;
}
if (s.e(action, a.b.f12216a)) {
startActivity(getMediator().r().a(context));
return;
}
if (s.e(action, a.r.f12233a)) {
startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://helpcenter.kufar.by/knowledge_base/item/275470?sid=58792", false, null, false, false, 60, null));
return;
}
if (s.e(action, a.o.f12230a)) {
startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://helpcenter.kufar.by/knowledge_base/item/275470?sid=58792", false, null, false, false, 60, null));
return;
}
if (s.e(action, a.j.f12225a)) {
startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://support.kufar.by/hc/ru/requests/new", false, null, false, false, 60, null));
return;
}
if (s.e(action, a.e.f12219a)) {
startActivity(getMediator().Q().b(context));
return;
}
if (s.e(action, a.s.f12234a)) {
reloadPageAndCounters();
return;
}
if (s.e(action, a.q.f12232a)) {
showSortingBottomSheet();
return;
}
if (s.e(action, a.f.f12220a)) {
getMyAdsVM().loadPage();
return;
}
if (action instanceof a.c) {
getAnalytics().e();
getMyAdsVM().buyMultipleVas();
return;
}
if (s.e(action, a.k.f12226a)) {
getMyAdsVM().onToggleSelectAllClicked();
return;
}
if (s.e(action, a.d.f12218a)) {
getMyAdsVM().cancelAutoSelection();
return;
}
if (s.e(action, a.l.f12227a)) {
getMyAdsVM().showExpandedVasList();
return;
}
if (action instanceof a.ShowSelectedVas) {
getMyAdsVM().showSelectedVas(((a.ShowSelectedVas) action).getVas());
return;
}
if (action instanceof a.AdvertSelected) {
a.AdvertSelected advertSelected = (a.AdvertSelected) action;
getMyAdsVM().onAdvertSelected(advertSelected.getAdID(), advertSelected.getIsSelected());
return;
}
if (action instanceof a.OpenAdvertScree) {
startActivity(getMediator().G().b(context, ((a.OpenAdvertScree) action).getAdID()));
return;
}
if (action instanceof a.OpenBumpScree) {
getAnalytics().a(null, getTab());
onPromoteClicked(v.f87507b, ((a.OpenBumpScree) action).getAdID());
} else if (action instanceof a.OpenPromoteSheet) {
a.OpenPromoteSheet openPromoteSheet = (a.OpenPromoteSheet) action;
showPromoteBottomSheet(openPromoteSheet.getAdID(), openPromoteSheet.getType());
}
}
private final d2 onPromoteClicked(v action, long adID) {
d2 d11;
d11 = kotlinx.coroutines.l.d(LifecycleOwnerKt.getLifecycleScope(this), null, null, new e(adID, action, null), 3, null);
return d11;
}
private final void onSortingClicked(pe.a action) {
getMyAdsVM().sortAdvertisement(action);
}
public final void openVasScreen(Context context, an.a vas, MyAdsItem item) {
this.startForRefresh.launch(s0.b.a(getMediator().P(), context, vas, Long.valueOf(item.getListId()), Long.valueOf(item.getAdID()), item.getSubCategory(), null, false, 0L, 224, null));
}
public final void reloadPageAndCounters() {
updateCounters();
getMyAdsVM().reload();
}
private final void setUp() {
kotlinx.coroutines.flow.i.M(kotlinx.coroutines.flow.i.R(getMyAdsVM().getEventsFlow(), new f(null)), LifecycleOwnerKt.getLifecycleScope(this));
}
private final void showPromoteBottomSheet(long itemID, PromoteBottomSheet.Companion.EnumC0268a type) {
getAnalytics().a(type, getTab());
getChildFragmentManager().setFragmentResultListener("REQUEST_KEY", getViewLifecycleOwner(), new FragmentResultListener() {
@Override
public final void onFragmentResult(String str, Bundle bundle) {
MyAdsFragment.showPromoteBottomSheet$lambda$2(MyAdsFragment.this, str, bundle);
}
});
PromoteBottomSheet.INSTANCE.a(itemID, type).show(getChildFragmentManager(), (String) null);
}
public static final void showPromoteBottomSheet$lambda$2(MyAdsFragment this$0, String str, Bundle bundle) {
s.j(this$0, "this$0");
s.j(str, "<anonymous parameter 0>");
s.j(bundle, "bundle");
Serializable serializable = bundle.getSerializable("ACTION");
s.h(serializable, "null cannot be cast to non-null type by.kufar.newdesign.myads.internal.ui.promote.domain.PromoteActions");
this$0.onPromoteClicked((v) serializable, bundle.getLong(PromoteBottomSheet.AD_ID));
}
private final void showSortingBottomSheet() {
getChildFragmentManager().setFragmentResultListener("REQUEST_KEY", getViewLifecycleOwner(), new FragmentResultListener() {
@Override
public final void onFragmentResult(String str, Bundle bundle) {
MyAdsFragment.showSortingBottomSheet$lambda$3(MyAdsFragment.this, str, bundle);
}
});
SortingBottomSheet.INSTANCE.a().show(getChildFragmentManager(), (String) null);
}
public static final void showSortingBottomSheet$lambda$3(MyAdsFragment this$0, String str, Bundle bundle) {
s.j(this$0, "this$0");
s.j(str, "<anonymous parameter 0>");
s.j(bundle, "bundle");
Serializable serializable = bundle.getSerializable("ACTION");
s.h(serializable, "null cannot be cast to non-null type by.kufar.newdesign.myads.internal.ui.sorting.SortingAction");
this$0.onSortingClicked((pe.a) serializable);
}
public final void updateCounters() {
MyAdsContainerFragment myAdsContainerFragment;
Fragment parentFragment = getParentFragment();
if (parentFragment instanceof MyAdsContainerFragment) {
myAdsContainerFragment = (MyAdsContainerFragment) parentFragment;
} else {
myAdsContainerFragment = null;
}
if (myAdsContainerFragment != null) {
myAdsContainerFragment.refreshCounters();
}
}
public final de.a getAnalytics() {
de.a aVar = this.analytics;
if (aVar != null) {
return aVar;
}
s.B("analytics");
return null;
}
public final cb.b getMediator() {
cb.b bVar = this.mediator;
if (bVar != null) {
return bVar;
}
s.B("mediator");
return null;
}
public final wi.e getMyAdsBannerHelper() {
wi.e eVar = this.myAdsBannerHelper;
if (eVar != null) {
return eVar;
}
s.B("myAdsBannerHelper");
return null;
}
public final de.a getMyAdsTracker() {
de.a aVar = this.myAdsTracker;
if (aVar != null) {
return aVar;
}
s.B("myAdsTracker");
return null;
}
public final tk.a getRibbonsDecorator() {
tk.a aVar = this.ribbonsDecorator;
if (aVar != null) {
return aVar;
}
s.B("ribbonsDecorator");
return null;
}
public final de.a getTracker() {
de.a aVar = this.tracker;
if (aVar != null) {
return aVar;
}
s.B("tracker");
return null;
}
public final me.j getUserAdvertisementsCache() {
me.j jVar = this.userAdvertisementsCache;
if (jVar != null) {
return jVar;
}
s.B("userAdvertisementsCache");
return null;
}
public final MyAdsVM.f getViewModelFactory() {
MyAdsVM.f fVar = this.viewModelFactory;
if (fVar != null) {
return fVar;
}
s.B("viewModelFactory");
return null;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
s.j(inflater, "inflater");
return nj.a.a(this, ComposableLambdaKt.composableLambdaInstance(685970513, true, new d()));
}
@Override
public void onInject() {
super.onInject();
by.kufar.newdesign.myads.internal.ui.c.a(this).a(this);
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
s.j(view, "view");
super.onViewCreated(view, savedInstanceState);
setUp();
}
public final void setAnalytics(de.a aVar) {
s.j(aVar, "<set-?>");
this.analytics = aVar;
}
public final void setMediator(cb.b bVar) {
s.j(bVar, "<set-?>");
this.mediator = bVar;
}
public final void setMyAdsBannerHelper(wi.e eVar) {
s.j(eVar, "<set-?>");
this.myAdsBannerHelper = eVar;
}
public final void setMyAdsTracker(de.a aVar) {
s.j(aVar, "<set-?>");
this.myAdsTracker = aVar;
}
public final void setRibbonsDecorator(tk.a aVar) {
s.j(aVar, "<set-?>");
this.ribbonsDecorator = aVar;
}
public final void setTracker(de.a aVar) {
s.j(aVar, "<set-?>");
this.tracker = aVar;
}
public final void setUserAdvertisementsCache(me.j jVar) {
s.j(jVar, "<set-?>");
this.userAdvertisementsCache = jVar;
}
public final void setViewModelFactory(MyAdsVM.f fVar) {
s.j(fVar, "<set-?>");
this.viewModelFactory = fVar;
}
@Metadata(d1 = {"\u0000\b\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"Lcom/yandex/mobile/ads/banner/BannerAdView;", "b", "()Lcom/yandex/mobile/ads/banner/BannerAdView;"}, k = 3, mv = {1, 9, 0})
public static final class b extends kotlin.jvm.internal.u implements Function0<BannerAdView> {
public b() {
super(0);
}
@Override
public final BannerAdView invoke() {
BannerAdView bannerAdView = new BannerAdView(MyAdsFragment.this.requireContext());
MyAdsFragment myAdsFragment = MyAdsFragment.this;
bannerAdView.setAdUnitId(si.a.f97636a.b());
bannerAdView.setAdSize(AdSize.BANNER_320x100);
bannerAdView.loadAd(myAdsFragment.getMyAdsBannerHelper().a());
bannerAdView.setBannerAdEventListener(new a(myAdsFragment));
return bannerAdView;
}
@Metadata(d1 = {"\u0000!\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0003\u001a\u00020\u0002H\u0016J\b\u0010\u0004\u001a\u00020\u0002H\u0016J\b\u0010\u0005\u001a\u00020\u0002H\u0016J\u0012\u0010\b\u001a\u00020\u00022\b\u0010\u0007\u001a\u0004\u0018\u00010\u0006H\u0016J\b\u0010\t\u001a\u00020\u0002H\u0016J\u0010\u0010\u000b\u001a\u00020\u00022\u0006\u0010\u0007\u001a\u00020\nH\u0016¨\u0006\f"}, d2 = {"by/kufar/newdesign/myads/internal/ui/ads/MyAdsFragment$b$a", "Lcom/yandex/mobile/ads/banner/BannerAdEventListener;", "", "onLeftApplication", "onReturnedToApplication", "onAdClicked", "Lcom/yandex/mobile/ads/common/ImpressionData;", "p0", "onImpression", "onAdLoaded", "Lcom/yandex/mobile/ads/common/AdRequestError;", "onAdFailedToLoad", "feature-my-ads_googleRelease"}, k = 1, mv = {1, 9, 0})
public static final class a implements BannerAdEventListener {
public final MyAdsFragment f12079a;
public a(MyAdsFragment myAdsFragment) {
this.f12079a = myAdsFragment;
}
@Override
public void onAdFailedToLoad(AdRequestError p02) {
s.j(p02, "p0");
wc0.a.INSTANCE.c(p02.toString(), new Object[0]);
this.f12079a.getMyAdsVM().onBannerLoadedWithError();
}
@Override
public void onAdClicked() {
}
@Override
public void onAdLoaded() {
}
@Override
public void onLeftApplication() {
}
@Override
public void onReturnedToApplication() {
}
@Override
public void onImpression(ImpressionData p02) {
}
}
}
}