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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:00:13+00:00 2026-05-25T13:00:13+00:00

Okey, so I’ve implemented a button on a Sliding drawer in a android application

  • 0

Okey, so I’ve implemented a button on a Sliding drawer in a android application I’m building. The only problem is that when I press the button the whole sliding drawer is pressed and it slides up.

I know I can disable ‘press to slide up’ in the XML, but that does not seem to work as the sliding drawer still is pressed just without the slide up.

If I call the slidingDrawer.lock(); function the button actually works but then the sliding drawer can’t slide up or even be pressed up.

Any one have a simple solution to this problem?

  • 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-25T13:00:14+00:00Added an answer on May 25, 2026 at 1:00 pm

    If I understand well you have added buttons on your SlidingDrawer handle and you want them to work like buttons when the user press them with keeping a standard SlidingDrawer behaviour when the handle is pressed/dragged?

    I just solved a similar problem.

    My Handle was looking something like that:

    Capture of the layout

    It’s composed of two buttons and a center TextView which will be the real handle (reacting as a standard SlidingDrawer handle).

    To make the buttons work independently of the SlidingDrawer I changed a bit of source code in the onInterceptTouchEvent method of the standard SlidingDrawer.java class (copy paste the source file from the android code source):

    public boolean onInterceptTouchEvent(MotionEvent event) {
        //...
        final Rect frame = mFrame;
        final View handle = mHandle;
    
        // original behaviour
        //mHandle.getDrawingRect(frame);
    
        // New code
        View trackHandle = mTrackHandle;
        // set the rect frame to the mTrackHandle view borders instead of the hole handle view
    
        // getParent() => The right and left are valid, but we need to get the parent top and bottom to have absolute values (in screen)
        frame.set(trackHandle.getLeft(), ((ViewGroup) trackHandle.getParent()).getTop(), trackHandle.getRight(), ((ViewGroup) trackHandle.getParent()).getBottom());
    
    
    
        if (!mTracking && !frame.contains((int) x, (int) y)) {
            return false;
        }
        //...
    }
    

    I also added a setter for the mTrackHandle attribute to set, during the activity creation, the real hanlde to use:

    protected void onCreate(Bundle savedInstanceState) {
        //...
        mSlidingDrawer.setTrackHandle((View) findViewById(R.id.menu_handle_TextView_Title));
        //...
    }
    

    After that you can set standard listener on your two buttons. They will work like a charm.

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

Sidebar

Related Questions

Okey so, im kind of new to JBoss. My problem is that i dont
Okey, here it goes. I have a block of code that repeats it self
Okey, this is my problem. I have one service class where Ive managed to
Okey I have a class that prints the board and another class that prints
I am writing a WPF application that has an optional dependency on an API
Okey, so this is my problem. I want to use mod_rewrite to make nice
Okey dokey, I have a jQuery function that checks the height of 2 divs
see by writting some code here we select that code & press ctrl +
Okey, here is my problem, im calling a bunch of different propertys named K0
Okey, so this is my problem. I have a page structure saved into a

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.