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.databinding.ActivityWebBinding; /** * 《服务协议》和《隐私协议》界面 */ public class WebActivity extends CustomBaseActivity { private ActivityWebBinding viewBinding; /** * 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 (HDLApp.getInstance().currentAppLanguage.equals("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"); } } } }