package com.tencent.mm.plugin.readerapp.ui;

import android.content.Context;
import android.database.Cursor;
import android.view.View;
import android.view.View.OnCreateContextMenuListener;
import android.view.ViewGroup;
import android.widget.TextView;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.readerapp.c.g;
import com.tencent.mm.pluginsdk.f.h;
import com.tencent.mm.ui.base.n.d;

@Deprecated
class ReaderAppUI$c extends a<String> {
    private Context context;
    private int enb = this.kmW;
    private int jNi;
    private int kmW = 3;
    final /* synthetic */ ReaderAppUI pFj;
    private int pFo;

    public ReaderAppUI$c(ReaderAppUI readerAppUI, Context context, String str) {
        this.pFj = readerAppUI;
        super(context, str);
        AppMethodBeat.i(76839);
        this.context = context;
        this.pFo = context.getResources().getDimensionPixelSize(2131427500);
        this.jNi = context.getResources().getDimensionPixelSize(2131427858);
        AppMethodBeat.o(76839);
    }

    public final void KD() {
        AppMethodBeat.i(76840);
        KC();
        AppMethodBeat.o(76840);
    }

    public final boolean bdn() {
        return this.kmW >= this.enb;
    }

    public final int getShowCount() {
        return this.kmW;
    }

    public final int bdo() {
        AppMethodBeat.i(76841);
        if (bdn()) {
            AppMethodBeat.o(76841);
            return 0;
        }
        this.kmW += 3;
        if (this.kmW <= this.enb) {
            AppMethodBeat.o(76841);
            return 3;
        }
        this.kmW = this.enb;
        int i = this.enb % 3;
        AppMethodBeat.o(76841);
        return i;
    }

    public final void KC() {
        AppMethodBeat.i(76842);
        this.enb = g.cdZ().kI(ReaderAppUI.a(this.pFj));
        setCursor(g.cdZ().cp(this.kmW, ReaderAppUI.a(this.pFj)));
        super.notifyDataSetChanged();
        AppMethodBeat.o(76842);
    }

    public final View getView(int i, View view, ViewGroup viewGroup) {
        a aVar;
        AppMethodBeat.i(76843);
        if (view == null) {
            aVar = new a(this);
            view = View.inflate(this.context, 2130970451, null);
            aVar.pFy = (ReaderItemListView) view.findViewById(2131826836);
            aVar.ngD = (TextView) view.findViewById(2131826831);
            view.setTag(aVar);
        } else {
            aVar = (a) view.getTag();
        }
        getItem(i);
        aVar.ngD.setText(h.c(this.context, 0, false));
        ReaderItemListView readerItemListView = aVar.pFy;
        String str = (String) getItem(i);
        OnCreateContextMenuListener a = ReaderAppUI.a(this.pFj, false);
        d g = ReaderAppUI.g(this.pFj);
        readerItemListView.position = i;
        readerItemListView.pFC = a;
        readerItemListView.jOb = g;
        readerItemListView.pFA = g.cdZ().R(str, readerItemListView.type);
        readerItemListView.pFB.notifyDataSetChanged();
        if (ReaderAppUI.h(this.pFj) != null) {
            aVar.ngD.setTextColor(ReaderAppUI.h(this.pFj).vgW);
            if (ReaderAppUI.h(this.pFj).vgX) {
                aVar.ngD.setShadowLayer(2.0f, 1.2f, 1.2f, ReaderAppUI.h(this.pFj).vgY);
            } else {
                aVar.ngD.setShadowLayer(0.0f, 0.0f, 0.0f, 0);
            }
            if (ReaderAppUI.h(this.pFj).vgZ) {
                aVar.ngD.setBackgroundResource(2130838199);
                aVar.ngD.setPadding(this.jNi, this.pFo, this.jNi, this.pFo);
            } else {
                aVar.ngD.setBackgroundColor(0);
            }
        }
        AppMethodBeat.o(76843);
        return view;
    }

    public final /* synthetic */ Object a(Object obj, Cursor cursor) {
        AppMethodBeat.i(76844);
        String string = cursor.getString(0);
        AppMethodBeat.o(76844);
        return string;
    }
}
