Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * class for handling spannable text click
- */
- private class PrivacyClickableSpan extends ClickableSpan {
- static final int TYPE_TERMS_SPAN = 1;
- static final int TYPE_PRIVACY_SPAN = 2;
- static final int TYPE_END = 3; //Need for fixing issue with click below first line span
- private int type;
- PrivacyClickableSpan(int type) {
- this.type = type;
- }
- @Override
- public void onClick(View widget) {
- switch (type) {
- case TYPE_PRIVACY_SPAN: {
- signUpPresenter.showPrivacyPolicy();
- }
- break;
- case TYPE_TERMS_SPAN: {
- signUpPresenter.showTermsOfUse();
- }
- break;
- default:
- break;
- }
- }
- @Override
- public void updateDrawState(TextPaint ds) {
- super.updateDrawState(ds);
- if (type != TYPE_END) {
- ds.setColor(ContextCompat.getColor(SignUpActivity.this, R.color.color_grey_959595));
- } else {
- ds.setColor(ContextCompat.getColor(SignUpActivity.this, android.R.color.transparent));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement