FadingTextView

class FadingTextView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : AppCompatTextView

Author

Tomer Rosenfeld AKA rosenpin Created by rosenpin on 12/8/16.

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun fadeTo(position: Int)

Fades text to position in provided array and pauses Consider calling pause() method before calling this function to avoid overriding currently active animation

Link copied to clipboard

This method should only be used to forcefully apply timeout changes It will dismiss the currently queued animation change and start a new animation

Link copied to clipboard
fun pause()

Pauses the animation Should only be used if you notice @see onDetachedFromWindow is not being executed as expected

Link copied to clipboard
fun restart()

Restarts the animation Only use this to restart the animation after stopping it using {@see stop}

Link copied to clipboard
fun resume()

Resumes the animation Should only be used if you notice @see onAttachedToWindow} is not being executed as expected

Link copied to clipboard
fun setTexts(texts: Array<String>)

Sets the texts to be shuffled using a string array

fun setTexts(@ArrayRes texts: Int)

Sets the texts to be shuffled using a string array resource

Link copied to clipboard
fun setTimeout(timeout: Duration)

Sets the length of time to wait between text changes in specific time units

Link copied to clipboard
fun shuffle()

Shuffle the strings Each time this method is ran, the order of the strings will be randomized After you set texts dynamically you will have to call shuffle again

Link copied to clipboard
open override fun startAnimation(animation: Animation)

This method is overridden to prevent animations from starting when the view is not shown If you want to start the animation manually, use the @see resume method

Link copied to clipboard
fun stop()

Stops the animation Unlike the pause function, the stop method will permanently stop the animation until the view is restarted

Properties

Link copied to clipboard