- ANDROID CHANGE SELECTED TEXT COLOR IN NAVIGATION DRAWER ANDROID
- ANDROID CHANGE SELECTED TEXT COLOR IN NAVIGATION DRAWER CODE
However, if you use our designed dashboard then you have to make some changes in it.Īs a result, change the parent layout of the main activity of the dashboard with the following code.
ANDROID CHANGE SELECTED TEXT COLOR IN NAVIGATION DRAWER CODE
In between the group tag, we have to place item tag with id, icon, and title of the item.Ĭode given below PGdyb3VwPiAgIAogICAgICAgIDxpdGVtCiAgICAgICAgICAgIGFuZHJvaWQ6aWQ9IkAraWQvbmF2X2hvbWUiCiAgICAgICAgICAgIGFuZHJvaWQ6aWNvbj0iQGRyYXdhYmxlL2hvbWVfaWNvbiIKICAgICAgICAgICAgYW5kcm9pZDp0aXRsZT0iSG9tZSIgLz4KCiAgICAgICAgPGl0ZW0KICAgICAgICAgICAgYW5kcm9pZDppZD0iQCtpZC9uYXZfY3ljbGUiCiAgICAgICAgICAgIGFuZHJvaWQ6aWNvbj0iQGRyYXdhYmxlL2ljb25zOF9jeWNsaW5nXzUwMCIKICAgICAgICAgICAgYW5kcm9pZDp0aXRsZT0iQ3ljbGluZyIgLz4KCiAgICAgICAgPGl0ZW0KICAgICAgICAgICAgYW5kcm9pZDppZD0iQCtpZC9uYXZfYnVzIgogICAgICAgICAgICBhbmRyb2lkOmljb249IkBkcmF3YWJsZS9pY29uczhfYnVzXzUwMCIKICAgICAgICAgICAgYW5kcm9pZDp0aXRsZT0iQnVzIiAvPgoKICAgICAgICA8aXRlbQogICAgICAgICAgICBhbmRyb2lkOmlkPSJAK2lkL25hdl9wbGFuZSIKICAgICAgICAgICAgYW5kcm9pZDppY29uPSJAZHJhd2FibGUvaWNvbnM4X2FpcnBsYW5lX3Rha2Vfb2ZmXzUwMCIKICAgICAgICAgICAgYW5kcm9pZDp0aXRsZT0iUGxhbmUiIC8+CiAgICA8L2dyb3VwPgoKICAgIDxpdGVtIGFuZHJvaWQ6dGl0bGU9IlByb2ZpbGUiPgoKICAgICAgICA8bWVudT4KCiAgICAgICAgICAgIDxncm91cCBhbmRyb2lkOmNoZWNrYWJsZUJlaGF2aW9yPSJzaW5nbGUiPgoKICAgICAgICAgICAgICAgIDxpdGVtCiAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDppZD0iQCtpZC9uYXZfbG9naW4iCiAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDppY29uPSJAZHJhd2FibGUvbG9naW5faWNvbiIKICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOnRpdGxlPSJMb2dpbiIgLz4KCiAgICAgICAgICAgICAgICA8aXRlbQogICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6aWQ9IkAraWQvbmF2X3Byb2ZpbGUiCiAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDppY29uPSJAZHJhd2FibGUvcHJvZmlsZV9pY29uIgogICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6dGl0bGU9IlByb2ZpbGUiIC8+CgogICAgICAgICAgICAgICAgPGl0ZW0KICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOmlkPSJAK2lkL25hdl9sb2dvdXQiCiAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDppY29uPSJAZHJhd2FibGUvbG9nb3V0X2ljb24iCiAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDp0aXRsZT0iTG9nb3V0IiAvPgogICAgICAgICAgICA8L2dyb3VwPgogICAgICAgIDwvbWVudT4KICAgIDwvaXRlbT4KCiAgICA8aXRlbSBhbmRyb2lkOnRpdGxlPSJDb21tdW5pY2F0ZSI+CgogICAgICAgIDxtZW51PgoKICAgICAgICAgICAgPGl0ZW0KICAgICAgICAgICAgICAgIGFuZHJvaWQ6aWQ9IkAraWQvbmF2X3NoYXJlIgogICAgICAgICAgICAgICAgYW5kcm9pZDppY29uPSJAZHJhd2FibGUvc2hhcmVfaWNvbiIKICAgICAgICAgICAgICAgIGFuZHJvaWQ6dGl0bGU9IlNoYXJlIiAvPgoKICAgICAgICAgICAgPGl0ZW0KICAgICAgICAgICAgICAgIGFuZHJvaWQ6aWQ9IkAraWQvbmF2X3JhdGUiCiAgICAgICAgICAgICAgICBhbmRyb2lkOmljb249IkBkcmF3YWJsZS9yYXRlX2ljb24iCiAgICAgICAgICAgICAgICBhbmRyb2lkOnRpdGxlPSJSYXRlIFVzIiAvPgogICAgICAgIDwvbWVudT4KICAgIDwvaXRlbT4KPC9tZW51Pg=Īfter that add the Image view tag and Text view tag as shown in the code ICAgIDxJbWFnZVZpZXcKICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0iNzVkcCIKICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9Ijc1ZHAiCiAgICAgICAgYW5kcm9pZDpzcmM9IkBkcmF3YWJsZS9pY29uczhfY3ljbGluZ181MDAiIC8+CgogICAgPFRleHRWaWV3CiAgICAgICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9IndyYXBfY29udGVudCIKICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCIKICAgICAgICBhbmRyb2lkOnRleHQ9IlRyYXZlbGluZyIKICAgICAgICBhbmRyb2lkOnRleHRTaXplPSIyNHNwIgogICAgICAgIGFwcDpmb250RmFtaWx5PSJAZm9udC9iYWxvbyIgLz4KCiAgICA8VGV4dFZpZXcKICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50IgogICAgICAgIGFuZHJvaWQ6bGF5b3V0X2hlaWdodD0id3JhcF9jb250ZW50IgogICAgICAgIGFuZHJvaWQ6dGV4dD0id3d3LnRhaW1vb3JzaWthbmRlci5jb20iCiAgICAgICAgYW5kcm9pZDp0ZXh0U2l6ZT0iMTRzcCIKICAgICAgICBhcHA6Zm9udEZhbWlseT0iQGZvbnQvYWNsb25pY2EiIC8+ Thus this means that one menu item of the group is selected at one time.
ANDROID CHANGE SELECTED TEXT COLOR IN NAVIGATION DRAWER ANDROID
However, to navigate in our application we have to make menus and the right place for placing menus in android is Navigation Drawer.Īs you have seen that in the group tag we write checkable behavior = single. Therefore navigation plays an important role in increasing the usability of an application. Navigation is how people move from one activity to another in our application. Navigation Drawer is the main menu in android applications that slides from the side of the application by clicking on the hamburger icon. Get Complete Source code for Bull’s Rent App.Show or hide Items in navigation drawer.Implement onNavigationItemSelected() method.1- Add Hooks of the components used in the design.Step #6: Add functionality to MainActivity.java file.Step #5: Design the main activity of our application.Step #4: Create a menu header file of Navigation drawer.Step #3: Create menu Resource file for Navigation drawer.Step #2: Add icons to the android project.