OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046

以下内容为反编译后的 MineFragment.java 源代码,内容仅作参考


package com.excelliance.kxqp.gs.ui.mine;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.alipay.sdk.util.i;
import com.bumptech.glide.d.d.a.e;
import com.excelliance.kxqp.bitmap.bean.RankingItem;
import com.excelliance.kxqp.bitmap.bean.ResponseData;
import com.excelliance.kxqp.gs.base.BaseLazyFragment;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.CommonActivity;
import com.excelliance.kxqp.gs.ui.mine.a;
import com.excelliance.kxqp.gs.ui.mine.b;
import com.excelliance.kxqp.gs.ui.mine.gaccount.GoogleAccountActivity;
import com.excelliance.kxqp.gs.ui.question.CommonWebViewActivity;
import com.excelliance.kxqp.gs.ui.setting.SettingActivity;
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.ViewSwitcher;
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.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.s;
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.ui.InformationCenterActivity;
import com.excelliance.kxqp.ui.comment.mine.MyCommentActivity;
import com.tencent.open.SocialConstants;
import java.util.List;
import org.json.JSONArray;

public class MineFragment extends BaseLazyFragment<b.InterfaceC0423b> implements a.InterfaceC0422a, b.d {
    private View A;
    private View B;
    private ImageView D;

    private View f10564a;
    private View m;
    private View n;
    private TextView o;
    private TextView p;
    private View q;
    private TextView r;
    private TextView s;
    private ImageView t;
    private FrameLayout u;
    private ImageView v;
    private View w;
    private View x;
    private View y;
    private View z;
    private Handler C = new Handler() {
        @Override
        public void handleMessage(Message message) {
            if (message.what != 1) {
                return;
            }
            aw.a(MineFragment.this.d, MineFragment.f4299b);
            List<com.excelliance.kxqp.gs.ui.account.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++) {
                com.excelliance.kxqp.gs.ui.account.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(MineFragment.this.d, w.e(MineFragment.this.d, "msg_login_google_account"));
                StatisticsGS.getInstance().uploadUserAction(MineFragment.this.d, 106, 1, sb.toString());
                bz.a().b(MineFragment.this.d, sb.toString());
            }
        }
    };
    private ViewSwitcher.b E = new ViewSwitcher.b() {
        @Override
        public void a() {
            MineFragment.this.g();
        }
    };
    private BroadcastReceiver F = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            if (!cd.a(action)) {
                if (TextUtils.equals(intent.getAction(), MineFragment.this.d.getPackageName() + ".user_diff_line")) {
                    MineFragment.this.n();
                    return;
                }
            }
            if ("action.store.cost.diamond".equals(action)) {
                MineFragment.this.n();
            }
        }
    };
    private BroadcastReceiver G = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            if ("updata_user_info".equals(action)) {
                MineFragment.this.a(intent.getStringExtra("user_name"), intent.getStringExtra("user_signature"), intent.getStringExtra("user_image"), intent.getIntExtra("vip", -1));
                return;
            }
            if ((MineFragment.this.d.getPackageName() + ".user_login_out").equals(intent.getAction())) {
                if (MineFragment.this.t != null) {
                    MineFragment.this.t.setImageResource(com.excelliance.kxqp.gs.ui.medal.a.c.d());
                }
            } else {
                if (TextUtils.equals(action, context.getPackageName() + "refresh_updatedata")) {
                    MineFragment.this.m();
                }
            }
        }
    };

    @Override
    protected void b() {
        this.B = a("layout_comment", 0);
        View a2 = a(com.alipay.sdk.sys.a.j, 1);
        this.A = a("official_community", 4);
        this.m = a("ll_google_account", 5);
        this.f10564a = b("ll_login_ourplay");
        View a3 = a("btn_add_google_account", 7);
        View a4 = a("cv_our_play_account", 8);
        this.z = a("cv_google_account", 9);
        this.n = b("rl_google_account");
        this.q = b("rl_our_play_account");
        this.o = (TextView) b("tv_google_account_name");
        this.p = (TextView) b("tv_google_account_count");
        this.r = (TextView) b("tv_our_account_name");
        this.s = (TextView) b("tv_our_account_vip");
        this.t = (ImageView) b("iv_our_account");
        this.D = (ImageView) b("iv_vip");
        this.u = (FrameLayout) a("rl_notification_center", 10);
        this.u.setOnClickListener(this);
        this.v = (ImageView) b("iv_has_notification");
        this.w = b("new_app_version");
        this.x = a("acknowledgement", 3);
        this.y = a("update_manager", 2);
        this.B.setOnClickListener(this);
        a2.setOnClickListener(this);
        this.x.setOnClickListener(this);
        this.y.setOnClickListener(this);
        this.A.setOnClickListener(this);
        this.m.setOnClickListener(this);
        a3.setOnClickListener(this);
        a4.setOnClickListener(this);
        this.z.setOnClickListener(this);
        g();
    }

    public void g() {
        boolean z = bs.c() && bs.p(this.d);
        ViewSwitcher.a(this.d).a();
        if (z || !ViewSwitcher.a(this.d).a()) {
            this.z.setVisibility(8);
        } else {
            this.z.setVisibility(0);
        }
        if (z) {
            this.A.setVisibility(8);
            this.x.setVisibility(8);
        } else {
            this.A.setVisibility(0);
            this.x.setVisibility(0);
        }
        if (bs.p(this.d)) {
            this.y.setVisibility(8);
        } else {
            this.y.setVisibility(0);
        }
        if (com.excelliance.kxqp.gs.util.b.bk(this.d)) {
            return;
        }
        this.B.setVisibility(8);
    }

    @Override
    public void onViewCreated(View view, Bundle bundle) {
        super.onViewCreated(view, bundle);
        ViewSwitcher.a(this.d).a(this.E);
        registerReceiver();
        if (by.a(this.d, "download_sp").b("isNewVersion", false).booleanValue()) {
            this.w.setVisibility(0);
        }
        p();
        n();
    }

    private void registerReceiver() {
        a.c().registerReceiver(getActivity());
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction(this.d.getPackageName() + ".user_diff_line");
        intentFilter.addAction("action.store.cost.diamond");
        intentFilter.addAction("updata_user_info");
        LocalBroadcastManager.getInstance(this.d).registerReceiver(this.F, intentFilter);
        IntentFilter intentFilter2 = new IntentFilter("updata_user_info");
        intentFilter2.addAction(this.d.getPackageName() + ".user_login_out");
        getActivity().registerReceiver(this.G, intentFilter2);
    }

    @Override
    public void onResume() {
        super.onResume();
        p();
        n();
        try {
            boolean b2 = g.a(this.d).b(this.d);
            if (this.w != null) {
                this.w.setVisibility(b2 ? 0 : 8);
            }
            m();
        } catch (Exception e) {
            e.printStackTrace();
        }
        a.c().a(this);
        l();
    }

    private void l() {
        String a2 = bx.a().a(this.d.getSharedPreferences("USERINFO", Build.VERSION.SDK_INT < 11 ? 0 : 4), t.f, "");
        if (a2 == null || "".equals(a2)) {
            return;
        }
        com.bumptech.glide.i.b(this.d).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.t);
    }

    public void m() {
        final TextView textView = (TextView) com.excelliance.kxqp.ui.util.b.a("update_prop", this.f);
        if (textView != null) {
            textView.setVisibility(8);
            tp.g(new Runnable() {
                @Override
                public void run() {
                    JSONArray a2 = com.excelliance.kxqp.gs.ui.update.a.a(MineFragment.this.d, ResponseData.getUpdateData(MineFragment.this.d));
                    final int size = (a2 != null ? RankingItem.pareseRankingItems(MineFragment.this.d, a2, true).size() + 0 : 0) + f.a(MineFragment.this.d).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(MineFragment.this.d, "update_prop"), Integer.valueOf(size)), "update_prop");
                            } else {
                                textView.setVisibility(8);
                            }
                        }
                    });
                }
            });
        }
    }

    @Override
    public void onVisible() {
        super.onVisible();
        try {
            boolean b2 = g.a(this.d).b(this.d);
            if (this.w != null) {
                this.w.setVisibility(b2 ? 0 : 8);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void a(String str, String str2, String str3, int i) {
        if (!TextUtils.isEmpty(str)) {
            this.r.setText(str);
            bx.a().b(this.d, str);
        }
        if (i != -1) {
            n();
        }
        if (TextUtils.isEmpty(str3)) {
            return;
        }
        com.bumptech.glide.i.a(getActivity()).a(str3).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.t);
    }

    public void n() {
        this.f10564a.setVisibility(bx.a().b(this.d) ? 8 : 0);
        this.q.setVisibility(bx.a().b(this.d) ? 0 : 8);
        String q = bx.a().q(this.d);
        Drawable k = w.k(this.d, "icon_vip_v2");
        this.r.setText(q);
        switch (o()) {
            case 1:
                this.D.setImageDrawable(null);
                return;
            case 2:
                cn.c(this.d);
                String e = w.e(this.d, "me_login_tips_vip");
                String s = bx.a().s(this.d);
                this.s.setText(e + s);
                this.D.setImageDrawable(k);
                return;
            case 3:
                if (!bx.a().n(this.d)) {
                    cn.b(this.d);
                }
                if (bx.a().p(this.d)) {
                    String e2 = w.e(this.d, "me_login_tips_vip");
                    String v = bx.a().v(this.d);
                    this.s.setText(e2 + v);
                    this.D.setImageDrawable(k);
                    return;
                }
                w.a(this.d, this.s, "me_login_tips_expired");
                this.D.setImageDrawable(null);
                return;
            default:
                w.a(this.d, this.r, "ourplay_account");
                w.a(this.d, this.s, "me_login_tips");
                this.D.setImageDrawable(null);
                return;
        }
    }

    private int o() {
        int u = bx.a().u(this.d);
        return u <= 0 ? bx.a().b(this.d) ? 1 : 0 : u == 4 ? 3 : 2;
    }

    private void p() {
        tp.b(new Runnable() {
            @Override
            public void run() {
                final List<com.excelliance.kxqp.gs.ui.account.c> f = as.f();
                tp.i(new Runnable() {
                    @Override
                    public void run() {
                        MineFragment.this.m.setVisibility(!s.a(f) ? 8 : 0);
                        MineFragment.this.n.setVisibility(s.a(f) ? 8 : 0);
                        if (s.a(f)) {
                            return;
                        }
                        MineFragment.this.p.setText(String.format(w.e(MineFragment.this.d, "google_account_count"), Integer.valueOf(f.size())));
                        com.excelliance.kxqp.gs.ui.account.c cVar = (com.excelliance.kxqp.gs.ui.account.c) f.get(0);
                        if (cVar == null || cVar.f8499b == null) {
                            return;
                        }
                        MineFragment.this.o.setText(cVar.f8499b.name);
                    }
                });
            }
        });
    }

    @Override
    protected int d() {
        return w.c(this.d, ViewRepository.VIEW_FRAGMENT_MINE);
    }

    @Override
    public b.InterfaceC0423b e() {
        return new c(this.d, this);
    }

    @Override
    public void singleClick(View view) {
        switch (Integer.valueOf(view.getTag().toString()).intValue()) {
            case 0:
                MyCommentActivity.a(this.d);
                return;
            case 1:
                StatisticsGS.getInstance().uploadUserAction(this.d, 33);
                startActivity(new Intent(this.d, (Class<?>) SettingActivity.class));
                q();
                return;
            case 2:
                StatisticsGS.getInstance().uploadUserAction(this.d, 103);
                startActivity(new Intent(this.d, (Class<?>) UpdateAppActivity.class));
                q();
                return;
            case 3:
                Intent intent = new Intent(this.d, (Class<?>) CommonWebViewActivity.class);
                intent.putExtra(SocialConstants.PARAM_URL, "https://h5.ourplay.com.cn/thanks/");
                startActivity(intent);
                q();
                return;
            case 4:
                Intent intent2 = new Intent();
                intent2.putExtra("page", 0);
                intent2.putExtra("title", com.excelliance.kxqp.swipe.a.a.getString(this.d, "official_community"));
                intent2.setComponent(new ComponentName(this.d, (Class<?>) CommonActivity.class));
                this.d.startActivity(intent2);
                bz.a().a(this.d, 51000, "进入官方社群");
                return;
            case 5:
            case 9:
                startActivity(new Intent(this.d, (Class<?>) GoogleAccountActivity.class));
                return;
            case 6:
            default:
                return;
            case 7:
                a.c().l();
                return;
            case 8:
                if (bx.a().b(this.d)) {
                    this.d.startActivity(new Intent(this.d, (Class<?>) UserInfoEditActivity.class));
                    return;
                }
                cg.a(this.d, w.e(this.d, "share_for_login_sure"));
                com.excelliance.kxqp.gs.router.a.a.f8074a.invokeLogin(this.d);
                return;
            case 10:
                startActivity(new Intent(this.d, (Class<?>) InformationCenterActivity.class));
                q();
                if (this.v != null) {
                    this.v.setVisibility(8);
                }
                bz.a().a(this.d, 49000, "进入消息中心");
                return;
        }
    }

    private void q() {
        getActivity().overridePendingTransition(w.i(this.d, "slide_right_in"), w.i(this.d, "slide_left_out"));
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        if (this.F != null) {
            LocalBroadcastManager.getInstance(this.d).unregisterReceiver(this.F);
        }
        if (this.G != null) {
            getActivity().unregisterReceiver(this.G);
        }
        ViewSwitcher.a(this.d).b(this.E);
    }

    @Override
    public void a(boolean z) {
        this.v.setVisibility(z ? 0 : 8);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        a.c().b(this);
        a.c().unregisterReceiver(getActivity());
    }

    @Override
    public void onActivityResult(int i, int i2, Intent intent) {
        Log.e(f4299b, "[data: " + intent + ",code:" + i2 + "]");
        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(MineFragment.this.d, "sp_pre_account_config");
                        String b2 = a2.b("sp_pre_account_config", "");
                        az.i(MineFragment.f4299b, "onActivityResult: ----config: " + b2);
                        if (TextUtils.equals(b2, "")) {
                            return;
                        }
                        as.a(MineFragment.this.d, 0, b2);
                        a2.a("sp_pre_account_config", "");
                    }
                });
                return;
            }
            return;
        }
        getActivity().setResult(-1, intent);
        this.C.sendMessageDelayed(this.C.obtainMessage(1), 200L);
        try {
            Intent intent2 = new Intent();
            String packageName = this.d.getPackageName();
            intent2.setComponent(new ComponentName(packageName, "com.excelliance.kxqp.gs.service.CustomIntentService"));
            intent2.setAction(packageName + ".google.account.add.success");
            this.d.startService(intent2);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (com.excelliance.kxqp.gs.util.b.cb(this.d)) {
            com.excelliance.kxqp.gs.ui.gaccount.receive.a.a(this.d).a();
        }
    }
}