jaychang0917 / SimpleText

A simple spannable string helper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pressed Text Color is shown instead of Text Color when fragment is popped from backstack

azri92 opened this issue · comments

Snippet in SignInFragment.kt

        val signUpText = SimpleText.from(signUpTextView.text)
        signUpText.apply {
            first(getString(R.string.sign_up)
            textColor(R.color.blue)
            underline()
            pressedTextColor(R.color.red)
            onClick(signUpTextView) { _, _, _ ->
                fragmentManager?.let {
                    goToRegisterFragment()
                }
            }
        }
        signUpTextView.text = signUpText

Reproduction:

  1. TextView has text "New user? Sign up".
  2. Click "Sign up" and a new fragment is shown.
  3. Click back, and SignInFragment is popped from backstack.
  4. "Sign up" shows as red color instead of blue.

Happens on:

  • Samsung J1 Ace (Android 5.1.1)
  • OnePlus One (Android 6.0.1)

Does not happen on Xiaomi Mi5 (Android 7.0)