mirror of
https://github.com/ankidroid/Anki-Android.git
synced 2024-09-20 20:03:05 +02:00
0cf4ff0b7b
This changes the way snackbars are created. Instead of calling a function with many arguments, the new methods consistently only take text, duration, and a builder block--whether it is called on an activity or a view. I chose builder pattern instead of call chaining as it makes sure that the snackbar is actually shown in the end. Note that if showSnackbar is called on an Activity that does not have a view with id root_layout--which does not allow proper placing and interaction with snackbars--a runtime exception will be intentionally thrown in a debug build. Release builds will show a toast with the contents of the snackbar instead. Some durations were changed, notably, Card browser's snackbar that allow searching in all decks now stay until dismissed. This is something user may want to do at any time later; and if the snackbar is in the way, they can dismiss it by swiping. In com.ichi2.anki.CoroutineHelpersKt.launchCatchingTask, a few unrelated to this change TODO comments were added. |
||
---|---|---|
.. | ||
src | ||
.gitignore | ||
build.gradle | ||
kotlinMigration-lint.gradle |