Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How Can I Add some onclicklisteners over the drawer?? #13

Open
hylarucoder opened this issue Apr 3, 2015 · 3 comments
Open

How Can I Add some onclicklisteners over the drawer?? #13

hylarucoder opened this issue Apr 3, 2015 · 3 comments

Comments

@hylarucoder
Copy link

You code well!

And i have a very simple question to ask you.

app/src/main/java/io/github/froger/instamaterial/ui/adapter/GlobalMenuAdapter.java

you set the drawer items , but how can i add a click event?

@HarlonWang
Copy link

you can try this : GlobalMenuView.setOnItemClickListener....

@hylarucoder
Copy link
Author

Oh ,Thank You.

@randhika
Copy link

@BaseActivity
private void setupDrawer() {
DrawerMenuView menuView = new DrawerMenuView(this);
menuView.setOnHeaderClickListener(this);
drawerLayout = DrawerLayoutInstaller.from(this)
.drawerRoot(R.layout.drawer_root)
.drawerLeftView(menuView)
.drawerLeftWidth(Utils.dpToPx(300))
.withNavigationIconToggler(getToolbar())
.build();
menuView.setOnItemClickListener(new DrawerItemClickListener());
}
private class DrawerItemClickListener implements ListView.OnItemClickListener {
@OverRide
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
int mPosition = (position - 1);
selectedItem(mPosition);
drawerLayout.closeDrawer(Gravity.START);
}
}

protected void selectedItem(int selectedItem){}

@MainActivity
@OverRide
protected void selectedItem(int selectedItem) {
Toast.makeText(MainActivity.this, "Position = "+selectedItem, 1).show();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants