搜书大师 v23.2版本的 MD5 值为:5ee433f6456b6278bd6e80a5d44df55e
以下内容为反编译后的 UserInfoAct.java 源代码,内容仅作参考
package com.flyersoft.WB;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ScrollView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import cd.InterfaceC0548;
import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.launcher.ARouter;
import com.bigkoo.pickerview.c;
import com.facebook.drawee.backends.pipeline.d;
import com.flyersoft.baseapplication.been.account.AmountInfo;
import com.flyersoft.baseapplication.been.account.UserInfo;
import com.flyersoft.baseapplication.been.seekbook.UserTask;
import com.flyersoft.baseapplication.config.ARouterPath;
import com.flyersoft.baseapplication.config.Const;
import com.flyersoft.baseapplication.http.MRManager;
import com.flyersoft.baseapplication.http.body.BaseRequest;
import com.flyersoft.baseapplication.http.callback.RequestCallBack;
import com.flyersoft.baseapplication.login.AccountData;
import com.flyersoft.baseapplication.tools.DateTools;
import com.flyersoft.baseapplication.tools.ToastTools;
import com.flyersoft.baseapplication.z2;
import com.flyersoft.components.ShelfImageView;
import com.flyersoft.components.VipTextView;
import com.flyersoft.components.m;
import com.flyersoft.discuss.tools.ClickUtil;
import com.flyersoft.discuss.tools.StringTools;
import com.flyersoft.discuss.tools.TencentHeaderImgUploadTools;
import com.flyersoft.discuss.weight.EditUserIntroDialog;
import com.flyersoft.discuss.z;
import com.flyersoft.seekbooks.ActivityMain;
import com.flyersoft.seekbooks.R;
import com.flyersoft.seekbooks.q;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.lygame.aaa.e50;
import com.lygame.aaa.f81;
import com.lygame.aaa.gy;
import com.lygame.aaa.my;
import com.lygame.aaa.o50;
import com.lygame.aaa.py;
import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;
import java.io.File;
import java.net.URL;
import java.net.URLConnection;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class UserInfoAct extends SwipeBaseHeaderActivity implements View.OnClickListener {
public static UserInfoAct selfPref;
TextView accountName;
ShelfImageView accountPic;
TextView balanceTv;
private TextView birthday;
private View birthdayLayout;
private BottomSheetDialog changeGenterDialog;
private TextView gender;
private View genderLayout;
private View genterCancel;
private View genterMale;
private View genterMaleTag;
private TextView genterMaleTv;
private View genterWoman;
private View genterWomanTag;
private TextView genterWomanTv;
boolean inOperating;
private TextView intro;
private View introLayout;
TextView memberState;
private TextView phone;
private TextView phoneBand;
private View phoneLayout;
String picUrl;
ProgressDialog progressDlg;
private c pvTime;
TextView statistics;
boolean updateMainBoardToo;
VipTextView vipTv;
private int changePhoneCode = 99;
boolean hasBandPhone = false;
public Handler handler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage(Message msg) {
if (UserInfoAct.this.isFinishing()) {
return;
}
if (msg.what == 1) {
o50.p2(UserInfoAct.this, (String) msg.obj);
}
if (msg.what == 1023) {
UserInfoAct userInfoAct = UserInfoAct.this;
if (userInfoAct.updateMainBoardToo) {
userInfoAct.updateMainBoardToo = false;
d.b().b();
o50.C(UserInfoAct.this.getTempPicFilename());
ActivityMain activityMain = ActivityMain.e;
if (activityMain != null) {
activityMain.showUserInfo();
}
}
UserInfoAct.this.updateInfoFields();
}
if (msg.what == 3) {
UserInfoAct.this.applyNoAdTime2(q.o());
}
if (msg.what == 4) {
UserInfoAct.this.showDeviceTimeCheckError();
UserInfoAct.this.inOperating = false;
}
if (msg.what == 5) {
UserInfoAct.this.createProgressDlg(null, "正在上传头像:" + ((msg.arg1 * 100) / msg.arg2) + "%");
}
if (msg.what == 6) {
UserInfoAct.this.hideProgressDlg();
}
}
};
public class AnonymousClass24 implements DialogInterface.OnClickListener {
AnonymousClass24() {
}
@Override
public void onClick(DialogInterface dialog, int which) {
new m.c(UserInfoAct.this).z("请再次确认").m(e50.W0("\n注销账号将清空所有账户数据,不可恢复, 确认要继续吗?")).v(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog2, int which2) {
MRManager.getInstance(UserInfoAct.this).userOut().subscribe(new Observer<BaseRequest>() {
@Override
public void onComplete() {
}
@Override
public void onError(@NonNull Throwable e) {
ToastTools.showToast(UserInfoAct.this, "网络错误,请稍后重试!");
}
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onNext(@NonNull BaseRequest baseRequest) {
if (baseRequest.getErrorCode() == 0) {
q.l();
z.exitLogin();
e50.e2 = 0L;
e50.e(UserInfoAct.this);
new m.c(UserInfoAct.this).m(e50.W0("\n已退出登录, 请自行重启应用.")).v(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog3, int which3) {
System.exit(0);
}
}).d(false).C();
return;
}
ToastTools.showToast(UserInfoAct.this, baseRequest.getErrorMsg());
}
});
}
}).o(R.string.no, null).C();
}
}
public void applyNoAdTime2(final int amount) {
q.w(new RequestCallBack<AmountInfo>() {
@Override
public void onFailure(String msg) {
UserInfoAct.this.toast("余额查询失败, 请稍后重试");
UserInfoAct.this.inOperating = false;
}
@Override
public void onSuccess(AmountInfo amountInfo) {
UserInfoAct.this.applyNoAdTime3(amount);
}
});
}
public void applyNoAdTime3(final int amount) {
Integer num = q.k;
if (num != null && num.intValue() >= amount) {
applyNoAdTime4(amount);
} else {
new m.c(this).m("余额不足请先充值").v(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
q.g = new RequestCallBack() {
@Override
public void onFailure(String msg) {
q.g = null;
UserInfoAct.this.toast(msg);
UserInfoAct.this.inOperating = false;
}
@Override
public void onSuccess(Object o) {
q.g = null;
AnonymousClass27 anonymousClass27 = AnonymousClass27.this;
UserInfoAct.this.applyNoAdTime2(amount);
}
};
q.A(UserInfoAct.this);
}
}).o(android.R.string.cancel, null).d(false).C();
}
}
private void applyNoAdTime4(int amount) {
if (q.x()) {
this.inOperating = false;
updateInfoFields();
} else {
q.i(amount, q.a, new RequestCallBack<AmountInfo>() {
@Override
public void onFailure(String msg) {
e50.N5("consume->RequestCallBack->onFailure:" + msg);
UserInfoAct.this.inOperating = false;
}
@Override
public void onSuccess(AmountInfo amountInfo) {
e50.N5("支付后剩余余额:" + amountInfo.getData());
UserInfoAct userInfoAct = UserInfoAct.this;
userInfoAct.updateNoAdTime(userInfoAct.getTodayOnNextMonth());
UserInfoAct.this.updateInfoFields();
}
});
}
}
public void bandPhone() {
if (!this.hasBandPhone && StringTools.isNotEmpty(AccountData.getInstance().getmUserInfo().getTelNo())) {
z2.alertDialog(this).setTitle("绑定手机").setMessage("是否绑定当前登录的手机号?").setNegativeButton("绑定新号码", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Postcard withString = ARouter.getInstance().build(ARouterPath.USER_CHANGE_PHONE_MAIN).withString("oldPhone", AccountData.getInstance().getmUserInfo().getTelNo());
UserInfoAct userInfoAct = UserInfoAct.this;
withString.navigation(userInfoAct, userInfoAct.changePhoneCode);
}
}).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
AccountData.finishTask(1, "").subscribe(new Observer<BaseRequest<UserInfo>>() {
@Override
public void onComplete() {
}
@Override
public void onError(Throwable e) {
ToastTools.showToastCenter(UserInfoAct.this, "服务器繁忙");
}
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(BaseRequest<UserInfo> userInfoBaseRequest) {
if (userInfoBaseRequest.getErrorCode() == 0) {
ToastTools.showToastCenter(UserInfoAct.this, "绑定成功");
UserInfoAct.this.phone.setText(userInfoBaseRequest.getData().getTelNo());
UserInfoAct.this.phoneBand.setEnabled(false);
UserInfoAct.this.phoneBand.setText("已绑定");
return;
}
ToastTools.showToastCenter(UserInfoAct.this, "服务器繁忙");
}
});
}
}).show();
} else {
ARouter.getInstance().build(ARouterPath.USER_CHANGE_PHONE_MAIN).withString("oldPhone", AccountData.getInstance().getmUserInfo().getTelNo()).navigation(this, this.changePhoneCode);
}
}
public void changeGender(final String genter, final String oldGender) {
z2.alertDialog(this).setTitle("是否更改性别?").setMessage("温馨提示: 性别更改只有一次机会!").setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (StringTools.isEmpty(oldGender)) {
UserInfoAct.this.updateGenter(genter);
}
UserInfoAct.this.changeGenterDialog.dismiss();
}
}).show();
}
public void checkTask() {
if (!StringTools.isNotEmpty(AccountData.getInstance().getmUserInfo().getGender()) || AccountData.getInstance().getmUserInfo().getBirthday() <= 0) {
return;
}
AccountData.finishTask(4, "").subscribe(new Observer<BaseRequest<UserInfo>>() {
@Override
public void onComplete() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseRequest<UserInfo> userInfoBaseRequest) {
}
@Override
public void onSubscribe(Disposable d) {
}
});
}
public void createProgressDlg(String title, String info) {
ProgressDialog progressDialog = this.progressDlg;
if (progressDialog != null) {
progressDialog.setTitle(title);
this.progressDlg.setMessage(info);
} else {
ProgressDialog g0 = e50.g0(this, title, info, true, true);
this.progressDlg = g0;
g0.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
UserInfoAct.this.progressDlg = null;
}
});
}
}
public void doModifyAccountName(String newName) {
if (newName.equals(q.G().getPetName())) {
return;
}
String trim = newName.trim();
if (o50.F1(trim) || trim.equals(q.G().getPetName())) {
return;
}
q.k(this, trim, new RequestCallBack() {
@Override
public void onFailure(String msg) {
UserInfoAct.this.toast("昵称更改失败: " + msg);
}
@Override
public void onSuccess(Object o) {
UserInfoAct userInfoAct = UserInfoAct.this;
userInfoAct.updateMainBoardToo = true;
userInfoAct.forceUpdateUserInfo();
UserInfoAct.this.toast("昵称更改成功");
}
});
}
public void doModifyAccountPic() {
z2.disableUriExpose();
Intent intent = new Intent("android.intent.action.GET_CONTENT");
intent.setType(InterfaceC0548.f1141);
startActivityForResult(intent, 1026);
}
private void doModifyAccountPic2() {
if (o50.A1(getTempPicFilename())) {
q.F(getTempPicFilename(), new f81() {
@Override
public void onError(Throwable e) {
super.onError(e);
UserInfoAct.this.toast("头像更改失败: " + e50.U0(e));
UserInfoAct.this.hideProgressDlg();
}
@Override
public void onNext(Object o) {
if (((Boolean) o).booleanValue()) {
UserInfoAct.this.toast("头像更改成功");
UserInfoAct.this.picUrl = null;
o50.C(q.s());
UserInfoAct userInfoAct = UserInfoAct.this;
userInfoAct.updateMainBoardToo = true;
userInfoAct.forceUpdateUserInfo();
} else {
UserInfoAct.this.toast("头像更改失败");
}
UserInfoAct.this.hideProgressDlg();
}
@Override
public void updateProgress(long readLength, long countLength) {
Handler handler = UserInfoAct.this.handler;
handler.sendMessage(handler.obtainMessage(5, (int) readLength, (int) countLength));
}
});
}
}
public void forceUpdateUserInfo() {
q.v(true);
}
public long getTodayOnNextMonth() {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
calendar.add(2, 1);
return calendar.getTimeInMillis();
}
private void initTimePick() {
Calendar calendar = Calendar.getInstance();
long birthday = AccountData.getInstance().getmUserInfo().getBirthday();
if (birthday > 0) {
calendar.setTimeInMillis(birthday);
}
Calendar calendar2 = Calendar.getInstance();
calendar2.set(1950, 0, 23);
Calendar calendar3 = Calendar.getInstance();
calendar3.set(DateTools.getNowYear().intValue(), DateTools.getNowMonth() - 1, DateTools.getDay());
this.pvTime = new c.a(this, new c.b() {
@Override
public void onTimeSelect(Date date, View v) {
AccountData.editUserInfo(4, new SimpleDateFormat("yyyy-MM-dd").format(date)).subscribe(new Observer<BaseRequest<UserInfo>>() {
@Override
public void onComplete() {
}
@Override
public void onError(Throwable e) {
ToastTools.showToastCenter(UserInfoAct.selfPref, "修改失败");
}
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(BaseRequest<UserInfo> userInfoBaseRequest) {
if (userInfoBaseRequest.getErrorCode() == 0) {
UserInfoAct.this.birthday.setText(new SimpleDateFormat("yyyy-MM-dd").format(new Date(userInfoBaseRequest.getData().getBirthday())));
UserInfoAct.this.birthday.setTextColor(-7829368);
ToastTools.showToastCenter(UserInfoAct.selfPref, "修改成功");
UserInfoAct.this.checkTask();
return;
}
ToastTools.showToastCenter(UserInfoAct.selfPref, "修改失败");
}
});
}
}).y0(new boolean[]{true, true, true, false, false, false}).h0("年", "月", "日", "时", "", "").V(true).f0(-12303292).c0(21).d0(calendar).m0(calendar2, calendar3).e0(null).T();
}
public void showDeviceTimeCheckError() {
o50.n2(this, "\n请检查网络链接和手机时间是否设置正确.");
}
private void showStatistics() {
StringBuilder sb;
try {
long parseLong = Long.parseLong(AccountData.getInstance().getmUserInfo().getAllReaderWords());
long parseLong2 = Long.parseLong(AccountData.getInstance().getmUserInfo().getAllReaderTime());
if (parseLong > e50.S4 && parseLong2 > e50.T4) {
e50.S4 = parseLong;
e50.T4 = parseLong2;
}
if (e50.S4 > 10000) {
sb = new StringBuilder();
sb.append(new DecimalFormat("0.0").format(((float) e50.S4) / 10000.0f));
sb.append("万");
} else {
sb = new StringBuilder();
sb.append("");
sb.append(e50.S4);
}
String sb2 = sb.toString();
this.statistics.setText("已阅读" + o50.W(e50.T4) + ", " + sb2 + "字");
} catch (Exception e) {
e50.S0(e);
}
}
private void showUserInfo() {
this.accountPic.d = true;
py a = py.a();
a.o(-1431655766, 1.0f);
this.accountPic.setHierarchy(my.u(getResources()).Z(a).B(DownloadTaskBrowser.MIN_JS_DEALY).a());
q.w(new RequestCallBack<AmountInfo>() {
@Override
public void onFailure(String msg) {
}
@Override
public void onSuccess(AmountInfo amountInfo) {
UserInfoAct.this.updateInfoFields();
}
});
updateInfoFields();
}
private void startImageCrop(Uri uri) {
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setDataAndType(uri, InterfaceC0548.f1141);
intent.putExtra("crop", true);
intent.putExtra("aspectX", 1);
intent.putExtra("aspectY", 1);
intent.putExtra("outputX", 300);
intent.putExtra("outputY", 300);
intent.putExtra("return-data", true);
startActivityForResult(intent, 1027);
}
public void updateGenter(final String genterStr) {
AccountData.editUserInfo(3, genterStr).subscribe(new Observer<BaseRequest<UserInfo>>() {
@Override
public void onComplete() {
}
@Override
public void onError(Throwable e) {
ToastTools.showToastCenter(UserInfoAct.selfPref, "修改失败");
}
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(BaseRequest<UserInfo> userInfoBaseRequest) {
if (userInfoBaseRequest.getErrorCode() == 0) {
UserInfoAct.this.gender.setText(userInfoBaseRequest.getData().getGender() + "");
UserInfoAct.this.gender.setTextColor(-7829368);
ToastTools.showToastCenter(UserInfoAct.selfPref, "修改成功");
UserInfoAct.this.checkTask();
return;
}
ToastTools.showToastCenter(UserInfoAct.selfPref, "修改失败");
}
});
ToastTools.showToastCenter(this, "更改性别:" + this.gender);
}
public void updateIntro() {
final EditUserIntroDialog editUserIntroDialog = new EditUserIntroDialog(this);
editUserIntroDialog.setText(AccountData.getInstance().getmUserInfo().getMotto());
editUserIntroDialog.setDialogListener(new EditUserIntroDialog.DialogListener() {
@Override
public void onLeftClick() {
editUserIntroDialog.dismiss();
}
@Override
public void onRightClick(String content) {
AccountData.editUserInfo(11, content).subscribe(new Observer<BaseRequest<UserInfo>>() {
@Override
public void onComplete() {
}
@Override
public void onError(Throwable e) {
ToastTools.showToastCenter(UserInfoAct.this, "修改失败");
editUserIntroDialog.dismiss();
}
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(BaseRequest<UserInfo> userInfoBaseRequest) {
if (userInfoBaseRequest.getErrorCode() == 0) {
UserInfoAct.this.intro.setText(userInfoBaseRequest.getData().getMotto());
ToastTools.showToastCenter(UserInfoAct.this, "个性签名已修改!");
} else {
ToastTools.showToastCenter(UserInfoAct.this, "修改失败");
}
editUserIntroDialog.dismiss();
}
});
}
});
editUserIntroDialog.show();
}
public void updateNoAdTime(long newTime) {
e50.N5("修改时间为:" + newTime + ", 当前时间是: " + q.G().getNoAdTime());
q.c().updateNoAdTime(newTime, new RequestCallBack<UserInfo>() {
@Override
public void onFailure(String msg) {
q.m = true;
UserInfoAct userInfoAct = UserInfoAct.this;
userInfoAct.inOperating = false;
o50.o2(userInfoAct, "服务器错误", "对不起, 更新会员免广告日期失败, 请加QQ群联系管理员(群号:" + z2.qqNumber + "), 我们将尽快为您修复这个错误.");
}
@Override
public void onSuccess(UserInfo userInfo) {
e50.N5("已获得免广告特权, 时间:" + o50.p(Long.valueOf(userInfo.getNoAdTime())));
UserInfoAct userInfoAct = UserInfoAct.this;
userInfoAct.inOperating = false;
userInfoAct.updateInfoFields();
}
});
}
void applyNoAdTime() {
if (e50.T5(this) || this.inOperating) {
return;
}
new Thread(new Runnable() {
private boolean verifyWebSiteOk(String url_str) {
try {
URLConnection openConnection = new URL(url_str).openConnection();
openConnection.connect();
long date = openConnection.getDate();
e50.N5("remote: " + o50.r(Long.valueOf(date)));
if (netTimeOk(date) && Math.abs(date - System.currentTimeMillis()) < o50.B(2L)) {
UserInfoAct.this.handler.sendEmptyMessage(3);
return true;
}
} catch (Exception e) {
e50.S0(e);
}
return false;
}
boolean netTimeOk(long t) {
return t > o50.c0(2018, 5, 1) && t < o50.c0(2048, 5, 1);
}
@Override
public void run() {
UserInfoAct.this.inOperating = true;
e50.N5("local: " + o50.r(Long.valueOf(System.currentTimeMillis())));
if (verifyWebSiteOk("http://www.baidu.com") || verifyWebSiteOk("http://www.163.com") || verifyWebSiteOk("http://www.qq.com")) {
return;
}
UserInfoAct.this.handler.sendEmptyMessage(4);
}
}).start();
}
String getTempPicFilename() {
return e50.z + "/.tmp.png";
}
public void hideProgressDlg() {
ProgressDialog progressDialog = this.progressDlg;
if (progressDialog != null) {
progressDialog.dismiss();
}
this.progressDlg = null;
}
public void onAbout(View view) {
startActivity(new Intent(this, (Class<?>) AboutAct.class));
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
boolean z;
if (requestCode == 1026 && resultCode == -1 && data != null) {
try {
o50.t1(getContentResolver().openInputStream(data.getData()), getTempPicFilename());
startImageCrop(Uri.fromFile(new File(getTempPicFilename())));
} catch (Exception e) {
e50.S0(e);
o50.p2(this, e50.U0(e));
}
}
if (requestCode == 1027) {
if (resultCode == -1 && data != null) {
try {
Bundle extras = data.getExtras();
if (extras != null) {
o50.j((Bitmap) extras.getParcelable("data"), getTempPicFilename());
z = true;
doModifyAccountPic2();
if (!z) {
Bitmap s2 = e50.s2(this, new File(getTempPicFilename()), 0, 0);
if (s2.getWidth() > 600) {
o50.j(o50.L2(s2, 600, (s2.getHeight() * 600) / s2.getWidth()), getTempPicFilename());
}
doModifyAccountPic2();
}
}
} catch (Exception e2) {
e50.S0(e2);
o50.p2(this, e50.U0(e2));
}
}
z = false;
if (!z) {
}
}
if (requestCode == this.changePhoneCode && data != null) {
String stringExtra = data.getStringExtra("phone");
if (StringTools.isNotEmpty(stringExtra)) {
this.phone.setText(StringTools.hitenPhoneNum(stringExtra));
this.phoneBand.setEnabled(false);
this.phoneBand.setText("已绑定");
}
}
super.onActivityResult(requestCode, resultCode, data);
}
@Override
public void onClick(View v) {
if (v.getId() == R.id.head_back) {
finish();
}
if (v.getId() == R.id.head_button1) {
startActivity(new Intent(this, (Class<?>) AboutAct.class));
}
if (v.getId() == R.id.accountName) {
final EditText editText = new EditText(this);
editText.setText(q.G().getPetName());
new m.c(this).z("更改昵称[ID:" + q.G().getId() + "]\n(一个月内只能更改一次)").B(editText).v(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
UserInfoAct.this.doModifyAccountName(editText.getText().toString());
}
}).o(R.string.cancel, null).C();
}
if (v.getId() == R.id.accountPic) {
if (!e50.k7(this, "请注意, 更改头像需要应用获取本地存储空间的权限以读取图片, 是否进行权限设置?")) {
return;
} else {
new m.c(this).m(e50.W0("\n是否更改头像?\n\n温馨提示: 使用色情﹑政治隐喻等违规图片做头像将被永久封号")).v(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
UserInfoAct.this.doModifyAccountPic();
}
}).o(R.string.no, null).C();
}
}
if (v.getId() == R.id.balanceLay) {
q.g = new RequestCallBack() {
@Override
public void onFailure(String msg) {
q.g = null;
UserInfoAct.this.toast(msg);
}
@Override
public void onSuccess(Object o) {
q.g = null;
q.w(new RequestCallBack<AmountInfo>() {
@Override
public void onFailure(String msg) {
UserInfoAct.this.toast("余额查询未成功, 请稍后再试\n" + msg);
}
@Override
public void onSuccess(AmountInfo amountInfo) {
UserInfoAct.this.updateInfoFields();
}
});
}
};
q.A(this);
}
if (v.getId() == R.id.memberService) {
if (q.x()) {
ScrollView scrollView = (ScrollView) LayoutInflater.from(this).inflate(R.layout.do_event_confirm, (ViewGroup) null);
TextView textView = (TextView) scrollView.findViewById(R.id.ofTextView);
final CheckBox checkBox = (CheckBox) scrollView.findViewById(R.id.ofNeverAskAgain);
textView.setText(Html.fromHtml(e50.W0("<font color=#009689>会员服务</font><br><br>每月支付" + q.p() + "元会员费即可成为搜书大师会员, 获得云端备份, 免广告特权等服务。<br><br><b>您已获得免广告服务, 会员到期时间" + o50.p(Long.valueOf(q.q())) + "</b>")));
checkBox.setChecked(e50.G2);
checkBox.setText(e50.W0("自动续费"));
new m.c(this).B(scrollView).v(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
boolean isChecked = checkBox.isChecked();
e50.G2 = isChecked;
e50.F2 = isChecked;
}
}).d(false).C();
} else {
if (this.inOperating) {
return;
}
ScrollView scrollView2 = (ScrollView) LayoutInflater.from(this).inflate(R.layout.do_event_confirm, (ViewGroup) null);
TextView textView2 = (TextView) scrollView2.findViewById(R.id.ofTextView);
final CheckBox checkBox2 = (CheckBox) scrollView2.findViewById(R.id.ofNeverAskAgain);
textView2.setText(Html.fromHtml(e50.W0("<font color=#009689>会员服务</font><br><br>每月支付" + q.p() + "元会员费即可成为搜书大师会员, 获得云端备份, 免广告特权等服务。")));
checkBox2.setChecked(e50.G2);
checkBox2.setText(e50.W0("自动续费"));
new m.c(this).B(scrollView2).w(e50.W0("加入会员"), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
boolean isChecked = checkBox2.isChecked();
e50.G2 = isChecked;
e50.F2 = isChecked;
UserInfoAct.this.applyNoAdTime();
}
}).o(R.string.cancel, null).d(false).C();
}
}
if (v.getId() == R.id.libLay) {
startActivity(new Intent(this, (Class<?>) LibAct.class));
}
if (v.getId() == R.id.exitLogin) {
new m.c(this).m(e50.W0("\n请确认是否要退出当前账号?")).v(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
q.l();
z.exitLogin();
e50.e2 = 0L;
e50.e(UserInfoAct.this);
new m.c(UserInfoAct.this).m(e50.W0("\n已退出登录, 请自行重启应用.")).v(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog2, int which2) {
System.exit(0);
}
}).d(false).C();
}
}).o(R.string.no, null).C();
}
if (v.getId() == R.id.delAccount) {
new m.c(this).m(e50.W0("\n注销账号将清空所有账户数据,确认要继续吗?")).v(R.string.yes, new AnonymousClass24()).o(R.string.no, null).C();
}
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.user_info);
selfPref = this;
TencentHeaderImgUploadTools.getInstance(this).init(this);
if (!q.d()) {
finish();
return;
}
findViewById(R.id.head_back).setOnClickListener(this);
((TextView) findViewById(R.id.head_title)).setText(e50.W0("账号管理"));
findViewById(R.id.head_progress).setVisibility(8);
findViewById(R.id.head_button1).setVisibility(0);
findViewById(R.id.head_button1).setOnClickListener(this);
((TextView) findViewById(R.id.head_button1)).setText(R.string.yingyongshuoming);
findViewById(R.id.head_menu).setVisibility(8);
this.genderLayout = findViewById(R.id.user_task_gender_layout);
this.birthdayLayout = findViewById(R.id.tv_user_task_birthday_layout);
this.introLayout = findViewById(R.id.tv_user_task_intro_layout);
this.phoneLayout = findViewById(R.id.tv_user_task_phone_layout);
this.phoneBand = (TextView) findViewById(R.id.tv_user_message_change_phone);
this.gender = (TextView) findViewById(R.id.tv_user_message_genter);
this.birthday = (TextView) findViewById(R.id.tv_user_message_birthday);
this.intro = (TextView) findViewById(R.id.tv_user_message_intro);
this.phone = (TextView) findViewById(R.id.tv_user_message_phone);
ClickUtil.bindSingleClick(this.genderLayout, 100, new View.OnClickListener() {
@Override
public void onClick(View v) {
if (Const.GENTER_MALE.equals(AccountData.getInstance().getmUserInfo().getGender())) {
UserInfoAct.this.genterMaleTv.setTextColor(-2613754);
UserInfoAct.this.genterMaleTag.setVisibility(0);
UserInfoAct.this.genterWomanTv.setTextColor(-7829368);
UserInfoAct.this.genterWomanTag.setVisibility(8);
} else if (Const.GENTER_WOMAN.equals(AccountData.getInstance().getmUserInfo().getGender())) {
UserInfoAct.this.genterWomanTv.setTextColor(-2613754);
UserInfoAct.this.genterWomanTag.setVisibility(0);
UserInfoAct.this.genterMaleTv.setTextColor(-7829368);
UserInfoAct.this.genterMaleTag.setVisibility(8);
} else {
UserInfoAct.this.genterMaleTv.setTextColor(-7829368);
UserInfoAct.this.genterMaleTag.setVisibility(8);
UserInfoAct.this.genterWomanTv.setTextColor(-7829368);
UserInfoAct.this.genterWomanTag.setVisibility(8);
}
UserInfoAct.this.changeGenterDialog.show();
}
});
ClickUtil.bindSingleClick(this.birthdayLayout, 100, new View.OnClickListener() {
@Override
public void onClick(View v) {
UserInfoAct.this.pvTime.show(UserInfoAct.this.birthday);
}
});
ClickUtil.bindSingleClick(this.introLayout, 100, new View.OnClickListener() {
@Override
public void onClick(View v) {
UserInfoAct.this.updateIntro();
}
});
ClickUtil.bindSingleClick(this.phoneBand, 100, new View.OnClickListener() {
@Override
public void onClick(View v) {
UserInfoAct.this.bandPhone();
}
});
if (StringTools.isNotEmpty(AccountData.getInstance().getmUserInfo().getMotto())) {
this.intro.setText(AccountData.getInstance().getmUserInfo().getMotto());
}
this.changeGenterDialog = new BottomSheetDialog(this);
View inflate = LayoutInflater.from(this).inflate(R.layout.dialog_select_genter, (ViewGroup) null);
this.genterMale = inflate.findViewById(R.id.relativeLayout5);
this.genterWoman = inflate.findViewById(R.id.relativeLayout6);
this.genterCancel = inflate.findViewById(R.id.dialog_select_genter_cancel);
this.genterMaleTv = (TextView) inflate.findViewById(R.id.dialog_select_genter_male_tv);
this.genterWomanTv = (TextView) inflate.findViewById(R.id.dialog_select_genter_woman_tv);
this.genterMaleTag = inflate.findViewById(R.id.dialog_select_genter_male_tag);
this.genterWomanTag = inflate.findViewById(R.id.dialog_select_genter_woman_tag);
this.changeGenterDialog.setContentView(inflate);
ClickUtil.bindSingleClick(this.genterMale, 200, new View.OnClickListener() {
@Override
public void onClick(View v) {
UserInfoAct.this.genterMaleTv.setTextColor(-2613754);
UserInfoAct.this.genterMaleTag.setVisibility(0);
UserInfoAct.this.genterWomanTv.setTextColor(-7829368);
UserInfoAct.this.genterWomanTag.setVisibility(8);
if (Const.GENTER_MALE.equals(AccountData.getInstance().getmUserInfo().getGender())) {
return;
}
UserInfoAct.this.changeGender(Const.GENTER_MALE, AccountData.getInstance().getmUserInfo().getGender());
}
});
ClickUtil.bindSingleClick(this.genterWoman, 200, new View.OnClickListener() {
@Override
public void onClick(View v) {
UserInfoAct.this.genterWomanTv.setTextColor(-2613754);
UserInfoAct.this.genterWomanTag.setVisibility(0);
UserInfoAct.this.genterMaleTv.setTextColor(-7829368);
UserInfoAct.this.genterMaleTag.setVisibility(8);
if (Const.GENTER_WOMAN.equals(AccountData.getInstance().getmUserInfo().getGender())) {
return;
}
UserInfoAct.this.changeGender(Const.GENTER_WOMAN, AccountData.getInstance().getmUserInfo().getGender());
}
});
ClickUtil.bindSingleClick(this.genterCancel, 200, new View.OnClickListener() {
@Override
public void onClick(View v) {
UserInfoAct.this.changeGenterDialog.dismiss();
}
});
try {
((ViewGroup) inflate.getParent()).setBackgroundResource(android.R.color.transparent);
} catch (Exception e) {
e.printStackTrace();
}
initTimePick();
if (StringTools.isNotEmpty(AccountData.getInstance().getmUserInfo().getGender())) {
this.gender.setText(AccountData.getInstance().getmUserInfo().getGender());
this.gender.setTextColor(-7829368);
}
for (UserTask userTask : AccountData.getInstance().getmUserInfo().getTaskList()) {
if (userTask.getTaskType() == 2 && userTask.getTaskNum() == 2) {
this.hasBandPhone = true;
}
}
if (this.hasBandPhone && StringTools.isNotEmpty(AccountData.getInstance().getmUserInfo().getTelNo())) {
this.phone.setText(AccountData.getInstance().getmUserInfo().getTelNo() + "");
this.phoneBand.setEnabled(false);
this.phoneBand.setText("已绑定");
}
if (AccountData.getInstance().getmUserInfo().getBirthday() > 0) {
this.birthday.setText(new SimpleDateFormat("yyyy-MM-dd").format(new Date(AccountData.getInstance().getmUserInfo().getBirthday())));
this.birthday.setTextColor(-7829368);
} else {
this.birthday.setText("90后?");
}
this.accountPic = (ShelfImageView) findViewById(R.id.accountPic);
this.accountName = (TextView) findViewById(R.id.accountName);
this.statistics = (TextView) findViewById(R.id.statistics);
this.balanceTv = (TextView) findViewById(R.id.balance);
this.memberState = (TextView) findViewById(R.id.memberState);
this.vipTv = (VipTextView) findViewById(R.id.vipTv);
findViewById(R.id.base).setBackgroundColor(e50.X2());
ViewGroup viewGroup = (ViewGroup) findViewById(R.id.base2);
findViewById(R.id.balanceLay).setOnClickListener(this);
findViewById(R.id.memberService).setOnClickListener(this);
findViewById(R.id.libLay).setOnClickListener(this);
findViewById(R.id.delAccount).setOnClickListener(this);
findViewById(R.id.exitLogin).setOnClickListener(this);
findViewById(R.id.accountPic).setOnClickListener(this);
findViewById(R.id.accountName).setOnClickListener(this);
for (int i = 0; i < viewGroup.getChildCount(); i++) {
if ((viewGroup.getChildAt(i) instanceof ViewGroup) && viewGroup.getChildAt(i).getTag() == null) {
viewGroup.getChildAt(i).setBackgroundColor(e50.K2());
}
}
if (e50.M2) {
e50.b1(viewGroup);
}
showStatistics();
showUserInfo();
forceUpdateUserInfo();
if (getIntent().getExtras() == null || !getIntent().getExtras().getBoolean("join")) {
return;
}
onClick(findViewById(R.id.memberService));
}
public void showVipLevel() {
if (q.x()) {
if (o50.A1("/system/fonts/Roboto-Bold.ttf")) {
this.vipTv.setTypeface(Typeface.createFromFile("/system/fonts/Roboto-Bold.ttf"));
} else {
this.vipTv.getPaint().setFakeBoldText(true);
}
this.vipTv.setTextColor(-287304427);
this.vipTv.setTextSize(16.0f);
this.vipTv.setPadding(e50.k0(14.0f), e50.k0(4.0f), e50.k0(14.0f), e50.k0(4.0f));
this.vipTv.d = e50.k0(1.5f);
this.vipTv.e = e50.k0(0.0f);
this.vipTv.a = -e50.k0(4.0f);
this.vipTv.c = e50.k0(8.0f);
this.vipTv.setText("SVIP");
return;
}
this.vipTv.setText("");
}
void toast(String text) {
Handler handler = this.handler;
handler.sendMessage(handler.obtainMessage(1, text));
}
public void updateInfoFields() {
String str;
String str2;
String petName = q.G().getPetName();
if (StringTools.isEmpty(petName)) {
petName = "点击设置用户名";
}
this.accountName.setText(petName);
String headPic = q.G().getHeadPic();
if (headPic != null) {
try {
if (!headPic.equals(this.picUrl)) {
this.picUrl = headPic;
this.accountPic.setImageURI(headPic);
if (o50.A1(q.s())) {
this.accountPic.getHierarchy().A(e50.u2(new File(q.s()), 1, 0), gy.c.FIT_XY);
}
}
} catch (Exception e) {
e50.S0(e);
}
} else {
this.accountPic.setImageURI(Uri.parse("res:///2131231133"));
}
TextView textView = this.balanceTv;
if (q.k == null) {
str = "";
} else {
str = "¥" + new DecimalFormat("0.00").format(q.k.intValue() / 100.0f);
}
textView.setText(str);
TextView textView2 = this.memberState;
if (q.x()) {
str2 = "" + o50.p(Long.valueOf(q.q()));
} else {
str2 = q.z(q.q()) ? "点击加入" : "已过期";
}
textView2.setText(str2);
showVipLevel();
}
}