[Android General] daxgirl:
Adding items to the Navigation Drawer:

1. Switch to project view.

It will be easier for you to navigate through project files. For that:

On the left panel on top, below the android studio menu, find this:

This is what your project will look right after you import it. This is module view. By default it is categorized and to work with it you need some understanding of this view.

Click the 2 arrow icon which is circled in blue and select "project"

Your structure will now change.

Navigate into the project by the following path: Project name > app > src > main

Now you will see directories, like: java, res, assets... and so on.

This is your working directory. You will be making your code changes here.​

2. Find a file called nav_drawer_arrays.xml. It is located in res/values folder. Double click on it to open.

You will see the following 3 arrays inside. The first one is a reference array (simple typed array) and the other 2 are strings arrays.

Those are WORKING ARRAYS. When you run the app as it is now, you will see all the items created in the navigation drawer based on this info.

Please read the comments we wrote in the xml file for you:​

<resources>
[COLOR="Green"][B][I]<!--The following array is for icons you want to use for your items
You can create new icons bu right clicking the drawable folder and choosing
New vector drawable
You have a great selection of items in xml vector format.
Those are supported starting lollipop.
YOU SHOULD NOT USE PNG. not even material one. Vectors will work best with any device density.

Once you have created the vector, reference it as regular drawable in the array below.

MAKE SURE THE ITEMS IN ALL 3 ARRAYS CORRESPOND IN ORDER AND ALL 3 ARRAYS ARE SAME LENGTH-->[/I][/B][/COLOR]
<array name="nav_menu_prefs_drawables">
<item>@drawable/ic_system_ui</item>
<item>@drawable/ic_phone</item>
<item>@drawable/ic_framework</item>
<item>@drawable/ic_notification_panel</item>
</array>

[COLOR="green"][B][I]<!--This array is for your items titles.
Use @string reference, so later on your app can be translated with ease
KEEP THE ORDER BETWEEN ALL YOUR ARRAYS-->[/I][/B][/COLOR]
<string-array name="nav_menu_prefs_titles">
<item>@string/systemui_prefs</item>
<item>@string/phone_prefs</item>
<item>@string/framework_prefs</item>
<item>@string/notification_panel_prefs</item>
</string-array>

[COLOR="green"][B][I] <!--This array is the most valuable one

Here you put the file names of the preference files you create in your xml directory
THEY MUST BE PRECISE AND CASE SENSITIVE!!! DO NOT ADD .xml SUFFIX-->[/I][/B][/COLOR]
<string-array name="nav_menu_xml_file_names" translatable="false">
<item>ui_prefs</item>
<item>phone_prefs</item>
<item>framework_prefs</item>
<item>notification_panel_prefs</item>
</string-array>
</resources>

3. Let's say you have 10 preference files in directory called xml. That means you will want to have 10 items referring to your preference files in the navigation drawer. That means you will need to have 10 items in EACH array. Create 10 empty preference files. DO NOT COPY THE ONES FROM RC v1.0. Just right click the xml folder, choose "New" and choose "New XML resource file". Give it a name and click ok. Leave them empty for now. create all the icons you need for them in the navigation drawer.

4. Populate the arrays with titles, icons and xml names. You're done. You now have a working items in the navigation drawer. You do not need any changes in java files. the items are being generated on run time and their onClicks redirected accordingly. If you run the app right now you should have 10 empty preference files.

We strongly encourage you to keep the ui_prefs.xml file and references to it in your project while you're working on it. It contains most valuable information about the kinds of preferences we have included and their various usages. You can remove it from arrays before making the release version. You can have it as last item in your arrays and use it as test dummy to see how things should work properly