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.
// 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.