admin
2022-08-09 399ac289f80b7a40aa4210341db6b447cacdcf14
app/src/main/java/com/tejia/lijin/app/ui/mine/SettingActivity.java
@@ -20,6 +20,7 @@
import com.bumptech.glide.Glide;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.tejia.lijin.app.ShoppingApplication;
import com.tejia.lijin.app.ui.invite.ShareBrowserTestActivity;
import com.wpc.library.util.DataCleanManager;
import com.wpc.library.util.GetManifestDataUtil;
import com.wpc.library.util.SystemCommon;
@@ -51,7 +52,7 @@
    private TextView tv_version;
    private TextView tv_cache_num;
    private CheckBox cb_msg, cb_no_see_red_point, cb_no_see_reward_statistics,
            cb_no_see_share_and_selection, cb_no_see_phone;// cb_no_see_invite_reward;, cb_open_share_red_packet//开启推广红包
            cb_no_see_share_and_selection, cb_no_see_phone,cb_push;// cb_no_see_invite_reward;, cb_open_share_red_packet//开启推广红包
    private LinearLayout ll_clear_cache, ll_check_update, ll_person_info, ll_account_grade,
            ll_about_us, ll_exit_account;
    private int shareRedPacket, noBonusCount, noNewsRedDot, noShareRecordAndStorage, noDisplayPhoneNum;
@@ -73,6 +74,7 @@
        cb_no_see_share_and_selection = findViewById(R.id.cb_no_see_share_and_selection);
        cb_no_see_phone = findViewById(R.id.cb_no_see_phone);
        cb_push= findViewById(R.id.cb_push);
//        cb_no_see_invite_reward = findViewById(R.id.cb_no_see_invite_reward);
        ll_clear_cache = findViewById(R.id.ll_clear_cache);
        ll_check_update = findViewById(R.id.ll_check_update);
@@ -120,6 +122,21 @@
                editor.commit();
            }
        });
        cb_push.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                UserCustomEvent.userSettingCommon(SettingActivity.this, "个性化推送开关");
                SharedPreferences.Editor editor = sp.edit();
                ToolUtil.notDisturb(SettingActivity.this, isChecked);
                if (isChecked)
                    editor.putBoolean("doNotRecommend", true);
                else
                    editor.putBoolean("doNotRecommend", false);
                editor.commit();
            }
        });
        cb_no_see_red_point.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@@ -161,12 +178,35 @@
        noDisplayPhoneNum = getIntent().getIntExtra("noDisplayPhoneNum", 0);
        cb_msg.setChecked(sp.getBoolean("doNotDisturb", false));
        cb_push.setChecked(sp.getBoolean("doNotRecommend", false));
//        cb_open_share_red_packet.setChecked(shareRedPacket == 1 ? true : false);
        cb_no_see_red_point.setChecked(noNewsRedDot == 1 ? true : false);
        cb_no_see_reward_statistics.setChecked(noBonusCount == 1 ? true : false);
        cb_no_see_share_and_selection.setChecked(noShareRecordAndStorage == 1 ? true : false);
        cb_no_see_phone.setChecked(noDisplayPhoneNum == 1 ? true : false);
        findViewById(R.id.view_test).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//连续点击5下进入调试模式
                if (System.currentTimeMillis() - debugLastClickTime < 500) {
                    debugCount++;
                    if (debugCount > 5) {
                        startActivity(new Intent(getApplicationContext(), ShareBrowserTestActivity.class));
                    }
                } else {
                    debugCount = 0;
                }
                debugLastClickTime = System.currentTimeMillis();
            }
        });
    }
    //调试模式
    long debugLastClickTime = 0;
    int debugCount = 0;
    @Override
    protected void onResume() {
@@ -260,7 +300,7 @@
                break;
            case R.id.ll_person_info:
                if (!LoginAndInviteStatusUtil.acessNext(getApplicationContext(), UserUtil.getUid(getApplicationContext()) , true))
                if (!LoginAndInviteStatusUtil.acessNext(getApplicationContext(), UserUtil.getUid(getApplicationContext()), true))
                    return;
                if (getSharedPreferences("user", MODE_PRIVATE).getBoolean("isLogin", false)) {
@@ -270,14 +310,13 @@
                }
                break;
            case R.id.ll_account_grade:
                if (!LoginAndInviteStatusUtil.acessNext(getApplicationContext(), UserUtil.getUid(getApplicationContext()) , true))
                if (!LoginAndInviteStatusUtil.acessNext(getApplicationContext(), UserUtil.getUid(getApplicationContext()), true))
                    return;
                startActivity(new Intent(SettingActivity.this, AccountGradeActivity.class));
                break;
            case R.id.ll_about_us:
                Intent intent2 = new Intent(ll_about_us.getContext(), ShareBrowserActivity.class);
                intent2.putExtra("url", SystemParamsUtil.getParam(getApplicationContext(), "about"));
                intent2.putExtra("title", "关于我们");
                startActivity(intent2);
                break;