package com.mexico.inloancash.activity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.core.widget.NestedScrollView;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.ButterKnife;
import com.google.gson.Gson;
import com.indiaholacash.holacash.R;
import com.mexico.inloancash.bean.India_BankingCheck_ListBean;
import com.mingle.widget.LoadingView;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import ඓ.ඓ.K.ʬ.C0625;
import ඓ.ඓ.K.㿎.C0701;

public class India_Bank_Card_Activity extends BaseActivity {
    public LoadingView mIndiaLoadingView;
    public NestedScrollView mIndiaScrollView;
    public LinearLayout mIndia_AddBank;
    public ImageView mIndia_GonBack;
    public RecyclerView mIndia_RecycleView;
    public TextView title;

    /* renamed from: ඓ  reason: contains not printable characters */
    public List<India_BankingCheck_ListBean.DataBean.BankListsBean> f2523;

    /* renamed from: 㴹  reason: contains not printable characters */
    public C0625 f2524;

    /* renamed from: com.mexico.inloancash.activity.India_Bank_Card_Activity$K  reason: contains not printable characters */
    public class C0435 implements Callback<String> {
        public C0435() {
        }

        @Override // retrofit2.Callback
        public void onFailure(Call<String> call, Throwable th) {
            India_Bank_Card_Activity.this.mIndiaScrollView.setVisibility(0);
            India_Bank_Card_Activity.this.mIndiaLoadingView.setVisibility(8);
        }

        @Override // retrofit2.Callback
        public void onResponse(Call<String> call, Response<String> response) {
            try {
                Log.d("loan", "getBankList onResponse:" + response.body());
                if (response.isSuccessful()) {
                    India_BankingCheck_ListBean india_BankingCheck_ListBean = (India_BankingCheck_ListBean) new Gson().fromJson(response.body(), India_BankingCheck_ListBean.class);
                    if (india_BankingCheck_ListBean.getStatus() == 1) {
                        India_Bank_Card_Activity.this.f2523.clear();
                        if (india_BankingCheck_ListBean.getData().getBankLists() != null && india_BankingCheck_ListBean.getData().getBankLists().size() > 0) {
                            for (int i = 0; i < india_BankingCheck_ListBean.getData().getBankLists().size(); i++) {
                                india_BankingCheck_ListBean.getData().getBankLists().get(i).setRadom(new Random().nextInt(2));
                                India_Bank_Card_Activity.this.f2523.add(india_BankingCheck_ListBean.getData().getBankLists().get(i));
                            }
                            India_Bank_Card_Activity.this.f2524.m2060(India_Bank_Card_Activity.this.f2523);
                        }
                    }
                }
            } catch (Exception unused) {
            }
            India_Bank_Card_Activity.this.mIndiaScrollView.setVisibility(0);
            India_Bank_Card_Activity.this.mIndiaLoadingView.setVisibility(8);
        }
    }

    @Override // androidx.fragment.app.FragmentActivity
    public void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        if (i == 0) {
            m1464();
        }
    }

    @Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, com.mexico.inloancash.activity.BaseActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.india_activity_view_bank);
        ButterKnife.m1066(this);
        this.title.setText("Mi tarjeta bancaria");
        this.f2523 = new ArrayList();
        this.f2524 = new C0625();
        this.mIndia_RecycleView.setAdapter(this.f2524);
        m1464();
    }

    @Override // androidx.appcompat.app.AppCompatActivity
    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (i == 4) {
            finish();
        }
        return super.onKeyDown(i, keyEvent);
    }

    public void onViewClicked(View view) {
        int id = view.getId();
        if (id == R.id.add_bank) {
            startActivityForResult(new Intent(this, IndiaAddBankActivity.class), 0);
        } else if (id == R.id.logon_back) {
            finish();
        }
    }

    /* renamed from: ؿ  reason: contains not printable characters */
    public void m1464() {
        Log.d("loan", "getBankList");
        C0701.f3707.m2131().m2102().enqueue(new C0435());
    }
}
