I am making an android application in which I am using onScroll gestures to increase or decrease brightness on Upward and downward scroll and on left to right scroll I am increasing and decreasing Song duration onTouch on screen, when I scroll upward and downward on screen its working fine but a little bit interruption with left to right scroll which creates problem. When I scroll left to right it works fine but some interruptions with up to down gestures which is used on screen touch. Please tell me what should I do????
Here is my code.
if (Math.abs(deltaX) < Math.abs(deltaY)) {
if (Math.abs(deltaY) > SWIPE_THRESHOLD) {
if (deltaY > leftSidelastX) {
leftSidelastX = deltaY;
upBrightness();
Log.i("", "Left side Slide up");
} else {
leftSidelastX = deltaY;
downBrightness();
Log.i("", "Left side Slide down");
}
}
} else {
if (Math.abs(deltaX) > SWIPE_THRESHOLD) {
if (deltaX > leftSidelastX) {
leftSidelastX = deltaX;
leftScroll();
Log.i("", "Left side Slide left");
} else {
leftSidelastX = deltaX;
rightScroll();
Log.i("", "Left side Slide right");
}
}
}