Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. private SpannableString getClickableString() {
  2. SpannableString agreementText = new SpannableString(getString(R.string.review_no_reviews));
  3. ClickableSpan clickableSpan = new ClickableSpan() {
  4. @Override
  5. public void onClick(@NotNull View textView) {
  6. if (user.getLogin() == null) {
  7. LoginActivity.startActivityFromProduct(ProductActivity.this);
  8. } else {
  9. commentForm.setVisibility(View.VISIBLE);
  10. addFirstReviewText.setVisibility(View.GONE);
  11. }
  12. }
  13. };
  14. agreementText.setSpan(clickableSpan, 33, 55, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
  15. return agreementText;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement