Coder Social home page Coder Social logo

drawer_menu actions about instamaterial HOT 3 CLOSED

frogermcs avatar frogermcs commented on June 23, 2024
drawer_menu actions

from instamaterial.

Comments (3)

pizzolante avatar pizzolante commented on June 23, 2024

this in BaseActivity have worked for me

protected void setupToolbar() {
    if (toolbar != null) {
        setSupportActionBar(toolbar);
        toolbar.setNavigationIcon(R.drawable.ic_menu_white);

        navigationView.setNavigationItemSelectedListener(
            new NavigationView.OnNavigationItemSelectedListener() {
                @Override
                public boolean onNavigationItemSelected(MenuItem menuItem) {
                    int position = -1;
                    switch (menuItem.getItemId()) {
                        case R.id.menu_foo_1:
                            #
                        break;
                    }
                    drawerLayout.closeDrawer(Gravity.LEFT);



                    return false;
                }
            });


}
}

from instamaterial.

tinasherobert avatar tinasherobert commented on June 23, 2024

*Note *, Replace this on BaseDrawerActivity

@Override
    protected void setupToolbar() {
        super.setupToolbar();
        if (getToolbar() != null) {
            getToolbar().setNavigationOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    drawerLayout.openDrawer(Gravity.LEFT);
                }
            });
            vNavigation.setNavigationItemSelectedListener(
                    new NavigationView.OnNavigationItemSelectedListener() {
                        @Override
                        public boolean onNavigationItemSelected(MenuItem menuItem) {
                            int position = -1;
                            switch (menuItem.getItemId()) {
                                case R.id.news_feed:
                                    Snackbar.make(getCurrentFocus(), "Clicked!", Snackbar.LENGTH_SHORT).show();
                                    
                                    break;
                            }
                            drawerLayout.closeDrawer(Gravity.LEFT);
                            return false;
                        }
                    });
        }
    }

from instamaterial.

gdaelexxer avatar gdaelexxer commented on June 23, 2024

thank you let me do that

On Wed, May 11, 2016 at 1:43 PM, Tinashe [email protected] wrote:

*Note *, Replace this on BaseDrawerActivity

@OverRide
protected void setupToolbar() {
super.setupToolbar();
if (getToolbar() != null) {
getToolbar().setNavigationOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
drawerLayout.openDrawer(Gravity.LEFT);
}
});
vNavigation.setNavigationItemSelectedListener(
new NavigationView.OnNavigationItemSelectedListener() {
@OverRide
public boolean onNavigationItemSelected(MenuItem menuItem) {
int position = -1;
switch (menuItem.getItemId()) {
case R.id.news_feed:
Snackbar.make(getCurrentFocus(), "Clicked!", Snackbar.LENGTH_SHORT).show();

                                break;
                        }
                        drawerLayout.closeDrawer(Gravity.LEFT);

                        return false;
                    }
                });

    }
}


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#20 (comment)

from instamaterial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.