+ override fun onNavigationItemSelected(menuItem: MenuItem) : Boolean {
+ // Get the menu item ID.
+ val menuItemId = menuItem.itemId
+
+ // Run the commands that correspond to the selected menu item.
+ if (menuItemId == R.id.permissions) { // Permissions.
+ // Instantiate the permissions dialog fragment.
+ val permissionsDialogFragment = WebViewDialog().type(WebViewDialog.PERMISSIONS)
+
+ // Show the permissions alert dialog.
+ permissionsDialogFragment.show(supportFragmentManager, getString(R.string.permissions))
+ } else if (menuItemId == R.id.privacy_policy) { // Privacy Policy.
+ // Instantiate the privacy policy dialog fragment.
+ val privacyPolicyDialogFragment = WebViewDialog().type(WebViewDialog.PRIVACY_POLICY)
+
+ // Show the privacy policy alert dialog.
+ privacyPolicyDialogFragment.show(supportFragmentManager, getString(R.string.privacy_policy))
+ } else if (menuItemId == R.id.changelog) { // Changelog.
+ // Instantiate the changelog dialog fragment.
+ val changelogDialogFragment = WebViewDialog().type(WebViewDialog.CHANGELOG)
+
+ // Show the changelog alert dialog.
+ changelogDialogFragment.show(supportFragmentManager, getString(R.string.changelog))
+ }
+
+ // Close the navigation drawer.
+ drawerLayout.closeDrawer(GravityCompat.START)
+
+ // Consume the click.
+ return true
+ }
+