wjc
2025-04-15 cdf49871675e42a5576f725a93eec7ca15294c6f
app/src/main/java/com/hdl/photovoltaic/ui/me/WebActivity.java
@@ -1,6 +1,7 @@
package com.hdl.photovoltaic.ui.me;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
@@ -35,8 +36,8 @@
    @Override
    public void onBindView(Bundle savedInstanceState) {
        setNotificationBarBackgroundColor(CustomBaseActivity.CustomColor.white);
        setStatusBarTextColor();
        setStatusBarTranslucent();
        getWindow().setNavigationBarColor(getColor(R.color.text_FF000000));
        this.typeIntValue = getIntent().getIntExtra("type", 0);
        //初始化
        initView();
@@ -45,7 +46,7 @@
    }
    private void initEvent() {
        viewBinding.toolbarTopFragmentHouseListRl.topBackLl.setOnClickListener(new View.OnClickListener() {
        viewBinding.toolbarTopRl.topBackLl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
@@ -53,33 +54,34 @@
        });
    }
    @SuppressLint("SetJavaScriptEnabled")
    private void initView() {
        viewBinding.contentView.getSettings().setJavaScriptEnabled(true);
        //xml里面设置背景无效
        viewBinding.contentView.setBackgroundColor(getColor(R.color.text_FF000000));
        if (this.typeIntValue == 0) {
            viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setText(R.string.app_service_agreement);
            viewBinding.toolbarTopRl.topTitleTv.setText(R.string.app_service_agreement);
        } else {
            viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setText(R.string.app_privacy_policy);
            viewBinding.toolbarTopRl.topTitleTv.setText(R.string.app_privacy_policy);
        }
        viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setTextColor(getResources().getColor(R.color.text_030D1C, null));
        viewBinding.toolbarTopFragmentHouseListRl.topBackLl.setVisibility(View.VISIBLE);
        viewBinding.toolbarTopFragmentHouseListRl.topBarView.setBackgroundColor(getResources().getColor(R.color.text_FFFFFFFF, null));
        viewBinding.toolbarTopRl.topBackLl.setVisibility(View.VISIBLE);
        if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(LocalManageUtil.zh)) {
            //中文
            if (this.typeIntValue == 0) {
                //用户协议
                viewBinding.contentView.loadUrl("https://developer.hdlcontrol.com/GreenSmartEnergy__UserAgreement.html");
                //用户协议 https://nearest.hdlcontrol.com
                viewBinding.contentView.loadUrl("https://common.hdlcontrol.com/common-h5/#/pages/greenEnergyAgreement/userAgreement");
            } else {
                //隐私协议
                viewBinding.contentView.loadUrl("https://developer.hdlcontrol.com/GreenSmartEnergy__PrivacyPolicy.html");
                viewBinding.contentView.loadUrl("https://common.hdlcontrol.com/common-h5/#/pages/greenEnergyAgreement/privacyAgreement");
            }
        } else {
            //英文
            if (this.typeIntValue == 0) {
                //用户协议
                viewBinding.contentView.loadUrl("https://developer.hdlcontrol.com/GreenSmartEnergy__UserAgreement-En.html");
                viewBinding.contentView.loadUrl("https://common.hdlcontrol.com/common-h5/#/pages/greenEnergyAgreement/userAgreementEn");
            } else {
                //隐私协议
                viewBinding.contentView.loadUrl("https://developer.hdlcontrol.com/GreenSmartEnergy_PrivacyPolicy-En.html");
                viewBinding.contentView.loadUrl("https://common.hdlcontrol.com/common-h5/#/pages/greenEnergyAgreement/privacyAgreementEn");
            }
        }