Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan09811 authored Feb 8, 2024
1 parent 8f23dc2 commit 4801131
Showing 1 changed file with 1 addition and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.content.Intent;
import android.os.Bundle;
import android.view.GestureDetector;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
Expand All @@ -23,10 +22,9 @@
import com.panda3ds.pandroid.view.PandaGlSurfaceView;
import com.panda3ds.pandroid.view.PandaLayoutController;

public class GameActivity extends BaseActivity implements GestureDetector.OnGestureListener {
public class GameActivity extends BaseActivity {
private final DrawerFragment drawerFragment = new DrawerFragment();
private final AlberInputListener inputListener = new AlberInputListener(this::onBackPressed);
private GestureDetector gestureDetector;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
Expand Down Expand Up @@ -60,28 +58,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
getSupportFragmentManager().beginTransaction().replace(R.id.drawer_fragment, drawerFragment).commitNow();
}

// Initialize gesture detector
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
float distanceX = e2.getX() - e1.getX();
float distanceY = e2.getY() - e1.getY();
if (Math.abs(distanceX) > Math.abs(distanceY) && distanceX > 0) {
//// Open the drawer when swiping from left to right
if (drawerFragment.isOpened()) {
} else {
drawerFragment.open();
}
return true;
}
return false;
}

@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
gestureDetector.onTouchEvent(ev);
return super.dispatchTouchEvent(ev);
}

@Override
protected void onResume() {
super.onResume();
Expand Down

0 comments on commit 4801131

Please sign in to comment.