Skip to content

Menu: Listener

三木思 edited this page Nov 6, 2018 · 6 revisions

This library has three listeners that can listen to menu events.

TimoMenuListener

timoBuilder.setTimoMenuListener(new TimoMenuListener() {
                    @Override
                    public void onShow() {
                       //When the menu is fully showed, will call this method.
                    }

                    @Override
                    public void onDismiss() {
                        //When the menu is fully dismissed, will call this method.
                    }
                })

OnTimoItemClickListener

timoBuilder.setTimoItemClickListener(new OnTimoItemClickListener() {
    @Override
    public void onItemClick(int row, int index, TimoItemView view) {
        //When the item is on click, will call this call back
        //row: the row of the menu
        //index: the index of the row
        //view: the clicked item view
    }
})

OnTimoItemTouchListener

 timoBuilder.setTimoItemTouchListener(new OnTimoItemTouchListener() {
                    @Override
                    public boolean onItemTouch(int row, int index, MotionEvent event, TimoItemView 				view) {
       			//When the item is on touch, will call this call back
                        //row: the row of the menu
                        //index: the index of the row
                        //view: the touched item view
                        
                        //Here you can customize your click animation
                        return false;
                    }
                })

Clone this wiki locally