Created
August 10, 2019 10:02
-
-
Save NezSpencer/0acfe534d2d1e46e4964cc9e330b80b9 to your computer and use it in GitHub Desktop.
Utility methods
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun createClickSpan(action: String) = when (action.toLowerCase()) { | |
"accepttc" -> CustomClickSpan({ showToast("Terms ACCEPTED!") }, Color.RED) | |
"opentc" -> CustomClickSpan({ showToast("Terms and condition OPENED!") }, Color.BLUE, true) | |
else -> throw NotImplementedError("action $action not implemented") | |
} | |
private fun showToast(prompt: String) = Toast.makeText(this, prompt, Toast.LENGTH_SHORT).show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment