- This project is textView for marquee that stop when text is located end of view.
- Min Android SDK : 21 (Lollipop)
- Add dependency
implementation 'io.reactivex.rxjava2:rxkotlin:2.4.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.11'
- Code
startWithCompletableButton.setOnClickListener {
marqueeTextView.awaitStartMarqueeAnimation(
delayMilliseconds = 500L,
durationMilliseconds = 1000L
).subscribe({
showCompleteToast()
}, { /* do nothing*/ })
}
-
Add dependency
- Nothing
-
Code
startAsyncButton.setOnClickListener {
marqueeTextView.startMarqueeAnimationAsync(
delayMilliseconds = 500L,
durationMilliseconds = 1000L
) {
showCompleteToast()
}
}
- Add dependency
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.1'
- Code
startCoroutineButton.setOnClickListener {
val deferred = marqueeTextView.awaitMarqueeAnimation(
delayMilliseconds = 500L,
durationMilliseconds = 1000L
)
CoroutineScope(Dispatchers.Main).launch {
deferred.await()
showCompleteToast()
}
}