| | |
| | | |
| | | |
| | | import android.content.Intent; |
| | | import android.graphics.Bitmap; |
| | | import android.graphics.Color; |
| | | import android.os.Bundle; |
| | | import android.view.View; |
| | | |
| | |
| | | import com.hdl.photovoltaic.enums.ShowErrorMode; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.other.HdlAppUpdateLogic; |
| | | import com.hdl.photovoltaic.other.HdlCommonLogic; |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | import com.hdl.photovoltaic.widget.FlashingBoxDialog; |
| | | import com.hdl.photovoltaic.widget.apkwgtupload.ApkDownLoadService; |
| | | import com.hdl.photovoltaic.widget.ConfirmationCancelDialog; |
| | | import com.hdl.photovoltaic.widget.UpdateConfirmationCancelDialog; |
| | | |
| | | /** |
| | | * 关于界面 |
| | | * 关于界面(app更新) |
| | | */ |
| | | public class AsRegardsActivity extends CustomBaseActivity { |
| | | |
| | |
| | | |
| | | @Override |
| | | public void onBindView(Bundle savedInstanceState) { |
| | | setNotificationBarBackgroundColor(CustomColor.white); |
| | | setStatusBarTextColor(); |
| | | setStatusBarTranslucent(); |
| | | getWindow().setNavigationBarColor(getColor(R.color.text_FF000000)); |
| | | //初始化 |
| | | initView(); |
| | | //初始化界面监听器 |
| | |
| | | mNewVersionBean = newVersionBean; |
| | | if (newVersionBean != null) { |
| | | //todo 发现新版本,改变UI样式 |
| | | viewBinding.asRegardsRlRightContentTv.setText(R.string.app_discover_new_version); |
| | | viewBinding.asRegardsRlRightContentTv.setTextColor(getResources().getColor(R.color.text_FFACACAC, null)); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | }); |
| | | //正式环境 |
| | | String content = "https://developer.hdlcontrol.com/AppDownload/HDLPhotovoltaicDownload.html"; |
| | | if (!AppConfigManage.getOnlineServer()) { |
| | | //测试环境 |
| | | content = "https://developer.hdlcontrol.com/AppDownload/HDLPhotovoltaicDebugDownload.html"; |
| | | } |
| | | Bitmap bitmap = HdlCommonLogic.getInstance().createQRCodeBitmap(content, 168, 168, "UTF-8", "H", "0", getColor(R.color.text_00000000), Color.WHITE); |
| | | viewBinding.asRegardsQrCodeIv.setImageBitmap(bitmap); |
| | | |
| | | } |
| | | |
| | | |
| | | private void initEvent() { |
| | | viewBinding.toolbarTopFragmentHouseListRl.topBackBtn.setOnClickListener(new View.OnClickListener() { |
| | | viewBinding.toolbarTopRl.topBackLl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | finish(); |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | Intent intent = new Intent(); |
| | | intent.putExtra("type", 0); |
| | | intent.putExtra("type", WebActivity.ServiceAgreement); |
| | | intent.setClass(_mActivity, WebActivity.class); |
| | | startActivity(intent); |
| | | } |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | Intent intent = new Intent(); |
| | | intent.putExtra("type", 1); |
| | | intent.putExtra("type", WebActivity.PrivacyAgreement); |
| | | intent.setClass(_mActivity, WebActivity.class); |
| | | startActivity(intent); |
| | | |
| | | } |
| | | }); |
| | | viewBinding.contactUsRl.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | Intent intent = new Intent(); |
| | | intent.setClass(_mActivity, ContactUsActivity.class); |
| | | startActivity(intent); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | private void initView() { |
| | | setNotificationBarBackgroundColor(CustomColor.white); |
| | | getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); |
| | | viewBinding.toolbarTopFragmentHouseListRl.topTitleTv.setText(R.string.me_regard); |
| | | 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)); |
| | | String versionsStr = "v" + AppConfigManage.getVersionName(); |
| | | viewBinding.toolbarTopRl.topBarView.setBackgroundColor(getColor(R.color.text_00000000)); |
| | | viewBinding.toolbarTopRl.topTitleTv.setText(R.string.me_regard); |
| | | viewBinding.toolbarTopRl.topBackLl.setVisibility(View.VISIBLE); |
| | | String versionsStr = _mActivity.getResources().getString(R.string.app_version_number) + " " + AppConfigManage.getVersionName(); |
| | | viewBinding.asRegardsIconVersionsTv.setText(versionsStr); |
| | | |
| | | } |
| | |
| | | @Override |
| | | public void run() { |
| | | if (mNewVersionBean == null) { |
| | | HdlThreadLogic.toast(_mActivity, R.string.app_new_version); |
| | | FlashingBoxDialog flashingBoxDialog = new FlashingBoxDialog(_mActivity, 1500); |
| | | flashingBoxDialog.setContent(getString(R.string.app_new_version)); |
| | | flashingBoxDialog.show(); |
| | | return; |
| | | } |
| | | String app_version = getString(R.string.app_version) + ":" + mNewVersionBean.getVersion(); |
| | |
| | | public void Confirm() { |
| | | Intent intent = new Intent(_mActivity, ApkDownLoadService.class); |
| | | intent.putExtra("updateUrl", mNewVersionBean.getPackageUrl()); |
| | | intent.putExtra("downLoadName", HdlAppUpdateLogic.ApkFileName); |
| | | intent.putExtra("downLoadName", HdlAppUpdateLogic.getInstance().getApkFileName()); |
| | | intent.putExtra("downLoadType", "0"); |
| | | _mActivity.startService(intent); |
| | | updateConfirmationCancelDialog.dismiss(); |