导航菜单

页面标题

页面副标题

95爱播免登录版 v3.1.9 - NewConvertActivity.java 源代码

正在查看: 95爱播免登录版 v3.1.9 应用的 NewConvertActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.showself.ui;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.mifeng.ui.R;
import com.showself.service.g;
import com.showself.utils.Utils;
import com.showself.view.EnCustomSegmentView;
import com.zego.zegoavkit2.ZegoConstants;
import java.util.HashMap;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class NewConvertActivity extends com.showself.ui.c implements View.OnClickListener {
    private TextView a;
    private TextView b;
    private TextView c;
    private int d;

    private TextView f2752e;

    private TextView f2753f;

    private TextView f2754g;

    private int f2755h;

    private int f2756i;

    private int f2757j;

    private int f2758k;
    private String[] l;
    private int[] m;
    private int[] n;
    private int[] o;
    private String[] p;
    private int[] q;
    private int[] r;
    private int[] s;
    private int t;
    private int u;
    private EnCustomSegmentView v;
    private int w = 1;
    private EnCustomSegmentView.b x = new d();

    class a implements View.OnClickListener {
        a() {
        }

        @Override
        public void onClick(View view) {
            Intent intent = new Intent(NewConvertActivity.this.getApplicationContext(), (Class<?>) HtmlDisplayActivity.class);
            intent.putExtra("title", NewConvertActivity.this.getResources().getString(R.string.goldingot_rule_title));
            intent.putExtra("url", "https://www.showself.com/help/ingotapp.html?grade=" + NewConvertActivity.this.f2758k);
            NewConvertActivity.this.startActivity(intent);
        }
    }

    class b implements DialogInterface.OnClickListener {
        b() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i2) {
            NewConvertActivity newConvertActivity = NewConvertActivity.this;
            newConvertActivity.d = newConvertActivity.n[i2];
            NewConvertActivity.this.a.setText(NewConvertActivity.this.m[i2] + "");
            NewConvertActivity newConvertActivity2 = NewConvertActivity.this;
            newConvertActivity2.t = newConvertActivity2.m[i2];
            NewConvertActivity.this.b.setText(NewConvertActivity.this.o[i2] + "");
        }
    }

    class c implements DialogInterface.OnClickListener {
        c() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i2) {
            NewConvertActivity newConvertActivity = NewConvertActivity.this;
            newConvertActivity.d = newConvertActivity.r[i2];
            NewConvertActivity.this.a.setText(NewConvertActivity.this.q[i2] + "");
            NewConvertActivity newConvertActivity2 = NewConvertActivity.this;
            newConvertActivity2.u = newConvertActivity2.q[i2];
            NewConvertActivity.this.b.setText(NewConvertActivity.this.s[i2] + "");
        }
    }

    class d implements EnCustomSegmentView.b {
        d() {
        }

        @Override
        public void a(int i2) {
            if (i2 == 0) {
                if (NewConvertActivity.this.w != 1) {
                    NewConvertActivity.this.w = 1;
                    NewConvertActivity.this.z();
                    NewConvertActivity.this.T();
                    NewConvertActivity.this.S();
                    return;
                }
                return;
            }
            if (i2 == 1 && NewConvertActivity.this.w != 2) {
                NewConvertActivity.this.w = 2;
                NewConvertActivity.this.z();
                NewConvertActivity.this.T();
                NewConvertActivity.this.S();
            }
        }
    }

    private void R() {
        if (this.w == 1) {
            int i2 = this.t;
            if (i2 == 0) {
                Utils.Z0(this, getResources().getString(R.string.exchange_coin_reminder_number));
                return;
            } else if (i2 > this.f2756i) {
                Utils.Z0(this, getResources().getString(R.string.exchange_lack_jewel));
                return;
            }
        } else {
            int i3 = this.u;
            if (i3 == 0) {
                Utils.Z0(this, getResources().getString(R.string.exchange_coin_reminder_number));
                return;
            } else if (i3 > this.f2757j) {
                Utils.Z0(this, getResources().getString(R.string.exchange_lack_goldingot));
                return;
            }
        }
        Utils.U0(this);
        HashMap hashMap = new HashMap();
        hashMap.put("c_id", Integer.valueOf(this.d));
        addTask(new com.showself.service.f(20011, hashMap), this);
    }

    public void S() {
        this.f2752e.setText(getString(R.string.my_money) + ZegoConstants.ZegoVideoDataAuxPublishingStream + this.f2755h);
        int i2 = this.w;
        if (i2 == 1) {
            Drawable drawable = getResources().getDrawable(R.drawable.jewel_icon);
            drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
            this.f2753f.setCompoundDrawables(drawable, null, null, null);
            this.f2753f.setText(getString(R.string.my_jewel) + ZegoConstants.ZegoVideoDataAuxPublishingStream + this.f2756i);
            this.f2754g.setText(getString(R.string.exchange_number_jewel));
            this.c.setVisibility(8);
            return;
        }
        if (i2 == 2) {
            Drawable drawable2 = getResources().getDrawable(R.drawable.icon_goldingot);
            drawable2.setBounds(0, 0, drawable2.getMinimumWidth(), drawable2.getMinimumHeight());
            this.f2753f.setCompoundDrawables(drawable2, null, null, null);
            this.f2753f.setText(getString(R.string.my_goldingot) + ZegoConstants.ZegoVideoDataAuxPublishingStream + this.f2757j);
            this.f2754g.setText(getString(R.string.exchange_number_goldingot));
            this.c.setVisibility(0);
            this.c.setOnClickListener(new a());
        }
    }

    public void T() {
        int i2 = this.w;
        if (i2 == 1) {
            U();
        } else if (i2 == 2) {
            V();
        }
    }

    private void U() {
        new AlertDialog.Builder(this).setItems(this.l, new b()).show();
    }

    private void V() {
        new AlertDialog.Builder(this).setItems(this.p, new c()).show();
    }

    public void z() {
        this.a.setText("");
        this.b.setText("");
        this.t = 0;
        this.u = 0;
    }

    @Override
    public void init() {
        String[] strArr = {getString(R.string.exchange_xiuzuan_toxiubi), getString(R.string.exchange_yuanbao_toxiubi)};
        EnCustomSegmentView enCustomSegmentView = (EnCustomSegmentView) findViewById(R.id.cs_activity_list_top_segment);
        this.v = enCustomSegmentView;
        enCustomSegmentView.f(strArr, this.x, 0);
        findViewById(R.id.btn_nav_left).setOnClickListener(this);
        findViewById(R.id.bt_selecter).setOnClickListener(this);
        findViewById(R.id.bt_action).setOnClickListener(this);
        this.a = (TextView) findViewById(R.id.tv_show_jewel1);
        this.b = (TextView) findViewById(R.id.tv_show_jewel2);
        this.f2752e = (TextView) findViewById(R.id.tv_product_my_money);
        this.f2753f = (TextView) findViewById(R.id.tv_product_my_jewel);
        this.f2754g = (TextView) findViewById(R.id.exchange);
        this.c = (TextView) findViewById(R.id.textView_rule);
        T();
        S();
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (id == 2131296414) {
            R();
        } else if (id == 2131296429) {
            T();
        } else {
            if (id != 2131296486) {
                return;
            }
            onBackPressed();
        }
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.convert_layout2);
        Intent intent = getIntent();
        try {
            JSONArray jSONArray = new JSONArray(intent.getStringExtra("jsonArray"));
            JSONArray jSONArray2 = new JSONArray(intent.getStringExtra("jsonArray_goldingot"));
            if (jSONArray.length() > 0 && jSONArray2.length() > 0) {
                this.l = new String[jSONArray.length()];
                this.n = new int[jSONArray.length()];
                this.m = new int[jSONArray.length()];
                this.o = new int[jSONArray.length()];
                this.p = new String[jSONArray2.length()];
                this.r = new int[jSONArray2.length()];
                this.q = new int[jSONArray2.length()];
                this.s = new int[jSONArray2.length()];
                for (int i2 = 0; i2 < jSONArray.length(); i2++) {
                    JSONObject optJSONObject = jSONArray.optJSONObject(i2);
                    this.l[i2] = optJSONObject.optString("diamond") + getResources().getString(R.string.exchange_xiuzuan_toxiubi2) + optJSONObject.optString("money") + getResources().getString(R.string.showself_coin);
                    this.n[i2] = optJSONObject.optInt("c_id");
                    this.o[i2] = optJSONObject.optInt("money");
                    this.m[i2] = optJSONObject.optInt("diamond");
                }
                for (int i3 = 0; i3 < jSONArray2.length(); i3++) {
                    JSONObject optJSONObject2 = jSONArray2.optJSONObject(i3);
                    this.p[i3] = optJSONObject2.optString("goldingot") + getResources().getString(R.string.exchange_yuanbao_toxiubi2) + optJSONObject2.optString("money") + getResources().getString(R.string.showself_coin);
                    this.r[i3] = optJSONObject2.optInt("c_id");
                    this.s[i3] = optJSONObject2.optInt("money");
                    this.q[i3] = optJSONObject2.optInt("goldingot");
                }
            }
        } catch (JSONException e2) {
            e2.printStackTrace();
        }
        this.f2755h = intent.getIntExtra("money", 0);
        this.f2757j = intent.getIntExtra("goldingot", 0);
        this.f2756i = intent.getIntExtra("jewel", 0);
        this.f2758k = intent.getIntExtra("wealthgrade", 0);
        init();
    }

    @Override
    public void refresh(Object... objArr) {
        Utils.n(null);
        g.i(this);
        int intValue = ((Integer) objArr[0]).intValue();
        HashMap hashMap = (HashMap) objArr[1];
        if (hashMap == null || intValue != 20011) {
            return;
        }
        int intValue2 = ((Integer) hashMap.get(com.showself.net.e.n1)).intValue();
        String str = (String) hashMap.get(com.showself.net.e.o1);
        if (com.showself.net.e.m1 == intValue2) {
            this.f2755h = ((Integer) hashMap.get("money")).intValue();
            int i2 = this.w;
            if (i2 == 1) {
                this.f2756i = ((Integer) hashMap.get("diamonds")).intValue();
            } else if (i2 == 2) {
                this.f2757j = ((Integer) hashMap.get("goldingot")).intValue();
            }
            S();
        }
        Utils.Z0(this, str);
    }
}