package com.tencent.mm.plugin.appbrand.ui.autofill;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.modelappbrand.a.b;
import com.tencent.mm.modelappbrand.a.f;
import com.tencent.mm.protocal.protobuf.bzo;
import com.tencent.mm.protocal.protobuf.ga;
import com.tencent.mm.protocal.protobuf.gb;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.ui.MMFragment;
import com.tencent.mm.ui.v;
import java.util.List;

public class AppBrandIDCardShowFrag extends MMFragment {
    private LinearLayout eol;
    private TextView hrg;
    com.tencent.mm.plugin.appbrand.ui.autofill.AppBrandIDCardUI.a iJN;
    private View iJO;
    private RecyclerView iJP;
    private TextView iJQ;
    private Button iJR;
    private CheckBox iJS;
    private TextView iJT;
    private LinearLayout iJU;
    private View iJV;
    private TextView iJW;
    private TextView iJX;
    private ImageView iyo;
    private com.tencent.mm.ui.a mActionBarHelper;

    public static class a extends android.support.v7.widget.RecyclerView.a<a> {
        private List<ga> iKa;

        public a(List<ga> list) {
            this.iKa = list;
        }

        public final int getItemCount() {
            AppMethodBeat.i(133210);
            if (this.iKa == null) {
                AppMethodBeat.o(133210);
                return 0;
            }
            int size = this.iKa.size();
            AppMethodBeat.o(133210);
            return size;
        }
    }

    public void dealContentView(View view) {
        AppMethodBeat.i(133213);
        if (this.iJN == null || this.iJN.aMH() == null) {
            ab.e("MicroMsg.AppBrandIDCardShowFrag", "idCardUILogic or idCardUILogic.getIDCardShowInfo() is null, err");
            AppMethodBeat.o(133213);
            return;
        }
        this.eol = (LinearLayout) view.findViewById(2131821198);
        this.iyo = (ImageView) view.findViewById(2131821199);
        this.hrg = (TextView) view.findViewById(2131821200);
        this.iJP = (RecyclerView) view.findViewById(2131821202);
        this.iJQ = (TextView) view.findViewById(2131821203);
        this.iJR = (Button) view.findViewById(2131821206);
        this.iJS = (CheckBox) view.findViewById(2131821204);
        this.iJT = (TextView) view.findViewById(2131821205);
        this.iJU = (LinearLayout) view.findViewById(2131821195);
        this.iJV = view.findViewById(2131821208);
        this.iJW = (TextView) view.findViewById(2131821207);
        this.iJX = (TextView) view.findViewById(2131821209);
        this.iJO = v.hu(getContext()).inflate(2130968612, null);
        this.iJO.setBackgroundColor(getResources().getColor(2131690310));
        this.mActionBarHelper = new com.tencent.mm.ui.a(this.iJO);
        this.eol.addView(this.iJO, 0, new LayoutParams(-1, com.tencent.mm.plugin.appbrand.widget.a.de(getActivity())));
        bzo aMH = this.iJN.aMH();
        this.mActionBarHelper.setTitle(aMH.title);
        this.mActionBarHelper.b(new 1(this));
        b.abR().a(this.iyo, aMH.wIL, com.tencent.mm.modelappbrand.a.a.abQ(), f.fqH);
        this.hrg.setText(aMH.fhH + " " + aMH.wYC);
        if (aMH.wYD != null) {
            this.iJP.setVisibility(0);
            RecyclerView recyclerView = this.iJP;
            getContext();
            recyclerView.setLayoutManager(new LinearLayoutManager());
            this.iJP.setAdapter(new a(aMH.wYD));
        } else {
            ab.e("MicroMsg.AppBrandIDCardShowFrag", "idCardShowInfo.user_id_list is null");
            this.iJP.setVisibility(8);
        }
        this.iJQ.setText(aMH.wYE);
        if (bo.isNullOrNil(aMH.wYF)) {
            this.iJR.setText(getString(2131296662));
        } else {
            this.iJR.setText(aMH.wYF);
        }
        ab.i("MicroMsg.AppBrandIDCardShowFrag", "idCardShowInfo.auth_checked:%b", new Object[]{Boolean.valueOf(aMH.wYJ)});
        this.iJS.setChecked(aMH.wYJ);
        this.iJR.setEnabled(aMH.wYJ);
        if (bo.isNullOrNil(aMH.wYK)) {
            this.iJS.setText(getString(2131296663));
        } else {
            this.iJS.setText(aMH.wYK);
        }
        this.iJS.setOnCheckedChangeListener(new 2(this));
        this.iJR.setOnClickListener(new 3(this));
        if (aMH.wYG != null) {
            this.iJT.setText(aMH.wYG.name);
            this.iJT.setOnClickListener(new 4(this, aMH));
        }
        if (aMH.wYH != null) {
            ab.d("MicroMsg.AppBrandIDCardShowFrag", "idCardShowInfo.jump_list size:%d", new Object[]{Integer.valueOf(aMH.wYH.size())});
            if (aMH.wYH.size() == 0) {
                this.iJU.setVisibility(8);
                AppMethodBeat.o(133213);
                return;
            } else if (aMH.wYH.size() == 1) {
                this.iJU.setVisibility(0);
                this.iJV.setVisibility(8);
                this.iJX.setVisibility(8);
                if (aMH.wYH.get(0) != null) {
                    this.iJW.setText(((gb) aMH.wYH.get(0)).name);
                    this.iJW.setOnClickListener(new 5(this, aMH));
                    AppMethodBeat.o(133213);
                    return;
                }
            } else {
                this.iJU.setVisibility(0);
                this.iJV.setVisibility(0);
                this.iJX.setVisibility(0);
                if (aMH.wYH.get(0) != null) {
                    this.iJW.setText(((gb) aMH.wYH.get(0)).name);
                    this.iJW.setOnClickListener(new 6(this, aMH));
                }
                if (aMH.wYH.get(1) != null) {
                    this.iJX.setText(((gb) aMH.wYH.get(1)).name);
                    this.iJX.setOnClickListener(new 7(this, aMH));
                }
            }
        }
        AppMethodBeat.o(133213);
    }

    public boolean noActionBar() {
        return true;
    }

    public boolean supportNavigationSwipeBack() {
        return false;
    }

    public int getLayoutId() {
        return 2130968687;
    }

    public void onSwipeBack() {
        AppMethodBeat.i(133214);
        if (this.iJN != null) {
            this.iJN.onSwipeBack();
        }
        AppMethodBeat.o(133214);
    }
}
