Skip to content

Commit

Permalink
remove deprecated GestureDetectorCompat
Browse files Browse the repository at this point in the history
  • Loading branch information
TBog committed May 31, 2024
1 parent 04c0c09 commit 28c4f64
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/src/main/java/rocks/tbog/tblauncher/LiveWallpaper.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.GestureDetectorCompat;
import androidx.preference.PreferenceManager;

import java.util.Locale;
Expand Down Expand Up @@ -53,7 +52,7 @@ public class LiveWallpaper {
private boolean wpReturnCenter = true;
private boolean wpStickToSides = false;

private GestureDetectorCompat gestureDetector = null;
private GestureDetector gestureDetector = null;
private final GestureDetector.SimpleOnGestureListener onGestureListener = new GestureDetector.SimpleOnGestureListener() {
@Override
public void onLongPress(@NonNull MotionEvent e) {
Expand Down Expand Up @@ -175,7 +174,7 @@ public void onCreateActivity(TBLauncherActivity mainActivity) {
View root = mainActivity.findViewById(R.id.root_layout);
root.setOnTouchListener(this::onRootTouch);

gestureDetector = new GestureDetectorCompat(mainActivity, onGestureListener);
gestureDetector = new GestureDetector(mainActivity, onGestureListener);
gestureDetector.setIsLongpressEnabled(true);
GestureDetectorHelper.setGestureDetectorTouchSlop(gestureDetector, UISizes.dp2px(mainActivity, GD_TOUCH_SLOP_DP));
}
Expand Down

0 comments on commit 28c4f64

Please sign in to comment.