| | |
| | | try { |
| | | viewBinding.homeLoginCheckBCCl.setSelected(UserConfigManage.getInstance().isBAccount()); |
| | | viewBinding.homeLoginPrivacyCheckIv.setSelected(UserConfigManage.getInstance().isAcceiptPolicy()); |
| | | setStringDifferentColors(viewBinding.homeLoginPrivacyTv); |
| | | setStringDifferentColors(viewBinding.homeLoginPrivacyTv,false); |
| | | |
| | | //注册和忘记密码需要加下划线 |
| | | String registerTvStr = viewBinding.homeLoginRegisterTv.getText().toString(); |
| | |
| | | /** |
| | | * 设置一串字符多种颜色以及点击事件 |
| | | * |
| | | * @param textView 当前组件 |
| | | * @param textView 当前组件 |
| | | * @param isHighlight 是否高亮(true表示高亮) |
| | | */ |
| | | private void setStringDifferentColors(TextView textView) { |
| | | private void setStringDifferentColors(TextView textView, boolean isHighlight) { |
| | | try { |
| | | |
| | | |
| | | int text_color = isHighlight ? R.color.text_38C494 : R.color.text_FFACACAC; |
| | | if (textView == null) { |
| | | return; |
| | | } |
| | |
| | | @Override |
| | | public void updateDrawState(@NonNull TextPaint ds) { |
| | | super.updateDrawState(ds); |
| | | |
| | | //设置字体颜色 |
| | | ds.setColor(getResources().getColor(R.color.text_FFACACAC, null)); |
| | | ds.setColor(getResources().getColor(text_color, null)); |
| | | // 去掉下划线 |
| | | ds.setUnderlineText(!UserConfigManage.getInstance().isZh()); |
| | | } |
| | |
| | | public void updateDrawState(@NonNull TextPaint ds) { |
| | | super.updateDrawState(ds); |
| | | //设置字体颜色 |
| | | ds.setColor(getResources().getColor(R.color.text_FFACACAC, null)); |
| | | ds.setColor(getResources().getColor(text_color, null)); |
| | | // 去掉下划线 |
| | | ds.setUnderlineText(!UserConfigManage.getInstance().isZh()); |
| | | } |
| | | |
| | | |
| | | }, startIndex2, endIndex2, 0); |
| | | // spannable.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), startIndex2, endIndex2, 0); |
| | |
| | | } |
| | | 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) { |
| | |
| | | confirmationCancelDialog.show(); |
| | | confirmationCancelDialog.isHideTitle(true); |
| | | confirmationCancelDialog.setContent(getString(R.string.loading_privacy_server)); |
| | | setStringDifferentColors(confirmationCancelDialog.getContentTextView()); |
| | | setStringDifferentColors(confirmationCancelDialog.getContentTextView(),true); |
| | | confirmationCancelDialog.setConfirmation(getString(R.string.loading_agree)); |
| | | confirmationCancelDialog.setCancel(getString(R.string.loading_on_agree)); |
| | | confirmationCancelDialog.setYesOnclickListener(new ConfirmationCancelDialog.onYesOnclickListener() { |