1
0
mirror of https://github.com/accelforce/Yuito synced 2024-12-22 21:28:08 +01:00
Yuito-app-android/app/src/test/java
Nik Clayton 5e8a63a046
Throttle UI actions instead of debouncing (#3651)
Introduce Flow<T>.throttleFirst(). In a flow this emits the first value,
and each value afterwards that is > some timeout after the previous
value.

This prevents accidental double-taps on UI elements from generating
multiple-actions.

The previous code used debounce(). That has a similar effect, but with
debounce() the code has to wait until after the timeout period has
elapsed before it can process the action, leading to an unnecessary
UI delay.

With throttleFirst a value is emitted immediately, there's no need
to wait. It's subsequent values that are potentially throttled.
2023-06-11 13:34:22 +02:00
..
android/text add ktlint plugin to project and apply default code style (#2209) 2021-06-28 21:13:24 +02:00
com/keylesspalace/tusky Throttle UI actions instead of debouncing (#3651) 2023-06-11 13:34:22 +02:00