package com.vinfast.companion.core.utils.verifyPhone;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes15.dex */
@kotlin.Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\u0004\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J)\u0010\t\u001a\u00020\u00052\u0006\u0010\u0004\u001a\u00020\u00032\b\u0010\u0006\u001a\u0004\u0018\u00010\u00052\u0006\u0010\b\u001a\u00020\u0007H\u0016¢\u0006\u0004\b\t\u0010\nR\u0016\u0010\u000e\u001a\u00020\u000b8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\f\u0010\r¨\u0006\u000f"}, d2 = {"Lcom/vinfast/companion/core/utils/verifyPhone/CustomAdapter;", "Landroid/widget/ArrayAdapter;", "Lcom/vinfast/companion/core/utils/verifyPhone/CountryModel;", "", "position", "Landroid/view/View;", "convertView", "Landroid/view/ViewGroup;", "parent", "getView", "(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;", "", "a", "Ljava/lang/String;", "mSelectedItemString", "core_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
public final class CustomAdapter extends android.widget.ArrayAdapter<com.vinfast.companion.core.utils.verifyPhone.CountryModel> {

    /* JADX INFO: renamed from: a, reason: from kotlin metadata */
    private java.lang.String mSelectedItemString;

    @Override // android.widget.ArrayAdapter, android.widget.Adapter
    public android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent) {
        kotlin.jvm.internal.Intrinsics.l(parent, "parent");
        android.view.View viewInflate = android.view.LayoutInflater.from(parent.getContext()).inflate(com.vinfast.companion.core.R.layout.dialog_singlechoice, parent, false);
        kotlin.jvm.internal.Intrinsics.k(viewInflate, "inflate(...)");
        android.view.View viewFindViewById = viewInflate.findViewById(com.vinfast.companion.core.R.id.imv_selected);
        kotlin.jvm.internal.Intrinsics.k(viewFindViewById, "findViewById(...)");
        android.widget.ImageView imageView = (android.widget.ImageView) viewFindViewById;
        android.widget.CheckedTextView checkedTextView = (android.widget.CheckedTextView) viewInflate.findViewById(android.R.id.title);
        android.view.View viewFindViewById2 = viewInflate.findViewById(com.vinfast.companion.core.R.id.item_dashboard_divider);
        com.vinfast.companion.core.utils.verifyPhone.CountryModel countryModel = (com.vinfast.companion.core.utils.verifyPhone.CountryModel) getItem(position);
        checkedTextView.setText(countryModel != null ? countryModel.c() : null);
        java.lang.String str = this.mSelectedItemString;
        com.vinfast.companion.core.utils.verifyPhone.CountryModel countryModel2 = (com.vinfast.companion.core.utils.verifyPhone.CountryModel) getItem(position);
        imageView.setVisibility(kotlin.jvm.internal.Intrinsics.g(str, countryModel2 != null ? countryModel2.b() : null) ? 0 : 8);
        if (position == getCount() - 1) {
            viewFindViewById2.setVisibility(8);
            return viewInflate;
        }
        viewFindViewById2.setVisibility(0);
        return viewInflate;
    }
}
