得物.apk(点击下载) / TrendRuleDialog.java


package com.shizhuang.duapp.modules.du_community_common.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.libs.safety.ISafety;
import com.shizhuang.duapp.modules.du_community_common.api.CommunityApi;
import df.b0;
import df.o0;
import fd.r;
import q20.v;
import td.j;
import td.s;
import u91.e;

public class TrendRuleDialog extends Dialog implements ISafety {
    public static ChangeQuickRedirect changeQuickRedirect;
    public View b;

    /* renamed from: c  reason: collision with root package name */
    public boolean f12761c = true;
    public OnTrendRuleClickListener d;
    @BindView(6504)
    public TextView tvConfirm;
    @BindView(6600)
    public TextView tvRuleDetail;

    public interface OnTrendRuleClickListener {
        void onConfirm();
    }

    public static class a extends j {
        public static ChangeQuickRedirect changeQuickRedirect;

        public static void confirmTrendAgreesments(s<String> sVar) {
            if (!PatchProxy.proxy(new Object[]{sVar}, null, changeQuickRedirect, true, 99760, new Class[]{s.class}, Void.TYPE).isSupported) {
                j.doRequest(((CommunityApi) j.getJavaGoApi(CommunityApi.class)).confirmTrendAgreements(), sVar);
            }
        }
    }

    public TrendRuleDialog(@NonNull Context context) {
        super(context);
        View inflate = LayoutInflater.from(context).inflate(R.layout.dialog_trend_rule, (ViewGroup) null);
        this.b = inflate;
        setContentView(inflate);
        ButterKnife.bind(this, this.b);
        setCanceledOnTouchOutside(false);
    }

    public void a(OnTrendRuleClickListener onTrendRuleClickListener) {
        if (!PatchProxy.proxy(new Object[]{onTrendRuleClickListener}, this, changeQuickRedirect, false, 99755, new Class[]{OnTrendRuleClickListener.class}, Void.TYPE).isSupported) {
            this.d = onTrendRuleClickListener;
        }
    }

    public void dismiss() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 99756, new Class[0], Void.TYPE).isSupported) {
            super.dismiss();
            this.f12761c = false;
        }
    }

    @Override // com.shizhuang.duapp.libs.safety.ISafety
    public boolean isSafety() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 99757, new Class[0], Boolean.TYPE);
        return proxy.isSupported ? ((Boolean) proxy.result).booleanValue() : this.f12761c;
    }

    @OnClick({6600, 6504})
    public void onViewClick(View view) {
        if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 99754, new Class[]{View.class}, Void.TYPE).isSupported) {
            if (view.getId() == R.id.tv_rule_detail) {
                o0.b("community_block_click", new r(this, 5));
                e.S(getContext(), "https://fast.dewu.com/nezha-plus/detail/5f9282bf1870721f2e722545");
            } else if (view.getId() == R.id.tv_confirm) {
                o0.b("community_block_click", new v(this, 0));
                b0.l("is_confirm_trend_convention", 1);
                a.confirmTrendAgreesments(new s(this));
                OnTrendRuleClickListener onTrendRuleClickListener = this.d;
                if (onTrendRuleClickListener != null) {
                    onTrendRuleClickListener.onConfirm();
                }
                dismiss();
            }
        }
    }
}