OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 UserInfoEditActivity.java 源代码,内容仅作参考
package com.excelliance.kxqp.user;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.InputMethodManager;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alipay.sdk.util.i;
import com.excelliance.kxqp.GameUtil;
import com.excelliance.kxqp.gs.newappstore.b.c;
import com.excelliance.kxqp.gs.util.w;
import com.excelliance.kxqp.photo_selector.c.a;
import com.excelliance.kxqp.ui.BaseActivity;
import com.excelliance.kxqp.util.ToastUtil;
import com.excelliance.kxqp.util.ac;
import com.excelliance.kxqp.util.aj;
import com.excelliance.kxqp.util.as;
import com.excelliance.kxqp.util.n;
import com.excelliance.kxqp.util.t;
import org.apache.http.HttpStatus;
import org.json.JSONException;
import org.json.JSONObject;
public class UserInfoEditActivity extends BaseActivity implements View.OnClickListener {
private Context f14822b;
private View c;
private ImageView d;
private RelativeLayout e;
private RelativeLayout f;
private RelativeLayout g;
private RelativeLayout h;
private TextView i;
private ImageView j;
private TextView k;
private TextView l;
private TextView m;
private SharedPreferences n;
private SharedPreferences o;
private ImageView p;
private RelativeLayout q;
private TextView r;
private ImageView s;
private RelativeLayout t;
private TextView u;
private ImageView v;
private RelativeLayout x;
private boolean w = false;
private Bitmap y = null;
private int z = 1995;
private int A = 1;
private int B = 1;
private Dialog C = null;
Handler f14821a = new Handler() {
@Override
public void handleMessage(Message message) {
String str;
super.handleMessage(message);
switch (message.what) {
case 11:
UserInfoEditActivity.this.a((View) message.obj);
return;
case 12:
default:
return;
case 13:
UserInfoEditActivity.this.g();
return;
case 14:
aj a2 = aj.a();
a2.a(UserInfoEditActivity.this.n, n.d, a2.a(UserInfoEditActivity.this.o, n.d));
a2.a(UserInfoEditActivity.this.n, n.e, a2.b(UserInfoEditActivity.this.o, n.e));
a2.a(UserInfoEditActivity.this.n, n.f, a2.a(UserInfoEditActivity.this.o, n.f));
UserInfoEditActivity.this.o.edit().clear().apply();
UserInfoEditActivity.this.k();
ToastUtil.showToast(UserInfoEditActivity.this.f14822b, com.excelliance.kxqp.swipe.a.a.getString(UserInfoEditActivity.this.f14822b, "save_changed"));
UserInfoEditActivity.this.j();
return;
case 15:
UserInfoEditActivity.this.o.edit().clear().apply();
UserInfoEditActivity.this.k.setText(aj.a().a(UserInfoEditActivity.this.n, n.d));
switch (aj.a().b(UserInfoEditActivity.this.n, n.e)) {
case 0:
str = "";
break;
case 1:
str = com.excelliance.kxqp.swipe.a.a.getString(UserInfoEditActivity.this.f14822b, "person_man");
break;
case 2:
str = com.excelliance.kxqp.swipe.a.a.getString(UserInfoEditActivity.this.f14822b, "person_woman");
break;
default:
str = "";
break;
}
UserInfoEditActivity.this.l.setText(str);
UserInfoEditActivity.this.m.setText(aj.a().a(UserInfoEditActivity.this.n, n.f));
UserInfoEditActivity.this.k();
ToastUtil.showToast(UserInfoEditActivity.this.f14822b, com.excelliance.kxqp.swipe.a.a.getString(UserInfoEditActivity.this.f14822b, "server_exception"));
UserInfoEditActivity.this.j();
return;
}
}
};
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.f14822b = this;
this.c = com.excelliance.kxqp.swipe.a.a.getLayout(this.f14822b, "activity_user_edit");
if (this.c != null) {
setContentView(this.c);
a();
}
this.n = getSharedPreferences("USERINFO", Build.VERSION.SDK_INT < 11 ? 0 : 4);
this.o = getSharedPreferences("USER_TEMP_INFO", Build.VERSION.SDK_INT < 11 ? 0 : 4);
aj.a().a(this.o, n.d, aj.a().a(this.n, n.d));
aj.a().a(this.o, n.e, aj.a().b(this.n, n.e));
aj.a().a(this.o, n.f, aj.a().a(this.n, n.f));
}
@Override
protected void onResume() {
int i;
int i2;
int i3;
int i4;
Context context;
String str;
Context context2;
String str2;
super.onResume();
boolean c = aj.a().c(this.n, n.c);
Log.d("UserInfoEditActivity", "userStatus = " + c);
if (c) {
boolean z = !TextUtils.equals(aj.a().a(this.o, n.d), aj.a().a(this.n, n.d));
boolean z2 = aj.a().b(this.o, n.e) != aj.a().b(this.n, n.e);
boolean z3 = !TextUtils.equals(aj.a().a(this.o, n.f), aj.a().a(this.n, n.f));
Log.d("UserInfoEditActivity", "bool = " + z + " ," + z2 + " ," + z3);
if (this.k != null) {
if (z) {
String a2 = aj.a().a(this.o, n.d);
Log.d("UserInfoEditActivity", "tempNickName = " + a2);
if (!TextUtils.isEmpty(a2)) {
this.k.setVisibility(0);
this.k.setText(a2);
} else {
this.k.setVisibility(8);
}
} else {
String a3 = aj.a().a(this.n, n.d);
if (!TextUtils.isEmpty(a3)) {
this.k.setVisibility(0);
this.k.setText(a3);
} else {
String a4 = aj.a().a(this.n, n.h);
if (!TextUtils.isEmpty(a4)) {
String str3 = a4.substring(0, 3) + "****" + a4.substring(7);
this.k.setVisibility(0);
this.k.setText(str3);
} else {
this.k.setVisibility(8);
}
}
}
}
if (this.l != null) {
if (z2) {
int b2 = aj.a().b(this.o, n.e);
if (b2 == 1 || b2 == 2) {
this.l.setVisibility(0);
TextView textView = this.l;
if (b2 == 1) {
context2 = this.f14822b;
str2 = "person_man";
} else {
context2 = this.f14822b;
str2 = "person_woman";
}
textView.setText(com.excelliance.kxqp.swipe.a.a.getString(context2, str2));
} else {
this.l.setVisibility(8);
}
} else {
int b3 = aj.a().b(this.n, n.e);
if (b3 == 1 || b3 == 2) {
this.l.setVisibility(0);
TextView textView2 = this.l;
if (b3 == 1) {
context = this.f14822b;
str = "person_man";
} else {
context = this.f14822b;
str = "person_woman";
}
textView2.setText(com.excelliance.kxqp.swipe.a.a.getString(context, str));
} else {
this.l.setVisibility(8);
}
}
}
if (this.m != null) {
if (z3) {
String a5 = aj.a().a(this.o, n.f);
if (!TextUtils.isEmpty(a5)) {
this.m.setVisibility(0);
this.m.setText(a5);
} else {
this.m.setVisibility(8);
}
if (!TextUtils.isEmpty(a5)) {
int indexOf = a5.indexOf("年");
int indexOf2 = a5.indexOf("月");
int indexOf3 = a5.indexOf("日");
if (indexOf > 0 && indexOf2 > (i3 = indexOf + 1) && indexOf3 > (i4 = indexOf2 + 1)) {
this.z = Integer.valueOf(a5.substring(0, indexOf)).intValue();
this.A = Integer.valueOf(a5.substring(i3, indexOf2)).intValue();
this.B = Integer.valueOf(a5.substring(i4, indexOf3)).intValue();
}
}
} else {
String a6 = aj.a().a(this.n, n.f);
if (!TextUtils.isEmpty(a6)) {
this.m.setVisibility(0);
this.m.setText(a6);
} else {
this.m.setVisibility(8);
}
if (!TextUtils.isEmpty(a6)) {
int indexOf4 = a6.indexOf("年");
int indexOf5 = a6.indexOf("月");
int indexOf6 = a6.indexOf("日");
if (indexOf4 > 0 && indexOf5 > (i = indexOf4 + 1) && indexOf6 > (i2 = indexOf5 + 1)) {
this.z = Integer.valueOf(a6.substring(0, indexOf4)).intValue();
this.A = Integer.valueOf(a6.substring(i, indexOf5)).intValue();
this.B = Integer.valueOf(a6.substring(i2, indexOf6)).intValue();
}
}
}
}
if (this.j != null) {
if (this.y != null) {
this.j.setImageBitmap(this.y);
return;
}
Bitmap a7 = com.excelliance.kxqp.photo_selector.c.a.a(com.excelliance.kxqp.photo_selector.c.a.b(this.f14822b) + "usericon" + aj.a().a(this.f14822b), HttpStatus.SC_BAD_REQUEST, HttpStatus.SC_BAD_REQUEST);
if (a7 != null) {
Log.d("UserInfoEditActivity", "头像已存在,直接设置");
this.j.setImageBitmap(com.excelliance.kxqp.photo_selector.c.a.a(a7, HttpStatus.SC_BAD_REQUEST, HttpStatus.SC_BAD_REQUEST, 0, 0));
} else {
int idOfDrawable = com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(this.f14822b, "icon_login");
if (idOfDrawable != 0) {
this.j.setImageResource(idOfDrawable);
}
}
}
if (this.p != null) {
int b4 = aj.a().b(this.n, n.e);
int b5 = aj.a().b(this.o, n.e);
if (z2) {
if (b5 == 1) {
this.p.setVisibility(0);
this.p.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(this.f14822b, "man_superscript"));
} else if (b5 == 2) {
this.p.setVisibility(0);
this.p.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(this.f14822b, "woman_superscript"));
} else {
this.p.setVisibility(8);
}
} else if (b4 == 1) {
this.p.setVisibility(0);
this.p.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(this.f14822b, "man_superscript"));
} else if (b4 == 2) {
this.p.setVisibility(0);
this.p.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(this.f14822b, "woman_superscript"));
} else {
this.p.setVisibility(8);
}
}
String a8 = aj.a().a(this.n, n.h);
if (this.r != null) {
if (TextUtils.isEmpty(a8)) {
this.r.setText(com.excelliance.kxqp.swipe.a.a.getString(this.f14822b, "user_phone_unbound"));
if (this.s != null) {
this.s.setVisibility(0);
}
if (this.t != null) {
this.t.setVisibility(0);
String a9 = aj.a().a(this.n, "USER_NAME");
Log.d("UserInfoEditActivity", "account = " + a9);
if (!TextUtils.isEmpty(a9) && this.u != null) {
this.u.setText(a9);
}
}
if (this.v != null) {
this.v.setVisibility(0);
}
} else {
this.r.setText(a8.substring(0, 3) + "****" + a8.substring(7));
if (this.q != null) {
this.q.setTag(8);
}
if (this.s != null) {
this.s.setVisibility(8);
}
if (this.t != null) {
this.t.setVisibility(8);
}
}
}
if (TextUtils.isEmpty(a8)) {
return;
}
this.w = true;
}
}
private void a() {
t a2 = t.a(this.f14822b);
this.d = (ImageView) a2.a(this.c, "iv_back", 0);
this.d.setOnClickListener(this);
this.e = (RelativeLayout) a2.a(this.c, "rl_user_icon", 1);
this.e.setOnClickListener(this);
this.j = (ImageView) a2.a("iv_icon", this.c);
this.f = (RelativeLayout) a2.a(this.c, "rl_user_nickname", 2);
this.f.setOnClickListener(this);
this.k = (TextView) a2.a("tv_nickname", this.c);
this.g = (RelativeLayout) a2.a(this.c, "rl_user_sex", 3);
this.g.setOnClickListener(this);
this.l = (TextView) a2.a("tv_user_sex", this.c);
this.h = (RelativeLayout) a2.a(this.c, "rl_user_birthday", 4);
this.h.setOnClickListener(this);
this.m = (TextView) a2.a("tv_user_birthday", this.c);
this.i = (TextView) a2.a(this.c, "tv_login_out", 5);
this.i.setOnClickListener(this);
this.p = (ImageView) a2.a("iv_sex", this.c);
this.q = (RelativeLayout) a2.a(this.c, "rl_user_phone_number", 6);
this.q.setOnClickListener(this);
this.r = (TextView) a2.a("tv_user_phon_number", this.c);
this.s = (ImageView) a2.a("iv_red_point", this.c);
this.t = (RelativeLayout) a2.a("rl_user_account", this.c);
this.u = (TextView) a2.a("tv_account", this.c);
this.v = (ImageView) a2.a("iv_phone_arrow", this.c);
this.x = (RelativeLayout) a2.a(this.c, "reset_user_password", 7);
this.x.setOnClickListener(this);
if (c.a(this.f14822b)) {
a2.a("user_info_top", this.c).setBackgroundColor(c.f7694a);
c.a(this.i, w.k(this.f14822b, "login_button_bg_new_store"));
}
}
@Override
public void onClick(View view) {
int intValue = Integer.valueOf(view.getTag().toString()).intValue();
int identifier = getResources().getIdentifier("slide_left_in", "anim", getPackageName());
int identifier2 = getResources().getIdentifier("slide_left_out", "anim", getPackageName());
switch (intValue) {
case 0:
if (i() || this.y != null) {
a("user_info_saving");
c();
return;
} else {
if (this.y != null) {
this.y = null;
}
b(view);
j();
return;
}
case 1:
com.excelliance.kxqp.photo_selector.c.a.a().a((Activity) this.f14822b, new a.InterfaceC0498a() {
@Override
public void a(Bitmap bitmap) {
if (UserInfoEditActivity.this.j != null) {
Bitmap a2 = com.excelliance.kxqp.photo_selector.c.a.a(bitmap, HttpStatus.SC_BAD_REQUEST, HttpStatus.SC_BAD_REQUEST, 0, 0);
if (bitmap != a2) {
bitmap.recycle();
}
UserInfoEditActivity.this.y = a2;
}
}
@Override
public void a(String str) {
Log.d("UserInfoEditActivity", "onFailed = " + str);
ToastUtil.showToast(UserInfoEditActivity.this.f14822b, com.excelliance.kxqp.swipe.a.a.getString(UserInfoEditActivity.this.f14822b, "custom_icon_error"));
}
});
return;
case 2:
f();
return;
case 3:
e();
return;
case 4:
d();
return;
case 5:
com.excelliance.kxqp.pay.ali.b.j(this.f14822b);
as.a().a(this.f14822b, this.n);
this.n.edit().putString("USER_P002", null).apply();
startActivity(new Intent(this.f14822b, (Class<?>) LoginActivity.class));
finish();
overridePendingTransition(identifier, identifier2);
return;
case 6:
startActivity(new Intent(this.f14822b, (Class<?>) BoundPhoneNumActivity.class));
overridePendingTransition(identifier, identifier2);
return;
case 7:
if (!this.w) {
ToastUtil.showToast(this, getResources().getString(getResources().getIdentifier("please_bind_phone_number", "string", getPackageName())));
return;
} else {
startActivity(new Intent(this.f14822b, (Class<?>) PasswordResetActivity.class));
overridePendingTransition(identifier, identifier2);
return;
}
case 8:
startActivity(new Intent(this.f14822b, (Class<?>) ChangePhoneNumActivity.class));
overridePendingTransition(identifier, identifier2);
return;
default:
return;
}
}
private void c() {
a("user_info_saving");
if (i()) {
g();
return;
}
if (this.y != null) {
com.excelliance.kxqp.photo_selector.c.a.a().a(this.y, com.excelliance.kxqp.photo_selector.c.a.b(this.f14822b), "usericon" + aj.a().a(this.f14822b));
this.y.recycle();
this.y = null;
k();
ToastUtil.showToast(this.f14822b, com.excelliance.kxqp.swipe.a.a.getString(this.f14822b, "save_changed"));
j();
}
}
private void d() {
new DatePickerDialog(this.f14822b, 3, new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker datePicker, int i, int i2, int i3) {
UserInfoEditActivity.this.m.setVisibility(0);
StringBuilder sb = new StringBuilder();
sb.append(String.valueOf(i));
sb.append("年");
int i4 = i2 + 1;
sb.append(String.valueOf(i4));
sb.append("月");
sb.append(String.valueOf(i3));
sb.append("日");
String sb2 = sb.toString();
UserInfoEditActivity.this.m.setText(sb2);
aj.a().a(UserInfoEditActivity.this.o, n.f, sb2);
UserInfoEditActivity.this.z = i;
UserInfoEditActivity.this.A = i4;
UserInfoEditActivity.this.B = i3;
}
}, this.z, this.A - 1, this.B).show();
}
private void e() {
final AlertDialog create = new AlertDialog.Builder(this.f14822b).create();
int identifier = getResources().getIdentifier("dialog_edit_sex", "layout", getPackageName());
if (identifier != 0) {
create.setView(LayoutInflater.from(this.f14822b).inflate(identifier, (ViewGroup) null));
create.show();
create.getWindow().setContentView(identifier);
create.getWindow().setSoftInputMode(4);
}
((TextView) create.findViewById(com.excelliance.kxqp.swipe.a.a.getId(this.f14822b, "tv_man"))).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String string = com.excelliance.kxqp.swipe.a.a.getString(UserInfoEditActivity.this.f14822b, "person_man");
if (!TextUtils.isEmpty(string)) {
UserInfoEditActivity.this.l.setVisibility(0);
UserInfoEditActivity.this.l.setText(string);
aj.a().a(UserInfoEditActivity.this.o, n.e, 1);
}
if (UserInfoEditActivity.this.p != null) {
UserInfoEditActivity.this.p.setVisibility(0);
UserInfoEditActivity.this.p.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(UserInfoEditActivity.this.f14822b, "man_superscript"));
}
create.dismiss();
}
});
((TextView) create.findViewById(com.excelliance.kxqp.swipe.a.a.getId(this.f14822b, "tv_woman"))).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String string = com.excelliance.kxqp.swipe.a.a.getString(UserInfoEditActivity.this.f14822b, "person_woman");
if (!TextUtils.isEmpty(string)) {
UserInfoEditActivity.this.l.setVisibility(0);
UserInfoEditActivity.this.l.setText(string);
aj.a().a(UserInfoEditActivity.this.o, n.e, 2);
}
if (UserInfoEditActivity.this.p != null) {
UserInfoEditActivity.this.p.setVisibility(0);
UserInfoEditActivity.this.p.setImageResource(com.excelliance.kxqp.swipe.a.a.getIdOfDrawable(UserInfoEditActivity.this.f14822b, "woman_superscript"));
}
create.dismiss();
}
});
}
private void f() {
final Dialog dialog = new Dialog(this.f14822b, com.excelliance.kxqp.swipe.a.a.getIdOfStyle(this.f14822b, "pop_custom_dialog_theme"));
int identifier = getResources().getIdentifier("dialog_edit_nickname", "layout", getPackageName());
dialog.setCanceledOnTouchOutside(false);
if (identifier != 0) {
dialog.getWindow().setContentView(identifier);
}
final EditText editText = (EditText) dialog.findViewById(com.excelliance.kxqp.swipe.a.a.getId(this.f14822b, "et_nickname"));
if (this.k != null && editText != null) {
editText.setText(this.k.getText());
editText.setSelection(this.k.getText().length());
}
Message obtainMessage = this.f14821a.obtainMessage(11);
obtainMessage.obj = editText;
this.f14821a.sendMessageDelayed(obtainMessage, 200L);
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void afterTextChanged(Editable editable) {
if (editable.toString().contains("\"") || editable.toString().contains("'") || editable.toString().contains(i.f491b) || editable.toString().contains("`") || editable.toString().contains(":")) {
editText.setText(UserInfoEditActivity.this.a(editable));
String string = com.excelliance.kxqp.swipe.a.a.getString(UserInfoEditActivity.this.f14822b, "nickName_format");
if (TextUtils.isEmpty(string)) {
return;
}
ToastUtil.showToast(UserInfoEditActivity.this.f14822b, string);
}
}
});
editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
if (i != 2) {
return false;
}
UserInfoEditActivity.this.a(textView, editText, dialog);
return true;
}
});
((TextView) dialog.findViewById(com.excelliance.kxqp.swipe.a.a.getId(this.f14822b, "tv_cancle"))).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
editText.setText("");
editText.setSelection(0);
UserInfoEditActivity.this.b(view);
dialog.dismiss();
}
});
((TextView) dialog.findViewById(com.excelliance.kxqp.swipe.a.a.getId(this.f14822b, "tv_ok"))).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
UserInfoEditActivity.this.a(view, editText, dialog);
}
});
if (dialog.isShowing() || ((Activity) this.f14822b).isFinishing()) {
return;
}
dialog.show();
}
public String a(CharSequence charSequence) {
String charSequence2 = charSequence.toString();
if (charSequence.toString().contains("\"")) {
return charSequence.toString().replace("\"", "");
}
if (charSequence.toString().contains("'")) {
return charSequence.toString().replace("'", "");
}
if (charSequence.toString().contains(i.f491b)) {
return charSequence.toString().replace(i.f491b, "");
}
if (charSequence.toString().contains("`")) {
return charSequence.toString().replace("`", "");
}
return charSequence.toString().contains(":") ? charSequence.toString().replace(":", "") : charSequence2;
}
public void a(View view, EditText editText, Dialog dialog) {
String trim = editText.getText().toString().trim();
if (TextUtils.isEmpty(trim)) {
String string = com.excelliance.kxqp.swipe.a.a.getString(this.f14822b, "nickName_input");
if (!TextUtils.isEmpty(string)) {
ToastUtil.showToast(this.f14822b, string);
return;
}
}
if (trim != null && trim.length() > 12) {
ToastUtil.showToast(this.f14822b, com.excelliance.kxqp.swipe.a.a.getString(this.f14822b, "nick_name_length"));
editText.setText(this.k.getText());
editText.setSelection(this.k.getText().length());
return;
}
b(editText);
dialog.dismiss();
this.k.setVisibility(0);
this.k.setText(trim);
aj.a().a(this.o, n.d, trim);
}
public void a(View view) {
InputMethodManager inputMethodManager = (InputMethodManager) this.f14822b.getSystemService("input_method");
if (inputMethodManager != null) {
view.requestFocus();
inputMethodManager.showSoftInput(view, 0);
}
}
public void b(View view) {
InputMethodManager inputMethodManager = (InputMethodManager) this.f14822b.getSystemService("input_method");
Log.d("UserInfoEditActivity", "imm = " + inputMethodManager);
if (inputMethodManager != null) {
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
}
public void g() {
String h = h();
if (TextUtils.isEmpty(h)) {
Log.d("UserInfoEditActivity", "param is empty");
this.f14821a.removeMessages(15);
this.f14821a.sendEmptyMessage(15);
} else {
ac.a().a("http://folder.appota.cn/userinfo.php", com.excelliance.kxqp.util.b.a(h), new ac.a() {
@Override
public void a(String str) {
if (TextUtils.isEmpty(str)) {
Log.d("UserInfoEditActivity", "server reture is empty");
UserInfoEditActivity.this.f14821a.removeMessages(15);
UserInfoEditActivity.this.f14821a.sendEmptyMessage(15);
return;
}
try {
int optInt = new JSONObject(str).optInt("flag");
Log.d("UserInfoEditActivity", "flag = " + optInt);
if (optInt == 1) {
if (UserInfoEditActivity.this.y != null) {
com.excelliance.kxqp.photo_selector.c.a.a().a(UserInfoEditActivity.this.y, com.excelliance.kxqp.photo_selector.c.a.b(UserInfoEditActivity.this.f14822b), "usericon" + aj.a().a(UserInfoEditActivity.this.f14822b));
UserInfoEditActivity.this.y.recycle();
UserInfoEditActivity.this.y = null;
}
UserInfoEditActivity.this.f14821a.removeMessages(14);
UserInfoEditActivity.this.f14821a.sendEmptyMessage(14);
return;
}
UserInfoEditActivity.this.f14821a.removeMessages(15);
UserInfoEditActivity.this.f14821a.sendEmptyMessage(15);
} catch (JSONException e) {
Log.d("UserInfoEditActivity", "okNet json exception");
e.printStackTrace();
UserInfoEditActivity.this.f14821a.removeMessages(15);
UserInfoEditActivity.this.f14821a.sendEmptyMessage(15);
}
}
@Override
public void b(String str) {
Log.d("UserInfoEditActivity", "onFailed info = " + str);
UserInfoEditActivity.this.f14821a.removeMessages(15);
UserInfoEditActivity.this.f14821a.sendEmptyMessage(15);
}
});
}
}
private String h() {
try {
GameUtil intance = GameUtil.getIntance();
JSONObject jSONObject = new JSONObject();
jSONObject.put("chid", intance.h());
jSONObject.put("subchid", intance.i());
jSONObject.put("userName", aj.a().a(this.n, "USER_NAME"));
jSONObject.put("nickname", aj.a().a(this.o, n.d));
jSONObject.put("sex", aj.a().b(this.o, n.e));
jSONObject.put("birthday", aj.a().a(this.o, n.f));
jSONObject.put("headIconUrl", "");
jSONObject.put("phoneNumber", "");
jSONObject.put("rid", aj.a().b(this.n, "USER_ID"));
return jSONObject.toString();
} catch (Exception e) {
e.printStackTrace();
Log.d("UserInfoEditActivity", "json exception");
return "";
}
}
@Override
public void onBackPressed() {
if (i() || this.y != null) {
a("user_info_saving");
c();
} else {
if (this.y != null) {
this.y.recycle();
this.y = null;
}
j();
}
}
private boolean i() {
boolean z = !TextUtils.equals(aj.a().a(this.o, n.d), aj.a().a(this.n, n.d));
if (aj.a().b(this.o, n.e) != aj.a().b(this.n, n.e)) {
z = true;
}
if (TextUtils.equals(aj.a().a(this.o, n.f), aj.a().a(this.n, n.f))) {
return z;
}
return true;
}
public void j() {
finish();
overridePendingTransition(0, getResources().getIdentifier("slide_right_out", "anim", getPackageName()));
}
public void a(String str) {
if (this.C == null) {
View inflate = LayoutInflater.from(this).inflate(getResources().getIdentifier("custom_progress_dialog", "layout", getPackageName()), (ViewGroup) null, false);
getResources().getIdentifier("custom_progress_dialog_layout01", "id", getPackageName());
ImageView imageView = (ImageView) inflate.findViewById(getResources().getIdentifier("custom_progress_dialog_img", "id", getPackageName()));
imageView.setImageDrawable(getResources().getDrawable(getResources().getIdentifier("spinner", "drawable", getPackageName())));
imageView.startAnimation(AnimationUtils.loadAnimation(this, getResources().getIdentifier("progress_animator", "anim", getPackageName())));
((TextView) inflate.findViewById(getResources().getIdentifier("progress_note", "id", getPackageName()))).setText(getResources().getIdentifier(str, "string", getPackageName()));
this.C = new Dialog(this, getResources().getIdentifier("custom_dialog_theme", "style", getPackageName()));
this.C.getWindow().setBackgroundDrawable(getResources().getDrawable(getResources().getIdentifier("dialog_transparent_bg", "drawable", getPackageName())));
this.C.setContentView(inflate);
this.C.setCanceledOnTouchOutside(false);
this.C.setOnKeyListener(new DialogInterface.OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) {
return i == 4;
}
});
}
if (this.C.isShowing()) {
return;
}
this.C.show();
}
public void k() {
if (this.C != null) {
this.C.cancel();
this.C = null;
}
}
@Override
protected void onDestroy() {
super.onDestroy();
this.f14821a.removeCallbacksAndMessages(null);
if (this.y != null) {
this.y.recycle();
this.y = null;
}
}
}