How to set Navigation Drawer icons to the right side of the Item Texts?

后端 未结 4 771
旧时难觅i
旧时难觅i 2021-01-24 05:33

My Project Screenshot: My Project

My Target Design: My Target

I have created a (right to left) navigation drawer. It\'s working fine but when I\'m trying to move

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-24 06:00

    I am not sure if ActionBar provide such feature . But you can do it by just using a menu item . Create a Menu on extreme right:

     
    

    Then OnmenuItem click Open/Close the Drawer:-

     @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.menu_action_Drawer:
                if (drawerLayout.isDrawerOpen(GravityCompat.END)) {
                    drawerLayout.closeDrawer(GravityCompat.END);
                } else {
                    drawerLayout.openDrawer(GravityCompat.END);
                }
                break;
        }
    }
    

提交回复
热议问题