Add two more navigation menu entries.
[PrivacyCell.git] / app / src / main / java / com / stoutner / privacycell / activities / PrivacyCell.kt
index a8863477a7bceb3a902452cd397468a6c7d3555c..964854687d7610f47863488a91bab640d40ab5ac 100644 (file)
@@ -44,8 +44,8 @@ import androidx.drawerlayout.widget.DrawerLayout
 import com.google.android.material.navigation.NavigationView
 
 import com.stoutner.privacycell.R
-import com.stoutner.privacycell.dialogs.PermissionsDialog
 import com.stoutner.privacycell.dialogs.PhonePermissionDialog
+import com.stoutner.privacycell.dialogs.WebViewDialog
 
 class PrivacyCell : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener, PhonePermissionDialog.StoragePermissionDialogListener {
     // Declare the class variables.
@@ -168,10 +168,22 @@ class PrivacyCell : AppCompatActivity(), NavigationView.OnNavigationItemSelected
         // Run the commands that correspond to the selected menu item.
         if (menuItemId == R.id.permissions) {  // Permissions.
             // Instantiate the permissions dialog fragment.
-            val permissionsDialogFragment = PermissionsDialog()
+            val permissionsDialogFragment = WebViewDialog().type(WebViewDialog.PERMISSIONS)
 
             // Show the permissions alert dialog.
-            permissionsDialogFragment.show(supportFragmentManager, getString(R.string.phone_permission))
+            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.