正在查看: 95爱播免登录版 v3.1.9 应用的 ConvertActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 95爱播免登录版 v3.1.9 应用的 ConvertActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.showself.ui;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
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.xiaomi.mipush.sdk.Constants;
import java.util.HashMap;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class ConvertActivity extends c implements View.OnClickListener {
private TextView a;
private TextView b;
private int c;
private TextView d;
private TextView f2616e;
private int f2617f;
private int f2618g;
private String[] f2619h;
private int[] f2620i;
private int[] f2621j;
private int[] f2622k;
private int l;
class a implements DialogInterface.OnClickListener {
a() {
}
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
ConvertActivity convertActivity = ConvertActivity.this;
convertActivity.c = convertActivity.f2621j[i2];
ConvertActivity.this.a.setText(ConvertActivity.this.f2620i[i2] + "");
ConvertActivity convertActivity2 = ConvertActivity.this;
convertActivity2.l = convertActivity2.f2620i[i2];
ConvertActivity.this.b.setText(ConvertActivity.this.f2622k[i2] + "");
}
}
private void G() {
int i2 = this.l;
if (i2 == 0) {
Utils.Z0(this, "请选择兑换数量");
return;
}
if (i2 > this.f2618g) {
Utils.Z0(this, "您的蜜金数量不够");
return;
}
Utils.U0(this);
HashMap hashMap = new HashMap();
hashMap.put("c_id", Integer.valueOf(this.c));
addTask(new com.showself.service.f(20011, hashMap), this);
}
private void H() {
this.d.setText(getString(R.string.my_money) + Constants.COLON_SEPARATOR + this.f2617f);
this.f2616e.setText(getString(R.string.my_jewel) + Constants.COLON_SEPARATOR + this.f2618g);
}
private void I() {
new AlertDialog.Builder(this).setItems(this.f2619h, new a()).show();
}
@Override
public void init() {
findViewById(R.id.btn_nav_left).setOnClickListener(this);
((TextView) findViewById(R.id.tv_nav_title)).setText(R.string.convert_money);
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.d = (TextView) findViewById(R.id.tv_product_my_money);
this.f2616e = (TextView) findViewById(R.id.tv_product_my_jewel);
I();
H();
}
@Override
public void onClick(View view) {
int id = view.getId();
if (id == 2131296414) {
G();
} else if (id == 2131296429) {
I();
} else {
if (id != 2131296486) {
return;
}
onBackPressed();
}
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.convert_layout);
Intent intent = getIntent();
try {
JSONArray jSONArray = new JSONArray(intent.getStringExtra("jsonArray"));
if (jSONArray.length() > 0) {
this.f2619h = new String[jSONArray.length()];
this.f2621j = new int[jSONArray.length()];
this.f2620i = new int[jSONArray.length()];
this.f2622k = new int[jSONArray.length()];
for (int i2 = 0; i2 < jSONArray.length(); i2++) {
JSONObject optJSONObject = jSONArray.optJSONObject(i2);
this.f2619h[i2] = optJSONObject.optString("diamond") + " 蜜金兑换 " + optJSONObject.optString("money") + " 蜜钻";
this.f2621j[i2] = optJSONObject.optInt("c_id");
this.f2622k[i2] = optJSONObject.optInt("money");
this.f2620i[i2] = optJSONObject.optInt("diamond");
}
}
} catch (JSONException e2) {
e2.printStackTrace();
}
this.f2617f = intent.getIntExtra("money", 0);
this.f2618g = intent.getIntExtra("jewel", 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.f2617f = ((Integer) hashMap.get("money")).intValue();
this.f2618g = ((Integer) hashMap.get("diamonds")).intValue();
H();
}
Utils.Z0(this, str);
}
}