Finish v1.30.14(332)

This commit is contained in:
Valerio Castellana 2023-02-13 13:09:26 +01:00
commit 9e87130d6c
3 changed files with 27 additions and 29 deletions

View File

@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
android { android {
def appVersionCode = 331 def appVersionCode = 332
def appVersionName = '1.30.13' def appVersionName = '1.30.14'
signingConfigs { signingConfigs {
release { release {
@ -41,6 +41,7 @@ android {
versionName appVersionName versionName appVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.release signingConfig signingConfigs.release
multiDexEnabled true
javaCompileOptions { javaCompileOptions {
annotationProcessorOptions { annotationProcessorOptions {
@ -66,7 +67,7 @@ android {
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_11 sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11
//coreLibraryDesugaringEnabled true coreLibraryDesugaringEnabled true
} }
productFlavors { productFlavors {
@ -115,7 +116,7 @@ dependencies {
implementation 'com.google.android.gms:play-services-basement:18.1.0' 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 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.8.0' implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
@ -188,7 +189,7 @@ dependencies {
// RxJava is also required. // RxJava is also required.
implementation 'io.reactivex.rxjava2:rxjava:2.1.12' implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2' implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.2'
} }
repositories { repositories {

View File

@ -1,7 +1,5 @@
package it.integry.integrywmsnative.core.rest; package it.integry.integrywmsnative.core.rest;
import android.os.Build;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
@ -62,11 +60,14 @@ public class RESTBuilder {
String endpoint = "http://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : ""); String endpoint = "http://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : "");
GsonBuilder builder = new GsonBuilder().setDateFormat("dd/MM/yyyy HH:mm:ss").excludeFieldsWithModifiers(Modifier.TRANSIENT); Gson gson = new GsonBuilder()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { .setDateFormat("dd/MM/yyyy HH:mm:ss")
builder.registerTypeAdapter(LocalDate.class, new LocalDateDeserializer()).registerTypeAdapter(LocalDate.class, new LocalDateSerializer()).registerTypeAdapter(LocalDateTime.class, new LocalDateTimeDeserializer()).registerTypeAdapter(LocalDateTime.class, new LocalDateTimeSerializer()); .excludeFieldsWithModifiers(Modifier.TRANSIENT)
} .registerTypeAdapter(LocalDate.class, new LocalDateDeserializer())
Gson gson = builder.create(); .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(); Retrofit retrofit = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create(gson)).baseUrl(endpoint).client(client).build();

View File

@ -103,8 +103,7 @@ public class UtilityDate {
SimpleDateFormat sdf = new SimpleDateFormat(format); SimpleDateFormat sdf = new SimpleDateFormat(format);
//sdf.setTimeZone(TimeZone.getTimeZone("GMT")); //sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
return sdf.format(dateToFormat); return sdf.format(dateToFormat);
} } else return null;
else return null;
} }
@ -131,8 +130,6 @@ public class UtilityDate {
} }
public static String formatDate(LocalDate dateToFormat, String format) { public static String formatDate(LocalDate dateToFormat, String format) {
if (dateToFormat != null) { if (dateToFormat != null) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format); DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
@ -185,7 +182,6 @@ public class UtilityDate {
} }
public static LocalDate getNow() { public static LocalDate getNow() {
return Instant.now() return Instant.now()
.atZone(currentZone) .atZone(currentZone)
@ -197,6 +193,7 @@ public class UtilityDate {
.atZone(currentZone) .atZone(currentZone)
.toLocalDateTime(); .toLocalDateTime();
} }
public static LocalDate timeToLocalDate(long time, @Nullable String timezone) { public static LocalDate timeToLocalDate(long time, @Nullable String timezone) {
return Instant.ofEpochSecond(time) return Instant.ofEpochSecond(time)
.atZone(timezone == null ? currentZone : ZoneId.of(timezone)) .atZone(timezone == null ? currentZone : ZoneId.of(timezone))
@ -210,7 +207,6 @@ public class UtilityDate {
} }
public static long localDateTimeToTime(LocalDateTime localDateTime, @Nullable String timezone) { public static long localDateTimeToTime(LocalDateTime localDateTime, @Nullable String timezone) {
return localDateTime return localDateTime
.atZone(timezone == null ? currentZone : ZoneId.of(timezone)) .atZone(timezone == null ? currentZone : ZoneId.of(timezone))