+ // Determine if import or export is checked.
+ if (exportRadioButton.isChecked()) { // The export radio button is checked.
+ // Hide the notification that the file does not exist.
+ fileDoesNotExistTextView.setVisibility(View.GONE);
+
+ // Display a warning if the file already exists.
+ if (file.exists()) {
+ fileExistsWarningTextView.setVisibility(View.VISIBLE);
+ } else {
+ fileExistsWarningTextView.setVisibility(View.GONE);
+ }
+
+ // Enable the export button if the file name and the password are populated.
+ importExportButton.setEnabled(!fileNameString.isEmpty() && !encryptionPasswordEditText.getText().toString().isEmpty());
+ } else if (importRadioButton.isChecked()) { // The import radio button is checked.
+ // Hide the file exists warning text view.
+ fileExistsWarningTextView.setVisibility(View.GONE);
+
+ // Check if the file exists.
+ if (file.exists()) { // The file exists.
+ // Hide the notification that the file does not exist.
+ fileDoesNotExistTextView.setVisibility(View.GONE);
+
+ // Enable the import button if the password is populated.
+ importExportButton.setEnabled(!encryptionPasswordEditText.getText().toString().isEmpty());
+ } else { // The file does not exist.
+ // Show a notification that the file does not exist.
+ fileDoesNotExistTextView.setVisibility(View.VISIBLE);
+
+ // Disable the import button.
+ importExportButton.setEnabled(false);
+ }
+ } else { // Neither radio button is checked.
+ // Hide the file notification text views.
+ fileExistsWarningTextView.setVisibility(View.GONE);
+ fileDoesNotExistTextView.setVisibility(View.GONE);
+ }