wjc
2025-05-07 8814f3f0828e6ac652a29cc9de9f971fd55bca5b
app/src/main/java/com/hdl/photovoltaic/ui/StartActivity.java
@@ -24,9 +24,11 @@
import com.hdl.photovoltaic.other.HdlResidenceLogic;
import com.hdl.photovoltaic.ui.bean.HouseIdBean;
import com.hdl.photovoltaic.ui.me.WebActivity;
import com.hdl.photovoltaic.uni.HDLUniMPSDKManager;
import com.hdl.photovoltaic.utils.LocalManageUtil;
import com.hdl.photovoltaic.utils.SharedPreUtils;
import com.hdl.photovoltaic.widget.ConfirmationCancelDialog;
import com.umeng.commonsdk.UMConfigure;
import java.util.List;
@@ -49,6 +51,7 @@
        getWindow().setNavigationBarColor(getColor(R.color.text_FF000000));
        //发布审核小米应用市场要求APP第一次启动提前提示《用户协议》和《隐私政策》才允许上线
        final String key = "is_login";
        HDLUniMPSDKManager.isExistsActivity=false;
        boolean isLogin = SharedPreUtils.getBoolean(key);
        if (!isLogin) {
            ConfirmationCancelDialog confirmationCancelDialog = new ConfirmationCancelDialog(this);
@@ -84,18 +87,10 @@
            //判断AccessToken是否null
            if (!TextUtils.isEmpty(HDLLinkPMUser.getInstance().getAccessToken())) {
                if (UserConfigManage.getInstance().isBAccount()) {
                    //2025年03月03日14:45:17 杨涛要求b端账号需要检验权限
                    boolean isAuthorization = SharedPreUtils.getBoolean("isAuthorization");
                    if (isAuthorization) {
                        //安装商跳转界面
                        Intent intent = new Intent();
                        intent.setClass(StartActivity.this, BPowerStationActivity.class);
                        openActivity(intent);
                    } else {
                        Intent intent = new Intent();
                        intent.setClass(StartActivity.this, LoginActivity.class);
                        openActivity(intent);
                    }
                    //安装商跳转界面
                    Intent intent = new Intent();
                    intent.setClass(StartActivity.this, BPowerStationActivity.class);
                    openActivity(intent);
                } else {
                    //C端用户跳转界面
//                showLoading();
@@ -192,7 +187,7 @@
                    public void updateDrawState(@NonNull TextPaint ds) {
                        super.updateDrawState(ds);
                        //设置字体颜色
                        ds.setColor(getResources().getColor(R.color.text_FFACACAC, null));
                        ds.setColor(getResources().getColor(R.color.text_38C494, null));
                        // 去掉下划线
                        ds.setUnderlineText(!UserConfigManage.getInstance().isZh());
                    }
@@ -215,7 +210,7 @@
                    public void updateDrawState(@NonNull TextPaint ds) {
                        super.updateDrawState(ds);
                        //设置字体颜色
                        ds.setColor(getResources().getColor(R.color.text_FFACACAC, null));
                        ds.setColor(getResources().getColor(R.color.text_38C494, null));
                        // 去掉下划线
                        ds.setUnderlineText(!UserConfigManage.getInstance().isZh());
                    }
@@ -228,7 +223,7 @@
            }
            textView.setText(spannable);
            //中途遇到点击后字体显示高亮,取消高亮
            textView.setHighlightColor(getResources().getColor(R.color.text_FF5B5B5B, null));
            textView.setHighlightColor(getResources().getColor(R.color.text_FFACACAC, null));
            //最后设置可点击,必须实现,否则只能显示样式,无法实现点击效果
            textView.setMovementMethod(LinkMovementMethod.getInstance());
        } catch (Exception ignored) {
@@ -245,8 +240,11 @@
            return;
        }
        HDLApp.getInstance().isStartInitThirdSDK = true;
        //初始化友盟SDK
        initUMengSDK();
        //初始化极光推送
        initJPush();
    }
    /**
@@ -256,5 +254,17 @@
        JPushInterface.setDebugMode(true);
        JPushInterface.init(getBaseContext());
    }
    /**
     * 初始化友盟SDK,抓闪退日志
     * 集成教程地址:https://developer.umeng.com/docs/119267/detail/118588
     */
    private void initUMengSDK() {
        UMConfigure.preInit(this, "6801aec0bc47b67d833fd76d", "XenterraSolar");
        //appkey和channl必须保持和预初始化一致!!!
        //deviceType:设备类型,UMConfigure.DEVICE_TYPE_PHONE为手机、UMConfigure.DEVICE_TYPE_BOX为盒子
        //pushSecret:Push推送业务的secret
        UMConfigure.init(this, "6801aec0bc47b67d833fd76d", "XenterraSolar", UMConfigure.DEVICE_TYPE_PHONE, "");
        UMConfigure.setLogEnabled(false);//AppConfigManage.isDebug()
    }
}