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 7165575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:16:22+00:00 2026-05-28T14:16:22+00:00

I have a SeekBar inside a HorizontalScrollView and am finding it very hard to

  • 0

I have a SeekBar inside a HorizontalScrollView and am finding it very hard to grab the handle and move it. If I don’t touch exactly on the handle, the HorizontalScrollView will receive and consume the touch event. Is there a way to increase the priority of the SeekBar so it will have the normal “range” for touch events or is this just a bad idea/design and I should avoid it?

  • 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-28T14:16:23+00:00Added an answer on May 28, 2026 at 2:16 pm

    I “solved” it by doing the following:

    NOTE: My scroll layout is lockable, as explained here: https://stackoverflow.com/a/5763815/1067721 (just pay atention to my answer a little bit lower, I found that bit to be important)

    I then wrapped my seekbar in a FrameLayout able to intercept touch events:

    public class InterceptFrameLayout extends FrameLayout {
    
        private OnTouchListener mListener;
    
        public InterceptFrameLayout(Context context) {
            super(context);
        }
    
        public InterceptFrameLayout(Context context, AttributeSet attrs) {
            super(context, attrs);
        }
    
        public InterceptFrameLayout(Context context, AttributeSet attrs, int defStyle) {
            super(context, attrs, defStyle);
        }
    
        @Override
        public boolean onInterceptTouchEvent (MotionEvent ev) {
            return onTouchEvent(ev);
        }
    
        @Override
        public void setOnTouchListener (View.OnTouchListener l) {
            mListener = l;
        }
    
        @Override
        public boolean onTouchEvent (MotionEvent ev) {
            if (mListener != null) {
                return mListener.onTouch(this, ev);
            } else {
                return super.onTouchEvent(ev);
            }
        }
    }
    

    And then, on my Fragment, I implemented the listener and let the SeekBar consume the event:

        volWrapper.setOnTouchListener(new OnTouchListener() {           
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                switch (event.getAction()) {
                    case MotionEvent.ACTION_DOWN: {
                        mHostingScroll.setScrollable(false);
                        break;
                    }
                    case MotionEvent.ACTION_UP: {
                        mHostingScroll.setScrollable(true);
                        break;
                    }
                }
                return volumeBar.onTouchEvent(event);
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to have the seekbar move only when the thumb is moved.
I have SeekBar with 3 value (left, on center and right) and I will
I have a player app with a seekbar for volume control inside. I use
I have a Seekbar and I want to save the state to database when
What I have is a seekbar which is controlled by buttons rather than a
So I have a Player view with seekbar and play/pause/rewind, etc. buttons, which are
I have a ClassCastException being thrown saying that I'm trying to cast a SeekBar
I have SeekBar s in an application which operate as expected and return values
Possible Duplicate: Android: Set interval in SeekBar I have a seekbar with max value
I'm trying to move the position of the seekbar using a button. Basically I

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.