From 7b623913d8a1279a949b51013ea6e2e6b8e57407 Mon Sep 17 00:00:00 2001 From: ValerioC Date: Mon, 13 Feb 2023 11:56:03 +0100 Subject: [PATCH 01/18] Aggiunto controllo in avvio chiamate rest per evitare che i terminali con android inferiore all'8.0 --- .../core/rest/RESTBuilder.java | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/RESTBuilder.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/RESTBuilder.java index 3def3811..2d1cbd57 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/rest/RESTBuilder.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/RESTBuilder.java @@ -1,5 +1,7 @@ package it.integry.integrywmsnative.core.rest; +import android.os.Build; + import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -59,20 +61,14 @@ public class RESTBuilder { String endpoint = "http://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : ""); - Gson gson = new GsonBuilder() - .setDateFormat("dd/MM/yyyy HH:mm:ss") - .registerTypeAdapter(LocalDate.class, new LocalDateDeserializer()) - .registerTypeAdapter(LocalDate.class, new LocalDateSerializer()) - .registerTypeAdapter(LocalDateTime.class, new LocalDateTimeDeserializer()) - .registerTypeAdapter(LocalDateTime.class, new LocalDateTimeSerializer()) - .excludeFieldsWithModifiers(Modifier.TRANSIENT) - .create(); - Retrofit retrofit = new Retrofit.Builder() - .addConverterFactory(GsonConverterFactory.create(gson)) - .baseUrl(endpoint) - .client(client) - .build(); + GsonBuilder builder = new GsonBuilder().setDateFormat("dd/MM/yyyy HH:mm:ss").excludeFieldsWithModifiers(Modifier.TRANSIENT); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + builder.registerTypeAdapter(LocalDate.class, new LocalDateDeserializer()).registerTypeAdapter(LocalDate.class, new LocalDateSerializer()).registerTypeAdapter(LocalDateTime.class, new LocalDateTimeDeserializer()).registerTypeAdapter(LocalDateTime.class, new LocalDateTimeSerializer()); + } + Gson gson = builder.create(); + + Retrofit retrofit = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create(gson)).baseUrl(endpoint).client(client).build(); return retrofit.create(service); } From c49197d002768d348db800b54d263ff2a0d60ac0 Mon Sep 17 00:00:00 2001 From: ValerioC Date: Mon, 13 Feb 2023 11:59:20 +0100 Subject: [PATCH 02/18] -> v1.30.13 (331) --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e232b11f..08ba127d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services' android { - def appVersionCode = 330 - def appVersionName = '1.30.12' + def appVersionCode = 331 + def appVersionName = '1.30.13' signingConfigs { release { From 79ec6430f62a1a3602f16e559a5375d0a2f9d4e8 Mon Sep 17 00:00:00 2001 From: ValerioC Date: Mon, 13 Feb 2023 13:08:09 +0100 Subject: [PATCH 03/18] =?UTF-8?q?implementata=20libreria=20compatibilit?= =?UTF-8?q?=C3=A0=20LocalDate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 7 +++-- .../core/rest/RESTBuilder.java | 15 +++++----- .../core/utility/UtilityDate.java | 30 ++++++++----------- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 08ba127d..b8ac5c61 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,6 +41,7 @@ android { versionName appVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" signingConfig signingConfigs.release + multiDexEnabled true javaCompileOptions { annotationProcessorOptions { @@ -66,7 +67,7 @@ android { compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 - //coreLibraryDesugaringEnabled true + coreLibraryDesugaringEnabled true } productFlavors { @@ -115,7 +116,7 @@ dependencies { implementation 'com.google.android.gms:play-services-basement:18.1.0' - implementation 'androidx.appcompat:appcompat:1.6.0' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'com.google.android.material:material:1.8.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' @@ -188,7 +189,7 @@ dependencies { // RxJava is also required. implementation 'io.reactivex.rxjava2:rxjava:2.1.12' implementation 'io.reactivex.rxjava2:rxandroid:2.0.2' - + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2' } repositories { diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/RESTBuilder.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/RESTBuilder.java index 2d1cbd57..cafdca2d 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/rest/RESTBuilder.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/RESTBuilder.java @@ -1,7 +1,5 @@ package it.integry.integrywmsnative.core.rest; -import android.os.Build; - import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -62,11 +60,14 @@ public class RESTBuilder { String endpoint = "http://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : ""); - GsonBuilder builder = new GsonBuilder().setDateFormat("dd/MM/yyyy HH:mm:ss").excludeFieldsWithModifiers(Modifier.TRANSIENT); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - builder.registerTypeAdapter(LocalDate.class, new LocalDateDeserializer()).registerTypeAdapter(LocalDate.class, new LocalDateSerializer()).registerTypeAdapter(LocalDateTime.class, new LocalDateTimeDeserializer()).registerTypeAdapter(LocalDateTime.class, new LocalDateTimeSerializer()); - } - Gson gson = builder.create(); + Gson gson = new GsonBuilder() + .setDateFormat("dd/MM/yyyy HH:mm:ss") + .excludeFieldsWithModifiers(Modifier.TRANSIENT) + .registerTypeAdapter(LocalDate.class, new LocalDateDeserializer()) + .registerTypeAdapter(LocalDate.class, new LocalDateSerializer()) + .registerTypeAdapter(LocalDateTime.class, new LocalDateTimeDeserializer()) + .registerTypeAdapter(LocalDateTime.class, new LocalDateTimeSerializer()) + .create(); Retrofit retrofit = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create(gson)).baseUrl(endpoint).client(client).build(); diff --git a/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityDate.java b/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityDate.java index d5130ea0..634378ed 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityDate.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityDate.java @@ -43,10 +43,10 @@ public class UtilityDate { public static final String DMY_HUMAN_LONG = "dd MMMM yyyy"; } - public static Date recognizeDateWithExceptionHandler(String dateString) { - try{ + public static Date recognizeDateWithExceptionHandler(String dateString) { + try { return UtilityDate.recognizeDate(dateString); - } catch (ParseException | DateNotRecognizedException | TimeNotRecognizedException pex){ + } catch (ParseException | DateNotRecognizedException | TimeNotRecognizedException pex) { UtilityLogger.error(pex); return null; } @@ -64,9 +64,9 @@ public class UtilityDate { char dateSeparator; String onlyDateSubstring = dateString.substring(0, 10); - if(onlyDateSubstring.contains("/")) dateSeparator = '/'; - else if(onlyDateSubstring.contains("-")) dateSeparator = '-'; - else if(onlyDateSubstring.contains(".")) dateSeparator = '.'; + if (onlyDateSubstring.contains("/")) dateSeparator = '/'; + else if (onlyDateSubstring.contains("-")) dateSeparator = '-'; + else if (onlyDateSubstring.contains(".")) dateSeparator = '.'; else throw new DateNotRecognizedException(dateString); String dateFormatString = (dateString.charAt(2) == dateSeparator) @@ -74,13 +74,13 @@ public class UtilityDate { : "yyyy" + dateSeparator + "MM" + dateSeparator + "dd"; - if(dateString.length() > 10){ + if (dateString.length() > 10) { char timeSeparator; String onlyTimeSubstring = dateString.substring(10, 14); - if(onlyTimeSubstring.contains("-")) timeSeparator = '-'; - else if(onlyTimeSubstring.contains(":")) timeSeparator = ':'; + if (onlyTimeSubstring.contains("-")) timeSeparator = '-'; + else if (onlyTimeSubstring.contains(":")) timeSeparator = ':'; else throw new TimeNotRecognizedException(dateString); String timeFormatString = "HH" + timeSeparator + "mm" + timeSeparator + "ss"; @@ -99,12 +99,11 @@ public class UtilityDate { public static String formatDate(Date dateToFormat, String format) { - if(dateToFormat != null) { + if (dateToFormat != null) { SimpleDateFormat sdf = new SimpleDateFormat(format); //sdf.setTimeZone(TimeZone.getTimeZone("GMT")); return sdf.format(dateToFormat); - } - else return null; + } else return null; } @@ -116,7 +115,7 @@ public class UtilityDate { public static Date getDateInstance(boolean removeTime) { var calendar = getCalendarInstance(); - if(removeTime) { + if (removeTime) { calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); @@ -131,8 +130,6 @@ public class UtilityDate { } - - public static String formatDate(LocalDate dateToFormat, String format) { if (dateToFormat != null) { DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format); @@ -185,7 +182,6 @@ public class UtilityDate { } - public static LocalDate getNow() { return Instant.now() .atZone(currentZone) @@ -197,6 +193,7 @@ public class UtilityDate { .atZone(currentZone) .toLocalDateTime(); } + public static LocalDate timeToLocalDate(long time, @Nullable String timezone) { return Instant.ofEpochSecond(time) .atZone(timezone == null ? currentZone : ZoneId.of(timezone)) @@ -210,7 +207,6 @@ public class UtilityDate { } - public static long localDateTimeToTime(LocalDateTime localDateTime, @Nullable String timezone) { return localDateTime .atZone(timezone == null ? currentZone : ZoneId.of(timezone)) From 0f6a9cdae2291e1560456f8ba787e61b585e2d5f Mon Sep 17 00:00:00 2001 From: ValerioC Date: Mon, 13 Feb 2023 13:09:20 +0100 Subject: [PATCH 04/18] -> v1.30.14 (332) --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b8ac5c61..3f5cbb81 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services' android { - def appVersionCode = 331 - def appVersionName = '1.30.13' + def appVersionCode = 332 + def appVersionName = '1.30.14' signingConfigs { release { From ad9795a3a3b3b335cd4851cb4bb26f95a6b11cf6 Mon Sep 17 00:00:00 2001 From: ValerioC Date: Mon, 13 Feb 2023 14:25:56 +0100 Subject: [PATCH 05/18] test compilazione jenkins con desugaring --- app/build.gradle | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3f5cbb81..797d03c5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -41,7 +41,6 @@ android { versionName appVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" signingConfig signingConfigs.release - multiDexEnabled true javaCompileOptions { annotationProcessorOptions { @@ -98,6 +97,7 @@ android { } dependencies { + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2' implementation fileTree(include: ['*.jar'], dir: 'libs') androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', { exclude group: 'com.android.support', module: 'support-annotations' @@ -189,7 +189,6 @@ dependencies { // RxJava is also required. implementation 'io.reactivex.rxjava2:rxjava:2.1.12' implementation 'io.reactivex.rxjava2:rxandroid:2.0.2' - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2' } repositories { From b02eaf02a8663ac3913fda72db1a4adef269a455 Mon Sep 17 00:00:00 2001 From: ValerioC Date: Mon, 13 Feb 2023 17:46:57 +0100 Subject: [PATCH 06/18] aggiornamento progetto a AGP 8.1 --- .idea/kotlinc.xml | 6 ++++ .idea/runConfigurations/app_base.xml | 5 ++-- .idea/runConfigurations/app_vglimenti.xml | 5 ++-- app/build.gradle | 1 + .../AccettazionePickingActivity.java | 20 ++++++------- .../gest/main/MainActivity.java | 29 +++++++------------ .../ui/expandablelayout/ExpandableLayout.java | 12 ++++---- .../DialogInputQuantityV2View.java | 6 ++-- .../view/dialogs/yes_no/DialogYesNoView.java | 7 ++--- build.gradle | 3 +- gradle/wrapper/gradle-wrapper.properties | 6 ++-- 11 files changed, 47 insertions(+), 53 deletions(-) create mode 100644 .idea/kotlinc.xml diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 00000000..2b8a50fc --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/app_base.xml b/.idea/runConfigurations/app_base.xml index f55876a3..07234dec 100644 --- a/.idea/runConfigurations/app_base.xml +++ b/.idea/runConfigurations/app_base.xml @@ -1,6 +1,6 @@ - +