package com.tencent.mm.plugin.appbrand.widget.input.autofill;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.View.MeasureSpec;
import android.widget.ListAdapter;
import android.widget.ListView;
import com.google.android.gms.common.util.CrashUtils.ErrorDialogData;
import com.tencent.matrix.trace.core.AppMethodBeat;

class AutoFillListPopupWindowBase$a extends ListView {
    private boolean aid;
    private boolean aie;

    public AutoFillListPopupWindowBase$a(Context context, boolean z) {
        super(context, null, 2130772192);
        AppMethodBeat.i(123909);
        this.aie = z;
        setCacheColorHint(0);
        AppMethodBeat.o(123909);
    }

    public final boolean isInTouchMode() {
        AppMethodBeat.i(123910);
        if ((this.aie && this.aid) || super.isInTouchMode()) {
            AppMethodBeat.o(123910);
            return true;
        }
        AppMethodBeat.o(123910);
        return false;
    }

    public final boolean hasWindowFocus() {
        AppMethodBeat.i(123911);
        if (this.aie || super.hasWindowFocus()) {
            AppMethodBeat.o(123911);
            return true;
        }
        AppMethodBeat.o(123911);
        return false;
    }

    public final boolean isFocused() {
        AppMethodBeat.i(123912);
        if (this.aie || super.isFocused()) {
            AppMethodBeat.o(123912);
            return true;
        }
        AppMethodBeat.o(123912);
        return false;
    }

    public final boolean hasFocus() {
        AppMethodBeat.i(123913);
        if (this.aie || super.hasFocus()) {
            AppMethodBeat.o(123913);
            return true;
        }
        AppMethodBeat.o(123913);
        return false;
    }

    /* Access modifiers changed, original: final */
    public final int dt(int i, int i2) {
        AppMethodBeat.i(123914);
        int listPaddingTop = getListPaddingTop();
        int listPaddingBottom = getListPaddingBottom();
        getListPaddingLeft();
        getListPaddingRight();
        int dividerHeight = getDividerHeight();
        Drawable divider = getDivider();
        ListAdapter adapter = getAdapter();
        if (adapter == null) {
            i2 = listPaddingTop + listPaddingBottom;
            AppMethodBeat.o(123914);
            return i2;
        }
        listPaddingBottom += listPaddingTop;
        if (dividerHeight <= 0 || divider == null) {
            dividerHeight = 0;
        }
        int count = adapter.getCount();
        int i3 = 0;
        View view = null;
        for (int i4 = 0; i4 < count; i4++) {
            listPaddingTop = adapter.getItemViewType(i4);
            if (listPaddingTop != i3) {
                i3 = listPaddingTop;
                view = null;
            }
            view = adapter.getView(i4, view, this);
            listPaddingTop = view.getLayoutParams().height;
            if (listPaddingTop > 0) {
                listPaddingTop = MeasureSpec.makeMeasureSpec(listPaddingTop, ErrorDialogData.SUPPRESSED);
            } else {
                listPaddingTop = MeasureSpec.makeMeasureSpec(0, 0);
            }
            view.measure(i, listPaddingTop);
            if (i4 > 0) {
                listPaddingTop = listPaddingBottom + dividerHeight;
            } else {
                listPaddingTop = listPaddingBottom;
            }
            listPaddingBottom = view.getMeasuredHeight() + listPaddingTop;
            if (listPaddingBottom >= i2) {
                AppMethodBeat.o(123914);
                return i2;
            }
        }
        AppMethodBeat.o(123914);
        return listPaddingBottom;
    }
}
