OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 AccountFragment.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.ui.account;
import android.accounts.Account;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;
import androidx.core.view.GravityCompat;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.alipay.sdk.util.i;
import com.bumptech.glide.d.d.a.e;
import com.bytedance.sdk.open.aweme.common.constants.ParamKeyConstants;
import com.excelliance.kxqp.bitmap.bean.RankingItem;
import com.excelliance.kxqp.bitmap.bean.ResponseData;
import com.excelliance.kxqp.gs.base.b;
import com.excelliance.kxqp.gs.bean.ShareGameBean;
import com.excelliance.kxqp.gs.dialog.ad;
import com.excelliance.kxqp.gs.dialog.ar;
import com.excelliance.kxqp.gs.dialog.h;
import com.excelliance.kxqp.gs.discover.user.UserActivity;
import com.excelliance.kxqp.gs.receiver.ApkDownloadCompleteReceiver;
import com.excelliance.kxqp.gs.record.RecordManagerActivity;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.CommonActivity;
import com.excelliance.kxqp.gs.ui.aboutus.AboutActivity;
import com.excelliance.kxqp.gs.ui.account.b;
import com.excelliance.kxqp.gs.ui.accreceive.FreeAccountActivity;
import com.excelliance.kxqp.gs.ui.gaccount.GAccountActivity;
import com.excelliance.kxqp.gs.ui.googlecard.CardActivity;
import com.excelliance.kxqp.gs.ui.googlecard.d;
import com.excelliance.kxqp.gs.ui.mine.a;
import com.excelliance.kxqp.gs.ui.opinion.OpinionActivity;
import com.excelliance.kxqp.gs.ui.pay.VipActivity;
import com.excelliance.kxqp.gs.ui.question.CommonWebViewActivity;
import com.excelliance.kxqp.gs.ui.setting.SettingActivity;
import com.excelliance.kxqp.gs.ui.share.core.config.SocializeMedia;
import com.excelliance.kxqp.gs.ui.signaction.SignInActivity;
import com.excelliance.kxqp.gs.ui.update.UpdateAppActivity;
import com.excelliance.kxqp.gs.ui.update.local.f;
import com.excelliance.kxqp.gs.user.UserInfoEditActivity;
import com.excelliance.kxqp.gs.util.UserUtil;
import com.excelliance.kxqp.gs.util.ViewSwitcher;
import com.excelliance.kxqp.gs.util.ao;
import com.excelliance.kxqp.gs.util.aq;
import com.excelliance.kxqp.gs.util.as;
import com.excelliance.kxqp.gs.util.aw;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bf;
import com.excelliance.kxqp.gs.util.bs;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.by;
import com.excelliance.kxqp.gs.util.bz;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.cg;
import com.excelliance.kxqp.gs.util.cn;
import com.excelliance.kxqp.gs.util.g;
import com.excelliance.kxqp.gs.util.t;
import com.excelliance.kxqp.gs.util.w;
import com.excelliance.kxqp.repository.ViewRepository;
import com.excelliance.kxqp.sdk.StatisticsGS;
import com.excelliance.kxqp.task.store.common.LazyLoadFragment;
import com.excelliance.kxqp.ui.InformationCenterActivity;
import com.excelliance.kxqp.ui.comment.mine.MyCommentActivity;
import com.excelliance.kxqp.widget.CustomListView;
import com.tencent.open.SocialConstants;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
public class AccountFragment extends LazyLoadFragment implements View.OnClickListener, ad.b, b.InterfaceC0339b, a.InterfaceC0422a {
private View A;
private View B;
private View C;
private View D;
private View E;
private View F;
private View G;
private View H;
private View I;
private View J;
private View K;
private View L;
private String N;
private boolean O;
private String P;
ApkDownloadCompleteReceiver f8443a;
private CustomListView c;
private com.excelliance.kxqp.gs.view.swipelistview.a d;
private ad e;
private h f;
private View g;
private int h;
private int i;
private ImageView k;
private TextView l;
private ImageView m;
private TextView n;
private View o;
private View p;
private ViewSwitcher q;
private ImageView u;
private FrameLayout v;
private View w;
private Context x;
private Handler y;
private a z;
private List<c> j = new ArrayList();
private Handler r = new Handler() {
@Override
public void handleMessage(Message message) {
switch (message.what) {
case 1:
if (AccountFragment.this.z != null) {
AccountFragment.this.z.a();
}
by.a(AccountFragment.this.x, "sp_pre_account_config").a("sp_pre_account_config", "");
List<c> f = as.f();
int size = f != null ? f.size() : 0;
StringBuilder sb = new StringBuilder();
boolean z = true;
for (int i = 0; i < size; i++) {
c cVar = f.get(i);
if (cVar.f8499b != null && !TextUtils.isEmpty(cVar.f8499b.name)) {
if (z) {
z = false;
} else {
sb.append(i.f491b);
}
sb.append(cVar.f8499b.name);
}
}
if (sb.length() > 0) {
cg.a(AccountFragment.this.x, w.e(AccountFragment.this.x, "msg_login_google_account"));
StatisticsGS.getInstance().uploadUserAction(AccountFragment.this.x, 106, 1, sb.toString());
bz.a().b(AccountFragment.this.x, sb.toString());
return;
}
return;
case 2:
AccountFragment.this.o();
return;
case 3:
if (AccountFragment.this.d != null) {
AccountFragment.this.d.notifyDataSetChanged();
return;
}
return;
case 4:
if (AccountFragment.this.f == null || !AccountFragment.this.f.isShowing()) {
return;
}
AccountFragment.this.f.dismiss();
return;
default:
return;
}
}
};
private BroadcastReceiver s = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if ("updata_user_info".equals(action)) {
AccountFragment.this.a(intent.getStringExtra("user_name"), intent.getStringExtra("user_signature"), intent.getStringExtra("user_image"), intent.getIntExtra("vip", -1));
return;
}
if ((AccountFragment.this.x.getPackageName() + ".user_login_out").equals(intent.getAction())) {
if (AccountFragment.this.m != null) {
AccountFragment.this.m.setImageResource(com.excelliance.kxqp.gs.ui.medal.a.c.d());
return;
}
return;
}
if (TextUtils.equals(action, AccountFragment.this.x.getPackageName() + ".action.accounts.MARKET_VIP_INFO_UPDATE")) {
AccountFragment.this.c(AccountFragment.this.j());
return;
}
if (!(AccountFragment.this.x.getPackageName() + ".user_login_out").equals(intent.getAction()) || AccountFragment.this.m == null) {
return;
}
AccountFragment.this.m.setImageResource(com.excelliance.kxqp.gs.ui.medal.a.c.d());
}
};
private ViewSwitcher.b t = new ViewSwitcher.b() {
@Override
public void a() {
if (com.excelliance.kxqp.gs.util.b.ap(AccountFragment.this.x) && AccountFragment.this.q.a() && AccountFragment.this.p != null && by.a(AccountFragment.this.x, "sp_five_day_sign_info").b("sp_pre_account_config", false).booleanValue()) {
AccountFragment.this.p.setVisibility(0);
}
AccountFragment.this.e();
}
};
private BroadcastReceiver M = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (!cd.a(action)) {
if (TextUtils.equals(intent.getAction(), AccountFragment.this.x.getPackageName() + ".user_diff_line")) {
AccountFragment.this.b(AccountFragment.this.j());
return;
}
}
if ("action.store.cost.diamond".equals(action)) {
AccountFragment.this.b(AccountFragment.this.j());
}
}
};
private Handler Q = new Handler() {
@Override
public void handleMessage(Message message) {
switch (message.what) {
case 0:
Toast.makeText(AccountFragment.this.x, w.e(AccountFragment.this.x, "net_unusable"), 0).show();
return;
case 1:
Bundle bundle = (Bundle) message.obj;
AccountFragment.this.P = bundle.getString("verName", "");
AccountFragment.this.N = bundle.getString("apkUrl", "");
AccountFragment.this.O = bundle.getShort("b64") == 1;
String str = (String) bundle.get("serverVersionCode");
if (!TextUtils.isEmpty(str)) {
Boolean a2 = g.a(AccountFragment.this.x).a(g.a(AccountFragment.this.x).a(), Integer.parseInt(str));
by.a(AccountFragment.this.x, "download_sp").a("isNewVersion", a2.booleanValue());
if (a2.booleanValue()) {
AccountFragment.this.a(bundle.getFloat(RankingItem.KEY_SIZE, 0.0f));
AccountFragment.this.d(0);
Intent intent = new Intent();
intent.setAction("HaveNewVersion");
intent.putExtra("msg", "msg");
intent.putExtra(ParamKeyConstants.WebViewConstants.QUERY_FROM, "about");
AccountFragment.this.x.sendBroadcast(intent);
return;
}
Toast.makeText(AccountFragment.this.x, w.e(AccountFragment.this.x, "now_is_new_version"), 0).show();
return;
}
Toast.makeText(AccountFragment.this.x, w.e(AccountFragment.this.x, "now_is_new_version"), 0).show();
return;
case 2:
Toast.makeText(AccountFragment.this.x, "share_sdk_share_no_info", 0);
return;
default:
return;
}
}
};
@Deprecated
private ar R = null;
public BroadcastReceiver f8444b = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action != null) {
String packageName = context.getPackageName();
if (TextUtils.equals(action, packageName + "refresh_updatedata")) {
AccountFragment.this.k();
return;
}
if (TextUtils.equals(action, packageName + ".refresh.google.acc.sell.ui")) {
try {
AccountFragment.this.f();
return;
} catch (Exception e) {
e.printStackTrace();
return;
}
}
if (!TextUtils.equals(action, "com.excelliance.kxqp.platform.action.accounts.LOGIN_ACCOUNTS_CHANGED") || AccountFragment.this.z == null) {
return;
}
AccountFragment.this.z.a();
}
}
};
protected void a() {
ao a2 = ao.a(getActivity());
this.v = (FrameLayout) a2.a(this.A, "rl_notification_center", 19);
this.v.setOnClickListener(this);
this.u = (ImageView) a2.a("iv_has_notification", this.A);
this.c = (CustomListView) a2.a("accountlistview", this.A);
this.B = a2.a(this.A, "add_account", 0);
this.L = a2.a(this.A, "layout_comment", 26);
this.L.setOnClickListener(this);
this.L.setVisibility(com.excelliance.kxqp.gs.util.b.bk(this.x) ? 0 : 8);
this.K = a2.a(this.A, com.alipay.sdk.sys.a.j, 1);
this.K.setOnClickListener(this);
this.B.setOnClickListener(this);
this.l = (TextView) a2.a(this.A, "login_name", 15);
this.l.setOnClickListener(this);
this.m = (ImageView) com.excelliance.kxqp.ui.util.b.a("login_icon", this.A);
this.m.setImageResource(com.excelliance.kxqp.gs.ui.medal.a.c.d());
this.k = (ImageView) a2.a("iv_vip", this.A);
this.n = (TextView) a2.a("login_tips", this.A);
View a3 = a2.a(this.A, "rl_head", 16);
a3.setOnClickListener(this);
this.g = a2.a("new_app_version", this.A);
final View a4 = a2.a(this.A, "opinion_reback", 3);
final View a5 = a2.a(this.A, "about_us", 4);
final View a6 = a2.a(this.A, "go_score", 5);
if (a6 != null) {
a6.setVisibility(8);
}
this.I = a2.a(this.A, "acknowledgement", 8);
this.J = a2.a(this.A, "update_manager", 9);
final View a7 = a2.a(this.A, "check_update", 7);
this.C = a2.a(this.A, "register_account", 10);
this.D = a2.a(this.A, "appeal_account", 11);
this.E = a2.a(this.A, "google_pay", 22);
this.F = a2.a(this.A, "setting_account", 21);
this.G = a2.a(this.A, "official_community", 12);
this.H = a2.a(this.A, "free_account", 20);
this.w = a2.a(this.A, "google_card", 13);
this.w.setOnClickListener(this);
View a8 = a2.a(this.A, "rl_login_out", 18);
a8.setOnClickListener(this);
final View a9 = a2.a(this.A, "my_vip", 23);
final View a10 = a2.a("my_vip_line", this.A);
a9.setOnClickListener(this);
View a11 = a2.a(this.A, "rl_record", 25);
a11.setOnClickListener(this);
a11.setVisibility(com.excelliance.kxqp.gs.util.b.bg(this.x) ? 0 : 8);
this.p = a2.a(this.A, "sign_rl", 24);
if (this.p != null) {
this.p.setOnClickListener(this);
}
final View a12 = a2.a(this.A, "tv_user_page", 17);
this.o = a2.a(this.A, "g_account_sell", 14);
this.o.setOnClickListener(this);
if (com.excelliance.kxqp.gs.discover.a.a(getActivity())) {
a8.setVisibility(0);
} else {
a8.setVisibility(8);
}
if (com.excelliance.kxqp.gs.discover.a.a(getActivity())) {
a12.setVisibility(0);
} else {
a12.setVisibility(8);
}
View a13 = a2.a("rl_top_root_view", this.A);
View a14 = a2.a("rl_top_status_view", this.A);
if (com.excelliance.kxqp.gs.newappstore.b.c.a(this.x)) {
if (a13 != null) {
a13.setBackgroundColor(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
}
if (a3 != null) {
a3.setBackgroundColor(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
}
if (a14 != null) {
a14.setBackgroundColor(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
}
}
this.Q.postDelayed(new Runnable() {
@Override
public void run() {
AccountFragment.this.g();
AccountFragment.this.e();
if (AccountFragment.this.G != null) {
AccountFragment.this.G.setOnClickListener(AccountFragment.this);
}
if (a4 != null) {
a4.setOnClickListener(AccountFragment.this);
}
if (a5 != null) {
a5.setOnClickListener(AccountFragment.this);
}
if (a6 != null) {
a6.setOnClickListener(AccountFragment.this);
}
if (a7 != null) {
a7.setOnClickListener(AccountFragment.this);
}
if (AccountFragment.this.I != null) {
AccountFragment.this.I.setOnClickListener(AccountFragment.this);
}
if (AccountFragment.this.J != null) {
AccountFragment.this.J.setOnClickListener(AccountFragment.this);
}
if (AccountFragment.this.C != null) {
AccountFragment.this.C.setOnClickListener(AccountFragment.this);
}
if (AccountFragment.this.D != null) {
AccountFragment.this.D.setOnClickListener(AccountFragment.this);
}
if (AccountFragment.this.F != null) {
AccountFragment.this.F.setOnClickListener(AccountFragment.this);
}
if (a12 != null) {
a12.setOnClickListener(AccountFragment.this);
}
if (AccountFragment.this.E != null) {
AccountFragment.this.E.setOnClickListener(AccountFragment.this);
}
if (com.excelliance.kxqp.gs.util.b.B(AccountFragment.this.x) && AccountFragment.this.q.a()) {
a10.setVisibility(0);
a9.setVisibility(0);
} else {
a10.setVisibility(8);
a9.setVisibility(8);
}
if (com.excelliance.kxqp.gs.util.b.k(AccountFragment.this.x)) {
AccountFragment.this.H.setOnClickListener(AccountFragment.this);
} else {
AccountFragment.this.H.setVisibility(8);
}
if (by.a(AccountFragment.this.x, "download_sp").b("isNewVersion", false).booleanValue()) {
AccountFragment.this.g.setVisibility(0);
}
AccountFragment.this.o.setVisibility(bs.q(AccountFragment.this.x) ? 0 : 8);
}
}, 500L);
}
public void e() {
Log.d("AccountFragment", String.format("AccountFragment/updateSwitchableView:thread(%s)", Thread.currentThread().getName()));
boolean z = bs.c() && bs.p(this.x);
this.q.a();
if (z || !this.q.a()) {
this.B.setVisibility(8);
this.C.setVisibility(8);
this.D.setVisibility(8);
this.F.setVisibility(8);
this.w.setVisibility(8);
this.o.setVisibility(8);
this.E.setVisibility(8);
this.H.setVisibility(8);
this.K.setVisibility(8);
} else {
this.B.setVisibility(0);
this.C.setVisibility(com.excelliance.kxqp.gs.util.b.ay(this.x) ? 8 : 0);
this.D.setVisibility(0);
this.F.setVisibility(0);
this.o.setVisibility(0);
this.E.setVisibility(0);
this.H.setVisibility(0);
this.K.setVisibility(0);
}
if (z) {
this.G.setVisibility(8);
this.I.setVisibility(8);
} else {
this.G.setVisibility(0);
this.I.setVisibility(0);
}
if (bs.p(this.x)) {
this.J.setVisibility(8);
} else {
this.J.setVisibility(0);
}
this.v.setVisibility(this.q.a() ? 0 : 8);
}
public void f() {
boolean z = false;
if (this.o != null) {
boolean q = bs.q(this.x);
Log.d("AccountFragment", "initId googleAccSellOpen: " + q);
this.o.setVisibility(q ? 0 : 8);
}
if (bs.c() && bs.p(this.x)) {
z = true;
}
this.q.a();
if ((z || !this.q.a()) && this.o != null) {
this.o.setVisibility(8);
}
}
protected int b() {
return w.c(getActivity(), ViewRepository.VIEW_FRAGMENT_ACCOUNT);
}
public a c() {
return new a(this, this.x);
}
@Override
public void onViewCreated(View view, Bundle bundle) {
super.onViewCreated(view, bundle);
com.excelliance.kxqp.gs.ui.mine.a.c().registerReceiver(getActivity());
String packageName = this.x.getPackageName();
IntentFilter intentFilter = new IntentFilter(packageName + "refresh_updatedata");
intentFilter.addAction(packageName + ".refresh.google.acc.sell.ui");
intentFilter.addAction("com.excelliance.kxqp.platform.action.accounts.LOGIN_ACCOUNTS_CHANGED");
this.x.registerReceiver(this.f8444b, intentFilter);
Log.d("AccountFragment", "run allowShow: " + intentFilter);
IntentFilter intentFilter2 = new IntentFilter("updata_user_info");
intentFilter2.addAction(packageName + ".user_login_out");
intentFilter2.addAction(packageName + ".action.accounts.MARKET_VIP_INFO_UPDATE");
getActivity().registerReceiver(this.s, intentFilter2);
}
@Override
public void onResume() {
super.onResume();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(this.x.getPackageName() + ".user_diff_line");
intentFilter.addAction("action.store.cost.diamond");
LocalBroadcastManager.getInstance(this.x).registerReceiver(this.M, intentFilter);
com.excelliance.kxqp.gs.ui.mine.a.c().a(this);
this.Q.post(new Runnable() {
@Override
public void run() {
if (AccountFragment.this.getActivity() == null) {
return;
}
try {
boolean b2 = g.a(AccountFragment.this.x).b(AccountFragment.this.x);
if (AccountFragment.this.g != null) {
AccountFragment.this.g.setVisibility(b2 ? 0 : 8);
}
AccountFragment.this.k();
} catch (Exception e) {
e.printStackTrace();
}
AccountFragment.this.g();
AccountFragment.this.h();
AccountFragment.this.i();
}
});
}
public void g() {
if (this.w != null) {
this.w.setVisibility(aq.v() || aq.e() || !aq.g() || (aq.m() && !aq.q()) ? 8 : 0);
int c = by.a(this.x, "global_config").c("sp_key_google_card_total_count", 0);
if (c == 0) {
Log.d("zch_updateCardStatus1", "updateCardStatus");
this.w.setVisibility(c == 0 ? 8 : 0);
}
}
}
public void a(String str, String str2, String str3, int i) {
if (str != null && !"".equals(str)) {
this.l.setText(str);
bx.a().b(this.x, str);
}
if (i != -1) {
b(j());
}
if (TextUtils.isEmpty(str3)) {
return;
}
bx.a().b(this.x.getSharedPreferences("USERINFO", 4), t.f, str3);
h();
}
public void h() {
String a2 = bx.a().a(this.x.getSharedPreferences("USERINFO", Build.VERSION.SDK_INT < 11 ? 0 : 4), t.f, "");
az.d("zch_resume_icon", "avatarUrl = " + a2);
if (a2 == null || "".equals(a2)) {
return;
}
com.bumptech.glide.i.a(getActivity()).a(a2).a(new e(getActivity()), new com.excelliance.kxqp.gs.discover.common.b(getActivity())).d(com.excelliance.kxqp.gs.ui.medal.a.c.d()).c(com.excelliance.kxqp.gs.ui.medal.a.c.d()).a(this.m);
}
public void i() {
b(j());
}
public int j() {
int u = bx.a().u(this.x);
return u <= 0 ? bx.a().b(this.x) ? 1 : 0 : u == 4 ? 3 : 2;
}
public void b(int i) {
String q = bx.a().q(this.x);
Drawable k = w.k(this.x, "icon_vip_v2");
switch (i) {
case 1:
this.m.setSelected(false);
this.l.setText(q);
w.a(this.x, this.n, "me_login_tips");
this.k.setImageDrawable(null);
return;
case 2:
this.m.setSelected(true);
cn.c(this.x);
this.l.setText(q);
String e = w.e(this.x, "me_login_tips_vip");
String s = bx.a().s(this.x);
this.n.setText(e + s);
this.k.setImageDrawable(k);
return;
case 3:
if (!bx.a().n(this.x)) {
cn.b(this.x);
}
this.l.setText(q);
if (bx.a().p(this.x)) {
String e2 = w.e(this.x, "me_login_tips_vip");
String v = bx.a().v(this.x);
this.n.setText(e2 + v);
this.k.setImageDrawable(k);
} else {
w.a(this.x, this.n, "me_login_tips_expired");
this.k.setImageDrawable(null);
}
this.m.setSelected(true);
return;
default:
this.m.setSelected(false);
if (bx.a().p(this.x)) {
String e3 = w.e(this.x, "me_login_tips_vip");
String v2 = bx.a().v(this.x);
this.n.setText(e3 + v2);
w.a(this.x, this.l, "me_login");
this.k.setImageDrawable(k);
return;
}
w.a(this.x, this.n, "me_login_tips");
w.a(this.x, this.l, "me_login");
this.k.setImageDrawable(null);
return;
}
}
public void c(int i) {
Drawable k = w.k(this.x, "icon_vip_v2");
if (i == 2) {
String e = w.e(this.x, "me_login_tips_vip");
String s = bx.a().s(this.x);
if (this.n != null) {
this.n.setText(e + s);
}
if (this.k != null) {
this.k.setImageDrawable(k);
}
}
}
public void k() {
final TextView textView = (TextView) com.excelliance.kxqp.ui.util.b.a("update_prop", this.A);
if (textView != null) {
textView.setVisibility(8);
tp.g(new Runnable() {
@Override
public void run() {
JSONArray a2 = com.excelliance.kxqp.gs.ui.update.a.a(AccountFragment.this.x, ResponseData.getUpdateData(AccountFragment.this.x));
final int size = (a2 != null ? RankingItem.pareseRankingItems(AccountFragment.this.x, a2, true).size() + 0 : 0) + f.a(AccountFragment.this.x).a(false).size();
tp.i(new Runnable() {
@Override
public void run() {
if (size > 0) {
textView.setVisibility(0);
com.excelliance.kxqp.ui.util.b.a(textView, String.format(com.excelliance.kxqp.swipe.a.a.getString(AccountFragment.this.x, "update_prop"), Integer.valueOf(size)), "update_prop");
} else {
textView.setVisibility(8);
}
}
});
}
});
}
}
private boolean l() {
if (j() > 0) {
return true;
}
if (getActivity() == null) {
return false;
}
cg.a(this.x, w.e(this.x, "share_for_login_sure"));
com.excelliance.kxqp.gs.router.a.a.f8074a.invokeLogin(this.x);
return false;
}
public void a(View view) {
int intValue = Integer.valueOf(view.getTag().toString()).intValue();
if (as.d(this.x, false) && intValue == 0 && intValue != 23) {
aw.d(this.x);
return;
}
switch (intValue) {
case 0:
com.excelliance.kxqp.gs.ui.mine.a.c().l();
return;
case 1:
StatisticsGS.getInstance().uploadUserAction(this.x, 33);
startActivity(new Intent(this.x, (Class<?>) SettingActivity.class));
p();
return;
case 2:
case 15:
default:
return;
case 3:
StatisticsGS.getInstance().uploadUserAction(this.x, 34);
startActivity(new Intent(this.x, (Class<?>) OpinionActivity.class));
p();
return;
case 4:
StatisticsGS.getInstance().uploadUserAction(this.x, 35);
startActivity(new Intent(this.x, (Class<?>) AboutActivity.class));
p();
return;
case 5:
StatisticsGS.getInstance().uploadUserAction(this.x, 36);
PackageManager packageManager = this.x.getPackageManager();
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse("market://details?id=" + this.x.getPackageName()));
if (packageManager.queryIntentActivities(intent, 0).size() > 0) {
startActivity(intent);
p();
return;
} else {
Toast.makeText(this.x, w.e(this.x, "no_market"), 0).show();
return;
}
case 6:
StatisticsGS.getInstance().uploadUserAction(this.x, 37);
this.e = new ad(this.x);
this.e.a(this);
this.e.a();
this.e.c();
return;
case 7:
StatisticsGS.getInstance().uploadUserAction(this.x, 48);
n();
this.z.c();
return;
case 8:
Intent intent2 = new Intent(this.x, (Class<?>) CommonWebViewActivity.class);
intent2.putExtra(SocialConstants.PARAM_URL, "https://h5.ourplay.com.cn/thanks/");
startActivity(intent2);
p();
return;
case 9:
StatisticsGS.getInstance().uploadUserAction(this.x, 103);
startActivity(new Intent(this.x, (Class<?>) UpdateAppActivity.class));
p();
return;
case 10:
com.excelliance.kxqp.gs.ui.mine.a.c().e();
return;
case 11:
com.excelliance.kxqp.gs.ui.mine.a.c().f();
return;
case 12:
Intent intent3 = new Intent();
intent3.putExtra("page", 0);
intent3.putExtra("title", com.excelliance.kxqp.swipe.a.a.getString(this.x, "official_community"));
intent3.setComponent(new ComponentName(this.x, (Class<?>) CommonActivity.class));
this.x.startActivity(intent3);
bz.a().a(this.x, 51000, "进入官方社群");
return;
case 13:
d.a(this.x, CardActivity.class, 2);
return;
case 14:
d.a(this.x, GAccountActivity.class, 0);
return;
case 16:
if (l()) {
if (com.excelliance.kxqp.gs.discover.a.a(getActivity())) {
Intent intent4 = new Intent(getActivity(), (Class<?>) UserActivity.class);
intent4.putExtra("user_id", bx.a().a(this.x));
startActivity(intent4);
return;
} else {
this.x.startActivity(new Intent(this.x, (Class<?>) UserInfoEditActivity.class));
p();
return;
}
}
return;
case 17:
if (bx.a().b(getActivity())) {
Intent intent5 = new Intent(getActivity(), (Class<?>) UserActivity.class);
intent5.putExtra("user_id", bx.a().a(this.x));
startActivity(intent5);
return;
}
com.excelliance.kxqp.gs.router.a.a.f8074a.invokeLogin(this.x);
return;
case 18:
SharedPreferences sharedPreferences = this.x.getSharedPreferences("USERINFO", Build.VERSION.SDK_INT >= 11 ? 4 : 0);
UserUtil.getInstance().clearLocalUserInfo(sharedPreferences, this.x);
sharedPreferences.edit().putString("USER_P002", null).apply();
aq.a().j(this.x);
az.d("AccountFragment", "LoginOut");
if (com.excelliance.kxqp.gs.util.b.bh(this.x)) {
com.excelliance.kxqp.gs.newappstore.b.a.a().a(null, this.x.getApplicationContext(), 2);
}
b(j());
this.m.setImageResource(com.excelliance.kxqp.gs.ui.medal.a.c.d());
return;
case 19:
startActivity(new Intent(this.x, (Class<?>) InformationCenterActivity.class));
p();
if (this.u != null) {
this.u.setVisibility(8);
}
bz.a().a(this.x, 49000, "进入消息中心");
return;
case 20:
getActivity().startActivity(new Intent(getActivity(), (Class<?>) FreeAccountActivity.class));
return;
case 21:
com.excelliance.kxqp.gs.ui.mine.a.c().g();
return;
case 22:
com.excelliance.kxqp.bitmap.ui.b.b.b(this.x);
return;
case 23:
this.x.startActivity(new Intent(this.x, (Class<?>) VipActivity.class));
return;
case 24:
cn.startActivity(this.x, SignInActivity.class);
return;
case 25:
this.x.startActivity(new Intent(this.x, (Class<?>) RecordManagerActivity.class));
break;
case 26:
break;
}
MyCommentActivity.a(this.x);
}
@Override
public void a(Bundle bundle) {
if (this.f != null) {
this.f.dismiss();
}
if (bundle == null) {
this.Q.sendMessage(this.Q.obtainMessage(0));
} else {
Message obtainMessage = this.Q.obtainMessage(1);
obtainMessage.obj = bundle;
this.Q.sendMessage(obtainMessage);
}
}
@Override
public void a(ShareGameBean shareGameBean, SocializeMedia socializeMedia) {
if (shareGameBean == null || shareGameBean.beanIsNull()) {
this.Q.sendMessage(this.Q.obtainMessage(2));
} else {
this.z.a(socializeMedia, shareGameBean);
}
}
@Deprecated
public void d(int i) {
if (this.g != null) {
this.g.setVisibility(i);
}
}
@Deprecated
public void m() {
String str;
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.intent.action.DOWNLOAD_COMPLETE");
ArrayList arrayList = new ArrayList();
arrayList.add(this.x.getPackageName());
arrayList.add(com.excelliance.kxqp.gs.ui.home.b.a(this.x).e());
this.f8443a = new ApkDownloadCompleteReceiver(arrayList);
this.x.registerReceiver(this.f8443a, intentFilter);
LocalBroadcastManager.getInstance(this.x).registerReceiver(this.f8443a, new IntentFilter(getContext().getPackageName() + ".download.notify.state"));
if (TextUtils.isEmpty(this.N) || (str = this.N) == null) {
return;
}
com.excelliance.kxqp.gs.util.e.a(this.x, str, this.O);
}
@Deprecated
public void a(float f) {
if (this.R == null) {
this.R = new ar(this.x, w.o(this.x, "theme_dialog_no_title2"));
this.R.a(new b.a() {
@Override
public void a() {
if (AccountFragment.this.R == null || !AccountFragment.this.R.isShowing()) {
return;
}
AccountFragment.this.R.dismiss();
AccountFragment.this.R = null;
AccountFragment.this.m();
}
@Override
public void b() {
if (AccountFragment.this.R == null || !AccountFragment.this.R.isShowing()) {
return;
}
AccountFragment.this.R.dismiss();
AccountFragment.this.R = null;
}
});
}
if (this.R == null || this.R.isShowing()) {
return;
}
this.R.show();
StringBuilder sb = new StringBuilder();
if (bf.a(this.x)) {
sb.append(w.e(this.x, "new_version_update"));
} else if (bf.b(this.x)) {
sb.append(w.e(this.x, "new_no_wifi_version_update0"));
}
String sb2 = sb.toString();
if (TextUtils.isEmpty(sb2)) {
return;
}
this.R.a(String.format(sb2, this.P, com.excelliance.kxqp.gs.util.ar.a(this.x, (int) f)));
}
private void n() {
if (this.f == null) {
this.f = new h(this.x);
}
if (!this.f.isShowing()) {
this.f.a(w.e(this.x, "check_update"));
} else {
this.f.dismiss();
}
}
public void a(Message message) {
int i = message.what;
String str = null;
com.excelliance.kxqp.gs.dialog.g gVar = new com.excelliance.kxqp.gs.dialog.g(this.x, w.o(this.x, "theme_dialog_no_title2"), i == 7 ? "dialog_with_image" : null);
gVar.a(new b.InterfaceC0157b() {
@Override
public void b(int i2, Message message2, int i3) {
}
@Override
public void a(int i2, Message message2, int i3) {
if (i2 == 11) {
c item = AccountFragment.this.d.getItem(((Bundle) message2.obj).getInt("position"));
AccountFragment.this.z.a(0, item.f8499b, item.f8498a);
}
}
});
if (gVar.isShowing()) {
return;
}
String str2 = "";
String str3 = "";
if (i == 11) {
str2 = w.e(this.x, "account_delete_content");
String string = ((Bundle) message.obj).getString("account");
if (!TextUtils.isEmpty(string)) {
str2 = cd.a(str2, new String[]{cd.a(string, "***", 2), w.e(this.x, "app_name")});
str = w.e(this.x, "dialog_cancel");
str3 = w.e(this.x, "dialog_sure");
}
}
gVar.show();
if (com.excelliance.kxqp.gs.newappstore.b.c.a(this.x)) {
gVar.a(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
gVar.b(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
}
gVar.c(i);
gVar.a(message);
gVar.a(str2);
gVar.a(true, str3, str);
}
@Override
public void a(List<c> list) {
if (list == null || list.size() < 0) {
return;
}
this.j.clear();
this.j.addAll(list);
o();
}
public void o() {
com.excelliance.kxqp.ui.util.b.a((TextView) com.excelliance.kxqp.ui.util.b.a("account_name", this.A), com.excelliance.kxqp.swipe.a.a.getString(getActivity(), (this.j == null || this.j.isEmpty()) ? "login_account" : "add_account"), "account_name");
if (this.d == null) {
this.d = new com.excelliance.kxqp.gs.view.swipelistview.a(this.j, getActivity());
this.d.a(new View.OnClickListener() {
@Override
public void onClick(View view) {
com.excelliance.kxqp.gs.ui.mine.a.c().f();
}
});
this.c.setAdapter((ListAdapter) this.d);
this.c.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long j) {
AccountFragment.this.a(view, i);
return false;
}
});
this.c.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
AccountFragment.this.z.a(AccountFragment.this.d.getItem(i).f8498a);
}
});
return;
}
this.d.a(this.j);
this.d.notifyDataSetChanged();
}
@Override
public void d() {
this.r.sendMessage(this.r.obtainMessage(3));
}
@Override
public void a(boolean z) {
this.u.setVisibility(z ? 0 : 8);
}
@Override
public void onVisible() {
super.onVisible();
try {
boolean b2 = g.a(this.x).b(this.x);
if (this.g != null) {
this.g.setVisibility(b2 ? 0 : 8);
}
} catch (Exception e) {
e.printStackTrace();
}
if (this.z != null) {
this.z.a();
}
}
@Override
public void onPause() {
super.onPause();
if (this.M != null) {
LocalBroadcastManager.getInstance(this.x).unregisterReceiver(this.M);
}
if (this.r != null) {
this.r.removeMessages(4);
this.r.sendEmptyMessageDelayed(4, 2000L);
}
}
private void p() {
if (this.i == 0) {
this.i = w.i(this.x, "slide_left_out");
}
if (this.h == 0) {
this.h = w.i(this.x, "slide_right_in");
}
getActivity().overridePendingTransition(this.h, this.i);
}
@Override
public void onActivityResult(int i, int i2, Intent intent) {
Log.e("AccountFragment", "[data: " + intent + ",code:" + i2 + "]");
com.excelliance.kxqp.gs.ui.mine.a.c().a(i, i2, intent);
if (i != 1) {
return;
}
if (i2 != -1) {
if (i2 == 0) {
tp.d(new Runnable() {
@Override
public void run() {
by a2 = by.a(AccountFragment.this.x, "sp_pre_account_config");
String b2 = a2.b("sp_pre_account_config", "");
az.i("AccountFragment", "onActivityResult: ----config: " + b2);
if (TextUtils.equals(b2, "")) {
return;
}
as.a(AccountFragment.this.x, 0, b2);
a2.a("sp_pre_account_config", "");
}
});
return;
}
return;
}
getActivity().setResult(-1, intent);
this.r.sendMessageDelayed(this.r.obtainMessage(1), 200L);
try {
Intent intent2 = new Intent();
String packageName = this.x.getPackageName();
intent2.setComponent(new ComponentName(packageName, "com.excelliance.kxqp.gs.service.CustomIntentService"));
intent2.setAction(packageName + ".google.account.add.success");
this.x.startService(intent2);
} catch (Exception e) {
e.printStackTrace();
}
if (com.excelliance.kxqp.gs.util.b.cb(this.x)) {
com.excelliance.kxqp.gs.ui.gaccount.receive.a.a(this.x).a();
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
Log.d("AccountFragment", "AccountFragment/onDestroyView:");
this.x.unregisterReceiver(this.f8444b);
getActivity().unregisterReceiver(this.s);
this.q.b(this.t);
com.excelliance.kxqp.gs.ui.mine.a.c().unregisterReceiver(getActivity());
}
@Override
public void onDestroy() {
super.onDestroy();
com.excelliance.kxqp.gs.ui.mine.a.c().b(this);
if (this.z != null) {
this.z.b();
}
if (this.r != null) {
this.r.removeCallbacksAndMessages(null);
}
if (this.f8443a != null) {
this.x.unregisterReceiver(this.f8443a);
LocalBroadcastManager.getInstance(this.x).unregisterReceiver(this.f8443a);
this.f8443a = null;
}
}
@Override
public void a(int i, String str) {
if (this.e != null) {
this.e.b();
}
String packageName = this.x.getPackageName();
if (i == 2) {
if (this.z.b("com.tencent.mm")) {
this.z.a(packageName, this.x, SocializeMedia.WEIXIN_MONMENT);
return;
} else {
a("share_sdk_not_install_wechat", 0);
return;
}
}
if (i == 4) {
if (this.z.b("com.tencent.mm")) {
this.z.a(packageName, this.x, SocializeMedia.WEIXIN);
return;
} else {
a("share_sdk_not_install_wechat", 0);
return;
}
}
if (i == 8) {
if (this.z.b("com.tencent.mobileqq") || this.z.b("com.tencent.tim")) {
this.z.a(packageName, this.x, SocializeMedia.QZONE);
return;
} else {
a("share_sdk_not_install_qq", 0);
return;
}
}
if (i == 16) {
if (this.z.b("com.tencent.mobileqq") || this.z.b("com.tencent.tim")) {
this.z.a(packageName, this.x, SocializeMedia.QQ);
return;
} else {
a("share_sdk_not_install_qq", 0);
return;
}
}
if (i != 32) {
if (i != 64) {
return;
}
this.z.a(packageName, this.x, SocializeMedia.MORESHARE);
} else if (this.z.b("com.sina.weibo")) {
this.z.a(packageName, this.x, SocializeMedia.SINA);
} else {
a("share_sdk_not_install_wb", 0);
}
}
public void a(String str, int i) {
Toast.makeText(this.x, w.e(this.x, str), i).show();
}
public void a(View view, final int i) {
ao a2 = ao.a(this.x);
View inflate = View.inflate(this.x, w.c(this.x, "pop_account_action"), null);
final PopupWindow popupWindow = new PopupWindow(inflate, com.excelliance.kxqp.gs.util.ad.a(this.x, 110.0f), com.excelliance.kxqp.gs.util.ad.a(this.x, 45.0f), true);
a2.a("ll_delete", inflate).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view2) {
popupWindow.dismiss();
Message message = new Message();
message.what = 11;
Bundle bundle = new Bundle();
Account account = AccountFragment.this.d.getItem(i).f8499b;
bundle.putInt("position", i);
bundle.putString("account", account.name);
message.obj = bundle;
AccountFragment.this.a(message);
}
});
popupWindow.setBackgroundDrawable(new BitmapDrawable());
inflate.measure(a(popupWindow.getWidth()), a(popupWindow.getHeight()));
int width = (view.getWidth() - inflate.getMeasuredWidth()) >> 1;
int height = ((view.getHeight() * 2) / 3) + inflate.getMeasuredHeight();
if (Build.VERSION.SDK_INT >= 19) {
popupWindow.showAsDropDown(view, width, -height, GravityCompat.START);
} else {
popupWindow.showAsDropDown(view, width, -height);
}
a(popupWindow);
}
public static int a(int i) {
return View.MeasureSpec.makeMeasureSpec(View.MeasureSpec.getSize(i), i == -2 ? 0 : 1073741824);
}
private void a(PopupWindow popupWindow) {
LocalBroadcastManager.getInstance(this.x).sendBroadcast(new Intent("action.show.window.shadow"));
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
LocalBroadcastManager.getInstance(AccountFragment.this.x).sendBroadcast(new Intent("action.hide.window.shadow"));
}
});
}
public void b(final boolean z) {
if (getActivity() != null) {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if (z && AccountFragment.this.p != null) {
if (Boolean.valueOf(by.a(AccountFragment.this.x, "switcher").b("switcher", "false")).booleanValue()) {
AccountFragment.this.p.setVisibility(0);
}
} else {
if (z || AccountFragment.this.p == null) {
return;
}
AccountFragment.this.p.setVisibility(8);
}
}
});
}
}
@Override
protected boolean loadData() {
this.z.initData();
return false;
}
@Override
public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
this.x = getActivity();
this.y = new Handler(Looper.getMainLooper());
this.z = c();
this.q = ViewSwitcher.a(this.x);
this.q.a(this.t);
this.A = ViewRepository.getInstance(getActivity()).getView(ViewRepository.VIEW_FRAGMENT_ACCOUNT);
if (this.A == null) {
this.A = layoutInflater.inflate(b(), viewGroup, false);
}
a();
return this.A;
}
@Override
public void onClick(View view) {
a(view);
}
}