diff --git a/app/src/main/java/fr/free/nrw/commons/navtab/MoreBottomSheetFragment.java b/app/src/main/java/fr/free/nrw/commons/navtab/MoreBottomSheetFragment.java index 24e6d25f0..f54ba61c7 100644 --- a/app/src/main/java/fr/free/nrw/commons/navtab/MoreBottomSheetFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/navtab/MoreBottomSheetFragment.java @@ -104,6 +104,27 @@ public class MoreBottomSheetFragment extends BottomSheetDialogFragment { @OnClick(R.id.more_feedback) public void onFeedbackClicked() { + showAlertDialog(); + } + + /** + * This method shows the alert dialog when a user wants to send feedback about the app. + */ + private void showAlertDialog() { + new AlertDialog.Builder(getActivity()) + .setMessage(R.string.feedback_sharing_data_alert) + .setCancelable(false) + .setPositiveButton(R.string.ok, (dialog, which) -> { + sendFeedback(); + }) + .show(); + } + + /** + * This method collects the feedback message and starts the activity with implicit intent + * to available email client. + */ + private void sendFeedback() { final String technicalInfo = commonsLogSender.getExtraInfo(); final Intent feedbackIntent = new Intent(Intent.ACTION_SENDTO); diff --git a/app/src/main/java/fr/free/nrw/commons/navtab/MoreBottomSheetLoggedOutFragment.java b/app/src/main/java/fr/free/nrw/commons/navtab/MoreBottomSheetLoggedOutFragment.java index 1ff2306ec..947440e5f 100644 --- a/app/src/main/java/fr/free/nrw/commons/navtab/MoreBottomSheetLoggedOutFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/navtab/MoreBottomSheetLoggedOutFragment.java @@ -11,13 +11,13 @@ import android.view.ViewGroup; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; import butterknife.ButterKnife; import butterknife.OnClick; import com.google.android.material.bottomsheet.BottomSheetDialogFragment; import fr.free.nrw.commons.AboutActivity; import fr.free.nrw.commons.CommonsApplication; import fr.free.nrw.commons.R; -import fr.free.nrw.commons.WelcomeActivity; import fr.free.nrw.commons.auth.LoginActivity; import fr.free.nrw.commons.di.ApplicationlessInjection; import fr.free.nrw.commons.kvstore.JsonKvStore; @@ -64,6 +64,27 @@ public class MoreBottomSheetLoggedOutFragment extends BottomSheetDialogFragment @OnClick(R.id.more_feedback) public void onFeedbackClicked() { + showAlertDialog(); + } + + /** + * This method shows the alert dialog when a user wants to send feedback about the app. + */ + private void showAlertDialog() { + new AlertDialog.Builder(getActivity()) + .setMessage(R.string.feedback_sharing_data_alert) + .setCancelable(false) + .setPositiveButton(R.string.ok, (dialog, which) -> { + sendFeedback(); + }) + .show(); + } + + /** + * This method collects the feedback message and starts and activity with implicit intent + * to available email client. + */ + private void sendFeedback() { final String technicalInfo = commonsLogSender.getExtraInfo(); final Intent feedbackIntent = new Intent(Intent.ACTION_SENDTO); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 821fc5ba6..f9d4738b3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -682,4 +682,5 @@ Upload your first media by tapping on the add button. Apply Reset Location data helps Wiki editors find your picture, making it much more useful.\nYour recent uploads have no location.\nWe suggest you turn on location in your camera app\'s settings.\nThank you for uploading! + Please remove from this email any information that you are not comfortable sharing publicly. Also, please be aware that your email address with which you are posting, and the associated name and profile picture, will be visible publicly.