mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-06 18:57:26 +01:00
5e3eaafe26
Slidr works by adding its own view in the hierarchy and listening to touch events in `onInterceptTouchEvent`. Once it detects movement in the correct direction, it returns `true` and handles all the events itself. Adding scrollable view detection to Slidr would solve the problem, but it is not possible and would probably have performance impact. Fortunately Slidr does not intercept the very first event, which is ACTION_DOWN, and it reaches scrollable view. So the scrollable view itself can decide if it should disallow the swipe. This also has a performance benefit over `OnScrollChangedListener` because the listener is triggered for every scroll of every view even if the child we are interested in did not scroll. On the other hand `on(Intercept)TouchEvent` is triggered only when the view is touched. There is a possibility that swipe won't be unlocked if view never receives ACTION_UP or ACTION_CANCEL. However the docs say nothing about the probability of this happening. Anyways, one possible solution is to post a runnable that will unlock swipe soon after locking. |
||
---|---|---|
.. | ||
src | ||
build.gradle | ||
proguard-rules.pro |