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

import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.address.d.b;
import com.tencent.mm.plugin.address.model.g;
import com.tencent.mm.sdk.platformtools.ab;

class WalletSelectAddrUI$4 implements OnItemClickListener {
    final /* synthetic */ WalletSelectAddrUI gLk;

    WalletSelectAddrUI$4(WalletSelectAddrUI walletSelectAddrUI) {
        this.gLk = walletSelectAddrUI;
    }

    public final void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
        AppMethodBeat.i(16980);
        ab.d("MicroMsg.WalletSelectAddrUI", "select pos ".concat(String.valueOf(i)));
        synchronized (WalletSelectAddrUI.c(this.gLk)) {
            try {
                if (i < WalletSelectAddrUI.d(this.gLk).size()) {
                    WalletSelectAddrUI.a(this.gLk, (b) WalletSelectAddrUI.d(this.gLk).get(i));
                    if (!WalletSelectAddrUI.e(this.gLk) && !WalletSelectAddrUI.f(this.gLk) && WalletSelectAddrUI.g(this.gLk) != null) {
                        WalletSelectAddrUI.a(this.gLk, WalletSelectAddrUI.g(this.gLk).id);
                    } else if (!(WalletSelectAddrUI.g(this.gLk) == null || WalletSelectAddrUI.g(this.gLk).id == 0)) {
                        WalletSelectAddrUI.h(this.gLk).g(new g(WalletSelectAddrUI.g(this.gLk).id));
                    }
                }
            } finally {
                AppMethodBeat.o(16980);
            }
        }
        WalletSelectAddrUI.i(this.gLk).notifyDataSetChanged();
    }
}
