package com.tencent.mm.plugin.wenote.ui.nativenote.b;

import android.content.res.Resources;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;
import com.tencent.mm.plugin.wenote.model.a.c;
import com.tencent.mm.plugin.wenote.model.nativenote.c.e;
import com.tencent.mm.plugin.wenote.model.nativenote.manager.WXRTEditText;
import com.tencent.mm.plugin.wenote.model.nativenote.manager.k;
import com.tencent.mm.sdk.platformtools.ab;

public abstract class i extends a {
    public static float uUN = Resources.getSystem().getDisplayMetrics().density;
    public static int uUO = Resources.getSystem().getDisplayMetrics().widthPixels;
    public static int uUP = ((int) ((40.0f * uUN) + 0.5f));
    public ImageView cAw;
    public LinearLayout gCe;
    public OnClickListener nij = new 4(this);
    public WXRTEditText uUA;
    public LinearLayout uUB;
    public TextView uUC;
    public TextView uUD;
    public ImageView uUE;
    public View uUF;
    public LinearLayout uUG;
    public LinearLayout uUH;
    public LinearLayout uUI;
    public LinearLayout uUJ;
    public LinearLayout uUK;
    public LinearLayout uUL;
    public LinearLayout uUM;
    public WXRTEditText uUz;

    public i(View view, k kVar) {
        super(view, kVar);
        this.cAw = (ImageView) view.findViewById(2131826385);
        this.uUF = view.findViewById(2131826386);
        this.uUB = (LinearLayout) view.findViewById(2131826387);
        this.gCe = (LinearLayout) view.findViewById(2131826391);
        this.uUC = (TextView) view.findViewById(2131826389);
        this.uUD = (TextView) view.findViewById(2131826390);
        this.uUE = (ImageView) view.findViewById(2131826388);
        this.uUC.setTextSize(16.0f);
        this.uUD.setTextSize(12.0f);
        this.uUG = (LinearLayout) view.findViewById(2131826400);
        this.uUG.setVisibility(8);
        this.uUI = (LinearLayout) view.findViewById(2131826405);
        this.uUI.setVisibility(8);
        this.uUJ = (LinearLayout) view.findViewById(2131826402);
        this.uUJ.setVisibility(8);
        this.uUK = (LinearLayout) view.findViewById(2131826408);
        this.uUK.setBackgroundColor(1347529272);
        this.uUK.setVisibility(8);
        this.uUK.setOnClickListener(new 1(this));
        this.uUL = (LinearLayout) view.findViewById(2131826377);
        this.uUL.setBackgroundColor(1347529272);
        this.uUL.setVisibility(4);
        this.uUM = (LinearLayout) view.findViewById(2131826409);
        this.uUM.setBackgroundColor(1347529272);
        this.uUM.setVisibility(4);
        this.uUH = (LinearLayout) view.findViewById(2131826376);
        LayoutParams layoutParams = (LayoutParams) this.uUH.getLayoutParams();
        layoutParams.width = uUO - uUP;
        layoutParams.height = -2;
        this.uUH.setLayoutParams(layoutParams);
        this.uUA = (WXRTEditText) view.findViewById(2131826413);
        this.uUz = (WXRTEditText) view.findViewById(2131826411);
        ((LinearLayout) view.findViewById(2131826412)).setOnClickListener(new 2(this));
        ((LinearLayout) view.findViewById(2131826410)).setOnClickListener(new 3(this));
        this.uUA.setEditTextType(2);
        this.uUz.setEditTextType(1);
        this.uUz.uPS = this;
        this.uUA.uPS = this;
        if (!(kVar.uQI == 2 && this.uSJ.uQJ)) {
            this.uUA.setKeyListener(null);
            this.uUA.setEnabled(false);
            this.uUA.setFocusable(false);
            this.uUz.setKeyListener(null);
            this.uUz.setEnabled(false);
            this.uUz.setFocusable(false);
        }
        this.uSJ.q(this.uUz);
        this.uSJ.q(this.uUA);
    }

    public void a(c cVar, int i, int i2) {
        ab.i("Micromsg.NoteOtherItemHolder", "ImageItemHolder position is " + ki());
        this.uUz.setPosInDataList(i);
        this.uUA.setPosInDataList(i);
        if (e.isEnabled()) {
            e.dfb().a(this.uUK, this.uUL, this.uUM, i);
        }
        cVar.uNW = this.uUz;
        cVar.uNX = this.uUA;
        cVar.uNY = null;
        if (!cVar.uNT) {
            if (this.uUz.hasFocus()) {
                this.uUz.clearFocus();
            }
            if (this.uUA.hasFocus()) {
                this.uUA.clearFocus();
            }
        } else if (cVar.uNZ) {
            this.uUz.requestFocus();
        } else {
            this.uUA.requestFocus();
        }
        if (this.uUB.getVisibility() != 0) {
            return;
        }
        if (cVar.uOa) {
            this.uUB.setBackgroundResource(2130840796);
        } else {
            this.uUB.setBackgroundResource(2130840795);
        }
    }
}
