aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt8
-rw-r--r--androidApp/src/main/res/values-es-rMX/strings.xml9
-rw-r--r--androidApp/src/main/res/values/strings.xml9
3 files changed, 26 insertions, 0 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt
index 56d5c4b..9633332 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/DetailsActivity.kt
@@ -5,6 +5,7 @@ import android.content.pm.PackageManager
import android.os.Bundle
import android.util.Log
import androidx.activity.result.contract.ActivityResultContracts
+import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import com.google.android.material.tabs.TabLayout
@@ -108,6 +109,13 @@ class DetailsActivity : AppCompatActivity() {
}
ActivityCompat.shouldShowRequestPermissionRationale(this, permission) -> {
Log.d("DetailsActivity", "shouldShowRequestPermissionRationale")
+ AlertDialog.Builder(this)
+ .setTitle(R.string.write_rationale_title)
+ .setMessage(R.string.write_rationale_msg)
+ .setPositiveButton(R.string.shared_ok) { _, _ ->
+ launcher.launch(permission)
+ }
+ .create().show()
}
else -> {
Log.d("DetailsActivity", "Requesting $permission permission")
diff --git a/androidApp/src/main/res/values-es-rMX/strings.xml b/androidApp/src/main/res/values-es-rMX/strings.xml
index 7284b6c..2645205 100644
--- a/androidApp/src/main/res/values-es-rMX/strings.xml
+++ b/androidApp/src/main/res/values-es-rMX/strings.xml
@@ -88,11 +88,20 @@
<string name="stops">Paradas</string>
<string name="period">Periodo</string>
<string name="select_period">Seleccionar</string>
+
<string name="export_report">Guardar</string>
<string name="share_report">Compartir</string>
<string name="export_stored">El reporte ha sido descargado</string>
<string name="export_open_file_with">Abrir con</string>
+ <string name="write_rationale_title">
+ Necesitamos tu permiso
+ </string>
+ <string name="write_rationale_msg">
+ Esta aplicación requiere acceso de escritura a tus archivos.
+ Requerimos este permiso para guardar reportes en tu teléfono.
+ </string>
+
<!-- Report periods -->
<string name="period_today">Hoy</string>
<string name="period_last_24">Últimas 24H</string>
diff --git a/androidApp/src/main/res/values/strings.xml b/androidApp/src/main/res/values/strings.xml
index 3e2b37a..8e59b14 100644
--- a/androidApp/src/main/res/values/strings.xml
+++ b/androidApp/src/main/res/values/strings.xml
@@ -101,11 +101,20 @@
<string name="stops">Stops</string>
<string name="period">Period</string>
<string name="select_period">Select</string>
+
<string name="export_report">Save</string>
<string name="share_report">Share</string>
<string name="export_stored">Report has been downloaded</string>
<string name="export_open_file_with">Open file with</string>
+ <string name="write_rationale_title">
+ We need your permission
+ </string>
+ <string name="write_rationale_msg">
+ This app relies on write access to your files.
+ We require access to this permission to save reports into your phone.
+ </string>
+
<!-- Report periods -->
<string name="period_today">Today</string>
<string name="period_last_24">Last 24H</string>