Finish v1.30.14(332)
This commit is contained in:
commit
9e87130d6c
@ -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 {
|
||||
@ -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 {
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -44,9 +44,9 @@ public class UtilityDate {
|
||||
}
|
||||
|
||||
public static Date recognizeDateWithExceptionHandler(String dateString) {
|
||||
try{
|
||||
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))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user