c69733c991d0b9a7cbad625454d4f00a2b1fa022.svn-base 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. package eVVM.apk.ui.My;
  2. import android.graphics.Color;
  3. import android.os.Bundle;
  4. import android.text.SpannableStringBuilder;
  5. import android.text.Spanned;
  6. import android.text.TextUtils;
  7. import android.text.style.ForegroundColorSpan;
  8. import android.widget.Button;
  9. import android.widget.CheckBox;
  10. import android.widget.CompoundButton;
  11. import android.widget.ImageView;
  12. import android.widget.TextView;
  13. import butterknife.BindView;
  14. import butterknife.ButterKnife;
  15. import butterknife.OnClick;
  16. import eVVM.apk.R;
  17. import eVVM.apk.common.MyActivity;
  18. public class ExamineActivity extends MyActivity {
  19. @BindView(R.id.examine_iv)
  20. ImageView examineIv;
  21. @BindView(R.id.examine_tv)
  22. TextView examineTv;
  23. @BindView(R.id.examine_cb_agree)
  24. CheckBox examineCbAgree;
  25. @BindView(R.id.examine_tv_protocol)
  26. TextView examineTvProtocol;
  27. @BindView(R.id.examine_btn_true)
  28. Button examineBtnTrue;
  29. @Override
  30. protected int getLayoutId() {
  31. return R.layout.activity_examine;
  32. }
  33. @Override
  34. protected int getTitleId() {
  35. return 0;
  36. }
  37. @Override
  38. protected void initView() {
  39. //设置用户协议
  40. toProtocol();
  41. examineBtnTrue.setEnabled(false);
  42. //设置 button的状态
  43. getBtnStact();
  44. }
  45. private void toProtocol() {
  46. SpannableStringBuilder builder = new SpannableStringBuilder(examineTvProtocol.getText().toString());
  47. ForegroundColorSpan blueSpan = new ForegroundColorSpan(Color.BLUE);
  48. //UnderlineSpan lineSpan = new UnderlineSpan();
  49. // builder.setSpan(lineSpan,8,16, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); //下划线
  50. builder.setSpan(blueSpan, 9, 15, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); //字体颜色
  51. examineTvProtocol.setText(builder);
  52. }
  53. private void getBtnStact() {
  54. examineCbAgree.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
  55. @Override
  56. public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
  57. if (b) {
  58. examineBtnTrue.setEnabled(true);
  59. } else {
  60. //forgetBtnLogin.setClickable(false);
  61. examineBtnTrue.setEnabled(false);
  62. }
  63. }
  64. });
  65. }
  66. @Override
  67. protected void initData() {
  68. }
  69. @OnClick(R.id.examine_btn_true)
  70. public void onViewClicked() {
  71. toast("审核通过");
  72. }
  73. }