Yalantis / GuillotineMenu-Android

Neat library, that provides a simple way to implement guillotine-styled animation
https://yalantis.com/
2.72k stars 495 forks source link

menu icon listener #17

Closed demo-Ashif closed 8 years ago

demo-Ashif commented 8 years ago

How to implement listener for menu icons like navigation drawer ?

TeeRawk commented 8 years ago

@demo-Ashif Hello, if you mean the on click listener for items in the menu it self , then simply add your menu layout to the root like it's shown in the sample , and then find the view you need by id , and set on click listener.

        View guillotineMenu = LayoutInflater.from(this).inflate(R.layout.guillotine, null);
        root.addView(guillotineMenu);
        LinearLayout profile = (LinearLayout) findViewById(R.id.profile_group);
        profile.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
             // your action  
            }
        });