From 44681130de1638ba466fe61e0dc417ef6112ce46 Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Wed, 1 Jun 2022 21:02:04 +0200 Subject: [PATCH 01/24] fix(#165): cosmetic issue... --- .../ui/input/observers/ObserversAndDateInputFragment.kt | 4 ++++ occtax/src/main/res/values-fr/strings.xml | 1 + occtax/src/main/res/values/strings.xml | 1 + 3 files changed, 6 insertions(+) diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/input/observers/ObserversAndDateInputFragment.kt b/occtax/src/main/java/fr/geonature/occtax/ui/input/observers/ObserversAndDateInputFragment.kt index 73ac9876..689fae05 100644 --- a/occtax/src/main/java/fr/geonature/occtax/ui/input/observers/ObserversAndDateInputFragment.kt +++ b/occtax/src/main/java/fr/geonature/occtax/ui/input/observers/ObserversAndDateInputFragment.kt @@ -337,6 +337,10 @@ class ObserversAndDateInputFragment : Fragment(), } dateStartTextInputLayout = view.findViewById(R.id.dateStart)?.apply { + hint = getString( + if (dateSettings.endDateSettings == null) R.string.observers_and_date_date_hint + else R.string.observers_and_date_date_start_hint + ) editText?.afterTextChanged { error = checkStartDateConstraints() dateEndTextInputLayout?.error = checkEndDateConstraints() diff --git a/occtax/src/main/res/values-fr/strings.xml b/occtax/src/main/res/values-fr/strings.xml index c7cd5708..27852432 100644 --- a/occtax/src/main/res/values-fr/strings.xml +++ b/occtax/src/main/res/values-fr/strings.xml @@ -104,6 +104,7 @@ Aucun observateur sélectionné.\nAjouter en un via le bouton "Ajouter". Jeu de données Date + Date du relevé Date de début Date de fin La date de début n\'a pas été définie diff --git a/occtax/src/main/res/values/strings.xml b/occtax/src/main/res/values/strings.xml index ac402bc8..7e38a5ec 100644 --- a/occtax/src/main/res/values/strings.xml +++ b/occtax/src/main/res/values/strings.xml @@ -104,6 +104,7 @@ No selected observer.\nAdd one by tapping the "Add" button. Dataset Date + Input date Start date End date Missing start date From 3577991210626860e7a22c40df3835bd32c3ff3e Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Tue, 21 Jun 2022 21:03:12 +0200 Subject: [PATCH 02/24] chore: update core and maps modules dependencies --- .idea/gradle.xml | 1 - gn_mobile_core | 2 +- gn_mobile_maps | 2 +- gn_mobile_occtax.iml | 4 +--- occtax/src/main/java/fr/geonature/occtax/MainApplication.kt | 6 ------ 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 11350fe2..6b6f226f 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -19,7 +19,6 @@ - diff --git a/gn_mobile_core b/gn_mobile_core index 7cbf2f6f..cdf89b6d 160000 --- a/gn_mobile_core +++ b/gn_mobile_core @@ -1 +1 @@ -Subproject commit 7cbf2f6f1fc515d318de6deffd7606d8e8c46ee9 +Subproject commit cdf89b6d9894f2e2c9deb6237ae034bae1ec2593 diff --git a/gn_mobile_maps b/gn_mobile_maps index 06477a7f..3f0b6e02 160000 --- a/gn_mobile_maps +++ b/gn_mobile_maps @@ -1 +1 @@ -Subproject commit 06477a7f729fafbda9c6d9bbd40d825e4d66ec19 +Subproject commit 3f0b6e02d3db093183c8c8049838b1aad205bee9 diff --git a/gn_mobile_occtax.iml b/gn_mobile_occtax.iml index 10e828d0..24cabba7 100644 --- a/gn_mobile_occtax.iml +++ b/gn_mobile_occtax.iml @@ -7,9 +7,7 @@ - - - + diff --git a/occtax/src/main/java/fr/geonature/occtax/MainApplication.kt b/occtax/src/main/java/fr/geonature/occtax/MainApplication.kt index 38163049..b3eb6855 100644 --- a/occtax/src/main/java/fr/geonature/occtax/MainApplication.kt +++ b/occtax/src/main/java/fr/geonature/occtax/MainApplication.kt @@ -7,7 +7,6 @@ import androidx.core.app.NotificationManagerCompat import androidx.hilt.work.HiltWorkerFactory import androidx.work.Configuration import dagger.hilt.android.HiltAndroidApp -import fr.geonature.datasync.auth.worker.CheckAuthLoginWorker import fr.geonature.datasync.packageinfo.worker.CheckInputsToSynchronizeWorker import fr.geonature.mountpoint.model.MountPoint import fr.geonature.mountpoint.util.FileUtils @@ -45,7 +44,6 @@ class MainApplication : Application(), Configuration.Provider { configureCheckInputsToSynchronizeChannel(notificationManager) configureSynchronizeDataChannel(notificationManager) - checkAuthLogin() checkInputsToSynchronize() } @@ -76,10 +74,6 @@ class MainApplication : Application(), Configuration.Provider { Logger.info { "logs directory: '$directoryForLogs'" } } - private fun checkAuthLogin() { - CheckAuthLoginWorker.enqueueUniquePeriodicWork(this) - } - private fun checkInputsToSynchronize() { CheckInputsToSynchronizeWorker.enqueueUniquePeriodicWork( this, From 041e6c1e148923bc21f5e8cea1962da8858f6b91 Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Tue, 21 Jun 2022 21:05:15 +0200 Subject: [PATCH 03/24] chore(#134): do not compute automatically the version code --- occtax/build.gradle | 6 ++---- occtax/version.properties | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 occtax/version.properties diff --git a/occtax/build.gradle b/occtax/build.gradle index 88e3a80b..bea18aa4 100644 --- a/occtax/build.gradle +++ b/occtax/build.gradle @@ -5,8 +5,6 @@ plugins { id 'kotlin-kapt' } -version = "2.2.0" - android { compileSdkVersion 31 @@ -23,8 +21,8 @@ android { applicationId "fr.geonature.occtax2" minSdkVersion 21 targetSdkVersion 31 - versionCode updateVersionCode(project.name) - versionName version + versionCode 3020 + versionName "2.2.0" buildConfigField "String", "BUILD_DATE", "\"" + new Date().getTime() + "\"" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" archivesBaseName = project.name + "-" + versionName diff --git a/occtax/version.properties b/occtax/version.properties deleted file mode 100644 index 62c38de5..00000000 --- a/occtax/version.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Tue May 31 19:20:42 CEST 2022 -VERSION_CODE=3020 From 82dd9c4067fb84a19574f4fe695be229985420ec Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Tue, 21 Jun 2022 21:11:08 +0200 Subject: [PATCH 04/24] chore: set minimal required version --- occtax/build.gradle | 2 +- .../java/fr/geonature/occtax/ui/home/HomeActivity.kt | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/occtax/build.gradle b/occtax/build.gradle index bea18aa4..6a7cfb99 100644 --- a/occtax/build.gradle +++ b/occtax/build.gradle @@ -19,7 +19,7 @@ android { defaultConfig { applicationId "fr.geonature.occtax2" - minSdkVersion 21 + minSdkVersion 26 targetSdkVersion 31 versionCode 3020 versionName "2.2.0" diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/home/HomeActivity.kt b/occtax/src/main/java/fr/geonature/occtax/ui/home/HomeActivity.kt index 20460cb0..baeccd95 100644 --- a/occtax/src/main/java/fr/geonature/occtax/ui/home/HomeActivity.kt +++ b/occtax/src/main/java/fr/geonature/occtax/ui/home/HomeActivity.kt @@ -4,6 +4,7 @@ import android.annotation.SuppressLint import android.content.Intent import android.database.Cursor import android.os.Bundle +import android.os.VibrationEffect import android.os.Vibrator import android.view.Menu import android.view.MenuItem @@ -215,7 +216,12 @@ class HomeActivity : AppCompatActivity() { ContextCompat.getSystemService( this@HomeActivity, Vibrator::class.java - )?.vibrate(100) + )?.vibrate( + VibrationEffect.createOneShot( + 100, + VibrationEffect.DEFAULT_AMPLITUDE + ) + ) makeSnackbar(getString(R.string.home_snackbar_input_deleted)) ?.setAction(R.string.home_snackbar_input_undo) { @@ -450,7 +456,7 @@ class HomeActivity : AppCompatActivity() { HomeActivity::class.java, MainApplication.CHANNEL_DATA_SYNCHRONIZATION ) - + loadAppSettings() } onFailure( From 8951a20103d054869b2e667394d6180a7b705bda Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Tue, 21 Jun 2022 21:53:44 +0200 Subject: [PATCH 05/24] chore: 2.3.0-rc0 pre-release --- CHANGELOG.md | 20 ++++++++++++++++++++ occtax/build.gradle | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3de3ae96..c7322ae9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [2.3.0-rc0](https://github.com/PnX-SI/gn_mobile_occtax/releases/tag/2.3.0-rc0) (2022-06-21, pre-release) + +### 🚀 Nouveautés + +* La rotation de la carte est bloquée par défaut (https://github.com/PnX-SI/gn_mobile_occtax/issues/139). + Son paramétrage reste accessible par configuration (cf. [README.md](https://github.com/PnX-SI/gn_mobile_maps/blob/develop/maps/README.md#parameters-description) du module). +* Possibilité d'ajouter directement un marqueur via un "toucher long" sur la carte (https://github.com/PnX-SI/gn_mobile_occtax/issues/14). + +### 🐛 Corrections + +* Suppression de la double vérification de la validité du cookie de session et du token de session (https://github.com/PnX-SI/gn_mobile_occtax/issues/163). + L'application reste "connectée" par défaut tant qu'elle ne reçoit pas en retour d'appel d'API une + erreur 401. +* Libellé du champ date plus clair quand seule la date de début du relevé est configurée (https://github.com/PnX-SI/gn_mobile_occtax/issues/165). + +### ⚠️ Notes de version + +* Code de version : 3025 +* L'application est officiellement compatible avec les terminaux tournant sur Android 8.0 au minimum. + ## [2.2.0](https://github.com/PnX-SI/gn_mobile_occtax/releases/tag/2.2.0) (2022-05-31, release) ### 🚀 Nouveautés diff --git a/occtax/build.gradle b/occtax/build.gradle index 6a7cfb99..3f314468 100644 --- a/occtax/build.gradle +++ b/occtax/build.gradle @@ -21,8 +21,8 @@ android { applicationId "fr.geonature.occtax2" minSdkVersion 26 targetSdkVersion 31 - versionCode 3020 - versionName "2.2.0" + versionCode 3025 + versionName "2.3.0-rc0" buildConfigField "String", "BUILD_DATE", "\"" + new Date().getTime() + "\"" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" archivesBaseName = project.name + "-" + versionName From ea61b25b53817764b62ab72492424c678584f722 Mon Sep 17 00:00:00 2001 From: Camille Monchicourt Date: Wed, 22 Jun 2022 08:22:35 +0200 Subject: [PATCH 06/24] Update install doc By @gil-deluermoz --- docs/installation-fr.adoc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/installation-fr.adoc b/docs/installation-fr.adoc index 1be9cc10..e62034cc 100644 --- a/docs/installation-fr.adoc +++ b/docs/installation-fr.adoc @@ -44,9 +44,7 @@ Il est nécessaire de gérer les fichiers de configuration, l'installation et la L'application *_Occtax-mobile_* se chargera alors de récupérer automatiquement sur le serveur GeoNature la dernière version du fichier de configuration des applications et détectera les éventuelles mises à jour disponibles pour l'application. -Pour cela, chargez l'APK de l'application *_Occtax-mobile_* ainsi que son fichier de configuration dans le fichier `settings.json` dans le dossier `$HOME/geonature/backend/static/mobile` du serveur GeoNature. - -Au préalable, Il faut créer un dossier par application, car les fichiers de configuration de chaque application ont le même nom (`settings.json`), +Pour cela, chargez l'APK de l'application *_Occtax-mobile_* ainsi que son fichier de configuration dans le fichier `settings.json` dans le dossier `$HOME/geonature/backend/static/mobile/occtax` du serveur GeoNature. Dans les commandes ci-dessous, remplacez `x.y.y` par le numéro (tag) de la version (release) utilisée. @@ -60,7 +58,7 @@ cd $HOME/geonature/backend/static/mobile mkdir occtax ---- -​Télécharger la version de *_Occtax-mobile_* souhaitée : +​ Télécharger la version de *_Occtax-mobile_* souhaitée : [source,shell] ---- @@ -72,9 +70,9 @@ Créer le fichier de settings `settings.json` en suivant https://github.com/PnX- Renseigner ensuite la table `gn_commons.t_mobile_apps` de la base de données. -Pour trouver la valeur à renseigner dans le champs `version_code`, reportez-vous aux fichiers suivants en sélectionnant le tag de version où la branche que vous utilisez : +Pour trouver la valeur à renseigner dans le champs `version_code`, celui-ci est mentionné dans les releases, ou reportez-vous au fichier suivant en sélectionnant le tag de version où la branche que vous utilisez : -https://github.com/PnX-SI/gn_mobile_occtax/blob/master/occtax/version.properties +https://github.com/PnX-SI/gn_mobile_occtax/blob/master/occtax/build.gradle#L24 Ou avec l'outil `aapt` (`apt-get install aapt` pour l'installer), exécutez la commande `aapt dump badging applicationfile.apk | grep -Po "(?<=\sversion(Code|Name)'='')([0-9.]+)"`. From b09bc96bf523fc2762a07bcd6a60d2d0a41928ba Mon Sep 17 00:00:00 2001 From: Camille Monchicourt Date: Wed, 22 Jun 2022 09:41:37 +0200 Subject: [PATCH 07/24] Doc install - Fix typo --- docs/installation-fr.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation-fr.adoc b/docs/installation-fr.adoc index e62034cc..2dbdb26a 100644 --- a/docs/installation-fr.adoc +++ b/docs/installation-fr.adoc @@ -44,7 +44,7 @@ Il est nécessaire de gérer les fichiers de configuration, l'installation et la L'application *_Occtax-mobile_* se chargera alors de récupérer automatiquement sur le serveur GeoNature la dernière version du fichier de configuration des applications et détectera les éventuelles mises à jour disponibles pour l'application. -Pour cela, chargez l'APK de l'application *_Occtax-mobile_* ainsi que son fichier de configuration dans le fichier `settings.json` dans le dossier `$HOME/geonature/backend/static/mobile/occtax` du serveur GeoNature. +Pour cela, chargez l'APK de l'application *_Occtax-mobile_* ainsi que son fichier de configuration `settings.json` dans le dossier `$HOME/geonature/backend/static/mobile/occtax` du serveur GeoNature. Dans les commandes ci-dessous, remplacez `x.y.y` par le numéro (tag) de la version (release) utilisée. From 1e836b2101a6f924c17b57029887fd6e27c01644 Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Wed, 22 Jun 2022 22:35:36 +0200 Subject: [PATCH 08/24] chore: ignore some IDE settings... --- .gitignore | 1 + .idea/misc.xml | 14 -------------- gn_mobile_occtax.iml | 20 -------------------- 3 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 .idea/misc.xml delete mode 100644 gn_mobile_occtax.iml diff --git a/.gitignore b/.gitignore index 74964d69..05c0093a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /keystore.properties /.idea/caches /.idea/libraries +/.idea/misc.xml /.idea/modules.xml /.idea/workspace.xml /.idea/navEditor.xml diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 98de6fa1..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/gn_mobile_occtax.iml b/gn_mobile_occtax.iml deleted file mode 100644 index 24cabba7..00000000 --- a/gn_mobile_occtax.iml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 0ae31220e889f94ebbd76547e06cc8d902cefcf1 Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Wed, 22 Jun 2022 22:36:48 +0200 Subject: [PATCH 09/24] chore: update maps module dependency see: https://github.com/PnX-SI/gn_mobile_occtax/issues/14 --- gn_mobile_maps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gn_mobile_maps b/gn_mobile_maps index 3f0b6e02..cc6d7b5f 160000 --- a/gn_mobile_maps +++ b/gn_mobile_maps @@ -1 +1 @@ -Subproject commit 3f0b6e02d3db093183c8c8049838b1aad205bee9 +Subproject commit cc6d7b5fd7f75b7d41bf3f93a1aff488482ac9a2 From 2e284c54ac5560758b6563cd6f3c3ba8412a87fe Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Wed, 22 Jun 2022 22:42:30 +0200 Subject: [PATCH 10/24] feat(#140): set comment at step 1 --- .../ObserversAndDateInputFragment.kt | 15 ++++++++++++ .../fragment_observers_and_date_input.xml | 23 ++++++++++++++++++- occtax/src/main/res/values-fr/strings.xml | 4 +++- occtax/src/main/res/values/strings.xml | 2 ++ 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/input/observers/ObserversAndDateInputFragment.kt b/occtax/src/main/java/fr/geonature/occtax/ui/input/observers/ObserversAndDateInputFragment.kt index 689fae05..553d5d47 100644 --- a/occtax/src/main/java/fr/geonature/occtax/ui/input/observers/ObserversAndDateInputFragment.kt +++ b/occtax/src/main/java/fr/geonature/occtax/ui/input/observers/ObserversAndDateInputFragment.kt @@ -97,6 +97,7 @@ class ObserversAndDateInputFragment : Fragment(), private var selectedDatasetActionView: ListItemActionView? = null private var dateStartTextInputLayout: TextInputLayout? = null private var dateEndTextInputLayout: TextInputLayout? = null + private var commentTextInputLayout: TextInputLayout? = null private val loaderCallbacks = object : LoaderManager.LoaderCallbacks { override fun onCreateLoader( @@ -437,6 +438,12 @@ class ObserversAndDateInputFragment : Fragment(), } } + commentTextInputLayout = view.findViewById(android.R.id.edit)?.apply { + editText?.afterTextChanged { + input?.comment = it?.toString()?.ifEmpty { null }?.ifBlank { null } + } + } + return view } @@ -532,6 +539,14 @@ class ObserversAndDateInputFragment : Fragment(), input?.endDate ) } + commentTextInputLayout?.hint = + getString( + if (input?.comment.isNullOrBlank()) R.string.observers_and_date_comment_add_hint + else R.string.observers_and_date_comment_edit_hint + ) + commentTextInputLayout?.editText?.apply { + text = input?.comment?.let { Editable.Factory.getInstance().newEditable(it) } + } } override fun setInput(input: AbstractInput) { diff --git a/occtax/src/main/res/layout/fragment_observers_and_date_input.xml b/occtax/src/main/res/layout/fragment_observers_and_date_input.xml index 646431fa..f26856cb 100644 --- a/occtax/src/main/res/layout/fragment_observers_and_date_input.xml +++ b/occtax/src/main/res/layout/fragment_observers_and_date_input.xml @@ -57,7 +57,9 @@ @@ -134,6 +136,25 @@ + + + + + + \ No newline at end of file diff --git a/occtax/src/main/res/values-fr/strings.xml b/occtax/src/main/res/values-fr/strings.xml index 27852432..57adb6dc 100644 --- a/occtax/src/main/res/values-fr/strings.xml +++ b/occtax/src/main/res/values-fr/strings.xml @@ -66,7 +66,7 @@ Abandonner Continuer la saisie Ajouter un commentaire - Editer un commentaire + Éditer le commentaire Ajouter un commentaire OK Annuler @@ -113,6 +113,8 @@ La date de fin doit être après celle du début EEE dd MMM yyyy EEE dd MMM yyyy \'à\' HH:mm + Ajouter un commentaire + Éditer le commentaire %d taxon trouvé diff --git a/occtax/src/main/res/values/strings.xml b/occtax/src/main/res/values/strings.xml index 7e38a5ec..29c615e2 100644 --- a/occtax/src/main/res/values/strings.xml +++ b/occtax/src/main/res/values/strings.xml @@ -113,6 +113,8 @@ End date should be after start date EEE dd MMM yyyy EEE dd MMM yyyy \'at\' HH:mm + Add a comment + Edit a comment %d taxon found From bb532a6ddf556ea4a0ad80527313502476b867d5 Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Wed, 22 Jun 2022 22:43:11 +0200 Subject: [PATCH 11/24] fix: cosmetic issues... --- occtax/src/main/res/layout/activity_home.xml | 6 +++--- occtax/src/main/res/layout/fragment_taxa.xml | 1 + occtax/src/main/res/values/colors.xml | 1 + occtax/src/main/res/values/styles.xml | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/occtax/src/main/res/layout/activity_home.xml b/occtax/src/main/res/layout/activity_home.xml index bbb2a327..c03d38e9 100644 --- a/occtax/src/main/res/layout/activity_home.xml +++ b/occtax/src/main/res/layout/activity_home.xml @@ -12,13 +12,13 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - android:padding="@dimen/padding_default" tools:context=".ui.home.HomeActivity"> diff --git a/occtax/src/main/res/layout/fragment_taxa.xml b/occtax/src/main/res/layout/fragment_taxa.xml index 00e89c7b..73ff3c97 100644 --- a/occtax/src/main/res/layout/fragment_taxa.xml +++ b/occtax/src/main/res/layout/fragment_taxa.xml @@ -43,6 +43,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" + android:gravity="center" android:text="@string/no_data" android:textAlignment="center" android:visibility="gone" /> diff --git a/occtax/src/main/res/values/colors.xml b/occtax/src/main/res/values/colors.xml index f80bc232..347fe65e 100644 --- a/occtax/src/main/res/values/colors.xml +++ b/occtax/src/main/res/values/colors.xml @@ -8,6 +8,7 @@ @android:color/white #80ffffff + #fbfbfb #eeeeee #e0e0e0 diff --git a/occtax/src/main/res/values/styles.xml b/occtax/src/main/res/values/styles.xml index 49c8cbc2..75856b1c 100644 --- a/occtax/src/main/res/values/styles.xml +++ b/occtax/src/main/res/values/styles.xml @@ -12,6 +12,8 @@ ?attr/colorAccent @android:color/white + @color/grey_10 + @style/UnderlinePageIndicator @style/ButtonThemeOverlay From ee445ad9f2c0f5a53517bdad265d6672240683ca Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Sat, 25 Jun 2022 13:44:52 +0200 Subject: [PATCH 12/24] chore: 2.3.0-rc1 pre-release --- CHANGELOG.md | 14 ++++++++++++++ occtax/build.gradle | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7322ae9..5ab13cc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [2.3.0-rc1](https://github.com/PnX-SI/gn_mobile_occtax/releases/tag/2.3.0-rc1) (2022-06-25, pre-release) + +### 🚀 Nouveautés + +* Le commentaire du relevé est présent également à l'étape 1 du relevé, sous le choix de la date (#140). + +### 🐛 Corrections + +* Possibilité d'ajouter directement un marqueur via un "toucher long" sur la carte (https://github.com/PnX-SI/gn_mobile_occtax/issues/14). + +### ⚠️ Notes de version + +* Code de version : 3037 + ## [2.3.0-rc0](https://github.com/PnX-SI/gn_mobile_occtax/releases/tag/2.3.0-rc0) (2022-06-21, pre-release) ### 🚀 Nouveautés diff --git a/occtax/build.gradle b/occtax/build.gradle index 3f314468..af4d98e8 100644 --- a/occtax/build.gradle +++ b/occtax/build.gradle @@ -21,8 +21,8 @@ android { applicationId "fr.geonature.occtax2" minSdkVersion 26 targetSdkVersion 31 - versionCode 3025 - versionName "2.3.0-rc0" + versionCode 3037 + versionName "2.3.0-rc1" buildConfigField "String", "BUILD_DATE", "\"" + new Date().getTime() + "\"" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" archivesBaseName = project.name + "-" + versionName From 94f235392562f4322cfa80abe01e89b42f470faf Mon Sep 17 00:00:00 2001 From: Sebastien Grimault Date: Sat, 25 Jun 2022 13:49:33 +0200 Subject: [PATCH 13/24] docs: URL issue... --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ab13cc9..e98ae64d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### 🚀 Nouveautés -* Le commentaire du relevé est présent également à l'étape 1 du relevé, sous le choix de la date (#140). +* Le commentaire du relevé est présent également à l'étape 1 du relevé, sous le choix de la date (https://github.com/PnX-SI/gn_mobile_occtax/issues/140). ### 🐛 Corrections From 480c0f145d64a23ab1842e2c4a4514e7775f6ad6 Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Sat, 25 Jun 2022 15:20:56 +0200 Subject: [PATCH 14/24] feat(#77): show a confirmation alert dialog before deleting item --- .../geonature/occtax/ui/home/HomeActivity.kt | 17 ++-- .../ui/input/counting/CountingFragment.kt | 48 +++++------- .../input/summary/InputTaxaSummaryFragment.kt | 77 +++++-------------- occtax/src/main/res/values-fr/strings.xml | 3 + occtax/src/main/res/values/strings.xml | 3 + 5 files changed, 59 insertions(+), 89 deletions(-) diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/home/HomeActivity.kt b/occtax/src/main/java/fr/geonature/occtax/ui/home/HomeActivity.kt index baeccd95..f9ffe538 100644 --- a/occtax/src/main/java/fr/geonature/occtax/ui/home/HomeActivity.kt +++ b/occtax/src/main/java/fr/geonature/occtax/ui/home/HomeActivity.kt @@ -211,8 +211,6 @@ class HomeActivity : AppCompatActivity() { position: Int, item: Input ) { - inputViewModel.deleteInput(item) - ContextCompat.getSystemService( this@HomeActivity, Vibrator::class.java @@ -223,11 +221,18 @@ class HomeActivity : AppCompatActivity() { ) ) - makeSnackbar(getString(R.string.home_snackbar_input_deleted)) - ?.setAction(R.string.home_snackbar_input_undo) { - inputViewModel.restoreDeletedInput() + AlertDialog.Builder(this@HomeActivity) + .setTitle(R.string.alert_dialog_input_delete_title) + .setPositiveButton( + R.string.alert_dialog_ok + ) { dialog, _ -> + inputViewModel.deleteInput(item) + dialog.dismiss() } - ?.show() + .setNegativeButton( + R.string.alert_dialog_cancel + ) { dialog, _ -> dialog.dismiss() } + .show() } override fun showEmptyTextView(show: Boolean) { diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/CountingFragment.kt b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/CountingFragment.kt index 76526d8c..191954e3 100644 --- a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/CountingFragment.kt +++ b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/CountingFragment.kt @@ -3,6 +3,7 @@ package fr.geonature.occtax.ui.input.counting import android.app.Activity import android.content.Intent import android.os.Bundle +import android.os.VibrationEffect import android.os.Vibrator import android.view.LayoutInflater import android.view.View @@ -12,14 +13,13 @@ import android.widget.TextView import android.widget.Toast import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.contract.ActivityResultContracts -import androidx.coordinatorlayout.widget.CoordinatorLayout +import androidx.appcompat.app.AlertDialog import androidx.core.content.ContextCompat.getSystemService import androidx.fragment.app.Fragment import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton -import com.google.android.material.snackbar.Snackbar import fr.geonature.commons.data.entity.Taxonomy import fr.geonature.commons.input.AbstractInput import fr.geonature.commons.ui.adapter.AbstractListItemRecyclerViewAdapter @@ -45,7 +45,6 @@ class CountingFragment : Fragment(), private var input: Input? = null private var adapter: CountingRecyclerViewAdapter? = null - private var contentView: CoordinatorLayout? = null private var recyclerView: RecyclerView? = null private var emptyTextView: TextView? = null private var fab: ExtendedFloatingActionButton? = null @@ -84,7 +83,6 @@ class CountingFragment : Fragment(), savedInstanceState ) - contentView = view.findViewById(android.R.id.content) recyclerView = view.findViewById(android.R.id.list) emptyTextView = view.findViewById(android.R.id.empty) @@ -109,35 +107,31 @@ class CountingFragment : Fragment(), position: Int, item: CountingMetadata ) { - adapter?.remove(item) - (input?.getCurrentSelectedInputTaxon() as InputTaxon?)?.deleteCountingMetadata(item.index) - (activity as AbstractPagerFragmentActivity?)?.validateCurrentPage() - context?.run { - @Suppress("DEPRECATION") getSystemService( this, Vibrator::class.java - )?.vibrate(100) - } - - contentView?.also { - Snackbar.make( - it, - R.string.counting_snackbar_counting_deleted, - Snackbar.LENGTH_LONG + )?.vibrate( + VibrationEffect.createOneShot( + 100, + VibrationEffect.DEFAULT_AMPLITUDE + ) ) - .setAction( - R.string.counting_snackbar_counting_undo - ) { - adapter?.add( - item, - position - ) - (input?.getCurrentSelectedInputTaxon() as InputTaxon?)?.addCountingMetadata( - item - ) + + AlertDialog.Builder(this) + .setTitle(R.string.alert_dialog_counting_delete_title) + .setPositiveButton( + R.string.alert_dialog_ok + ) { dialog, _ -> + adapter?.remove(item) + (input?.getCurrentSelectedInputTaxon() as InputTaxon?)?.deleteCountingMetadata(item.index) + (activity as AbstractPagerFragmentActivity?)?.validateCurrentPage() + + dialog.dismiss() } + .setNegativeButton( + R.string.alert_dialog_cancel + ) { dialog, _ -> dialog.dismiss() } .show() } } diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/input/summary/InputTaxaSummaryFragment.kt b/occtax/src/main/java/fr/geonature/occtax/ui/input/summary/InputTaxaSummaryFragment.kt index fc2db93d..9512d9ce 100644 --- a/occtax/src/main/java/fr/geonature/occtax/ui/input/summary/InputTaxaSummaryFragment.kt +++ b/occtax/src/main/java/fr/geonature/occtax/ui/input/summary/InputTaxaSummaryFragment.kt @@ -1,6 +1,7 @@ package fr.geonature.occtax.ui.input.summary import android.os.Bundle +import android.os.VibrationEffect import android.os.Vibrator import android.text.TextUtils import android.view.LayoutInflater @@ -11,7 +12,7 @@ import android.view.View import android.view.ViewGroup import android.view.animation.AnimationUtils import android.widget.TextView -import android.widget.Toast +import androidx.appcompat.app.AlertDialog import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.core.content.ContextCompat.getSystemService import androidx.fragment.app.Fragment @@ -19,8 +20,6 @@ import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton -import com.google.android.material.snackbar.BaseTransientBottomBar -import com.google.android.material.snackbar.Snackbar import fr.geonature.commons.input.AbstractInput import fr.geonature.commons.input.AbstractInputTaxon import fr.geonature.commons.ui.adapter.AbstractListItemRecyclerViewAdapter @@ -42,7 +41,6 @@ class InputTaxaSummaryFragment : Fragment(), private var input: Input? = null private var adapter: InputTaxaSummaryRecyclerViewAdapter? = null - private var contentView: CoordinatorLayout? = null private var recyclerView: RecyclerView? = null private var emptyTextView: TextView? = null private var fab: ExtendedFloatingActionButton? = null @@ -89,7 +87,6 @@ class InputTaxaSummaryFragment : Fragment(), // we have a menu item to show in action bar setHasOptionsMenu(true) - contentView = view.findViewById(android.R.id.content) recyclerView = view.findViewById(android.R.id.list) fab = view.findViewById(R.id.fab) @@ -119,63 +116,31 @@ class InputTaxaSummaryFragment : Fragment(), position: Int, item: AbstractInputTaxon ) { - adapter?.remove(item) - input?.removeInputTaxon(item.taxon.id) - (activity as AbstractPagerFragmentActivity?)?.validateCurrentPage() - context?.run { - @Suppress("DEPRECATION") getSystemService( this, Vibrator::class.java - )?.vibrate(100) - } - - contentView?.also { - Snackbar.make( - it, - R.string.summary_snackbar_input_taxon_deleted, - Snackbar.LENGTH_LONG + )?.vibrate( + VibrationEffect.createOneShot( + 100, + VibrationEffect.DEFAULT_AMPLITUDE + ) ) - .setAction( - R.string.summary_snackbar_input_taxon_undo - ) { - adapter?.add( - item, - position - ) - input?.addInputTaxon(item) + + AlertDialog.Builder(this) + .setTitle(R.string.alert_dialog_taxon_delete_title) + .setPositiveButton( + R.string.alert_dialog_ok + ) { dialog, _ -> + adapter?.remove(item) + input?.removeInputTaxon(item.taxon.id) + (activity as AbstractPagerFragmentActivity?)?.validateCurrentPage() + + dialog.dismiss() } - .addCallback(object : BaseTransientBottomBar.BaseCallback() { - override fun onDismissed( - transientBottomBar: Snackbar?, - event: Int - ) { - super.onDismissed( - transientBottomBar, - event - ) - - (activity as AbstractPagerFragmentActivity?)?.validateCurrentPage() - - // check if this step is still valid and apply automatic redirection if any - if (!this@InputTaxaSummaryFragment.validate()) { - val context = context ?: return - - Toast.makeText( - context, - R.string.summary_toast_no_input_taxon, - Toast.LENGTH_LONG - ) - .show() - - ((activity as AbstractPagerFragmentActivity?))?.also { activity -> - activity.goToPreviousPage() - activity.goToNextPage() - } - } - } - }) + .setNegativeButton( + R.string.alert_dialog_cancel + ) { dialog, _ -> dialog.dismiss() } .show() } } diff --git a/occtax/src/main/res/values-fr/strings.xml b/occtax/src/main/res/values-fr/strings.xml index 57adb6dc..78b76a5d 100644 --- a/occtax/src/main/res/values-fr/strings.xml +++ b/occtax/src/main/res/values-fr/strings.xml @@ -65,6 +65,9 @@ Abandonner les changements apportés à ce dénombrement ? Abandonner Continuer la saisie + Souhaitez vous supprimer ce relevé ? + Souhaitez vous supprimer ce dénombrement ? + Souhaitez vous supprimer ce taxon ? Ajouter un commentaire Éditer le commentaire Ajouter un commentaire diff --git a/occtax/src/main/res/values/strings.xml b/occtax/src/main/res/values/strings.xml index 29c615e2..49aa37d6 100644 --- a/occtax/src/main/res/values/strings.xml +++ b/occtax/src/main/res/values/strings.xml @@ -66,6 +66,9 @@ Discard changes to this counting? Discard Keep editing + Delete this input? + Delete this counting? + Delete this taxon? Add a comment Edit a comment Add a comment From d9c0c28f63bf6c5a15bafd9d45ac8ec10ae55333 Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Wed, 29 Jun 2022 19:40:27 +0200 Subject: [PATCH 15/24] feat(#114): use a NumberPicker to edit "Min" & "Max" properties values --- .../NomenclatureTypesRecyclerViewAdapter.kt | 161 ++++++------------ .../ui/shared/view/NumberPickerHelper.kt | 50 ++++++ .../main/res/layout/view_action_min_max.xml | 65 ++++--- 3 files changed, 131 insertions(+), 145 deletions(-) create mode 100644 occtax/src/main/java/fr/geonature/occtax/ui/shared/view/NumberPickerHelper.kt diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt index d74ec4b4..23c1f097 100644 --- a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt +++ b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt @@ -2,24 +2,26 @@ package fr.geonature.occtax.ui.input.counting import android.database.Cursor import android.text.Editable -import android.text.TextWatcher import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.ArrayAdapter import android.widget.AutoCompleteTextView +import android.widget.NumberPicker +import android.widget.TextView import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.RecyclerView import com.google.android.material.textfield.TextInputLayout import fr.geonature.commons.data.entity.Nomenclature import fr.geonature.commons.data.entity.NomenclatureType -import fr.geonature.commons.util.KeyboardUtils.hideSoftKeyboard import fr.geonature.occtax.R import fr.geonature.occtax.input.CountingMetadata import fr.geonature.occtax.input.NomenclatureTypeViewType import fr.geonature.occtax.input.PropertyValue import fr.geonature.occtax.settings.PropertySettings +import fr.geonature.occtax.ui.shared.view.setOnValueChangedListener import java.util.Locale +import kotlin.math.ceil /** * Default RecyclerView Adapter used by [EditCountingMetadataFragment]. @@ -322,134 +324,73 @@ class NomenclatureTypesRecyclerViewAdapter(private val listener: OnNomenclatureT false ) ) { - private var editMin: TextInputLayout = itemView.findViewById(R.id.editMin) - private var editMax: TextInputLayout = itemView.findViewById(R.id.editMax) - - private val minTextWatcher = object : TextWatcher { - override fun beforeTextChanged( - s: CharSequence?, - start: Int, - count: Int, - after: Int - ) { - } - - override fun onTextChanged( - s: CharSequence?, - start: Int, - before: Int, - count: Int - ) { - } - - override fun afterTextChanged(s: Editable?) { - val minValue = s?.toString()?.toIntOrNull() ?: 0 - val maxValue = editMax.editText?.text?.toString()?.toIntOrNull() ?: 0 - - if (minValue > maxValue) setMaxValue(minValue) + private val defaultMaxValueOffset = 50 + private var editMinLabel: TextView = itemView.findViewById(R.id.editMinLabel) + private var editMaxLabel: TextView = itemView.findViewById(R.id.editMaxLabel) + private var editMinPicker: NumberPicker = itemView.findViewById(R.id.editMinPicker) + private var editMaxPicker: NumberPicker = itemView.findViewById(R.id.editMaxPicker) - setMinValue(minValue) - editMin.editText?.setSelection(minValue.toString().length) - - listener.onMinMaxValues( - minValue, - if (minValue > maxValue) minValue else maxValue - ) - } - } - - private val maxTextWatcher = object : TextWatcher { - override fun beforeTextChanged( - s: CharSequence?, - start: Int, - count: Int, - after: Int - ) { - } - - override fun onTextChanged( - s: CharSequence?, - start: Int, - before: Int, - count: Int - ) { - } - - override fun afterTextChanged(s: Editable?) { - val minValue = editMin.editText?.text?.toString()?.toIntOrNull() ?: 0 - val maxValue = s?.toString()?.toIntOrNull() ?: 0 - - setMaxValue(maxValue) - editMax.editText?.setSelection(maxValue.toString().length) + init { + with(editMinPicker) { + minValue = 0 + maxValue = defaultMaxValueOffset + setOnValueChangedListener(defaultMaxValueOffset) { + editMaxPicker.maxValue = editMinPicker.maxValue - listener.onMinMaxValues( - minValue, - if (minValue > maxValue) minValue else maxValue - ) - } - } + if (editMaxPicker.value < it) editMaxPicker.value = it - init { - with(editMin) { - visibility = View.GONE - editText?.addTextChangedListener(minTextWatcher) - setOnFocusChangeListener { v, hasFocus -> - if (!hasFocus) { - // workaround to force hide the soft keyboard - hideSoftKeyboard(v) - } + listener.onMinMaxValues( + it, + editMaxPicker.value + ) } } - with(editMax) { - visibility = View.GONE - editText?.addTextChangedListener(maxTextWatcher) - setOnFocusChangeListener { v, hasFocus -> - if (!hasFocus) { - // workaround to force hide the soft keyboard - hideSoftKeyboard(v) + with(editMaxPicker) { + minValue = 0 + maxValue = defaultMaxValueOffset + setOnValueChangedListener(defaultMaxValueOffset) { + editMinPicker.maxValue = editMaxPicker.maxValue - val minValue = editMin.editText?.text?.toString()?.toIntOrNull() ?: 0 - val maxValue = editMax.editText?.text?.toString()?.toIntOrNull() ?: 0 + if (editMinPicker.value > it) editMinPicker.value = it - if (minValue > maxValue) setMaxValue(minValue) - } + listener.onMinMaxValues( + editMinPicker.value, + it + ) } } } override fun onBind(property: PropertyValue) { - editMin.visibility = - if (hasMinAndMaxPropertyValues() || property.code == "MIN") View.VISIBLE else View.GONE - editMax.visibility = - if (hasMinAndMaxPropertyValues() || property.code == "MAX") View.VISIBLE else View.GONE - - (properties.firstOrNull { it.code == "MIN" }?.value as Int?)?.also { - setMinValue(it) + with(if (hasMinAndMaxPropertyValues() || property.code == "MIN") View.VISIBLE else View.GONE) { + editMinLabel.visibility = this + editMinPicker.visibility = this } - (properties.firstOrNull { it.code == "MAX" }?.value as Int?)?.also { - setMaxValue(it) + with(if (hasMinAndMaxPropertyValues() || property.code == "MAX") View.VISIBLE else View.GONE) { + editMaxLabel.visibility = this + editMaxPicker.visibility = this } - } - private fun setMinValue(min: Int = 0) { - editMin.also { - it.editText?.removeTextChangedListener(minTextWatcher) - it.editText?.text = Editable.Factory.getInstance() - .newEditable(min.toString()) - it.editText?.addTextChangedListener(minTextWatcher) + (properties.firstOrNull { it.code == "MIN" }?.value as Int?)?.also { + if (it > editMinPicker.maxValue) { + editMinPicker.maxValue = + (ceil((it.toDouble() / defaultMaxValueOffset)) * defaultMaxValueOffset).toInt() + editMaxPicker.maxValue = editMinPicker.maxValue + } + + editMinPicker.value = it } - if ((editMax.editText?.text?.toString()?.toIntOrNull() ?: 0) < min) setMaxValue(min) - } + (properties.firstOrNull { it.code == "MAX" }?.value as Int?)?.also { + if (it > editMaxPicker.maxValue) { + editMaxPicker.maxValue = + (ceil((it.toDouble() / defaultMaxValueOffset)) * defaultMaxValueOffset).toInt() + editMinPicker.maxValue = editMaxPicker.maxValue + } - private fun setMaxValue(max: Int = 0) { - editMax.also { - it.editText?.removeTextChangedListener(maxTextWatcher) - it.editText?.text = Editable.Factory.getInstance() - .newEditable(max.toString()) - it.editText?.addTextChangedListener(maxTextWatcher) + editMaxPicker.value = it } } diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/shared/view/NumberPickerHelper.kt b/occtax/src/main/java/fr/geonature/occtax/ui/shared/view/NumberPickerHelper.kt new file mode 100644 index 00000000..10fa9889 --- /dev/null +++ b/occtax/src/main/java/fr/geonature/occtax/ui/shared/view/NumberPickerHelper.kt @@ -0,0 +1,50 @@ +package fr.geonature.occtax.ui.shared.view + +import android.widget.EditText +import android.widget.NumberPicker +import androidx.core.view.children +import kotlin.math.ceil + +/** + * Utilities function about NumberPicker. + * + * @author S. Grimault + */ + +/** + * Extension function to increment automatically the `maxValue` attribute when the current value + * reach the max value. + * + * @param offset the offset used to increment the max value + * @param callback the listener to be notified on change of the current value + */ +fun NumberPicker.setOnValueChangedListener(offset: Int, callback: (newValue: Int) -> Unit) { + setOnValueChangedListener { _, _, newVal -> + if (newVal == maxValue) { + maxValue += offset + } + + callback.invoke(newVal) + } + + children.find { it is EditText }?.let { it as EditText }?.also { + it.filters = emptyArray() + it.setOnFocusChangeListener { _, hasFocus -> + if (hasFocus) { + it.selectAll() + } else { + it.setSelection( + 0, + 0 + ) + + val intValue = it.text?.toString()?.toIntOrNull() ?: 0 + + if (intValue > maxValue) maxValue = + (ceil((intValue.toDouble() / offset)) * offset).toInt() + value = intValue + callback.invoke(value) + } + } + } +} \ No newline at end of file diff --git a/occtax/src/main/res/layout/view_action_min_max.xml b/occtax/src/main/res/layout/view_action_min_max.xml index b3cf1300..71fba80b 100644 --- a/occtax/src/main/res/layout/view_action_min_max.xml +++ b/occtax/src/main/res/layout/view_action_min_max.xml @@ -2,51 +2,46 @@ - + app:layout_constraintEnd_toEndOf="@+id/editMinPicker" + app:layout_constraintStart_toStartOf="@+id/editMinPicker" /> - - - - - + app:layout_constraintHorizontal_bias="0.2" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/editMinLabel" /> - + - + \ No newline at end of file From cd037d94d64d038b9c9a6538aa34bc5bd0d04a89 Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Wed, 29 Jun 2022 20:00:41 +0200 Subject: [PATCH 16/24] fix(#140): cosmetic issue, comment edit text within a CardView --- .../fragment_observers_and_date_input.xml | 75 +++++++++++++------ occtax/src/main/res/values-fr/strings.xml | 1 + occtax/src/main/res/values/strings.xml | 1 + 3 files changed, 53 insertions(+), 24 deletions(-) diff --git a/occtax/src/main/res/layout/fragment_observers_and_date_input.xml b/occtax/src/main/res/layout/fragment_observers_and_date_input.xml index f26856cb..98ae1ca8 100644 --- a/occtax/src/main/res/layout/fragment_observers_and_date_input.xml +++ b/occtax/src/main/res/layout/fragment_observers_and_date_input.xml @@ -15,9 +15,7 @@ @@ -38,8 +36,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/padding_default" - android:layout_marginTop="@dimen/padding_default" android:layout_marginEnd="@dimen/padding_default" + android:layout_marginBottom="@dimen/padding_default" app:cardCornerRadius="@dimen/cardview_radius" app:cardElevation="@dimen/cardview_elevation" app:contentPadding="@dimen/padding_default"> @@ -58,8 +56,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/padding_default" - android:layout_marginTop="@dimen/padding_default" android:layout_marginEnd="@dimen/padding_default" + android:layout_marginBottom="@dimen/padding_default" app:cardCornerRadius="@dimen/cardview_radius" app:cardElevation="@dimen/cardview_elevation" app:contentPadding="@dimen/padding_default"> @@ -69,7 +67,7 @@ android:layout_height="wrap_content"> @@ -136,24 +134,53 @@ - + android:layout_marginStart="@dimen/padding_default" + android:layout_marginEnd="@dimen/padding_default" + android:layout_marginBottom="@dimen/padding_default" + app:cardCornerRadius="@dimen/cardview_radius" + app:cardElevation="@dimen/cardview_elevation" + app:contentPadding="@dimen/padding_default"> - + android:orientation="vertical"> + + + + + + + + + + + + - diff --git a/occtax/src/main/res/values-fr/strings.xml b/occtax/src/main/res/values-fr/strings.xml index 78b76a5d..73d48c1c 100644 --- a/occtax/src/main/res/values-fr/strings.xml +++ b/occtax/src/main/res/values-fr/strings.xml @@ -116,6 +116,7 @@ La date de fin doit être après celle du début EEE dd MMM yyyy EEE dd MMM yyyy \'à\' HH:mm + Commentaire du relevé Ajouter un commentaire Éditer le commentaire diff --git a/occtax/src/main/res/values/strings.xml b/occtax/src/main/res/values/strings.xml index 49aa37d6..4764fc88 100644 --- a/occtax/src/main/res/values/strings.xml +++ b/occtax/src/main/res/values/strings.xml @@ -116,6 +116,7 @@ End date should be after start date EEE dd MMM yyyy EEE dd MMM yyyy \'at\' HH:mm + Input comment Add a comment Edit a comment From 73aab97a2f07f54cf86db736307c553e26b57c57 Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Wed, 29 Jun 2022 21:31:35 +0200 Subject: [PATCH 17/24] chore: update maps module dependency --- gn_mobile_maps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gn_mobile_maps b/gn_mobile_maps index cc6d7b5f..fbae4018 160000 --- a/gn_mobile_maps +++ b/gn_mobile_maps @@ -1 +1 @@ -Subproject commit cc6d7b5fd7f75b7d41bf3f93a1aff488482ac9a2 +Subproject commit fbae40182921bfbfa7e09fd955211fc051f00706 From bcddb75802767340af4484ac29035f8d16a9c949 Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Wed, 29 Jun 2022 21:44:31 +0200 Subject: [PATCH 18/24] chore: 2.3.0-rc2 pre-release --- CHANGELOG.md | 15 +++++++++++++++ occtax/build.gradle | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e98ae64d..44639d67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [2.3.0-rc2](https://github.com/PnX-SI/gn_mobile_occtax/releases/tag/2.3.0-rc2) (2022-06-29, pre-release) + +### 🚀 Nouveautés + +* Refonte ergonomique des champs de saisie "Min" et "Max" (https://github.com/PnX-SI/gn_mobile_occtax/issues/114). + +### 🐛 Corrections + +* Possibilité de déplacer directement un marqueur existant via un "toucher long" sur la carte (https://github.com/PnX-SI/gn_mobile_occtax/issues/14). +* Ajustement d'ordre cosmétique sur le commentaire présenté à l'étape 1 du relevé (https://github.com/PnX-SI/gn_mobile_occtax/issues/140). + +### ⚠️ Notes de version + +* Code de version : 3041 + ## [2.3.0-rc1](https://github.com/PnX-SI/gn_mobile_occtax/releases/tag/2.3.0-rc1) (2022-06-25, pre-release) ### 🚀 Nouveautés diff --git a/occtax/build.gradle b/occtax/build.gradle index af4d98e8..45a44198 100644 --- a/occtax/build.gradle +++ b/occtax/build.gradle @@ -21,8 +21,8 @@ android { applicationId "fr.geonature.occtax2" minSdkVersion 26 targetSdkVersion 31 - versionCode 3037 - versionName "2.3.0-rc1" + versionCode 3041 + versionName "2.3.0-rc2" buildConfigField "String", "BUILD_DATE", "\"" + new Date().getTime() + "\"" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" archivesBaseName = project.name + "-" + versionName From 9fccb3018ff0020d16226fbcb8563a85098bda3d Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Sun, 3 Jul 2022 14:30:37 +0200 Subject: [PATCH 19/24] feat(#114): dedicated save button at the bottom of the screen page --- .../counting/EditCountingMetadataActivity.kt | 22 ++--- .../counting/EditCountingMetadataFragment.kt | 87 +++++++++++++++---- .../NomenclatureTypesRecyclerViewAdapter.kt | 51 +++++++++++ occtax/src/main/res/drawable/ic_close.xml | 11 --- occtax/src/main/res/layout/activity_home.xml | 1 - .../res/layout/fragment_counting_edit.xml | 54 ++++++++++++ occtax/src/main/res/menu/save.xml | 10 --- 7 files changed, 179 insertions(+), 57 deletions(-) delete mode 100644 occtax/src/main/res/drawable/ic_close.xml create mode 100644 occtax/src/main/res/layout/fragment_counting_edit.xml delete mode 100644 occtax/src/main/res/menu/save.xml diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/EditCountingMetadataActivity.kt b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/EditCountingMetadataActivity.kt index 3cf46c3e..aba5855f 100644 --- a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/EditCountingMetadataActivity.kt +++ b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/EditCountingMetadataActivity.kt @@ -4,7 +4,6 @@ import android.app.Activity import android.content.Context import android.content.Intent import android.os.Bundle -import android.view.Menu import android.view.MenuItem import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatActivity @@ -38,7 +37,6 @@ class EditCountingMetadataActivity : AppCompatActivity(), supportActionBar?.run { setDisplayHomeAsUpEnabled(true) - setHomeAsUpIndicator(R.drawable.ic_close) } countingMetadata = intent.getParcelableExtra(EXTRA_COUNTING_METADATA) ?: CountingMetadata() @@ -65,26 +63,12 @@ class EditCountingMetadataActivity : AppCompatActivity(), } } - override fun onCreateOptionsMenu(menu: Menu?): Boolean { - menuInflater.inflate( - R.menu.save, - menu - ) - - return true - } - override fun onOptionsItemSelected(item: MenuItem): Boolean { return when (item.itemId) { android.R.id.home -> { confirmBeforeQuit() true } - R.id.action_save -> { - sendResult() - finish() - true - } else -> super.onOptionsItemSelected(item) } } @@ -98,6 +82,12 @@ class EditCountingMetadataActivity : AppCompatActivity(), this.isDirty = true } + override fun onSave(countingMetadata: CountingMetadata) { + this.countingMetadata = countingMetadata + sendResult() + finish() + } + private fun sendResult() { setResult(Activity.RESULT_OK, Intent().apply { diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/EditCountingMetadataFragment.kt b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/EditCountingMetadataFragment.kt index f8a32454..97edf664 100644 --- a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/EditCountingMetadataFragment.kt +++ b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/EditCountingMetadataFragment.kt @@ -6,14 +6,17 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.view.animation.AnimationUtils +import android.widget.ProgressBar +import android.widget.TextView import androidx.core.os.bundleOf -import androidx.core.view.setPadding import androidx.fragment.app.Fragment import androidx.loader.app.LoaderManager import androidx.loader.content.CursorLoader import androidx.loader.content.Loader import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton import dagger.hilt.android.AndroidEntryPoint import fr.geonature.commons.data.ContentProviderAuthority import fr.geonature.commons.data.GeoNatureModuleName @@ -51,6 +54,10 @@ class EditCountingMetadataFragment : Fragment(), @Inject lateinit var moduleName: String + private var progressBar: ProgressBar? = null + private var emptyTextView: TextView? = null + private var fab: ExtendedFloatingActionButton? = null + private var listener: OnEditCountingMetadataFragmentListener? = null private var adapter: NomenclatureTypesRecyclerViewAdapter? = null private lateinit var taxonomy: Taxonomy @@ -174,12 +181,28 @@ class EditCountingMetadataFragment : Fragment(), container: ViewGroup?, savedInstanceState: Bundle? ): View { - val recyclerView = inflater.inflate( - R.layout.recycler_view, + return inflater.inflate( + R.layout.fragment_counting_edit, container, false ) - recyclerView.setPadding(resources.getDimensionPixelOffset(R.dimen.padding_default)) + } + + override fun onViewCreated( + view: View, + savedInstanceState: Bundle? + ) { + val recyclerView = view.findViewById(android.R.id.list) + + progressBar = view.findViewById(android.R.id.progress) + emptyTextView = view.findViewById(android.R.id.empty) + + fab = view.findViewById(R.id.fab) + fab?.apply { + setOnClickListener { + listener?.onSave(countingMetadata) + } + } // Set the adapter adapter = NomenclatureTypesRecyclerViewAdapter(object : @@ -187,7 +210,7 @@ class EditCountingMetadataFragment : Fragment(), override fun onAction(nomenclatureTypeMnemonic: String) { // workaround to force hide the soft keyboard - view?.rootView?.also { + view.rootView?.also { hideSoftKeyboard(it) } @@ -212,26 +235,40 @@ class EditCountingMetadataFragment : Fragment(), listener?.onCountingMetadata(countingMetadata) } + + override fun showEmptyTextView(show: Boolean) { + progressBar?.visibility = View.GONE + + if (emptyTextView?.visibility == View.VISIBLE == show) { + return + } + + if (show) { + emptyTextView?.startAnimation( + AnimationUtils.loadAnimation( + context, + android.R.anim.fade_in + ) + ) + emptyTextView?.visibility = View.VISIBLE + } else { + emptyTextView?.startAnimation( + AnimationUtils.loadAnimation( + context, + android.R.anim.fade_out + ) + ) + emptyTextView?.visibility = View.GONE + } + } }) - with(recyclerView as RecyclerView) { + with(recyclerView) { layoutManager = LinearLayoutManager(context) adapter = this@EditCountingMetadataFragment.adapter } - return recyclerView - } - - override fun onViewCreated( - view: View, - savedInstanceState: Bundle? - ) { - LoaderManager.getInstance(this) - .initLoader( - LOADER_NOMENCLATURE_TYPES, - null, - loaderCallbacks - ) + loadNomenclatureTypes() } override fun onAttach(context: Context) { @@ -256,6 +293,17 @@ class EditCountingMetadataFragment : Fragment(), listener?.onCountingMetadata(countingMetadata) } + private fun loadNomenclatureTypes() { + progressBar?.visibility = View.VISIBLE + + LoaderManager.getInstance(this) + .initLoader( + LOADER_NOMENCLATURE_TYPES, + null, + loaderCallbacks + ) + } + private fun loadDefaultNomenclatureValues() { LoaderManager.getInstance(this) .initLoader( @@ -275,6 +323,7 @@ class EditCountingMetadataFragment : Fragment(), */ interface OnEditCountingMetadataFragmentListener { fun onCountingMetadata(countingMetadata: CountingMetadata) + fun onSave(countingMetadata: CountingMetadata) } companion object { diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt index 23c1f097..a6140ed3 100644 --- a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt +++ b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt @@ -35,6 +35,52 @@ class NomenclatureTypesRecyclerViewAdapter(private val listener: OnNomenclatureT private val availableNomenclatureTypes = mutableListOf>() private val properties = mutableListOf() + init { + this.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() { + override fun onChanged() { + super.onChanged() + + listener.showEmptyTextView(itemCount == 0) + } + + override fun onItemRangeChanged( + positionStart: Int, + itemCount: Int + ) { + super.onItemRangeChanged( + positionStart, + itemCount + ) + + listener.showEmptyTextView(getItemCount() == 0) + } + + override fun onItemRangeInserted( + positionStart: Int, + itemCount: Int + ) { + super.onItemRangeInserted( + positionStart, + itemCount + ) + + listener.showEmptyTextView(false) + } + + override fun onItemRangeRemoved( + positionStart: Int, + itemCount: Int + ) { + super.onItemRangeRemoved( + positionStart, + itemCount + ) + + listener.showEmptyTextView(getItemCount() == 0) + } + }) + } + override fun onCreateViewHolder( parent: ViewGroup, viewType: Int @@ -421,5 +467,10 @@ class NomenclatureTypesRecyclerViewAdapter(private val listener: OnNomenclatureT min: Int = 0, max: Int = 0 ) + + /** + * Whether to show an empty text view when data changed. + */ + fun showEmptyTextView(show: Boolean) } } diff --git a/occtax/src/main/res/drawable/ic_close.xml b/occtax/src/main/res/drawable/ic_close.xml deleted file mode 100644 index 2bc7934e..00000000 --- a/occtax/src/main/res/drawable/ic_close.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/occtax/src/main/res/layout/activity_home.xml b/occtax/src/main/res/layout/activity_home.xml index c03d38e9..2c060c96 100644 --- a/occtax/src/main/res/layout/activity_home.xml +++ b/occtax/src/main/res/layout/activity_home.xml @@ -11,7 +11,6 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/occtax/src/main/res/menu/save.xml b/occtax/src/main/res/menu/save.xml deleted file mode 100644 index a81d66d0..00000000 --- a/occtax/src/main/res/menu/save.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file From 1349bf522489afec8217ea4108073d84302ba1b2 Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Mon, 4 Jul 2022 19:33:27 +0200 Subject: [PATCH 20/24] feat(#114): "Max" property value follow "Min" property value if the latter is modified by the user --- .../ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt index a6140ed3..d679f862 100644 --- a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt +++ b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt @@ -382,8 +382,7 @@ class NomenclatureTypesRecyclerViewAdapter(private val listener: OnNomenclatureT maxValue = defaultMaxValueOffset setOnValueChangedListener(defaultMaxValueOffset) { editMaxPicker.maxValue = editMinPicker.maxValue - - if (editMaxPicker.value < it) editMaxPicker.value = it + editMaxPicker.value = it listener.onMinMaxValues( it, From f5bb736e77cde3949dd322604a86d97fa5edcb3f Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Mon, 4 Jul 2022 20:53:25 +0200 Subject: [PATCH 21/24] chore: 2.3.0-rc3 pre-release --- CHANGELOG.md | 15 +++++++++++++++ occtax/build.gradle | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44639d67..5bba9832 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [2.3.0-rc3](https://github.com/PnX-SI/gn_mobile_occtax/releases/tag/2.3.0-rc3) (2022-07-04, pre-release) + +### 🚀 Nouveautés + +* Légère refonte ergonomique du formulaire sur le dénombrement (https://github.com/PnX-SI/gn_mobile_occtax/issues/114). + +### 🐛 Corrections + +* Le champ de saisie "Max" prend la valeur du champ de saisie "Min" si ce dernier est directement + modifié par l'utilisateur (https://github.com/PnX-SI/gn_mobile_occtax/issues/114). + +### ⚠️ Notes de version + +* Code de version : 3049 + ## [2.3.0-rc2](https://github.com/PnX-SI/gn_mobile_occtax/releases/tag/2.3.0-rc2) (2022-06-29, pre-release) ### 🚀 Nouveautés diff --git a/occtax/build.gradle b/occtax/build.gradle index 45a44198..3ab24287 100644 --- a/occtax/build.gradle +++ b/occtax/build.gradle @@ -21,8 +21,8 @@ android { applicationId "fr.geonature.occtax2" minSdkVersion 26 targetSdkVersion 31 - versionCode 3041 - versionName "2.3.0-rc2" + versionCode 3049 + versionName "2.3.0-rc3" buildConfigField "String", "BUILD_DATE", "\"" + new Date().getTime() + "\"" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" archivesBaseName = project.name + "-" + versionName From de39ba8b37e7b4b04deb10e1eb53c6b63db2a8a1 Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Wed, 13 Jul 2022 14:41:35 +0200 Subject: [PATCH 22/24] fix(#114): cosmetic issue, "max" value follows "min" value when "max" = "min" --- .../NomenclatureTypesRecyclerViewAdapter.kt | 20 ++++++++++++------- .../ui/shared/view/NumberPickerHelper.kt | 17 ++++++++++++---- .../res/layout/fragment_counting_edit.xml | 2 +- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt index d679f862..adcb7952 100644 --- a/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt +++ b/occtax/src/main/java/fr/geonature/occtax/ui/input/counting/NomenclatureTypesRecyclerViewAdapter.kt @@ -380,12 +380,18 @@ class NomenclatureTypesRecyclerViewAdapter(private val listener: OnNomenclatureT with(editMinPicker) { minValue = 0 maxValue = defaultMaxValueOffset - setOnValueChangedListener(defaultMaxValueOffset) { - editMaxPicker.maxValue = editMinPicker.maxValue - editMaxPicker.value = it + setOnValueChangedListener(defaultMaxValueOffset) { oldValue, newValue -> + if (editMaxPicker.value < newValue) { + editMaxPicker.maxValue = editMinPicker.maxValue + editMaxPicker.value = newValue + } + + if (editMaxPicker.value == oldValue) { + editMaxPicker.value = newValue + } listener.onMinMaxValues( - it, + newValue, editMaxPicker.value ) } @@ -394,14 +400,14 @@ class NomenclatureTypesRecyclerViewAdapter(private val listener: OnNomenclatureT with(editMaxPicker) { minValue = 0 maxValue = defaultMaxValueOffset - setOnValueChangedListener(defaultMaxValueOffset) { + setOnValueChangedListener(defaultMaxValueOffset) { _, newValue -> editMinPicker.maxValue = editMaxPicker.maxValue - if (editMinPicker.value > it) editMinPicker.value = it + if (editMinPicker.value > newValue) editMinPicker.value = newValue listener.onMinMaxValues( editMinPicker.value, - it + newValue ) } } diff --git a/occtax/src/main/java/fr/geonature/occtax/ui/shared/view/NumberPickerHelper.kt b/occtax/src/main/java/fr/geonature/occtax/ui/shared/view/NumberPickerHelper.kt index 10fa9889..c37c4941 100644 --- a/occtax/src/main/java/fr/geonature/occtax/ui/shared/view/NumberPickerHelper.kt +++ b/occtax/src/main/java/fr/geonature/occtax/ui/shared/view/NumberPickerHelper.kt @@ -18,13 +18,19 @@ import kotlin.math.ceil * @param offset the offset used to increment the max value * @param callback the listener to be notified on change of the current value */ -fun NumberPicker.setOnValueChangedListener(offset: Int, callback: (newValue: Int) -> Unit) { - setOnValueChangedListener { _, _, newVal -> +fun NumberPicker.setOnValueChangedListener( + offset: Int, + callback: (oldValue: Int, newValue: Int) -> Unit +) { + setOnValueChangedListener { _, oldVal, newVal -> if (newVal == maxValue) { maxValue += offset } - callback.invoke(newVal) + callback.invoke( + oldVal, + newVal + ) } children.find { it is EditText }?.let { it as EditText }?.also { @@ -43,7 +49,10 @@ fun NumberPicker.setOnValueChangedListener(offset: Int, callback: (newValue: Int if (intValue > maxValue) maxValue = (ceil((intValue.toDouble() / offset)) * offset).toInt() value = intValue - callback.invoke(value) + callback.invoke( + value, + value + ) } } } diff --git a/occtax/src/main/res/layout/fragment_counting_edit.xml b/occtax/src/main/res/layout/fragment_counting_edit.xml index 55fd07c7..52aef9ce 100644 --- a/occtax/src/main/res/layout/fragment_counting_edit.xml +++ b/occtax/src/main/res/layout/fragment_counting_edit.xml @@ -42,13 +42,13 @@ android:id="@+id/fab" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/padding_default" android:layout_marginBottom="@dimen/padding_default" android:gravity="center" android:text="@string/action_save" app:elevation="@dimen/fab_elevation" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" app:layout_constraintWidth_percent="0.5" /> \ No newline at end of file From 88a73013c33478fd1af504c8bef4337b34793c50 Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Wed, 13 Jul 2022 14:54:58 +0200 Subject: [PATCH 23/24] chore: 2.3.0-rc4 pre-release --- CHANGELOG.md | 11 +++++++++++ occtax/build.gradle | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bba9832..64cb4009 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [2.3.0-rc4](https://github.com/PnX-SI/gn_mobile_occtax/releases/tag/2.3.0-rc4) (2022-07-13, pre-release) + +### 🐛 Corrections + +* Légère refonte ergonomique du formulaire sur le dénombrement (https://github.com/PnX-SI/gn_mobile_occtax/issues/114). +* Le champ de saisie "Max" suit la valeur du champ de saisie "Min" si ces deux valeurs sont identiques. + +### ⚠️ Notes de version + +* Code de version : 3061 + ## [2.3.0-rc3](https://github.com/PnX-SI/gn_mobile_occtax/releases/tag/2.3.0-rc3) (2022-07-04, pre-release) ### 🚀 Nouveautés diff --git a/occtax/build.gradle b/occtax/build.gradle index 3ab24287..bbc8c74e 100644 --- a/occtax/build.gradle +++ b/occtax/build.gradle @@ -21,8 +21,8 @@ android { applicationId "fr.geonature.occtax2" minSdkVersion 26 targetSdkVersion 31 - versionCode 3049 - versionName "2.3.0-rc3" + versionCode 3061 + versionName "2.3.0-rc4" buildConfigField "String", "BUILD_DATE", "\"" + new Date().getTime() + "\"" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" archivesBaseName = project.name + "-" + versionName From fad68567c55209777fc1d9de6d8db399d07b571e Mon Sep 17 00:00:00 2001 From: "S. Grimault" Date: Thu, 14 Jul 2022 10:29:38 +0200 Subject: [PATCH 24/24] chore: 2.3.0 release --- CHANGELOG.md | 24 ++++++++++++++++++++++++ occtax/build.gradle | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64cb4009..5cf3c86c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## [2.3.0](https://github.com/PnX-SI/gn_mobile_occtax/releases/tag/2.3.0) (2022-07-14, release) + +### 🚀 Nouveautés + +* Possibilité d'ajouter directement un marqueur via un "toucher long" sur la carte (https://github.com/PnX-SI/gn_mobile_occtax/issues/14). +* La rotation de la carte est bloquée par défaut (https://github.com/PnX-SI/gn_mobile_occtax/issues/139). + Son paramétrage reste accessible par configuration (cf. [README.md](https://github.com/PnX-SI/gn_mobile_maps/blob/develop/maps/README.md#parameters-description) du module). +* Le commentaire du relevé est présent également à l'étape 1 du relevé, sous le choix de la date (https://github.com/PnX-SI/gn_mobile_occtax/issues/140). +* Refonte ergonomique des champs de saisie "Min" et "Max" (https://github.com/PnX-SI/gn_mobile_occtax/issues/114). +* Mise en place des boîtes de dialogue de confirmation pour la suppression des éléments saisis (https://github.com/PnX-SI/gn_mobile_occtax/issues/77) + +### 🐛 Corrections + +* Suppression de la double vérification de la validité du cookie de session et du token de session (https://github.com/PnX-SI/gn_mobile_occtax/issues/163). + L'application reste "connectée" par défaut tant qu'elle ne reçoit pas en retour d'appel d'API une + erreur 401. +* Libellé du champ date plus clair quand seule la date de début du relevé est configurée (https://github.com/PnX-SI/gn_mobile_occtax/issues/165). +* Ajustement d'ordre cosmétique sur le commentaire présenté à l'étape 1 du relevé (https://github.com/PnX-SI/gn_mobile_occtax/issues/140). + +### ⚠️ Notes de version + +* Code de version : 3070 +* L'application est officiellement compatible avec les terminaux tournant sur Android 8.0 au minimum. + ## [2.3.0-rc4](https://github.com/PnX-SI/gn_mobile_occtax/releases/tag/2.3.0-rc4) (2022-07-13, pre-release) ### 🐛 Corrections diff --git a/occtax/build.gradle b/occtax/build.gradle index bbc8c74e..c62bf41e 100644 --- a/occtax/build.gradle +++ b/occtax/build.gradle @@ -21,8 +21,8 @@ android { applicationId "fr.geonature.occtax2" minSdkVersion 26 targetSdkVersion 31 - versionCode 3061 - versionName "2.3.0-rc4" + versionCode 3070 + versionName "2.3.0" buildConfigField "String", "BUILD_DATE", "\"" + new Date().getTime() + "\"" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" archivesBaseName = project.name + "-" + versionName