X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fui%2FOnSwipeTouchListener.java;h=b6223043cc085f356a263a3a89fef71d6911e279;hp=ecc00959014493a14b4afc3d7ca71b3579464db7;hb=a9f669055c4458c54e3ece1d2896e5ce0c28b920;hpb=0bbdc409d82da31324c031f36607510f17d992e6 diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/OnSwipeTouchListener.java b/app/src/main/java/net/ktnx/mobileledger/ui/OnSwipeTouchListener.java index ecc00959..b6223043 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/OnSwipeTouchListener.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/OnSwipeTouchListener.java @@ -1,29 +1,30 @@ /* - * Copyright © 2018 Damyan Ivanov. - * This file is part of Mobile-Ledger. - * Mobile-Ledger is free software: you can distribute it and/or modify it + * Copyright © 2019 Damyan Ivanov. + * This file is part of MoLe. + * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your opinion), any later version. * - * Mobile-Ledger is distributed in the hope that it will be useful, + * MoLe is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License terms for details. * * You should have received a copy of the GNU General Public License - * along with Mobile-Ledger. If not, see . + * along with MoLe. If not, see . */ package net.ktnx.mobileledger.ui; import android.content.Context; -import android.util.Log; import android.view.GestureDetector; import android.view.GestureDetector.SimpleOnGestureListener; import android.view.MotionEvent; import android.view.View; +import static net.ktnx.mobileledger.utils.Logger.debug; + public abstract class OnSwipeTouchListener implements View.OnTouchListener { public final GestureDetector gestureDetector; @@ -37,7 +38,7 @@ public abstract class OnSwipeTouchListener implements View.OnTouchListener { @Override public boolean onDown(MotionEvent e) { - Log.d("sw-l", "onDown"); + debug("sw-l", "onDown"); return false; } @@ -45,7 +46,7 @@ public abstract class OnSwipeTouchListener implements View.OnTouchListener { public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { boolean result = false; - Log.d("sw-l", "onFling"); + debug("sw-l", "onFling"); try { float diffX = e2.getX() - e1.getX(); @@ -53,11 +54,11 @@ public abstract class OnSwipeTouchListener implements View.OnTouchListener { if (Math.abs(diffX) > Math.abs(diffY)) { if (Math.abs(diffX) > SWIPE_THRESHOLD && Math.abs(velocityX) > SWIPE_VELOCITY_THRESHOLD) { if (diffX > 0) { - Log.d("sw-l", "calling onSwipeRight"); + debug("sw-l", "calling onSwipeRight"); onSwipeRight(); } else { - Log.d("sw-l", "calling onSwipeLeft"); + debug("sw-l", "calling onSwipeLeft"); onSwipeLeft(); } } @@ -83,7 +84,7 @@ public abstract class OnSwipeTouchListener implements View.OnTouchListener { public void onSwipeRight() {} public void onSwipeLeft() { - Log.d("sw-l", "LEFT"); + debug("sw-l", "LEFT"); } public void onSwipeUp() {} public void onSwipeDown() {}