Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7506565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:18:37+00:00 2026-05-29T22:18:37+00:00

I am using Gesture Listner to acheive Swipe screen navigation. But it is not

  • 0

I am using Gesture Listner to acheive Swipe screen navigation. But it is not so comfortable that I need to swipe multiple time to navigate to next or previous screen. What are the proper values for Velocity, Off path and Min Distance.

Please find below is my code:

private static final int SWIPE_MIN_DISTANCE = 50;
private static final int SWIPE_MAX_OFF_PATH = 300;
private static final int SWIPE_THRESHOLD_VELOCITY = 200;

class MyGestureDetector extends SimpleOnGestureListener {
    @Override
    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
        try {
            if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH)
                return false;
            // right to left swipe
            if(e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
                viewFlipper.setInAnimation(slideLeftIn);
                viewFlipper.setOutAnimation(slideLeftOut);
                viewFlipper.showNext();    
                configDisplay();
            }  else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
                viewFlipper.setInAnimation(slideRightIn);
                viewFlipper.setOutAnimation(slideRightOut);
                viewFlipper.showPrevious();
                configDisplay();
            }
        } catch (Exception e) {
            // nothing
        }
        return false;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:18:39+00:00Added an answer on May 29, 2026 at 10:18 pm

    These links helped me achieve the solution:

    GestureDetector.SimpleOnGestureListener

    implementing-the-pinch-zoom-gestur

    Android-pinch

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I'm looking for jQuery HTML scroller plugin that will have swipe navigation on mobile
Google docs app uses swipable gesture based tabs using which you can navigate to
I am using gesture detector to catch flings and using a view flipper to
I need to catch two different swipping gestures using UISwipeGestureRecognizer (for example, UISwipeGestureRecognizerDirectionRight and
Using ASP.NET MVC there are situations (such as form submission) that may require a
I am using gesture recognizers: Initialize in viewDidLoad : UILongPressGestureRecognizer *longPressRecognizer = [[UILongPressGestureRecognizer alloc]
How to use NSUndoManager to rotate a UIImageView using rotation gesture? This is my
I have a 2d map that the user can zoom and pan using the
I'm implementing the pinch gesture in my application using GestureListener in silverlight. The problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.