Make swipe width dependent on minimum screen size

This commit is contained in:
M66B 2021-02-28 11:33:12 +01:00
parent 4d82405ad9
commit bd5df69465
1 changed files with 3 additions and 1 deletions

View File

@ -30,7 +30,9 @@ public class SwipeListener implements View.OnTouchListener {
private final GestureDetector gestureDetector;
SwipeListener(final Context context, final ISwipeListener listener) {
final int width = context.getResources().getDisplayMetrics().widthPixels;
final int width = Math.min(
context.getResources().getDisplayMetrics().widthPixels,
context.getResources().getDisplayMetrics().heightPixels);
final int MOVE_THRESHOLD = width / 3;
final int SPEED_THRESHOLD = width / 2;