pawegio / KAndroid

Kotlin library for Android
Apache License 2.0
896 stars 81 forks source link

Multiple toasts or toasts during dismissing #60

Closed Papashkin closed 5 years ago

Papashkin commented 5 years ago

Hello, At first, thank you for your job related library. But unfortunately I couldn't find the solution for cancel the toasts. It'll be a good feature in cases when I make multiple toasts or the activity/fragment dismissing and toast's showing in a same time. What do you think about it?

illuzor commented 5 years ago

I couldn't find the solution for cancel the toasts.

val myToast = toast("hello")
myToast.cancel()
Papashkin commented 5 years ago
val myToast = toast("hello")
myToast.cancel()

The toast() method returns the Unit object, but only the Toast object can use cancel() method. Or you supposed that I should use the "Class never succeeds" suppress?

But my project uses the version 0.8.7 of KAndroid. Could it be a reason of the issue?

pawegio commented 5 years ago

@Papashkin toast() function returns Toast instance since v0.8.8, see: e2297c6af2a7626edf1c0884eb464d533c41b9c7

Papashkin commented 5 years ago

toast() function returns Toast instance since v0.8.8,

@pawegio Thank you for clarification of this issue.