得物.apk(点击下载) / FavoriteCouponDialog.java
package com.shizhuang.duapp.modules.productv2.favorite.dialog;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Point;
import android.os.Bundle;
import android.util.ArrayMap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.knightboost.weaver.api.Scope;
import com.knightboost.weaver.api.annotations.Insert;
import com.knightboost.weaver.api.annotations.TargetClass;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.component.module.DuModuleAdapter;
import com.shizhuang.duapp.common.dialog.BaseDialogFragment;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.libs.duimageloaderview.options.DuRequestOptions;
import com.shizhuang.duapp.modules.du_mall_common.model.FavoriteCouponEntryModel;
import com.shizhuang.duapp.modules.du_mall_common.model.FavoriteCouponItemModel;
import com.shizhuang.duapp.modules.du_mall_common.widget.DuLinearDividerDecoration;
import com.shizhuang.duapp.modules.productv2.api.ProductFacadeV2;
import com.shizhuang.duapp.modules.productv2.api.ProductService;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import jn.b;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import org.jetbrains.annotations.NotNull;
import td.j;
import td.s;
@Metadata(bv = {}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u00002\u00020\u0001:\u0001\u0004B\u0007¢\u0006\u0004\b\u0002\u0010\u0003¨\u0006\u0005"}, d2 = {"Lcom/shizhuang/duapp/modules/productv2/favorite/dialog/FavoriteCouponDialog;", "Lcom/shizhuang/duapp/common/dialog/BaseDialogFragment;", "<init>", "()V", "a", "du_product_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: FavoriteCouponDialog.kt */
public final class FavoriteCouponDialog extends BaseDialogFragment {
public static ChangeQuickRedirect changeQuickRedirect;
@NotNull
public static final a i = new a(null);
public final DuModuleAdapter e = new DuModuleAdapter(false, 0, null, 7);
public ArrayList<FavoriteCouponItemModel> f;
/* renamed from: g reason: collision with root package name */
public final Lazy f23755g = LazyKt__LazyJVMKt.lazy(new FavoriteCouponDialog$entryModel$2(this));
/* renamed from: h reason: collision with root package name */
public HashMap f23756h;
public class _boostWeave {
public static ChangeQuickRedirect changeQuickRedirect;
@TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
@Insert(mayCreateSuper = true, value = "onCreate")
@Keep
public static void FragmentMethodWeaver_onCreate(FavoriteCouponDialog favoriteCouponDialog, Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{favoriteCouponDialog, bundle}, null, changeQuickRedirect, true, 295764, new Class[]{FavoriteCouponDialog.class, Bundle.class}, Void.TYPE).isSupported) {
long currentTimeMillis = System.currentTimeMillis();
FavoriteCouponDialog.s(favoriteCouponDialog, bundle);
long currentTimeMillis2 = System.currentTimeMillis();
if (favoriteCouponDialog.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.favorite.dialog.FavoriteCouponDialog")) {
b.f34396a.fragmentOnCreateMethod(favoriteCouponDialog, currentTimeMillis, currentTimeMillis2);
}
}
}
@TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
@Insert(mayCreateSuper = true, value = "onCreateView")
@Keep
public static View FragmentMethodWeaver_onCreateView(@NonNull FavoriteCouponDialog favoriteCouponDialog, @Nullable LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, Bundle bundle) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{favoriteCouponDialog, layoutInflater, viewGroup, bundle}, null, changeQuickRedirect, true, 295766, new Class[]{FavoriteCouponDialog.class, LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
if (proxy.isSupported) {
return (View) proxy.result;
}
long currentTimeMillis = System.currentTimeMillis();
View u4 = FavoriteCouponDialog.u(favoriteCouponDialog, layoutInflater, viewGroup, bundle);
long currentTimeMillis2 = System.currentTimeMillis();
if (favoriteCouponDialog.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.favorite.dialog.FavoriteCouponDialog")) {
b.f34396a.fragmentOnCreateViewMethod(favoriteCouponDialog, currentTimeMillis, currentTimeMillis2);
}
return u4;
}
@TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
@Insert(mayCreateSuper = true, value = "onResume")
@Keep
public static void FragmentMethodWeaver_onResume(FavoriteCouponDialog favoriteCouponDialog) {
if (!PatchProxy.proxy(new Object[]{favoriteCouponDialog}, null, changeQuickRedirect, true, 295767, new Class[]{FavoriteCouponDialog.class}, Void.TYPE).isSupported) {
long currentTimeMillis = System.currentTimeMillis();
FavoriteCouponDialog.v(favoriteCouponDialog);
long currentTimeMillis2 = System.currentTimeMillis();
if (favoriteCouponDialog.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.favorite.dialog.FavoriteCouponDialog")) {
b.f34396a.fragmentOnResumeMethod(favoriteCouponDialog, currentTimeMillis, currentTimeMillis2);
}
}
}
@TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
@Insert(mayCreateSuper = true, value = "onStart")
@Keep
public static void FragmentMethodWeaver_onStart(FavoriteCouponDialog favoriteCouponDialog) {
if (!PatchProxy.proxy(new Object[]{favoriteCouponDialog}, null, changeQuickRedirect, true, 295765, new Class[]{FavoriteCouponDialog.class}, Void.TYPE).isSupported) {
long currentTimeMillis = System.currentTimeMillis();
FavoriteCouponDialog.t(favoriteCouponDialog);
long currentTimeMillis2 = System.currentTimeMillis();
if (favoriteCouponDialog.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.favorite.dialog.FavoriteCouponDialog")) {
b.f34396a.fragmentOnStartMethod(favoriteCouponDialog, currentTimeMillis, currentTimeMillis2);
}
}
}
@TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
@Insert(mayCreateSuper = true, value = "onViewCreated")
@Keep
public static void FragmentMethodWeaver_onViewCreated(@NonNull FavoriteCouponDialog favoriteCouponDialog, @Nullable View view, Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{favoriteCouponDialog, view, bundle}, null, changeQuickRedirect, true, 295768, new Class[]{FavoriteCouponDialog.class, View.class, Bundle.class}, Void.TYPE).isSupported) {
long currentTimeMillis = System.currentTimeMillis();
FavoriteCouponDialog.w(favoriteCouponDialog, view, bundle);
long currentTimeMillis2 = System.currentTimeMillis();
if (favoriteCouponDialog.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.favorite.dialog.FavoriteCouponDialog")) {
b.f34396a.fragmentOnViewCreatedMethod(favoriteCouponDialog, currentTimeMillis, currentTimeMillis2);
}
}
}
}
/* compiled from: FavoriteCouponDialog.kt */
public static final class a {
public static ChangeQuickRedirect changeQuickRedirect;
public a(DefaultConstructorMarker defaultConstructorMarker) {
}
}
public static void s(FavoriteCouponDialog favoriteCouponDialog, Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{bundle}, favoriteCouponDialog, changeQuickRedirect, false, 295754, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
super.onCreate(bundle);
}
}
public static void t(FavoriteCouponDialog favoriteCouponDialog) {
if (!PatchProxy.proxy(new Object[0], favoriteCouponDialog, changeQuickRedirect, false, 295756, new Class[0], Void.TYPE).isSupported) {
super.onStart();
}
}
public static View u(FavoriteCouponDialog favoriteCouponDialog, LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, favoriteCouponDialog, changeQuickRedirect, false, 295758, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
return proxy.isSupported ? (View) proxy.result : super.onCreateView(layoutInflater, viewGroup, bundle);
}
public static void v(FavoriteCouponDialog favoriteCouponDialog) {
if (!PatchProxy.proxy(new Object[0], favoriteCouponDialog, changeQuickRedirect, false, 295760, new Class[0], Void.TYPE).isSupported) {
super.onResume();
}
}
public static void w(FavoriteCouponDialog favoriteCouponDialog, View view, Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{view, bundle}, favoriteCouponDialog, changeQuickRedirect, false, 295762, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
super.onViewCreated(view, bundle);
}
}
public View _$_findCachedViewById(int i3) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 295751, new Class[]{Integer.TYPE}, View.class);
if (proxy.isSupported) {
return (View) proxy.result;
}
if (this.f23756h == null) {
this.f23756h = new HashMap();
}
View view = (View) this.f23756h.get(Integer.valueOf(i3));
if (view != null) {
return view;
}
View view2 = getView();
if (view2 == null) {
return null;
}
View findViewById = view2.findViewById(i3);
this.f23756h.put(Integer.valueOf(i3), findViewById);
return findViewById;
}
@Override // com.shizhuang.duapp.common.dialog.DuDialogFragment
public void g() {
Dialog dialog;
Window window;
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295747, new Class[0], Void.TYPE).isSupported && (dialog = getDialog()) != null && (window = dialog.getWindow()) != null) {
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.width = -1;
attributes.height = -1;
attributes.gravity = 17;
attributes.dimAmount = 0.7f;
window.setAttributes(attributes);
}
}
@Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
public void onCreate(Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 295753, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
_boostWeave.FragmentMethodWeaver_onCreate(this, bundle);
}
}
@Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, this, changeQuickRedirect, false, 295757, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
return proxy.isSupported ? (View) proxy.result : _boostWeave.FragmentMethodWeaver_onCreateView(this, layoutInflater, viewGroup, bundle);
}
@Override // androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
public void onDestroyView() {
HashMap hashMap;
super.onDestroyView();
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295752, new Class[0], Void.TYPE).isSupported && (hashMap = this.f23756h) != null) {
hashMap.clear();
}
}
@Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
public void onResume() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295759, new Class[0], Void.TYPE).isSupported) {
_boostWeave.FragmentMethodWeaver_onResume(this);
}
}
@Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
public void onStart() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295755, new Class[0], Void.TYPE).isSupported) {
_boostWeave.FragmentMethodWeaver_onStart(this);
}
}
@Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
public void onViewCreated(View view, Bundle bundle) {
if (!PatchProxy.proxy(new Object[]{view, bundle}, this, changeQuickRedirect, false, 295761, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
_boostWeave.FragmentMethodWeaver_onViewCreated(this, view, bundle);
}
}
@Override // com.shizhuang.duapp.common.dialog.BaseDialogFragment
public int q() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295746, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.dialog_favorite_coupon;
}
@Override // com.shizhuang.duapp.common.dialog.BaseDialogFragment
public void r(@org.jetbrains.annotations.Nullable View view) {
if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 295748, new Class[]{View.class}, Void.TYPE).isSupported) {
Bundle arguments = getArguments();
if (!(arguments == null || arguments.getParcelableArrayList("COUPON_LIST") == null)) {
Bundle arguments2 = getArguments();
this.f = arguments2 != null ? arguments2.getParcelableArrayList("COUPON_LIST") : null;
}
((RecyclerView) _$_findCachedViewById(R.id.couponListRv)).setVisibility(0);
((ImageView) _$_findCachedViewById(R.id.receiveBtn)).setVisibility(0);
((DuRequestOptions) mn.a.f35714a.g("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/product/icon_fav_coupon_dialog_title.webp").G(this).u(new FavoriteCouponDialog$initView$2(this))).y();
((DuImageLoaderView) _$_findCachedViewById(R.id.bgImg)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/du_product/bg_fav_coupon_dialog.webp").x();
i60.b bVar = i60.b.f33293a;
ArrayMap arrayMap = new ArrayMap(8);
arrayMap.put("community_type", Integer.valueOf(x().getCommunityType()));
arrayMap.put("button_title", "知道了");
arrayMap.put("status", 1);
bVar.b("trade_collect_pop_ups_exposure", "46", "849", arrayMap);
this.e.getDelegate().C(FavoriteCouponItemModel.class, 1, null, -1, true, null, null, new FavoriteCouponDialog$initView$4(this));
ArrayList<FavoriteCouponItemModel> arrayList = this.f;
if (arrayList != null && (!arrayList.isEmpty())) {
ArrayList<FavoriteCouponItemModel> arrayList2 = this.f;
if (arrayList2 != null) {
y(arrayList2);
}
} else if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295749, new Class[0], Void.TYPE).isSupported) {
ProductFacadeV2 productFacadeV2 = ProductFacadeV2.f23068a;
o51.a aVar = new o51.a(this, this);
if (!PatchProxy.proxy(new Object[]{aVar}, productFacadeV2, ProductFacadeV2.changeQuickRedirect, false, 285256, new Class[]{s.class}, Void.TYPE).isSupported) {
j.doRequest(((ProductService) j.getJavaGoApi(ProductService.class)).getFavoriteCouponList(), aVar);
}
}
((ImageView) _$_findCachedViewById(R.id.closeTv)).setOnClickListener(new FavoriteCouponDialog$initView$6(this));
((ImageView) _$_findCachedViewById(R.id.receiveBtn)).setOnClickListener(new FavoriteCouponDialog$initView$7(this));
}
}
public final FavoriteCouponEntryModel x() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295745, new Class[0], FavoriteCouponEntryModel.class);
return (FavoriteCouponEntryModel) (proxy.isSupported ? proxy.result : this.f23755g.getValue());
}
public final void y(List<FavoriteCouponItemModel> list) {
if (!PatchProxy.proxy(new Object[]{list}, this, changeQuickRedirect, false, 295750, new Class[]{List.class}, Void.TYPE).isSupported) {
((RecyclerView) _$_findCachedViewById(R.id.couponListRv)).setLayoutManager(new LinearLayoutManager(getContext()));
Context context = getContext();
if (context != null) {
((RecyclerView) _$_findCachedViewById(R.id.couponListRv)).addItemDecoration(new DuLinearDividerDecoration(context, 0, null, ContextCompat.getColor(context, R.color.transparent), fi.b.b((float) 5), new Point(0, 0), false, false, 198));
}
if (list.size() > 3) {
this.e.setItems(CollectionsKt___CollectionsKt.plus((Collection) list, (Iterable) CollectionsKt__CollectionsJVMKt.listOf(new nc.j(fi.b.b((float) 20), null, 2))));
} else {
this.e.setItems(list);
}
((RecyclerView) _$_findCachedViewById(R.id.couponListRv)).setAdapter(this.e);
}
}
}