package com.mexico.inloancash.fragment;

import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.ButterKnife;
import com.facebook.AccessToken;
import com.facebook.appevents.AppEventsConstants;
import com.google.gson.Gson;
import com.indiaholacash.holacash.R;
import com.mexico.inloancash.MyApplication;
import com.mexico.inloancash.bean.India_Billing_ListBean;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import ඓ.ඓ.K.ʬ.C0627;
import ඓ.ඓ.K.ⁱ.C0648;
import ඓ.ඓ.K.㿎.C0701;
import ඓ.ඓ.K.䁗.C0733;
import ඓ.K.K.K.C1293;
import ῲ.ᨨ.㳳.C1841;

public class MainBillFragment extends C0648 {
    public TextView bill_amount;
    public RecyclerView bill_recycle;

    /* renamed from: ʬ  reason: contains not printable characters */
    public View f2796;

    /* renamed from: ඓ  reason: contains not printable characters */
    public C0627 f2797;

    /* renamed from: 㴹  reason: contains not printable characters */
    public String f2798 = AppEventsConstants.EVENT_PARAM_VALUE_NO;

    /* renamed from: 㸾  reason: contains not printable characters */
    public List<India_Billing_ListBean.DataBean> f2799;

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

        @Override // retrofit2.Callback
        public void onFailure(Call<String> call, Throwable th) {
        }

        @Override // retrofit2.Callback
        public void onResponse(Call<String> call, Response<String> response) {
            try {
                if (response.isSuccessful()) {
                    India_Billing_ListBean india_Billing_ListBean = (India_Billing_ListBean) new Gson().fromJson(response.body(), India_Billing_ListBean.class);
                    if (india_Billing_ListBean.getCode() == 200) {
                        MainBillFragment.this.f2799.clear();
                        MainBillFragment.this.f2799.addAll(india_Billing_ListBean.getData());
                        MainBillFragment.this.f2797.m2060(MainBillFragment.this.f2799);
                        for (India_Billing_ListBean.DataBean dataBean : MainBillFragment.this.f2799) {
                            if (!(dataBean.getStatus() == 0 || dataBean.getStatus() == 2 || dataBean.getStatus() == 6)) {
                                MainBillFragment.this.f2798 = C0733.m2153(dataBean.getPay_amount());
                            }
                        }
                    }
                }
            } catch (Exception unused) {
            }
            TextView textView = MainBillFragment.this.bill_amount;
            StringBuilder r4 = C1293.m3416(" $");
            r4.append(MainBillFragment.this.f2798);
            textView.setText(r4.toString());
        }
    }

    public MainBillFragment() {
        new Handler();
    }

    @Override // androidx.fragment.app.Fragment
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        this.f2796 = layoutInflater.inflate(R.layout.first_main_bill, viewGroup, false);
        ButterKnife.m1067(this, this.f2796);
        this.f2799 = new ArrayList();
        this.f2797 = new C0627();
        this.f2797.m2051(LayoutInflater.from(getContext()).inflate(R.layout.empty_view, (ViewGroup) null));
        this.bill_recycle.setAdapter(this.f2797);
        m1623();
        m1624();
        return this.f2796;
    }

    @Override // androidx.fragment.app.Fragment
    public void onHiddenChanged(boolean z) {
        super.onHiddenChanged(z);
        if (!z) {
            m1624();
        }
    }

    @Override // androidx.fragment.app.Fragment
    public void onResume() {
        super.onResume();
    }

    /* renamed from: ᨨ  reason: contains not printable characters */
    public final void m1623() {
    }

    /* renamed from: 㿎  reason: contains not printable characters */
    public void m1624() {
        C0701.f3707.m2131().m2111(C1841.m4788(AccessToken.TOKEN_KEY, ""), MyApplication.f2291).enqueue(new C0526());
    }
}
