Problems covered in this chapter |
|
In this chapter we dive into the user interface of our tutorial app for the first time and create a main menu (menu_main.xml) and a toolbar menu (menu_toolbar.xml). For the main menu we need some vector graphics, so we add the standard icons Home (baseline_home_24.xml), Edit Note (baseline_edit_note_24.xml), Groups (baseline_groups_24.xml), Tag (baseline_tag_24.xml) and WC (baseline_wc_24.xml) in the drawables folder via the Android Studio menu ”New → Vector Asset”.
As can be seen from the XML file, we have added four menu items to our tools menu:
Settings
Import/Export
Help
Search
Except for Help, the remaining three menu items are set to invisible by setting the attribute android:visible=”false”: This is because we will only show these menu items at certain navigation points in the app, e.g. the search only when we display a list of entries (for example, all diary entries), or the settings and import/export only on the app’s home page.
Since we want our two menus to be language-specific, we need to extend our two string.xml files accordingly:
The following menu items are defined in the main menu:
Overview (start page),
Diary entries,
Persons,
Keywords,
Genders and
Help.