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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:42:42+00:00 2026-05-12T06:42:42+00:00

Im trying to change the icon on the handle when i try to open

  • 0

Im trying to change the icon on the handle when i try to open the slidingdrawer.
When I extract the handle from the view and sets the onclicklistener or ontouchlistener it seems to never get trigget.

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    SlidingDrawer drawer = (SlidingDrawer)findViewById(R.id.drawer_landscape);

    ImageView handle = (ImageView)findViewById(R.id.handle_l);
    handle.setFocusable(true);

    handle.setOnClickListener(new OnClickListener(){


        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            Log.i("test","onClick");
        }

    });


}

And my XML

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:id="@+id/base_frame_layout"
     android:layout_gravity="bottom"
     >        
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
        <TextView  
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content" 
            android:text="@string/hello"
            />
    </LinearLayout>

        <SlidingDrawer
             android:id="@+id/drawer_landscape"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:handle="@+id/handle_l"
             android:content="@+id/content"
             android:orientation="vertical"
             android:visibility="visible"
        >

            <ImageView
                android:id="@+id/handle_l"
                android:layout_height="50px"
                android:layout_width="64px"
                android:padding="0px"
                android:src="@drawable/icon"
            />

            <TextView
                android:id="@+id/content" 
                android:text="content" 
                android:layout_height="50px"
                android:layout_width="64px"
            />                  

         </SlidingDrawer>       

</FrameLayout>

I was hoping this code should log “onClick” message, but it doesn’t.

Any ideas?

  • 1 1 Answer
  • 2 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-12T06:42:42+00:00Added an answer on May 12, 2026 at 6:42 am

    I found it, it was pritty easy… I just need to setOnDrawerScrollListener on my drawer.

    than implement the 2 methods onScrollEnded and onScrollStarted.

        mSlidingDrawer.setOnDrawerScrollListener(new OnDrawerScrollListener(){
    
            @Override
            public void onScrollEnded() {
                // TODO Auto-generated method stub
                Log.i("ddd","onScrollEnded slider");
                slider_animation.reverseTransition(HANDLE_ANIMATION_SPEED);
            }
    
            @Override
            public void onScrollStarted() {
                // TODO Auto-generated method stub
                Log.i("ddd","onScrollStarted slider");
                slider_animation.startTransition(HANDLE_ANIMATION_SPEED);
            }
    
    });
    

    I rather use an animation on the handle instead of changing the Image bacause of the flickering.

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

Sidebar

Related Questions

I'm trying to change the state of a Gtk status icon from a thread
I’m trying to change the tabbar icon color from default blue to red, but
I'm trying to change the application icon from default to something else. So what
I'm trying to change the content of a ContentPresenter to one of my View
I am trying to change the marker icon and put my own icon with
Quick question I'm trying to change my app's launch icon but it doesn't seem
I'm trying to work out whether it is possible to change the icon based
Trying to change the marker from an overlay item I noticed the setMarker() makes
I'm using NetBeans, trying to change the familiar Java coffee cup icon to a
Is there a way to change a WPF assembly icon from code? I'm not

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.