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

  • Home
  • SEARCH
  • 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 8143101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:00:29+00:00 2026-06-06T13:00:29+00:00

I had implemented a custom Gallery with custom Adapter. My Requirement is that however

  • 0

I had implemented a custom Gallery with custom Adapter.
My Requirement is that however fast or slow does the user operates fling on the gallery only one item should change in the gallery.
I tried to override the Gallery’s onFling method

@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
    float velocityY) {
//Log.e("VELOCITY ORIGINAL", ""+velocityX);
if (velocityX > 500) {//moving left
    velocityX = 500.0f;
}else if(velocityX < -500){//moving right
    velocityX = -500.0f;
}
//Log.e("VELOCITY MODIFIED", ""+velocityX);
return super.onFling(e1, e2, velocityX, velocityY);
}

But this did not produce desired results as sometimes it would flick one item and some times it won’t.

Then I tried

@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
    return false;
}

But this completely disabled fling operation.

What could be the solution?

  • 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-06-06T13:00:31+00:00Added an answer on June 6, 2026 at 1:00 pm

    For that you have to override the onFling method in the Gallery class Try this and just Use ExtendedGallery instead of Gallery

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

Sidebar

Related Questions

I've got a UITableView with custom tablecells. First I had a version which implemented
I have implemented mail composer. But it opens mail composer whenever user had implemented
I have implemented antiforgery token on my login page. Now I had one user
I've implemented a custom CursorAdapter . This adapter takes data from a Cursor and
If I had a custom class that inherits from Collection called LookUpValueCollection that handle
I have a form with 3 text fields and 3 checkboxes. I had implemented
Since short time ago, Google + has had hangouts implemented on the iPhone. You
Need some help with this problem in implementing with XSLT, I had already implemented
I had this jquery idle timeout script implemented into a site, thanks to ehynds
I had started working on GPGPU some days ago and successfully implemented cholesky factorization

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.