EverythingMe / overscroll-decor

Android: iOS-like over-scrolling effect applicable over almost all scrollable Android views.
BSD 2-Clause "Simplified" License
2.85k stars 400 forks source link

Fix counter-orientation-direction operations on some devices #77

Open Krupson opened 4 years ago

Krupson commented 4 years ago

I have noticed that on some devices the counter-orientation-direction operations does not work. After short debugging I have noticed that dx and dy are equal to 0 at the beginning of dragging on these devices and therefore it's not triggering the Math.abs(dx) > Math.abs(dy) condition. In order to fix this issue I have added zero check on dx and dy.

Tested on Samsung Galaxy S8, Samsung Galaxy S20+, Samsung Galaxy A6, Sony Xperia Z2, Huawei P40 Lite and Google Pixel 4. Problem occured only on last two of them. Now it works good on all these devices.