| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- package eVVM.apk.ui.My;
- import android.graphics.Color;
- import android.os.Bundle;
- import android.text.SpannableStringBuilder;
- import android.text.Spanned;
- import android.text.TextUtils;
- import android.text.style.ForegroundColorSpan;
- import android.widget.Button;
- import android.widget.CheckBox;
- import android.widget.CompoundButton;
- import android.widget.ImageView;
- import android.widget.TextView;
- import butterknife.BindView;
- import butterknife.ButterKnife;
- import butterknife.OnClick;
- import eVVM.apk.R;
- import eVVM.apk.common.MyActivity;
- public class ExamineActivity extends MyActivity {
- @BindView(R.id.examine_iv)
- ImageView examineIv;
- @BindView(R.id.examine_tv)
- TextView examineTv;
- @BindView(R.id.examine_cb_agree)
- CheckBox examineCbAgree;
- @BindView(R.id.examine_tv_protocol)
- TextView examineTvProtocol;
- @BindView(R.id.examine_btn_true)
- Button examineBtnTrue;
- @Override
- protected int getLayoutId() {
- return R.layout.activity_examine;
- }
- @Override
- protected int getTitleId() {
- return 0;
- }
- @Override
- protected void initView() {
- //设置用户协议
- toProtocol();
- examineBtnTrue.setEnabled(false);
- //设置 button的状态
- getBtnStact();
- }
- private void toProtocol() {
- SpannableStringBuilder builder = new SpannableStringBuilder(examineTvProtocol.getText().toString());
- ForegroundColorSpan blueSpan = new ForegroundColorSpan(Color.BLUE);
- //UnderlineSpan lineSpan = new UnderlineSpan();
- // builder.setSpan(lineSpan,8,16, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); //下划线
- builder.setSpan(blueSpan, 9, 15, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); //字体颜色
- examineTvProtocol.setText(builder);
- }
- private void getBtnStact() {
- examineCbAgree.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
- if (b) {
- examineBtnTrue.setEnabled(true);
- } else {
- //forgetBtnLogin.setClickable(false);
- examineBtnTrue.setEnabled(false);
- }
- }
- });
- }
- @Override
- protected void initData() {
- }
- @OnClick(R.id.examine_btn_true)
- public void onViewClicked() {
- toast("审核通过");
- }
- }
|