红果免费短剧 v6.2.3.32版本的 MD5 值为:a6b05492607eab2c8a25f26d2f238ae0

以下内容为反编译后的 AdInterestDialogFragment.java 源代码,内容仅作参考


package com.dragon.read.ad.feedback;

import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.admetaversesdk.adbase.entity.banner.AdModel;
import com.bytedance.apm.agent.v2.instrumentation.ClickAgent;
import com.dragon.read.ad.dark.report.AdEventDispatcher;
import com.dragon.read.ad.feedback.AdInterestDialogFragment;
import com.dragon.read.ad.feedback.ui.AbsQueueBottomSheetDialogFragment;
import com.dragon.read.app.ActivityRecordManager;
import com.phoenix.read.R;
import com.ss.android.ad.utils.l;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.json.JSONObject;

public final class AdInterestDialogFragment extends AbsQueueBottomSheetDialogFragment {

    public static final a f39187a = new a(null);

    public final List<b> f39188b;

    public final AdModel f39189c;
    public TextView d;
    public b e;
    public Runnable f;
    public Map<Integer, View> g;
    private TextView l;
    private ImageView m;

    public AdInterestDialogFragment(List list, AdModel adModel, DefaultConstructorMarker defaultConstructorMarker) {
        this(list, adModel);
    }

    @Override
    public View a(int i) {
        View findViewById;
        Map<Integer, View> map = this.g;
        View view = map.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null || (findViewById = view2.findViewById(i)) == null) {
            return null;
        }
        map.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

    @Override
    public void h() {
        this.g.clear();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        h();
    }

    public static final class a {
        public a(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private a() {
        }

        public final AdInterestDialogFragment a(AdModel model) {
            Intrinsics.checkNotNullParameter(model, "model");
            ArrayList arrayList = new ArrayList();
            arrayList.add(new b("不喜欢该类型", "4:67", false, 4, null));
            boolean z = false;
            int i = 4;
            DefaultConstructorMarker defaultConstructorMarker = null;
            arrayList.add(new b("重复出现", "4:6", z, i, defaultConstructorMarker));
            boolean z2 = false;
            int i2 = 4;
            DefaultConstructorMarker defaultConstructorMarker2 = null;
            arrayList.add(new b("广告密集", "4:62", z2, i2, defaultConstructorMarker2));
            arrayList.add(new b("不相关", "4:63", z, i, defaultConstructorMarker));
            arrayList.add(new b("内容质量差", "4:36", z2, i2, defaultConstructorMarker2));
            arrayList.add(new b("其他", "4:13", z, i, defaultConstructorMarker));
            return new AdInterestDialogFragment(arrayList, model, null);
        }
    }

    public final void g() {
        ImageView imageView = this.m;
        if (imageView != null) {
            imageView.setOnClickListener(new c());
        }
        TextView textView = this.d;
        if (textView != null) {
            textView.setOnClickListener(new d());
        }
    }

    @Override
    public void onStart() {
        View findViewById;
        super.onStart();
        Dialog dialog = getDialog();
        if (dialog != null && (findViewById = dialog.findViewById(R.id.design_bottom_sheet)) != null) {
            findViewById.setBackgroundResource(R.color.a1);
        }
    }

    public final void i() {
        FragmentActivity fragmentActivity;
        Activity currentActivity = ActivityRecordManager.inst().getCurrentActivity();
        if (currentActivity instanceof FragmentActivity) {
            fragmentActivity = (FragmentActivity) currentActivity;
        } else {
            fragmentActivity = null;
        }
        if (fragmentActivity != null) {
            this.i = fragmentActivity;
            FragmentManager supportFragmentManager = fragmentActivity.getSupportFragmentManager();
            Intrinsics.checkNotNullExpressionValue(supportFragmentManager, "it.supportFragmentManager");
            show(supportFragmentManager, "");
        }
    }

    public final void a(Runnable runnable) {
        Intrinsics.checkNotNullParameter(runnable, "runnable");
        this.f = runnable;
    }

    public static final class c implements View.OnClickListener {
        c() {
        }

        @Override
        public final void onClick(View view) {
            ClickAgent.onClick(view);
            AdInterestDialogFragment.this.dismissAllowingStateLoss();
        }
    }

    public static final class d implements View.OnClickListener {
        d() {
        }

        @Override
        public final void onClick(View view) {
            String str;
            String str2;
            ClickAgent.onClick(view);
            if (AdInterestDialogFragment.this.e == null) {
                return;
            }
            b bVar = AdInterestDialogFragment.this.e;
            com.dragon.read.ad.feedback.util.b bVar2 = com.dragon.read.ad.feedback.util.b.f39245a;
            JSONObject jSONObject = new JSONObject();
            AdInterestDialogFragment adInterestDialogFragment = AdInterestDialogFragment.this;
            String[] strArr = new String[1];
            String str3 = null;
            if (bVar != null) {
                str = bVar.f39191b;
            } else {
                str = null;
            }
            strArr[0] = str;
            jSONObject.putOpt("dislike_id", CollectionsKt.arrayListOf(strArr));
            jSONObject.putOpt("creative_id", Long.valueOf(adInterestDialogFragment.f39189c.getId()));
            jSONObject.putOpt("log_extra", adInterestDialogFragment.f39189c.getLogExtra());
            Unit unit = Unit.INSTANCE;
            bVar2.a("https://ad.zijieapi.com/api/ad/v1/dislike/", null, true, true, jSONObject);
            long id = AdInterestDialogFragment.this.f39189c.getId();
            String logExtra = AdInterestDialogFragment.this.f39189c.getLogExtra();
            JSONObject jSONObject2 = new JSONObject();
            JSONObject jSONObject3 = new JSONObject();
            if (bVar != null) {
                str2 = bVar.f39191b;
            } else {
                str2 = null;
            }
            jSONObject3.putOpt("dislike_id", str2);
            if (bVar != null) {
                str3 = bVar.f39190a;
            }
            jSONObject3.putOpt("dislike_name", str3);
            Unit unit2 = Unit.INSTANCE;
            jSONObject2.putOpt("ad_extra_data", jSONObject3);
            Unit unit3 = Unit.INSTANCE;
            AdEventDispatcher.dispatchEvent(id, "novel_ad", "dislike_monitor", "", logExtra, false, jSONObject2);
            l.a(AdInterestDialogFragment.this.getContext(), "感谢反馈, 将为你优化推荐内容");
            Runnable runnable = AdInterestDialogFragment.this.f;
            if (runnable != null) {
                runnable.run();
            }
            AdInterestDialogFragment.this.dismissAllowingStateLoss();
        }
    }

    private AdInterestDialogFragment(List<b> list, AdModel adModel) {
        this.g = new LinkedHashMap();
        this.f39188b = list;
        this.f39189c = adModel;
    }

    public static final class b {

        public final String f39190a;

        public final String f39191b;

        public boolean f39192c;

        public b(String text, String dislikeId, boolean z) {
            Intrinsics.checkNotNullParameter(text, "text");
            Intrinsics.checkNotNullParameter(dislikeId, "dislikeId");
            this.f39190a = text;
            this.f39191b = dislikeId;
            this.f39192c = z;
        }

        public b(String str, String str2, boolean z, int i, DefaultConstructorMarker defaultConstructorMarker) {
            this(str, str2, (i & 4) != 0 ? false : z);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle bundle) {
        Intrinsics.checkNotNullParameter(inflater, "inflater");
        View inflate = inflater.inflate(R.layout.ps, viewGroup);
        this.l = (TextView) inflate.findViewById(R.id.bqd);
        this.m = (ImageView) inflate.findViewById(R.id.c9c);
        this.d = (TextView) inflate.findViewById(R.id.ew6);
        TextView textView = this.l;
        if (textView != null) {
            textView.setText("不感兴趣");
        }
        RecyclerView recyclerView = (RecyclerView) inflate.findViewById(R.id.bqe);
        final com.dragon.read.ad.feedback.ui.a aVar = new com.dragon.read.ad.feedback.ui.a(this.f39188b, this.f39189c);
        aVar.a(new Function1<Integer, Unit>() {
            {
                super(1);
            }

            @Override
            public Unit invoke(Integer num) {
                invoke(num.intValue());
                return Unit.INSTANCE;
            }

            public final void invoke(int i) {
                boolean z;
                TextView textView2 = AdInterestDialogFragment.this.d;
                if (textView2 != null) {
                    textView2.setAlpha(1.0f);
                }
                AdInterestDialogFragment adInterestDialogFragment = AdInterestDialogFragment.this;
                adInterestDialogFragment.e = adInterestDialogFragment.f39188b.get(i);
                int size = AdInterestDialogFragment.this.f39188b.size();
                for (int i2 = 0; i2 < size; i2++) {
                    AdInterestDialogFragment.b bVar = AdInterestDialogFragment.this.f39188b.get(i2);
                    if (i2 == i) {
                        z = true;
                    } else {
                        z = false;
                    }
                    bVar.f39192c = z;
                }
                aVar.notifyDataSetChanged();
            }
        });
        recyclerView.setAdapter(aVar);
        recyclerView.setLayoutManager(new GridLayoutManager(getContext(), 3));
        g();
        return inflate;
    }
}