mac
2024-01-02 d1ebb94e1a17b7c25d4fcf73d85345d92cc86b5c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package com.hdl.photovoltaic.ui.me;
 
 
import android.os.Bundle;
import android.view.View;
 
import com.hdl.photovoltaic.HDLApp;
import com.hdl.photovoltaic.R;
import com.hdl.photovoltaic.base.CustomBaseActivity;
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.databinding.ActivityWebBinding;
import com.hdl.photovoltaic.utils.LocalManageUtil;
 
/**
 * 《服务协议》和《隐私协议》界面
 */
public class WebActivity extends CustomBaseActivity {
 
 
    private ActivityWebBinding viewBinding;
 
    public static final int ServiceAgreement = 0;
    public static final int PrivacyAgreement = 1;
 
    /**
     * 0,表示服务协议
     * 1,表示隐私协议
     */
    private int typeIntValue;
 
    @Override
    public Object getContentView() {
        viewBinding = ActivityWebBinding.inflate(getLayoutInflater());
        return viewBinding.getRoot();
    }
 
    @Override
    public void onBindView(Bundle savedInstanceState) {
        setNotificationBarBackgroundColor(CustomBaseActivity.CustomColor.white);
        setStatusBarTextColor();
        this.typeIntValue = getIntent().getIntExtra("type", 0);
        //初始化
        initView();
        //初始化界面监听器
        initEvent();
    }
 
    private void initEvent() {
        viewBinding.toolbarTopFragmentHouseListRl.topBackBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }
 
    private void initView() {
        if (this.typeIntValue == 0) {
            viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setText(R.string.app_service_agreement);
        } else {
            viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setText(R.string.app_privacy_policy);
        }
        viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setTextColor(getResources().getColor(R.color.text_030D1C, null));
        viewBinding.toolbarTopFragmentHouseListRl.topBackBtn.setVisibility(View.VISIBLE);
        viewBinding.toolbarTopFragmentHouseListRl.topBarView.setBackgroundColor(getResources().getColor(R.color.text_FFFFFFFF, null));
 
        if (UserConfigManage.getInstance().getCurrentAppLanguage().equals(LocalManageUtil.zh)) {
            //中文
            if (this.typeIntValue == 0) {
                //用户协议
                viewBinding.contentView.loadUrl("https://developer.hdlcontrol.com/GreenSmartEnergy__UserAgreement.html");
            } else {
                //隐私协议
                viewBinding.contentView.loadUrl("https://developer.hdlcontrol.com/GreenSmartEnergy__PrivacyPolicy.html");
            }
        } else {
            //英文
            if (this.typeIntValue == 0) {
                //用户协议
                viewBinding.contentView.loadUrl("https://developer.hdlcontrol.com/GreenSmartEnergy__UserAgreement-En.html");
            } else {
                //隐私协议
                viewBinding.contentView.loadUrl("https://developer.hdlcontrol.com/GreenSmartEnergy_PrivacyPolicy-En.html");
            }
        }
 
    }
}