Implementazioni varie
This commit is contained in:
parent
0e81cc3371
commit
90dbe35bd0
51
.idea/assetWizardSettings.xml
generated
Normal file
51
.idea/assetWizardSettings.xml
generated
Normal file
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="WizardSettings">
|
||||
<option name="children">
|
||||
<map>
|
||||
<entry key="imageWizard">
|
||||
<value>
|
||||
<PersistentState />
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="vectorWizard">
|
||||
<value>
|
||||
<PersistentState>
|
||||
<option name="children">
|
||||
<map>
|
||||
<entry key="vectorAssetStep">
|
||||
<value>
|
||||
<PersistentState>
|
||||
<option name="children">
|
||||
<map>
|
||||
<entry key="clipartAsset">
|
||||
<value>
|
||||
<PersistentState>
|
||||
<option name="values">
|
||||
<map>
|
||||
<entry key="url" value="jar:file:/C:/Program%20Files/Android/Android%20Studio/plugins/android/lib/android.jar!/images/material_design_icons/action/ic_print_black_24dp.xml" />
|
||||
</map>
|
||||
</option>
|
||||
</PersistentState>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
<option name="values">
|
||||
<map>
|
||||
<entry key="outputName" value="ic_print_black_24dp" />
|
||||
<entry key="sourceFile" value="C:\Users\GiuseppeS" />
|
||||
</map>
|
||||
</option>
|
||||
</PersistentState>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</PersistentState>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@ -10,6 +10,7 @@
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/pointmobilescannerlibrary" />
|
||||
<option value="$PROJECT_DIR$/waterfall_toolbar" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
|
||||
1
.idea/modules.xml
generated
1
.idea/modules.xml
generated
@ -5,6 +5,7 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/IntegryWMSNative.iml" filepath="$PROJECT_DIR$/IntegryWMSNative.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/pointmobilescannerlibrary/pointmobilescannerlibrary.iml" filepath="$PROJECT_DIR$/pointmobilescannerlibrary/pointmobilescannerlibrary.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/waterfall_toolbar/waterfall_toolbar.iml" filepath="$PROJECT_DIR$/waterfall_toolbar/waterfall_toolbar.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -29,16 +29,12 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
|
||||
implementation 'com.orhanobut:logger:2.2.0'
|
||||
|
||||
|
||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||
implementation 'com.android.support:support-v4:27.1.1'
|
||||
implementation 'com.android.support:design:27.1.1'
|
||||
@ -46,46 +42,34 @@ dependencies {
|
||||
implementation 'com.android.support:cardview-v7:27.1.1'
|
||||
implementation 'com.android.support:recyclerview-v7:27.1.1'
|
||||
implementation 'com.android.support:preference-v7:27.1.1'
|
||||
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.0.0'
|
||||
|
||||
implementation 'org.parceler:parceler-api:1.1.10'
|
||||
annotationProcessor 'org.parceler:parceler:1.1.10'
|
||||
|
||||
implementation 'com.annimon:stream:1.2.1'
|
||||
|
||||
//MVVM
|
||||
implementation "android.arch.lifecycle:extensions:1.1.1"
|
||||
implementation 'android.arch.lifecycle:extensions:1.1.1'
|
||||
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
|
||||
|
||||
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
|
||||
implementation 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.1.1'
|
||||
implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.1.1'
|
||||
implementation 'com.jakewharton.rxbinding2:rxbinding-design:2.1.1'
|
||||
implementation 'com.jakewharton.rxbinding2:rxbinding-recyclerview-v7:2.1.1'
|
||||
|
||||
implementation 'com.jakewharton:butterknife:8.8.1'
|
||||
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
|
||||
|
||||
implementation 'br.com.zbra:android-linq:1.1.0'
|
||||
|
||||
//FAB
|
||||
//implementation 'com.getbase:floatingactionbutton:1.10.1'
|
||||
implementation 'com.github.clans:fab:1.6.4'
|
||||
|
||||
//CUSTOM VIEWS
|
||||
implementation 'de.hdodenhof:circleimageview:2.2.0'
|
||||
|
||||
implementation 'com.fxn769:stash:1.2'
|
||||
|
||||
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
|
||||
implementation 'com.github.frankiesardo:linearlistview:1.0.1@aar'
|
||||
|
||||
|
||||
implementation 'com.github.andrefrsousa:SuperBottomSheet:1.2.1@aar'
|
||||
implementation 'com.fede987:status-bar-alert:1.0.1'
|
||||
|
||||
|
||||
implementation 'com.fxn769:stash:1.2'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
implementation project(':waterfall_toolbar')
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
@ -26,9 +26,19 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".gest.accettazione_ordine_inevaso.AccettazioneOrdineInevasoActivity"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity android:name=".gest.login.LoginActivity" android:theme="@style/Theme.AppCompat.Light.NoActionBar"></activity>
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustNothing" />
|
||||
<activity
|
||||
android:name=".gest.login.LoginActivity"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
|
||||
<activity
|
||||
android:name=".gest.lista_bancali.ListaBancaliActivity"
|
||||
android:label="@string/activity_lista_bancali_title"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
|
||||
<activity
|
||||
android:name=".gest.contenuto_bancale.ContenutoBancaleActivity"
|
||||
android:label="@string/activity_contenuto_bancale_title"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar"></activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@ -12,6 +12,7 @@ import com.orhanobut.logger.Logger;
|
||||
import it.integry.integrywmsnative.core.REST.watcher.ServerStatusChecker;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.settings.Stash;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||
|
||||
@ -30,6 +31,7 @@ public class MainApplication extends Application {
|
||||
SettingsManager.init(this);
|
||||
ServerStatusChecker.init();
|
||||
|
||||
// UtilityExceptions.init(this);
|
||||
UtilityResources.init(this);
|
||||
|
||||
Logger.addLogAdapter(new AndroidLogAdapter());
|
||||
|
||||
@ -25,6 +25,8 @@ public class CommonRESTException {
|
||||
return "Errore di comunicazione con il server remoto. Riprova.";
|
||||
} else if(ex instanceof SocketTimeoutException){
|
||||
return "Errore di timeout durante la comunicazione con il server remoto. Riprova.";
|
||||
} else if(ex.getMessage().startsWith("Printer not found")){
|
||||
return "Stampante non configurata";
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.REST;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import okhttp3.OkHttpClient;
|
||||
import retrofit2.Retrofit;
|
||||
@ -15,11 +17,20 @@ public class RESTBuilder {
|
||||
// return getService(service, "192.168.2.13", 8080);
|
||||
return getService(service, SettingsManager.i().server.host, SettingsManager.i().server.port, true);
|
||||
|
||||
}
|
||||
public static <T> T getService(final Class<T> service, long timeout) {
|
||||
// return getService(service, "192.168.2.13", 8080);
|
||||
return getService(service, SettingsManager.i().server.host, SettingsManager.i().server.port, true);
|
||||
|
||||
}
|
||||
|
||||
public static <T> T getService(final Class<T> service, String host, int port, boolean addInterceptors){
|
||||
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder();
|
||||
|
||||
clientBuilder.connectTimeout(30, TimeUnit.SECONDS);
|
||||
clientBuilder.readTimeout(30, TimeUnit.SECONDS);
|
||||
clientBuilder.writeTimeout(30, TimeUnit.SECONDS);
|
||||
|
||||
if(addInterceptors) clientBuilder.addInterceptor(new HttpInterceptor());
|
||||
|
||||
OkHttpClient client = clientBuilder.build();
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
package it.integry.integrywmsnative.core.REST.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.generated.callback.Runnable;
|
||||
|
||||
public class DepositoRESTConsumer {
|
||||
|
||||
public static void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete) {
|
||||
|
||||
MtbDepo mtbDepo = new MtbDepo();
|
||||
mtbDepo.setCodMdep(codMdep);
|
||||
mtbDepo.setOperation(CommonModelConsts.OPERATION.SELECT);
|
||||
mtbDepo.setOnlyPkMaster(false);
|
||||
|
||||
EntityRESTConsumer.selectEntity(mtbDepo, new ISimpleOperationCallback<List<MtbDepo>>() {
|
||||
@Override
|
||||
public void onSuccess(List<MtbDepo> value) {
|
||||
if(value != null && value.size() > 0) {
|
||||
onComplete.run(value.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
UtilityLogger.errorMe(ex);
|
||||
}
|
||||
}, MtbDepo.class);
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,6 +6,8 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.REST.model.EsitoType;
|
||||
@ -18,7 +20,7 @@ import retrofit2.Response;
|
||||
|
||||
public class EntityRESTConsumer {
|
||||
|
||||
public static <T extends EntityBase> void processEntity(T entityToSave, final ISimpleOperationCallback<T> callback, final Type clazzType){
|
||||
public static <T extends EntityBase> void processEntity(T entityToSave, final ISimpleOperationCallback<T> callback, Class<T> type){
|
||||
|
||||
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
||||
Call<ServiceRESTResponse<Object>> request = service.processEntity(entityToSave);
|
||||
@ -30,9 +32,66 @@ public class EntityRESTConsumer {
|
||||
if(response.body() != null) {
|
||||
if(response.body().getEsito() == EsitoType.OK) {
|
||||
Gson gson = new Gson();
|
||||
//Type fooType = new TypeToken<T>() {}.getType();
|
||||
String json = gson.toJson(response.body().getEntity());
|
||||
callback.onSuccess(gson.fromJson(json, clazzType));
|
||||
|
||||
callback.onSuccess(gson.fromJson(json, type));
|
||||
} else {
|
||||
Log.e("EntityRESTConsumer", response.body().getErrorMessage());
|
||||
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
||||
}
|
||||
} else {
|
||||
Log.e("EntityRESTConsumer", response.message());
|
||||
callback.onFailed(new Exception(response.message()));
|
||||
}
|
||||
} else {
|
||||
Log.e("EntityRESTConsumer", "Status " + response.code() + ": " + response.message());
|
||||
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||
Log.e("EntityRESTConsumer", t.toString());
|
||||
callback.onFailed(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static <T extends EntityBase> void selectEntity(T entityToSave, final ISimpleOperationCallback<List<T>> callback, Class type){
|
||||
|
||||
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
||||
Call<ServiceRESTResponse<Object>> request = service.processEntity(entityToSave);
|
||||
request.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
if(response.isSuccessful()) {
|
||||
|
||||
if(response.body() != null) {
|
||||
if(response.body().getEsito() == EsitoType.OK) {
|
||||
Gson gson = new Gson();
|
||||
String json = gson.toJson(response.body().getEntityList());
|
||||
|
||||
List<T> newList = new ArrayList<T>();
|
||||
|
||||
Type fooType = new TypeToken<ArrayList<T>>() {}.getType();
|
||||
List<T> oldList = gson.fromJson(json, fooType);
|
||||
|
||||
|
||||
|
||||
if(oldList != null) {
|
||||
for (int i = 0; i < oldList.size(); i ++){
|
||||
String jsonTmp = gson.toJson(oldList.get(i));
|
||||
|
||||
newList.add((T) gson.fromJson(jsonTmp, type));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
callback.onSuccess(newList);
|
||||
} else {
|
||||
Log.e("EntityRESTConsumer", response.body().getErrorMessage());
|
||||
callback.onFailed(new Exception(response.body().getErrorMessage()));
|
||||
|
||||
@ -0,0 +1,72 @@
|
||||
package it.integry.integrywmsnative.core.REST.consumers;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.REST.model.GestSetupDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.generated.callback.Runnable;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class GestSetupRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public static void getValue(String gestName, String sectionName, String keySection, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
||||
service.getGestSetupValue(gestName, sectionName, keySection).enqueue(new Callback<ServiceRESTResponse<GestSetupDTO>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
|
||||
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
||||
Log.e("PrintCollo", t.toString());
|
||||
UtilityLogger.errorMe(new Exception(t));
|
||||
if(onFailed != null) onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getBooleanValue(String gestName, String sectionName, String keySection, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
getValue(gestName, sectionName, keySection, value -> {
|
||||
if(value != null){
|
||||
onComplete.run("S".equalsIgnoreCase(value.value));
|
||||
} else onComplete.run(false);
|
||||
}, ex -> {
|
||||
if(onFailed != null) onFailed.run(ex);
|
||||
});
|
||||
}
|
||||
|
||||
public static void getValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<GestSetupDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
|
||||
service.getGestSetupValue(gestName, sectionName, keySection, codMdep).enqueue(new Callback<ServiceRESTResponse<GestSetupDTO>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<GestSetupDTO>> call, Response<ServiceRESTResponse<GestSetupDTO>> response) {
|
||||
analyzeAnswer(response, "GestSetup", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<GestSetupDTO>> call, Throwable t) {
|
||||
Log.e("PrintCollo", t.toString());
|
||||
UtilityLogger.errorMe(new Exception(t));
|
||||
if(onFailed != null) onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getBooleanValue(String gestName, String sectionName, String keySection, String codMdep, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
getValue(gestName, sectionName, keySection, codMdep, value -> {
|
||||
if(value != null){
|
||||
onComplete.run("S".equalsIgnoreCase(value.value));
|
||||
} else onComplete.run(false);
|
||||
}, ex -> {
|
||||
if(onFailed != null) onFailed.run(ex);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package it.integry.integrywmsnative.core.REST.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.GestSetupDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GestSetupRESTConsumerService {
|
||||
|
||||
@GET("gestSetup")
|
||||
Call<ServiceRESTResponse<GestSetupDTO>> getGestSetupValue(
|
||||
@Query("gestName") String gestName,
|
||||
@Query("section") String section,
|
||||
@Query("keySection") String keySection);
|
||||
|
||||
@GET("gestSetup")
|
||||
Call<ServiceRESTResponse<GestSetupDTO>> getGestSetupValue(
|
||||
@Query("gestName") String gestName,
|
||||
@Query("section") String section,
|
||||
@Query("keySection") String keySection,
|
||||
@Query("codMdep") String codMdep);
|
||||
|
||||
}
|
||||
@ -3,17 +3,22 @@ package it.integry.integrywmsnative.core.REST.consumers;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.CommonRESTException;
|
||||
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.REST.model.EsitoType;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
import static br.com.zbra.androidlinq.Linq.stream;
|
||||
|
||||
public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public enum Type {
|
||||
@ -44,12 +49,24 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
printerService.getAvailablePrinters(codMdep).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
||||
analyzeAnswer(response, "GetAvailablePrinters", callback);
|
||||
analyzeAnswer(response, "GetAvailablePrinters", new ISimpleOperationCallback<List<String>>() {
|
||||
@Override
|
||||
public void onSuccess(List<String> value) {
|
||||
callback.onSuccess(value != null ? stream(value).where(x -> x != null).toList() : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
callback.onFailed(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, Throwable t) {
|
||||
|
||||
Log.e("GetAvailablePrinters", t.toString());
|
||||
UtilityLogger.errorMe(new Exception(t));
|
||||
callback.onFailed(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -66,12 +83,14 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, Throwable t) {
|
||||
|
||||
Log.e("GetAvailablePrinters", t.toString());
|
||||
UtilityLogger.errorMe(new Exception(t));
|
||||
callback.onFailed(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void printCollo(String printerName, MtbColt testataColloToPrint, int quantity, String reportName, final ISimpleOperationCallback<Object> callback) {
|
||||
public static void printCollo(String printerName, MtbColt testataColloToPrint, int quantity, String reportName, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||
printerService.printCollo(
|
||||
@ -86,13 +105,14 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
.enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "PrintCollo", callback);
|
||||
analyzeAnswer(response, "PrintCollo", data -> {
|
||||
onComplete.run();
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||
Log.e("PrintCollo", t.toString());
|
||||
callback.onFailed(new Exception(t));
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -5,6 +5,8 @@ import java.util.List;
|
||||
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
@ -22,12 +24,13 @@ public interface PrinterRESTConsumerService {
|
||||
|
||||
|
||||
@POST("pkgPrintLabel")
|
||||
@FormUrlEncoded
|
||||
Call<ServiceRESTResponse<Object>> printCollo(
|
||||
@Query("printerName") String printerName,
|
||||
@Query("dataCollo") String dataCollo,
|
||||
@Query("gestione") String gestione,
|
||||
@Query("serCollo") String serCollo,
|
||||
@Query("numCollo") int numCollo,
|
||||
@Field("dataCollo") String dataCollo,
|
||||
@Field("gestione") String gestione,
|
||||
@Field("serCollo") String serCollo,
|
||||
@Field("numCollo") int numCollo,
|
||||
@Query("printQuantity") int printQuantity,
|
||||
@Query("reportName") String reportName
|
||||
);
|
||||
|
||||
@ -2,27 +2,73 @@ package it.integry.integrywmsnative.core.REST.consumers;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.MailDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.MailRequestDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.NativeSqlRequestDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.generated.callback.Runnable;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public static <T> void processSql(String nativeSql, final Type clazz, final ISimpleOperationCallback<T> callback) {
|
||||
|
||||
NativeSqlRequestDTO nativeSqlDTO = new NativeSqlRequestDTO();
|
||||
nativeSqlDTO.nativeSql = nativeSql;
|
||||
|
||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||
service.processSql(nativeSqlDTO).enqueue(new Callback<ServiceRESTResponse<Object>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "ProcessSql", new ISimpleOperationCallback<Object>() {
|
||||
@Override
|
||||
public void onSuccess(Object value) {
|
||||
Gson gson = new Gson();
|
||||
String json = gson.toJson(value);
|
||||
|
||||
InputStream ims = new ByteArrayInputStream(json.getBytes());
|
||||
Reader reader = new InputStreamReader(ims);
|
||||
T gsonObj = gson.fromJson(reader, clazz);
|
||||
|
||||
callback.onSuccess(gsonObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
callback.onFailed(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||
Log.e("ProcessSql", t.toString());
|
||||
callback.onFailed(new Exception(t));
|
||||
UtilityLogger.errorMe(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void getAvailableProfiles(final ISimpleOperationCallback<List<String>> callback){
|
||||
|
||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||
@ -36,6 +82,7 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, final Throwable t) {
|
||||
Log.e("ProfilesAvailable", t.toString());
|
||||
callback.onFailed(new Exception(t));
|
||||
UtilityLogger.errorMe(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
@ -59,10 +106,9 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
public void onFailure(Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> call, final Throwable t) {
|
||||
Log.e("CodMdepsAvailable", t.toString());
|
||||
callback.onFailed(new Exception(t));
|
||||
UtilityLogger.errorMe(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -71,7 +117,7 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
String currentAzienda = UtilityString.isNullOrEmpty(SettingsManager.i().userSession.profileDB) ? "" : " [" + SettingsManager.i().userSession.profileDB + "]";
|
||||
|
||||
|
||||
MailDTO mailDTO = new MailDTO()
|
||||
MailRequestDTO mailDTO = new MailRequestDTO()
|
||||
.setFrom("sender@integry.it")
|
||||
.setFromName("WMS Android")
|
||||
.setTo(TextUtils.join(";", CommonConst.Mail.forErrors))
|
||||
@ -85,7 +131,7 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public static void sendMail(MailDTO mailDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public static void sendMail(MailRequestDTO mailDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
SystemRESTConsumerService service = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||
service.sendMail(mailDTO).enqueue(new Callback<ServiceRESTResponse<String>>() {
|
||||
|
||||
@ -3,7 +3,8 @@ package it.integry.integrywmsnative.core.REST.consumers;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.MailDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.MailRequestDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.NativeSqlRequestDTO;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
@ -13,6 +14,9 @@ import retrofit2.http.Query;
|
||||
|
||||
public interface SystemRESTConsumerService {
|
||||
|
||||
@POST("processSql")
|
||||
Call<ServiceRESTResponse<Object>> processSql(@Body NativeSqlRequestDTO nativeSqlDTO);
|
||||
|
||||
@GET("getAvailableProfiles")
|
||||
Call<ServiceRESTResponse<List<String>>> getAvailableProfiles(@Query("username") String username, @Query("password") String password);
|
||||
|
||||
@ -20,6 +24,6 @@ public interface SystemRESTConsumerService {
|
||||
Call<ServiceRESTResponse<List<AvailableCodMdepsDTO>>> getAvailableCodMdeps();
|
||||
|
||||
@POST("sendEmail")
|
||||
Call<ServiceRESTResponse<String>> sendMail(@Body MailDTO mailDto);
|
||||
Call<ServiceRESTResponse<String>> sendMail(@Body MailRequestDTO mailDto);
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import android.util.Log;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.model.EsitoType;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import retrofit2.Response;
|
||||
|
||||
@ -29,7 +30,20 @@ public class _BaseRESTConsumer {
|
||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> void analyzeAnswer(Response<ServiceRESTResponse<T>> response, String logTitle, RunnableArgs<T> onComplete, RunnableArgs<Exception> onFailed){
|
||||
analyzeAnswer(response, logTitle, new ISimpleOperationCallback<T>() {
|
||||
@Override
|
||||
public void onSuccess(T value) {
|
||||
onComplete.run(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
package it.integry.integrywmsnative.core.REST.model;
|
||||
|
||||
public class GestSetupDTO {
|
||||
|
||||
public String value;
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
package it.integry.integrywmsnative.core.REST.model;
|
||||
|
||||
public class MailDTO {
|
||||
public class MailRequestDTO {
|
||||
|
||||
private String from;
|
||||
private String fromName;
|
||||
@ -18,7 +18,7 @@ public class MailDTO {
|
||||
return from;
|
||||
}
|
||||
|
||||
public MailDTO setFrom(String from) {
|
||||
public MailRequestDTO setFrom(String from) {
|
||||
this.from = from;
|
||||
return this;
|
||||
}
|
||||
@ -27,7 +27,7 @@ public class MailDTO {
|
||||
return fromName;
|
||||
}
|
||||
|
||||
public MailDTO setFromName(String fromName) {
|
||||
public MailRequestDTO setFromName(String fromName) {
|
||||
this.fromName = fromName;
|
||||
return this;
|
||||
}
|
||||
@ -36,7 +36,7 @@ public class MailDTO {
|
||||
return to;
|
||||
}
|
||||
|
||||
public MailDTO setTo(String to) {
|
||||
public MailRequestDTO setTo(String to) {
|
||||
this.to = to;
|
||||
return this;
|
||||
}
|
||||
@ -45,7 +45,7 @@ public class MailDTO {
|
||||
return replyTo;
|
||||
}
|
||||
|
||||
public MailDTO setReplyTo(String replyTo) {
|
||||
public MailRequestDTO setReplyTo(String replyTo) {
|
||||
this.replyTo = replyTo;
|
||||
return this;
|
||||
}
|
||||
@ -54,7 +54,7 @@ public class MailDTO {
|
||||
return replyToName;
|
||||
}
|
||||
|
||||
public MailDTO setReplyToName(String replyToName) {
|
||||
public MailRequestDTO setReplyToName(String replyToName) {
|
||||
this.replyToName = replyToName;
|
||||
return this;
|
||||
}
|
||||
@ -63,7 +63,7 @@ public class MailDTO {
|
||||
return cc;
|
||||
}
|
||||
|
||||
public MailDTO setCc(String cc) {
|
||||
public MailRequestDTO setCc(String cc) {
|
||||
this.cc = cc;
|
||||
return this;
|
||||
}
|
||||
@ -72,7 +72,7 @@ public class MailDTO {
|
||||
return ccn;
|
||||
}
|
||||
|
||||
public MailDTO setCcn(String ccn) {
|
||||
public MailRequestDTO setCcn(String ccn) {
|
||||
this.ccn = ccn;
|
||||
return this;
|
||||
}
|
||||
@ -81,7 +81,7 @@ public class MailDTO {
|
||||
return subject;
|
||||
}
|
||||
|
||||
public MailDTO setSubject(String subject) {
|
||||
public MailRequestDTO setSubject(String subject) {
|
||||
this.subject = subject;
|
||||
return this;
|
||||
}
|
||||
@ -90,7 +90,7 @@ public class MailDTO {
|
||||
return msgText;
|
||||
}
|
||||
|
||||
public MailDTO setMsgText(String msgText) {
|
||||
public MailRequestDTO setMsgText(String msgText) {
|
||||
this.msgText = msgText;
|
||||
return this;
|
||||
}
|
||||
@ -99,7 +99,7 @@ public class MailDTO {
|
||||
return isHtml;
|
||||
}
|
||||
|
||||
public MailDTO setHtml(boolean html) {
|
||||
public MailRequestDTO setHtml(boolean html) {
|
||||
isHtml = html;
|
||||
return this;
|
||||
}
|
||||
@ -108,7 +108,7 @@ public class MailDTO {
|
||||
return isDebug;
|
||||
}
|
||||
|
||||
public MailDTO setDebug(boolean debug) {
|
||||
public MailRequestDTO setDebug(boolean debug) {
|
||||
isDebug = debug;
|
||||
return this;
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.REST.model;
|
||||
|
||||
public class NativeSqlRequestDTO {
|
||||
|
||||
public String nativeSql;
|
||||
|
||||
}
|
||||
@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.REST.model;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by GiuseppeS on 06/03/2018.
|
||||
@ -17,6 +18,7 @@ public class ServiceRESTResponse<T> {
|
||||
|
||||
private T dto;
|
||||
private T entity;
|
||||
private List<T> entityList;
|
||||
|
||||
public EsitoType getEsito() {
|
||||
return EsitoType.fromIntValue(esito);
|
||||
@ -46,4 +48,8 @@ public class ServiceRESTResponse<T> {
|
||||
public T getEntity() {
|
||||
return entity;
|
||||
}
|
||||
|
||||
public List<T> getEntityList() {
|
||||
return entityList;
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,9 +32,9 @@ public class RecyclerViewAdapterBinders {
|
||||
//// .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
//// for (int i = 0; i < entries.size(); i++) {
|
||||
//// T entry = entries.get(i);
|
||||
//// ViewDataBinding binding = DataBindingUtil
|
||||
//// ViewDataBinding bindings = DataBindingUtil
|
||||
//// .inflate(inflater, layoutId, viewGroup, true);
|
||||
//// binding.setVariable(BR.data, entry);
|
||||
//// bindings.setVariable(BR.data, entry);
|
||||
//// }
|
||||
//// }
|
||||
// }
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
package it.integry.integrywmsnative.core.interfaces;
|
||||
|
||||
public interface IRecyclerItemClicked<T> {
|
||||
void onItemClick(T item, int position);
|
||||
}
|
||||
@ -1,11 +1,14 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class MtbColr extends EntityBase{
|
||||
public class MtbColr extends EntityBase implements Parcelable {
|
||||
|
||||
|
||||
private String gestione;
|
||||
@ -35,13 +38,181 @@ public class MtbColr extends EntityBase{
|
||||
private String mtbPartitaMag_descrizione;
|
||||
private String dataScadPartita;
|
||||
private String descrizione;
|
||||
|
||||
private String untMis;
|
||||
|
||||
public MtbColr() {
|
||||
type = "mtb_colr";
|
||||
}
|
||||
|
||||
|
||||
protected MtbColr(Parcel in) {
|
||||
type = "mtb_colr";
|
||||
gestione = in.readString();
|
||||
serCollo = in.readString();
|
||||
if (in.readByte() == 0) {
|
||||
numCollo = null;
|
||||
} else {
|
||||
numCollo = in.readInt();
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
riga = null;
|
||||
} else {
|
||||
riga = in.readInt();
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
rigaOrd = null;
|
||||
} else {
|
||||
rigaOrd = in.readInt();
|
||||
}
|
||||
codMart = in.readString();
|
||||
codBarre = in.readString();
|
||||
codCol = in.readString();
|
||||
codTagl = in.readString();
|
||||
partitaMag = in.readString();
|
||||
gestioneRif = in.readString();
|
||||
serColloRif = in.readString();
|
||||
note = in.readString();
|
||||
dataOrd = in.readString();
|
||||
dataColloRif = in.readString();
|
||||
if (in.readByte() == 0) {
|
||||
numOrd = null;
|
||||
} else {
|
||||
numOrd = in.readInt();
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
numEtich = null;
|
||||
} else {
|
||||
numEtich = in.readInt();
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
numColloRif = null;
|
||||
} else {
|
||||
numColloRif = in.readInt();
|
||||
}
|
||||
datetimeRow = in.readString();
|
||||
codJcom = in.readString();
|
||||
insPartitaMag = in.readString();
|
||||
mtbPartitaMag_descrizione = in.readString();
|
||||
dataScadPartita = in.readString();
|
||||
descrizione = in.readString();
|
||||
untMis = in.readString();
|
||||
|
||||
if (in.readByte() == 0) {
|
||||
qtaCnf = null;
|
||||
} else {
|
||||
qtaCnf = new BigDecimal(in.readFloat());
|
||||
}
|
||||
|
||||
if (in.readByte() == 0) {
|
||||
qtaCol = null;
|
||||
} else {
|
||||
qtaCol = new BigDecimal(in.readFloat());
|
||||
}
|
||||
|
||||
if (in.readByte() == 0) {
|
||||
numCnf = null;
|
||||
} else {
|
||||
numCnf = new BigDecimal(in.readFloat());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(gestione);
|
||||
dest.writeString(serCollo);
|
||||
if (numCollo == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(numCollo);
|
||||
}
|
||||
if (riga == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(riga);
|
||||
}
|
||||
if (rigaOrd == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(rigaOrd);
|
||||
}
|
||||
dest.writeString(codMart);
|
||||
dest.writeString(codBarre);
|
||||
dest.writeString(codCol);
|
||||
dest.writeString(codTagl);
|
||||
dest.writeString(partitaMag);
|
||||
dest.writeString(gestioneRif);
|
||||
dest.writeString(serColloRif);
|
||||
dest.writeString(note);
|
||||
dest.writeString(dataOrd);
|
||||
dest.writeString(dataColloRif);
|
||||
if (numOrd == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(numOrd);
|
||||
}
|
||||
if (numEtich == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(numEtich);
|
||||
}
|
||||
if (numColloRif == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(numColloRif);
|
||||
}
|
||||
dest.writeString(datetimeRow);
|
||||
dest.writeString(codJcom);
|
||||
dest.writeString(insPartitaMag);
|
||||
dest.writeString(mtbPartitaMag_descrizione);
|
||||
dest.writeString(dataScadPartita);
|
||||
dest.writeString(descrizione);
|
||||
dest.writeString(untMis);
|
||||
|
||||
if (qtaCnf == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeFloat(qtaCnf.floatValue());
|
||||
}
|
||||
|
||||
if (qtaCol == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeFloat(qtaCol.floatValue());
|
||||
}
|
||||
|
||||
if (numCnf == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeFloat(numCnf.floatValue());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<MtbColr> CREATOR = new Creator<MtbColr>() {
|
||||
@Override
|
||||
public MtbColr createFromParcel(Parcel in) {
|
||||
return new MtbColr(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MtbColr[] newArray(int size) {
|
||||
return new MtbColr[size];
|
||||
}
|
||||
};
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
@ -344,4 +515,15 @@ public class MtbColr extends EntityBase{
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public MtbColr setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,21 +1,25 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import android.databinding.ObservableArrayList;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
|
||||
/**
|
||||
* Created by GiuseppeS on 06/03/2018.
|
||||
*/
|
||||
|
||||
public class MtbColt extends EntityBase{
|
||||
public class MtbColt extends EntityBase implements Parcelable {
|
||||
private String gestione;
|
||||
private String dataCollo;
|
||||
private String serCollo;
|
||||
@ -50,6 +54,196 @@ public class MtbColt extends EntityBase{
|
||||
private BigDecimal larghezzaCm;
|
||||
private BigDecimal altezzaCm;
|
||||
|
||||
protected MtbColt(Parcel in) {
|
||||
type = "mtb_colt";
|
||||
gestione = in.readString();
|
||||
dataCollo = in.readString();
|
||||
serCollo = in.readString();
|
||||
if (in.readByte() == 0) {
|
||||
numCollo = null;
|
||||
} else {
|
||||
numCollo = in.readInt();
|
||||
}
|
||||
rifOrd = in.readString();
|
||||
codAnag = in.readString();
|
||||
codVdes = in.readString();
|
||||
codMdep = in.readString();
|
||||
codVlis = in.readString();
|
||||
codDtip = in.readString();
|
||||
codTcol = in.readString();
|
||||
serDoc = in.readString();
|
||||
filtroOrdini = in.readString();
|
||||
preparatoDa = in.readString();
|
||||
annotazioni = in.readString();
|
||||
posizione = in.readString();
|
||||
codDtipProvv = in.readString();
|
||||
serDocProvv = in.readString();
|
||||
codJfas = in.readString();
|
||||
dataOrd = in.readString();
|
||||
dataDoc = in.readString();
|
||||
oraInizPrep = in.readString();
|
||||
oraFinePrep = in.readString();
|
||||
dataDocProvv = in.readString();
|
||||
dataVers = in.readString();
|
||||
if (in.readByte() == 0) {
|
||||
segno = null;
|
||||
} else {
|
||||
segno = in.readInt();
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
numOrd = null;
|
||||
} else {
|
||||
numOrd = in.readInt();
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
numDoc = null;
|
||||
} else {
|
||||
numDoc = in.readInt();
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
numDocProvv = null;
|
||||
} else {
|
||||
numDocProvv = in.readInt();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (in.readByte() == 0) {
|
||||
pesoKg = null;
|
||||
} else {
|
||||
pesoKg = new BigDecimal(in.readFloat());
|
||||
}
|
||||
|
||||
if (in.readByte() == 0) {
|
||||
lunghezzaCm = null;
|
||||
} else {
|
||||
lunghezzaCm = new BigDecimal(in.readFloat());
|
||||
}
|
||||
|
||||
if (in.readByte() == 0) {
|
||||
larghezzaCm = null;
|
||||
} else {
|
||||
larghezzaCm = new BigDecimal(in.readFloat());
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
altezzaCm = null;
|
||||
} else {
|
||||
altezzaCm = new BigDecimal(in.readFloat());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
in.readTypedList(mtbColr, MtbColr.CREATOR);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(gestione);
|
||||
dest.writeString(dataCollo);
|
||||
dest.writeString(serCollo);
|
||||
if (numCollo == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(numCollo);
|
||||
}
|
||||
dest.writeString(rifOrd);
|
||||
dest.writeString(codAnag);
|
||||
dest.writeString(codVdes);
|
||||
dest.writeString(codMdep);
|
||||
dest.writeString(codVlis);
|
||||
dest.writeString(codDtip);
|
||||
dest.writeString(codTcol);
|
||||
dest.writeString(serDoc);
|
||||
dest.writeString(filtroOrdini);
|
||||
dest.writeString(preparatoDa);
|
||||
dest.writeString(annotazioni);
|
||||
dest.writeString(posizione);
|
||||
dest.writeString(codDtipProvv);
|
||||
dest.writeString(serDocProvv);
|
||||
dest.writeString(codJfas);
|
||||
dest.writeString(dataOrd);
|
||||
dest.writeString(dataDoc);
|
||||
dest.writeString(oraInizPrep);
|
||||
dest.writeString(oraFinePrep);
|
||||
dest.writeString(dataDocProvv);
|
||||
dest.writeString(dataVers);
|
||||
if (segno == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(segno);
|
||||
}
|
||||
if (numOrd == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(numOrd);
|
||||
}
|
||||
if (numDoc == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(numDoc);
|
||||
}
|
||||
if (numDocProvv == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(numDocProvv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (pesoKg == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeFloat(pesoKg.floatValue());
|
||||
}
|
||||
if (lunghezzaCm == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeFloat(lunghezzaCm.floatValue());
|
||||
}
|
||||
if (larghezzaCm == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeFloat(larghezzaCm.floatValue());
|
||||
}
|
||||
if (altezzaCm == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeFloat(altezzaCm.floatValue());
|
||||
}
|
||||
|
||||
dest.writeTypedList(mtbColr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<MtbColt> CREATOR = new Creator<MtbColt>() {
|
||||
@Override
|
||||
public MtbColt createFromParcel(Parcel in) {
|
||||
return new MtbColt(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MtbColt[] newArray(int size) {
|
||||
return new MtbColt[size];
|
||||
}
|
||||
};
|
||||
|
||||
public void generaFiltroOrdine() throws Exception {
|
||||
|
||||
if (this.gestione == null) {
|
||||
@ -104,6 +298,19 @@ public class MtbColt extends EntityBase{
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDataColloHumanLong() {
|
||||
Date dataColloD = null;
|
||||
try {
|
||||
dataColloD = getDataColloD();
|
||||
} catch (ParseException ex){
|
||||
UtilityLogger.errorMe(ex);
|
||||
}
|
||||
|
||||
if(dataColloD != null){
|
||||
return UtilityDate.formatDate(dataColloD, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN_LONG);
|
||||
} else return null;
|
||||
}
|
||||
|
||||
public String getDataColloS() {
|
||||
return dataCollo;
|
||||
}
|
||||
@ -408,4 +615,8 @@ public class MtbColt extends EntityBase{
|
||||
this.altezzaCm = altezzaCm;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,360 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class MtbDepo extends EntityBase implements Parcelable {
|
||||
|
||||
|
||||
private String codMdep;
|
||||
private String descrizione;
|
||||
private String flagVal;
|
||||
private String codAnag;
|
||||
private BigDecimal percDepo;
|
||||
private BigDecimal valDepo;
|
||||
private String indirizzo;
|
||||
private String cap;
|
||||
private String citta;
|
||||
private String prov;
|
||||
private String tel;
|
||||
private String nazione;
|
||||
private String fax;
|
||||
private String eMail;
|
||||
private String sitoWeb;
|
||||
private String codVdes;
|
||||
private String serie;
|
||||
private String flagMovimentabile;
|
||||
private String codJfas;
|
||||
private String codVlis;
|
||||
private String codCcau;
|
||||
private String codCcon;
|
||||
private String codDtip;
|
||||
private String codDtipFat;
|
||||
private String flagContoVendita;
|
||||
private String flagTipoNegozio;
|
||||
private String codMdepReso;
|
||||
|
||||
public MtbDepo() {
|
||||
type = "mtb_depo";
|
||||
}
|
||||
|
||||
protected MtbDepo(Parcel in) {
|
||||
type = "mtb_depo";
|
||||
codMdep = in.readString();
|
||||
descrizione = in.readString();
|
||||
flagVal = in.readString();
|
||||
codAnag = in.readString();
|
||||
indirizzo = in.readString();
|
||||
cap = in.readString();
|
||||
citta = in.readString();
|
||||
prov = in.readString();
|
||||
tel = in.readString();
|
||||
nazione = in.readString();
|
||||
fax = in.readString();
|
||||
eMail = in.readString();
|
||||
sitoWeb = in.readString();
|
||||
codVdes = in.readString();
|
||||
serie = in.readString();
|
||||
flagMovimentabile = in.readString();
|
||||
codJfas = in.readString();
|
||||
codVlis = in.readString();
|
||||
codCcau = in.readString();
|
||||
codCcon = in.readString();
|
||||
codDtip = in.readString();
|
||||
codDtipFat = in.readString();
|
||||
flagContoVendita = in.readString();
|
||||
flagTipoNegozio = in.readString();
|
||||
codMdepReso = in.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(codMdep);
|
||||
dest.writeString(descrizione);
|
||||
dest.writeString(flagVal);
|
||||
dest.writeString(codAnag);
|
||||
dest.writeString(indirizzo);
|
||||
dest.writeString(cap);
|
||||
dest.writeString(citta);
|
||||
dest.writeString(prov);
|
||||
dest.writeString(tel);
|
||||
dest.writeString(nazione);
|
||||
dest.writeString(fax);
|
||||
dest.writeString(eMail);
|
||||
dest.writeString(sitoWeb);
|
||||
dest.writeString(codVdes);
|
||||
dest.writeString(serie);
|
||||
dest.writeString(flagMovimentabile);
|
||||
dest.writeString(codJfas);
|
||||
dest.writeString(codVlis);
|
||||
dest.writeString(codCcau);
|
||||
dest.writeString(codCcon);
|
||||
dest.writeString(codDtip);
|
||||
dest.writeString(codDtipFat);
|
||||
dest.writeString(flagContoVendita);
|
||||
dest.writeString(flagTipoNegozio);
|
||||
dest.writeString(codMdepReso);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<MtbDepo> CREATOR = new Creator<MtbDepo>() {
|
||||
@Override
|
||||
public MtbDepo createFromParcel(Parcel in) {
|
||||
return new MtbDepo(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MtbDepo[] newArray(int size) {
|
||||
return new MtbDepo[size];
|
||||
}
|
||||
};
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public MtbDepo setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MtbDepo setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagVal() {
|
||||
return flagVal;
|
||||
}
|
||||
|
||||
public MtbDepo setFlagVal(String flagVal) {
|
||||
this.flagVal = flagVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public MtbDepo setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getPercDepo() {
|
||||
return percDepo;
|
||||
}
|
||||
|
||||
public MtbDepo setPercDepo(BigDecimal percDepo) {
|
||||
this.percDepo = percDepo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getValDepo() {
|
||||
return valDepo;
|
||||
}
|
||||
|
||||
public MtbDepo setValDepo(BigDecimal valDepo) {
|
||||
this.valDepo = valDepo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIndirizzo() {
|
||||
return indirizzo;
|
||||
}
|
||||
|
||||
public MtbDepo setIndirizzo(String indirizzo) {
|
||||
this.indirizzo = indirizzo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCap() {
|
||||
return cap;
|
||||
}
|
||||
|
||||
public MtbDepo setCap(String cap) {
|
||||
this.cap = cap;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCitta() {
|
||||
return citta;
|
||||
}
|
||||
|
||||
public MtbDepo setCitta(String citta) {
|
||||
this.citta = citta;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProv() {
|
||||
return prov;
|
||||
}
|
||||
|
||||
public MtbDepo setProv(String prov) {
|
||||
this.prov = prov;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTel() {
|
||||
return tel;
|
||||
}
|
||||
|
||||
public MtbDepo setTel(String tel) {
|
||||
this.tel = tel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNazione() {
|
||||
return nazione;
|
||||
}
|
||||
|
||||
public MtbDepo setNazione(String nazione) {
|
||||
this.nazione = nazione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFax() {
|
||||
return fax;
|
||||
}
|
||||
|
||||
public MtbDepo setFax(String fax) {
|
||||
this.fax = fax;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String geteMail() {
|
||||
return eMail;
|
||||
}
|
||||
|
||||
public MtbDepo seteMail(String eMail) {
|
||||
this.eMail = eMail;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSitoWeb() {
|
||||
return sitoWeb;
|
||||
}
|
||||
|
||||
public MtbDepo setSitoWeb(String sitoWeb) {
|
||||
this.sitoWeb = sitoWeb;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodVdes() {
|
||||
return codVdes;
|
||||
}
|
||||
|
||||
public MtbDepo setCodVdes(String codVdes) {
|
||||
this.codVdes = codVdes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSerie() {
|
||||
return serie;
|
||||
}
|
||||
|
||||
public MtbDepo setSerie(String serie) {
|
||||
this.serie = serie;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagMovimentabile() {
|
||||
return flagMovimentabile;
|
||||
}
|
||||
|
||||
public MtbDepo setFlagMovimentabile(String flagMovimentabile) {
|
||||
this.flagMovimentabile = flagMovimentabile;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJfas() {
|
||||
return codJfas;
|
||||
}
|
||||
|
||||
public MtbDepo setCodJfas(String codJfas) {
|
||||
this.codJfas = codJfas;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodVlis() {
|
||||
return codVlis;
|
||||
}
|
||||
|
||||
public MtbDepo setCodVlis(String codVlis) {
|
||||
this.codVlis = codVlis;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodCcau() {
|
||||
return codCcau;
|
||||
}
|
||||
|
||||
public MtbDepo setCodCcau(String codCcau) {
|
||||
this.codCcau = codCcau;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodCcon() {
|
||||
return codCcon;
|
||||
}
|
||||
|
||||
public MtbDepo setCodCcon(String codCcon) {
|
||||
this.codCcon = codCcon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodDtip() {
|
||||
return codDtip;
|
||||
}
|
||||
|
||||
public MtbDepo setCodDtip(String codDtip) {
|
||||
this.codDtip = codDtip;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodDtipFat() {
|
||||
return codDtipFat;
|
||||
}
|
||||
|
||||
public MtbDepo setCodDtipFat(String codDtipFat) {
|
||||
this.codDtipFat = codDtipFat;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagContoVendita() {
|
||||
return flagContoVendita;
|
||||
}
|
||||
|
||||
public MtbDepo setFlagContoVendita(String flagContoVendita) {
|
||||
this.flagContoVendita = flagContoVendita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagTipoNegozio() {
|
||||
return flagTipoNegozio;
|
||||
}
|
||||
|
||||
public MtbDepo setFlagTipoNegozio(String flagTipoNegozio) {
|
||||
this.flagTipoNegozio = flagTipoNegozio;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMdepReso() {
|
||||
return codMdepReso;
|
||||
}
|
||||
|
||||
public MtbDepo setCodMdepReso(String codMdepReso) {
|
||||
this.codMdepReso = codMdepReso;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package it.integry.integrywmsnative.core.report;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.generated.callback.Runnable;
|
||||
|
||||
public class ReportManager {
|
||||
|
||||
|
||||
public static void getRightReportNameByMtbColt(MtbColt mtbColt, RunnableArgs<String> onComplete, RunnableArgs<Exception> onFailed) throws Exception{
|
||||
|
||||
if(mtbColt != null){
|
||||
|
||||
GestioneEnum gestione = GestioneEnum.fromString(mtbColt.getGestione());
|
||||
|
||||
switch (gestione) {
|
||||
case ACQUISTO:
|
||||
onComplete.run("EtichettaBancale");
|
||||
break;
|
||||
|
||||
case LAVORAZIONE:
|
||||
onFailed.run(new Exception("Etichetta non definita"));
|
||||
break;
|
||||
|
||||
case VENDITA:
|
||||
onFailed.run(new Exception("Etichetta non definita"));
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new Exception("mtbColt cannot be NULL");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -18,6 +18,7 @@ public class SettingsModel {
|
||||
public static class User {
|
||||
public String username;
|
||||
public String password;
|
||||
public String fullname;
|
||||
}
|
||||
|
||||
public static class UserSession {
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class UtilityDB {
|
||||
|
||||
public static String valueToString(Object value) {
|
||||
String valueString;
|
||||
SimpleDateFormat dateFormatFile = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
if (value == null) {
|
||||
valueString = "NULL";
|
||||
} else {
|
||||
|
||||
valueString = value.toString();
|
||||
|
||||
if(value instanceof String) {
|
||||
if(UtilityString.isNullOrEmpty((String) value)){
|
||||
valueString = "NULL";
|
||||
} else {
|
||||
valueString = "'" + valueString.replaceAll("'","''") + "'";
|
||||
}
|
||||
} else if (value instanceof Date){
|
||||
valueString = "'" + dateFormatFile.format(value) + "'";
|
||||
} else if (value instanceof Integer) {
|
||||
|
||||
} else {
|
||||
valueString = null;
|
||||
}
|
||||
}
|
||||
return valueString;
|
||||
}
|
||||
|
||||
}
|
||||
@ -17,6 +17,7 @@ public class UtilityDate {
|
||||
|
||||
|
||||
public static final String DMY_HUMAN = "dd MMM yyyy";
|
||||
public static final String DMY_HUMAN_LONG = "dd MMMM yyyy";
|
||||
}
|
||||
|
||||
public static Date recognizeDate(String dateString) throws Exception{
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.text.SpannableString;
|
||||
import android.util.Log;
|
||||
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.CommonRESTException;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||
|
||||
public class UtilityExceptions {
|
||||
|
||||
|
||||
public static void defaultException(Context context, Exception ex, ProgressDialog progressDialog){
|
||||
progressDialog.dismiss();
|
||||
defaultException(context, ex);
|
||||
}
|
||||
|
||||
public static void defaultException(Context context, Exception ex){
|
||||
|
||||
Logger.e(ex, ex.getMessage());
|
||||
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||
|
||||
if(errorMessage == null) errorMessage = ex.getMessage();
|
||||
DialogSimpleMessageHelper.makeErrorDialog(context, new SpannableString(errorMessage), null, null).show();
|
||||
|
||||
UtilityLogger.errorMe(ex);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
@ -14,11 +16,23 @@ import okhttp3.internal.Util;
|
||||
public class UtilityLogger {
|
||||
|
||||
public static void logMe(String message){
|
||||
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
|
||||
|
||||
String caller = "UtilityLogger";
|
||||
|
||||
for(int i = 0; i < stackTraceElements.length; i++){
|
||||
|
||||
if(stackTraceElements[i].getMethodName().equalsIgnoreCase("logMe")){
|
||||
caller = stackTraceElements[i+1].getFileName() + "->" + stackTraceElements[i+1].getMethodName();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Log.d("WMS LOGGER", caller + ": " + message);
|
||||
}
|
||||
|
||||
public static void errorMe(Exception ex) {
|
||||
ex.printStackTrace(); //Default log
|
||||
|
||||
String message = UtilityResources.readRawTextFile(R.raw.error_mail);
|
||||
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.util.Locale;
|
||||
|
||||
public class UtilityNumber {
|
||||
|
||||
public static String decimalToString(BigDecimal bigDecimal){
|
||||
if(bigDecimal == null) return "0";
|
||||
return decimalToString(bigDecimal, 2);
|
||||
}
|
||||
|
||||
public static String decimalToString(BigDecimal bigDecimal, int decimal){
|
||||
if(bigDecimal == null) return "0";
|
||||
return decimalToString(bigDecimal.floatValue(), decimal);
|
||||
}
|
||||
|
||||
public static String decimalToString(float floatValue, int decimal) {
|
||||
DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.getDefault());
|
||||
otherSymbols.setDecimalSeparator('.');
|
||||
otherSymbols.setGroupingSeparator(',');
|
||||
|
||||
final DecimalFormat decimalFormat = new DecimalFormat();
|
||||
decimalFormat.setMaximumFractionDigits(decimal);
|
||||
decimalFormat.setDecimalFormatSymbols(otherSymbols);
|
||||
decimalFormat.setGroupingUsed(false);
|
||||
|
||||
return decimalFormat.format(floatValue);
|
||||
}
|
||||
|
||||
}
|
||||
@ -251,7 +251,7 @@ public class MainAccettazioneFragment extends Fragment implements ICheckBoxCallb
|
||||
AtomicInteger artsCounter = new AtomicInteger();
|
||||
|
||||
Stream.of(ordini).forEach(x -> {
|
||||
artsCounter.addAndGet((int) Stream.of(x.ordini).filter(y -> y.getQtaDaEvadere() > 0).count());
|
||||
artsCounter.addAndGet((int) Stream.of(x.ordini).filter(y -> y.getQtaDaEvadere().floatValue() > 0).count());
|
||||
});
|
||||
|
||||
List<String> ordersKeys = new ArrayList<>();
|
||||
|
||||
@ -12,6 +12,7 @@ import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.REST.model.EsitoType;
|
||||
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ILoadOrdiniCallback;
|
||||
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ILoadPickingListCallback;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||
@ -110,7 +111,8 @@ public class AccettazioneHelper {
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<OrdineAccettazioneDTO>>> call, Throwable t) {
|
||||
Log.e("Accettazione", t.getCause().toString());
|
||||
Log.e("Accettazione", t.toString());
|
||||
UtilityLogger.errorMe(new Exception(t));
|
||||
callback.onLoadFail(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
@ -4,6 +4,7 @@ import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@ -54,21 +55,21 @@ public class OrdineAccettazioneDTO implements Parcelable {
|
||||
|
||||
public String dataCons;
|
||||
|
||||
public Float getQtaDaEvadere() {
|
||||
return this.getQtaOrd() - this.getQtaEvasa() - this.getQtaRiservate();
|
||||
public BigDecimal getQtaDaEvadere() {
|
||||
return this.getQtaOrd().subtract(this.getQtaEvasa()).subtract(this.getQtaRiservate());
|
||||
}
|
||||
|
||||
|
||||
public Float getQtaOrd() {
|
||||
return qtaOrd != null ? qtaOrd : 0;
|
||||
public BigDecimal getQtaOrd() {
|
||||
return qtaOrd != null ? new BigDecimal(qtaOrd) : BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
public Float getQtaRiservate() {
|
||||
return qtaRiservate != null ? qtaRiservate : 0;
|
||||
public BigDecimal getQtaRiservate() {
|
||||
return qtaRiservate != null ? new BigDecimal(qtaRiservate) : BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
public Float getQtaEvasa() {
|
||||
return qtaEvasa != null ? qtaEvasa : 0;
|
||||
public BigDecimal getQtaEvasa() {
|
||||
return qtaEvasa != null ? new BigDecimal(qtaEvasa) : BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
public int getRigaOrd() {
|
||||
|
||||
@ -6,6 +6,7 @@ import android.databinding.ObservableArrayList;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@ -85,7 +86,7 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
List<OrdineAccettazioneDTO.Riga> tmpList = Stream.of(mDataset).filter(x -> x.getCodArtFor() != null && x.getCodArtFor().equalsIgnoreCase(codArtForn)).toList();
|
||||
|
||||
for(int i = 0; i < tmpList.size(); i++){
|
||||
if(tmpList.get(i).getQtaDaEvadere() <= 0){
|
||||
if(tmpList.get(i).getQtaDaEvadere().floatValue() <= 0){
|
||||
tmpList.remove(i);
|
||||
i--;
|
||||
}
|
||||
@ -119,7 +120,7 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
List<OrdineAccettazioneDTO.Riga> tmpList = Stream.of(mDataset).filter(x -> x.getDescrizioneEstesa() != null && x.getDescrizioneEstesa().equalsIgnoreCase(descrArtForn)).toList();
|
||||
|
||||
for(int i = 0; i < tmpList.size(); i++){
|
||||
if(tmpList.get(i).getQtaDaEvadere() <= 0){
|
||||
if(tmpList.get(i).getQtaDaEvadere().floatValue() <= 0){
|
||||
tmpList.remove(i);
|
||||
i--;
|
||||
}
|
||||
@ -179,7 +180,7 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
List<OrdineAccettazioneDTO.Riga> tmpList = Stream.of(mDataset).filter(x -> x.getCodJcom().equalsIgnoreCase(dto.codJcom)).toList();
|
||||
|
||||
for(int i = 0; i < tmpList.size(); i++){
|
||||
if(tmpList.get(i).getQtaDaEvadere() <= 0){
|
||||
if(tmpList.get(i).getQtaDaEvadere().floatValue() <= 0){
|
||||
tmpList.remove(i);
|
||||
i--;
|
||||
}
|
||||
@ -205,7 +206,6 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
|
||||
List<AccettazioneOrdineInevasoListViewModel> listModel = new ArrayList<>();
|
||||
|
||||
DecimalFormat decimalFormat = new DecimalFormat("#.#");
|
||||
for(int i = 0; i < groupedRighe.size(); i++){
|
||||
AccettazioneOrdineInevasoListViewModel itemModel = new AccettazioneOrdineInevasoListViewModel();
|
||||
|
||||
@ -217,16 +217,16 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
final OrdineAccettazioneDTO.Riga rowItem = groupedRighe.get(i).get(k);
|
||||
final AccettazioneOrdineInevasoListViewModel.SubItem rowModel = new AccettazioneOrdineInevasoListViewModel.SubItem();
|
||||
|
||||
rowModel.badge1 = rowItem.codJcom != null ? rowItem.codJcom : CommonConst.Config.COMMESSA_MAG;
|
||||
rowModel.badge2 = String.valueOf(rowItem.numOrd);
|
||||
rowModel.setBadge1(rowItem.codJcom != null ? rowItem.codJcom : CommonConst.Config.COMMESSA_MAG);
|
||||
rowModel.setBadge2(String.valueOf(rowItem.numOrd));
|
||||
|
||||
// rowModel.descrizione = rowItem.ragSocCom;
|
||||
rowModel.descrizione = rowItem.descrizioneCommessa;
|
||||
rowModel.setDescrizione(rowItem.descrizioneCommessa);
|
||||
|
||||
rowModel.qtaRiservata = decimalFormat.format(getRigaQuantityEvasa(rowItem, mtbColrs));
|
||||
rowModel.qtaOrdinata = decimalFormat.format(rowItem.getQtaOrd());
|
||||
rowModel.setQtaRiservata(getRigaQuantityEvasa(rowItem, mtbColrs));
|
||||
rowModel.setQtaOrdinata(rowItem.getQtaOrd());
|
||||
|
||||
rowModel.originalModel = rowItem;
|
||||
rowModel.setOriginalModel(rowItem);
|
||||
|
||||
itemModel.rows.add(rowModel);
|
||||
}
|
||||
@ -240,7 +240,6 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
public List<AccettazioneOrdineInevasoListViewModel> getListViewModelPerRagSocCommessa(List<List<OrdineAccettazioneDTO.Riga>> groupedRighe, List<MtbColr> mtbColrs) {
|
||||
List<AccettazioneOrdineInevasoListViewModel> listModel = new ArrayList<>();
|
||||
|
||||
DecimalFormat decimalFormat = new DecimalFormat("#.#");
|
||||
for(int i = 0; i < groupedRighe.size(); i++){
|
||||
AccettazioneOrdineInevasoListViewModel itemModel = new AccettazioneOrdineInevasoListViewModel();
|
||||
|
||||
@ -260,16 +259,16 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
final OrdineAccettazioneDTO.Riga rowItem = groupedRighe.get(i).get(k);
|
||||
final AccettazioneOrdineInevasoListViewModel.SubItem rowModel = new AccettazioneOrdineInevasoListViewModel.SubItem();
|
||||
|
||||
rowModel.badge1 = rowItem.codArtFor;
|
||||
rowModel.badge2 = String.valueOf(rowItem.numOrd);
|
||||
rowModel.setBadge1(rowItem.codArtFor);
|
||||
rowModel.setBadge2(String.valueOf(rowItem.numOrd));
|
||||
|
||||
rowModel.descrizione = rowItem.mtbAart.descrizioneEstesa;
|
||||
rowModel.setDescrizione(rowItem.mtbAart.descrizioneEstesa);
|
||||
|
||||
rowModel.qtaRiservata = decimalFormat.format(getRigaQuantityEvasa(rowItem, mtbColrs));
|
||||
rowModel.setQtaRiservata(getRigaQuantityEvasa(rowItem, mtbColrs));
|
||||
// rowModel.qtaRiservata = decimalFormat.format(rowItem.qtaRiservate);
|
||||
rowModel.qtaOrdinata = decimalFormat.format(rowItem.getQtaOrd());
|
||||
rowModel.setQtaOrdinata(rowItem.getQtaOrd());
|
||||
|
||||
rowModel.originalModel = rowItem;
|
||||
rowModel.setOriginalModel(rowItem);
|
||||
|
||||
itemModel.rows.add(rowModel);
|
||||
}
|
||||
@ -281,8 +280,8 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
|
||||
|
||||
|
||||
private float getRigaQuantityEvasa(OrdineAccettazioneDTO.Riga item, List<MtbColr> mtbColrs){
|
||||
float currentQtaEvasa = item.getQtaRiservate() + item.getQtaEvasa();
|
||||
private BigDecimal getRigaQuantityEvasa(OrdineAccettazioneDTO.Riga item, List<MtbColr> mtbColrs){
|
||||
BigDecimal currentQtaEvasa = item.getQtaRiservate().add(item.getQtaEvasa());
|
||||
|
||||
if(mtbColrs != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||
@ -296,7 +295,7 @@ public class AccettazioneOrdineInevasoHelper {
|
||||
|
||||
|
||||
for (MtbColr mtbColr : filteredMtbColrs) {
|
||||
currentQtaEvasa += mtbColr.getQtaCol().floatValue();
|
||||
currentQtaEvasa = currentQtaEvasa.add(mtbColr.getQtaCol());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.dto.AccettazioneOrdineInevasoListViewModel;
|
||||
|
||||
@ -30,8 +31,7 @@ public class MainListOrdineAccettazioneAdapter extends RecyclerView.Adapter<Main
|
||||
protected ObservableArrayList<AccettazioneOrdineInevasoListViewModel> mDataset;
|
||||
protected IOnOrdineRowDispatchCallback mOrdineRowDispatch;
|
||||
|
||||
private static final Pools.SynchronizedPool sPool =
|
||||
new Pools.SynchronizedPool(200);
|
||||
private static final Pools.SynchronizedPool sPool = new Pools.SynchronizedPool(200);
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
// each data item is just a string in this case
|
||||
@ -130,9 +130,9 @@ public class MainListOrdineAccettazioneAdapter extends RecyclerView.Adapter<Main
|
||||
View groupModelView = groupModelViewPool;
|
||||
holder.pool.add(groupModelView);
|
||||
|
||||
if(Float.parseFloat(rowItem.qtaRiservata) == Float.parseFloat(rowItem.qtaOrdinata)) {
|
||||
if(rowItem.getQtaRiservata().equals(rowItem.getQtaOrdinata())) {
|
||||
groupModelView.setBackgroundColor(mContext.getResources().getColor(R.color.green_500_with_alpha));
|
||||
} else if(Float.parseFloat(rowItem.qtaRiservata) > 0) {
|
||||
} else if(rowItem.getQtaRiservata().floatValue() > 0) {
|
||||
groupModelView.setBackgroundColor(mContext.getResources().getColor(R.color.orange_600_with_alpha));
|
||||
} else if(i % 2 == 1) {
|
||||
groupModelView.setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
|
||||
@ -142,15 +142,15 @@ public class MainListOrdineAccettazioneAdapter extends RecyclerView.Adapter<Main
|
||||
|
||||
|
||||
final TextView badge1 = groupModelView.findViewById(R.id.accettazione_ordine_inevaso_main_list_group_item_badge1);
|
||||
badge1.setText(rowItem.badge1);
|
||||
badge1.setText(rowItem.getBadge1());
|
||||
|
||||
final TextView badge2 = groupModelView.findViewById(R.id.accettazione_ordine_inevaso_main_list_group_item_badge2);
|
||||
badge2.setText(rowItem.badge2);
|
||||
badge2.setText(rowItem.getBadge2());
|
||||
|
||||
|
||||
final TextView descrizione = groupModelView.findViewById(R.id.accettazione_ordine_inevaso_main_list_group_item_descrizione);
|
||||
|
||||
String descrizioneString = rowItem.descrizione;
|
||||
String descrizioneString = rowItem.getDescrizione();
|
||||
int descrizioneColor = Color.BLACK;
|
||||
|
||||
if(UtilityString.isNullOrEmpty(descrizioneString)) {
|
||||
@ -164,15 +164,15 @@ public class MainListOrdineAccettazioneAdapter extends RecyclerView.Adapter<Main
|
||||
descrizione.setTextColor(descrizioneColor);
|
||||
|
||||
final TextView qtaEvasa = groupModelView.findViewById(R.id.accettazione_ordine_inevaso_main_list_group_item_qta_evasa);
|
||||
qtaEvasa.setText(rowItem.qtaRiservata);
|
||||
qtaEvasa.setText(UtilityNumber.decimalToString(rowItem.getQtaRiservata()));
|
||||
|
||||
final TextView qtaTot = groupModelView.findViewById(R.id.accettazione_ordine_inevaso_main_list_group_item_qta_tot);
|
||||
qtaTot.setText(rowItem.qtaOrdinata);
|
||||
qtaTot.setText(UtilityNumber.decimalToString(rowItem.getQtaOrdinata()));
|
||||
|
||||
|
||||
groupModelView.setOnClickListener(view -> {
|
||||
if(mOrdineRowDispatch != null){
|
||||
mOrdineRowDispatch.onOrdineRowDispatch(rowItem.originalModel);
|
||||
mOrdineRowDispatch.onOrdineRowDispatch(rowItem.getOriginalModel());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||
@ -15,15 +16,68 @@ public class AccettazioneOrdineInevasoListViewModel {
|
||||
|
||||
public static class SubItem {
|
||||
|
||||
public String badge1;
|
||||
public String badge2;
|
||||
private String badge1;
|
||||
private String badge2;
|
||||
|
||||
public String descrizione;
|
||||
public String qtaRiservata;
|
||||
public String qtaOrdinata;
|
||||
private String descrizione;
|
||||
private BigDecimal qtaRiservata;
|
||||
private BigDecimal qtaOrdinata;
|
||||
|
||||
public OrdineAccettazioneDTO.Riga originalModel;
|
||||
private OrdineAccettazioneDTO.Riga originalModel;
|
||||
|
||||
public String getBadge1() {
|
||||
return badge1;
|
||||
}
|
||||
|
||||
public SubItem setBadge1(String badge1) {
|
||||
this.badge1 = badge1;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBadge2() {
|
||||
return badge2;
|
||||
}
|
||||
|
||||
public SubItem setBadge2(String badge2) {
|
||||
this.badge2 = badge2;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public SubItem setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaRiservata() {
|
||||
return qtaRiservata;
|
||||
}
|
||||
|
||||
public SubItem setQtaRiservata(BigDecimal qtaRiservata) {
|
||||
this.qtaRiservata = qtaRiservata;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaOrdinata() {
|
||||
return qtaOrdinata;
|
||||
}
|
||||
|
||||
public SubItem setQtaOrdinata(BigDecimal qtaOrdinata) {
|
||||
this.qtaOrdinata = qtaOrdinata;
|
||||
return this;
|
||||
}
|
||||
|
||||
public OrdineAccettazioneDTO.Riga getOriginalModel() {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
public SubItem setOriginalModel(OrdineAccettazioneDTO.Riga originalModel) {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.rest;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||
|
||||
public class OrdineAccettazioneInevasoRESTConsumerService {
|
||||
|
||||
public static void getBancaliGiaRegistrati(List<OrdineAccettazioneDTO> ordiniToShow, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) throws Exception {
|
||||
|
||||
List<String> colliWhereCond = new ArrayList<>();
|
||||
|
||||
|
||||
Stream.of(ordiniToShow).forEach(x -> {
|
||||
try {
|
||||
Date date = UtilityDate.recognizeDate(x.data);
|
||||
String dateString = UtilityDate.formatDate(date, "yyyy/MM/dd");
|
||||
|
||||
if (!colliWhereCond.contains(x.gestione + " " + dateString + " " + x.numero)) {
|
||||
colliWhereCond.add(x.gestione + " " + dateString + " " + x.numero);
|
||||
}
|
||||
} catch (Exception ex){
|
||||
UtilityLogger.errorMe(ex);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
String colliINCondition = "";
|
||||
|
||||
for(int i = 0; i < colliWhereCond.size(); i ++){
|
||||
colliINCondition += "'" + colliWhereCond.get(i) + "'";
|
||||
|
||||
if(i < (colliWhereCond.size()-1)) colliINCondition += ",";
|
||||
}
|
||||
|
||||
|
||||
|
||||
String sql = "select distinct mtb_colt.* " +
|
||||
"from mtb_colt, mtb_colr " +
|
||||
"where mtb_colt.gestione = mtb_colr.gestione and " +
|
||||
"mtb_colt.ser_collo = mtb_colr.ser_collo and " +
|
||||
"mtb_colt.data_collo = mtb_colr.data_collo and " +
|
||||
"mtb_colt.num_collo = mtb_colr.num_collo AND " +
|
||||
"mtb_colt.gestione + ' ' + convert(varchar(15), mtb_colr.data_ord, 111) + ' ' + convert(varchar, mtb_colr.num_ord) IN (" + colliINCondition +
|
||||
") and mtb_colt.data_doc is null ";
|
||||
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {}.getType();
|
||||
SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<List<MtbColt>>() {
|
||||
@Override
|
||||
public void onSuccess(List<MtbColt> value) {
|
||||
if(onComplete != null) onComplete.run(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
if(onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,6 +2,7 @@ package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.viewmodel;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.databinding.ObservableArrayList;
|
||||
import android.databinding.ObservableField;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
@ -21,6 +22,7 @@ import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.REST.CommonRESTException;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.GestSetupRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISingleValueOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.PrinterRESTConsumer;
|
||||
@ -30,14 +32,19 @@ import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.AccettazioneOrdineInevasoActivity;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core.AccettazioneOrdineInevasoHelper;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core.IOnOrdineRowDispatchCallback;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core.MainListOrdineAccettazioneAdapter;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.dto.AccettazioneOrdineInevasoOrderBy;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.rest.OrdineAccettazioneInevasoRESTConsumerService;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.views.NoteAggiuntiveNuovaULDialog;
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
||||
import it.integry.integrywmsnative.gest.login.LoginActivity;
|
||||
import it.integry.integrywmsnative.ui.StatusBarAlert;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.interfaces.IOnColloClosedCallback;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.viewmodel.ArticoliInColloBottomSheetViewModel;
|
||||
@ -166,84 +173,90 @@ public class AccettazioneOnOrdineInevasoViewModel implements IOnColloClosedCallb
|
||||
//Add loading dialog here
|
||||
progress.show();
|
||||
|
||||
MtbColt mtbColt = new MtbColt();
|
||||
mtbColt .setDataCollo(new Date())
|
||||
.setGestione(GestioneEnum.ACQUISTO)
|
||||
.setCodMdep(SettingsManager.i().userSession.depo.getCodMdep())
|
||||
.setPreparatoDa(SettingsManager.i().user.username)
|
||||
.setOraInizPrep(new Date())
|
||||
.setAnnotazioni(noteString)
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
List<String> codAnags =
|
||||
stream(mOrders)
|
||||
.select(c -> c.codAnag)
|
||||
.distinct()
|
||||
.toList();
|
||||
GestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_POSIZIONE_COLLI_ACCETTAZIONE", defaultPosAccettazioneDTO -> {
|
||||
|
||||
if(codAnags != null && codAnags.size() == 1){
|
||||
mtbColt.setCodAnag(codAnags.get(0));
|
||||
}
|
||||
String defaultPosAccettazione = "";
|
||||
if(defaultPosAccettazioneDTO != null && !UtilityString.isNullOrEmpty(defaultPosAccettazioneDTO.value)) defaultPosAccettazione = defaultPosAccettazioneDTO.value;
|
||||
|
||||
List<String> rifOrds =
|
||||
stream(mOrders)
|
||||
.select(c -> c.rifOrd)
|
||||
.distinct()
|
||||
.toList();
|
||||
MtbColt mtbColt = new MtbColt();
|
||||
mtbColt .setDataCollo(new Date())
|
||||
.setGestione(GestioneEnum.ACQUISTO)
|
||||
.setCodMdep(SettingsManager.i().userSession.depo.getCodMdep())
|
||||
.setPreparatoDa(SettingsManager.i().user.fullname)
|
||||
.setOraInizPrep(new Date())
|
||||
.setAnnotazioni(noteString)
|
||||
.setPosizione(defaultPosAccettazione)
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
if(rifOrds != null && rifOrds.size() == 1){
|
||||
mtbColt.setRifOrd(rifOrds.get(0));
|
||||
}
|
||||
|
||||
List<String> numDataOrds =
|
||||
stream(mOrders)
|
||||
.select(value -> ("" + value.numero) + value.data)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(numDataOrds != null && numDataOrds.size() == 1){
|
||||
mtbColt.setNumOrd(mOrders.get(0).numero);
|
||||
mtbColt.setDataOrd(mOrders.get(0).data);
|
||||
|
||||
try {
|
||||
mtbColt.generaFiltroOrdine();
|
||||
} catch (Exception ex) {
|
||||
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(ex.getMessage()), null, null).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||
@Override
|
||||
public void onSuccess(MtbColt value) {
|
||||
|
||||
isFabVisible.set(false);
|
||||
value.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(value);
|
||||
|
||||
progress.dismiss();
|
||||
|
||||
new StatusBarAlert.Builder(mActivity)
|
||||
.autoHide(true)
|
||||
.withDuration(2500)
|
||||
.showProgress(false)
|
||||
.withText(R.string.data_saved)
|
||||
.withAlertColor(R.color.mainGreen)
|
||||
.build();
|
||||
List<String> codAnags =
|
||||
stream(mOrders)
|
||||
.select(c -> c.codAnag)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(codAnags != null && codAnags.size() == 1){
|
||||
mtbColt.setCodAnag(codAnags.get(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
progress.dismiss();
|
||||
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||
List<String> rifOrds =
|
||||
stream(mOrders)
|
||||
.select(c -> c.rifOrd)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(errorMessage == null) errorMessage = ex.getMessage();
|
||||
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(errorMessage), null, null).show();
|
||||
if(rifOrds != null && rifOrds.size() == 1){
|
||||
mtbColt.setRifOrd(rifOrds.get(0));
|
||||
}
|
||||
});
|
||||
|
||||
List<String> numDataOrds =
|
||||
stream(mOrders)
|
||||
.select(value -> ("" + value.numero) + value.data)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(numDataOrds != null && numDataOrds.size() == 1){
|
||||
mtbColt.setNumOrd(mOrders.get(0).numero);
|
||||
mtbColt.setDataOrd(mOrders.get(0).data);
|
||||
|
||||
try {
|
||||
mtbColt.generaFiltroOrdine();
|
||||
} catch (Exception ex) {
|
||||
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(ex.getMessage()), null, null).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||
@Override
|
||||
public void onSuccess(MtbColt value) {
|
||||
|
||||
isFabVisible.set(false);
|
||||
value.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(value);
|
||||
|
||||
progress.dismiss();
|
||||
|
||||
new StatusBarAlert.Builder(mActivity)
|
||||
.autoHide(true)
|
||||
.withDuration(2500)
|
||||
.showProgress(false)
|
||||
.withText(R.string.data_saved)
|
||||
.withAlertColor(R.color.mainGreen)
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||
}
|
||||
});
|
||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -259,7 +272,29 @@ public class AccettazioneOnOrdineInevasoViewModel implements IOnColloClosedCallb
|
||||
|
||||
//Al click di "Mostra UL già create"
|
||||
public void showCreatedUL() {
|
||||
mActivity.bindings.accettazioneOrdineInevasoFab.close(true);
|
||||
|
||||
final ProgressDialog progress = ProgressDialog.show(mActivity, mActivity.getText(R.string.waiting),
|
||||
mActivity.getText(R.string.loading) + " ...", true);
|
||||
|
||||
|
||||
mActivity.bindings.accettazioneOrdineInevasoFab.close(false);
|
||||
|
||||
try {
|
||||
OrdineAccettazioneInevasoRESTConsumerService.getBancaliGiaRegistrati(mOrders, mtbColts -> {
|
||||
|
||||
progress.dismiss();
|
||||
|
||||
Intent myIntent = new Intent(mActivity, ListaBancaliActivity.class);
|
||||
myIntent.putExtra("key", (ArrayList<MtbColt>) mtbColts); //Optional parameters
|
||||
mActivity.startActivity(myIntent);
|
||||
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -290,32 +325,24 @@ public class AccettazioneOnOrdineInevasoViewModel implements IOnColloClosedCallb
|
||||
PrinterRESTConsumer.printCollo(
|
||||
value.get(0),
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.get(),
|
||||
1, "EtichettaBancale", new ISimpleOperationCallback<Object>() {
|
||||
@Override
|
||||
public void onSuccess(Object value) {
|
||||
1, "EtichettaBancale", () ->{
|
||||
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||
|
||||
isFabVisible.set(true);
|
||||
isFabVisible.set(true);
|
||||
progress.dismiss();
|
||||
|
||||
progress.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
progress.dismiss();
|
||||
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||
|
||||
if (errorMessage == null) errorMessage = ex.getMessage();
|
||||
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(errorMessage), null, null).show();
|
||||
}
|
||||
});
|
||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||
isFabVisible.set(true);
|
||||
|
||||
progress.dismiss();
|
||||
String errorMessage = "Nessuna stampante configurata";
|
||||
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(errorMessage), null, null).show();
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mActivity, new SpannableString(errorMessage), null, null).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
package it.integry.integrywmsnative.gest.contenuto_bancale;
|
||||
|
||||
import android.databinding.DataBindingUtil;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.databinding.ActivityContenutoBancaleBinding;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel.ContenutoBancaleViewModel;
|
||||
|
||||
public class ContenutoBancaleActivity extends AppCompatActivity {
|
||||
|
||||
public ActivityContenutoBancaleBinding bindings;
|
||||
|
||||
private ContenutoBancaleViewModel mViewModel;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
bindings = DataBindingUtil.setContentView(this, R.layout.activity_contenuto_bancale);
|
||||
|
||||
MtbColt mtbColt = getIntent().getParcelableExtra("key");
|
||||
mViewModel = new ContenutoBancaleViewModel(this, mtbColt);
|
||||
|
||||
bindings.waterfallToolbar.setNestedScrollView(bindings.scrollView);
|
||||
|
||||
setSupportActionBar(this.bindings.toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp() {
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,108 @@
|
||||
package it.integry.integrywmsnative.gest.contenuto_bancale.core;
|
||||
|
||||
import android.content.Context;
|
||||
import android.databinding.DataBindingUtil;
|
||||
import android.databinding.ObservableArrayList;
|
||||
import android.databinding.ObservableList;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.databinding.ListaContenutoBancaleListModelBinding;
|
||||
|
||||
public class ContenutoBancaleListAdapter extends RecyclerView.Adapter<ContenutoBancaleListAdapter.ViewHolder> {
|
||||
|
||||
|
||||
protected Context mContext;
|
||||
protected ObservableArrayList<MtbColr> mDataset;
|
||||
|
||||
private IRecyclerItemClicked<MtbColr> mOnItemClickListener;
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
protected ListaContenutoBancaleListModelBinding mViewDataBinding;
|
||||
|
||||
|
||||
public ViewHolder(ListaContenutoBancaleListModelBinding v) {
|
||||
super(v.getRoot());
|
||||
mViewDataBinding = v;
|
||||
}
|
||||
|
||||
public void bind(MtbColr mtbColr) {
|
||||
mViewDataBinding.setMtbColr(mtbColr);
|
||||
mViewDataBinding.executePendingBindings();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ContenutoBancaleListAdapter(Context context, ObservableArrayList<MtbColr> myDataset, IRecyclerItemClicked<MtbColr> onItemClickListener) {
|
||||
mContext = context;
|
||||
mDataset = myDataset;
|
||||
mOnItemClickListener = onItemClickListener;
|
||||
|
||||
myDataset.addOnListChangedCallback(onListChangedCallback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContenutoBancaleListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
// create a new view
|
||||
ListaContenutoBancaleListModelBinding viewDataBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.lista_contenuto_bancale_list_model, parent, false);
|
||||
|
||||
return new ViewHolder(viewDataBinding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ContenutoBancaleListAdapter.ViewHolder holder, int position) {
|
||||
MtbColr item = mDataset.get(position);
|
||||
holder.bind(item);
|
||||
|
||||
holder.mViewDataBinding.getRoot().setOnClickListener(x -> {
|
||||
if(mOnItemClickListener != null) {
|
||||
mOnItemClickListener.onItemClick(item, position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewRecycled(ContenutoBancaleListAdapter.ViewHolder holder) {
|
||||
super.onViewRecycled(holder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mDataset.size();
|
||||
}
|
||||
|
||||
|
||||
private ObservableList.OnListChangedCallback onListChangedCallback = new ObservableList.OnListChangedCallback<ObservableList<MtbColr>>(){
|
||||
|
||||
@Override
|
||||
public void onChanged(ObservableList<MtbColr> sender) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeChanged(ObservableList<MtbColr> sender, int positionStart, int itemCount) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeInserted(ObservableList<MtbColr> sender, int positionStart, int itemCount) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeMoved(ObservableList<MtbColr> sender, int fromPosition, int toPosition, int itemCount) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeRemoved(ObservableList<MtbColr> sender, int positionStart, int itemCount) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package it.integry.integrywmsnative.gest.contenuto_bancale.ui;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.andrefrsousa.superbottomsheet.SuperBottomSheetFragment;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
|
||||
public class ContenutoBancaleBottomPanel extends SuperBottomSheetFragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
super.onCreateView(inflater, container, savedInstanceState);
|
||||
return inflater.inflate(R.layout.fragment_contenuto_bancale, container, false);
|
||||
}
|
||||
|
||||
public float getCornerRadius() {
|
||||
if(getContext() != null) return getContext().getResources().getDimension(R.dimen.bottom_sheet_round16);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatusBarColor() {
|
||||
return Color.RED;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,138 @@
|
||||
package it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.res.Resources;
|
||||
import android.databinding.ObservableField;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.DividerItemDecoration;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.text.SpannableString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivity;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.core.ContenutoBancaleListAdapter;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||
|
||||
public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr> {
|
||||
|
||||
private ContenutoBancaleActivity mContext;
|
||||
|
||||
public ObservableField<MtbColt> mtbColt;
|
||||
public BindableString descrizioneDepo = new BindableString();
|
||||
|
||||
public ObservableField<Boolean> isFabVisible = new ObservableField<>();
|
||||
|
||||
private ContenutoBancaleListAdapter mAdapter;
|
||||
|
||||
public ContenutoBancaleViewModel(ContenutoBancaleActivity context, MtbColt mtbColt){
|
||||
mContext = context;
|
||||
this.mtbColt = new ObservableField<>(mtbColt);
|
||||
this.isFabVisible.set(true);
|
||||
|
||||
mContext.bindings.setViewModel(this);
|
||||
|
||||
initRecyclerView();
|
||||
|
||||
initColloInfo();
|
||||
}
|
||||
|
||||
|
||||
private void initRecyclerView() {
|
||||
mContext.bindings.contenutoBancaleMainList.setNestedScrollingEnabled(false);
|
||||
|
||||
mContext.bindings.contenutoBancaleMainList.setHasFixedSize(true);
|
||||
|
||||
mContext.bindings.contenutoBancaleMainList.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
|
||||
DividerItemDecoration itemDecorator = new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL);
|
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(mContext, R.drawable.divider));
|
||||
mContext.bindings.contenutoBancaleMainList.addItemDecoration(itemDecorator);
|
||||
|
||||
mAdapter = new ContenutoBancaleListAdapter(mContext, mtbColt.get().getMtbColr(), this);
|
||||
mContext.bindings.contenutoBancaleMainList.setAdapter(mAdapter);
|
||||
|
||||
// mContext.bindings.waterfallToolbar.setRecyclerView(mContext.bindings.contenutoBancaleMainList);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void initColloInfo() {
|
||||
DepositoRESTConsumer.getDepoByCodMdep(mtbColt.get().getCodMdep(), depo -> {
|
||||
descrizioneDepo.set("(" + depo.getDescrizione() + ")");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(MtbColr item, int position) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void recoverUL(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void printUL() {
|
||||
mContext.bindings.contenutoBancaleFab.close(true);
|
||||
|
||||
final ProgressDialog progress = ProgressDialog.show(mContext, mContext.getText(R.string.waiting),
|
||||
mContext.getText(R.string.loading) + " ...", true);
|
||||
|
||||
PrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().userSession.depo.getCodMdep(), new ISimpleOperationCallback<List<String>>() {
|
||||
@Override
|
||||
public void onSuccess(List<String> value) {
|
||||
|
||||
if(value.size() > 0) {
|
||||
|
||||
try {
|
||||
ReportManager.getRightReportNameByMtbColt(mtbColt.get(), reportName -> {
|
||||
|
||||
PrinterRESTConsumer.printCollo(value.get(0),
|
||||
mtbColt.get(),
|
||||
1,
|
||||
reportName,
|
||||
() -> {
|
||||
progress.dismiss();
|
||||
|
||||
Resources res = mContext.getResources();
|
||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||
DialogSimpleMessageHelper.makeSuccessDialog(mContext, res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show();
|
||||
}, ex -> UtilityExceptions.defaultException(mContext,ex, progress));
|
||||
|
||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress)
|
||||
);
|
||||
} catch (Exception ex){
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
}
|
||||
|
||||
} else {
|
||||
progress.dismiss();
|
||||
String errorMessage = "Nessuna stampante configurata";
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mContext, new SpannableString(errorMessage), null, null).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package it.integry.integrywmsnative.gest.lista_bancali;
|
||||
|
||||
import android.databinding.DataBindingUtil;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.databinding.ActivityListaBancaliBinding;
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.viewmodel.ListaBancaliViewModel;
|
||||
|
||||
public class ListaBancaliActivity extends AppCompatActivity {
|
||||
|
||||
public ActivityListaBancaliBinding bindings;
|
||||
|
||||
private ListaBancaliViewModel mViewModel;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
bindings = DataBindingUtil.setContentView(this, R.layout.activity_lista_bancali);
|
||||
|
||||
|
||||
List<MtbColt> mtbColts = (ArrayList<MtbColt>)getIntent().getSerializableExtra("key");
|
||||
mViewModel = new ListaBancaliViewModel(this, mtbColts);
|
||||
|
||||
setSupportActionBar(this.bindings.toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp() {
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,111 @@
|
||||
package it.integry.integrywmsnative.gest.lista_bancali.core;
|
||||
|
||||
import android.content.Context;
|
||||
import android.databinding.DataBindingUtil;
|
||||
import android.databinding.ObservableArrayList;
|
||||
import android.databinding.ObservableList;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.View;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.databinding.ListaBancaliListModelBinding;
|
||||
|
||||
public class MainListListaColliAdapter extends RecyclerView.Adapter<MainListListaColliAdapter.ViewHolder> {
|
||||
|
||||
protected Context mContext;
|
||||
protected ObservableArrayList<MtbColt> mDataset;
|
||||
|
||||
private IRecyclerItemClicked<MtbColt> mOnItemClickListener;
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
protected ListaBancaliListModelBinding mViewDataBinding;
|
||||
|
||||
|
||||
public ViewHolder(ListaBancaliListModelBinding v) {
|
||||
super(v.getRoot());
|
||||
mViewDataBinding = v;
|
||||
}
|
||||
|
||||
public void bind(MtbColt mtbColt) {
|
||||
mViewDataBinding.setMtbColt(mtbColt);
|
||||
mViewDataBinding.executePendingBindings();
|
||||
}
|
||||
}
|
||||
|
||||
public MainListListaColliAdapter(Context context, ObservableArrayList<MtbColt> myDataset, IRecyclerItemClicked<MtbColt> onItemClickListener) {
|
||||
mContext = context;
|
||||
mDataset = myDataset;
|
||||
mOnItemClickListener = onItemClickListener;
|
||||
|
||||
myDataset.addOnListChangedCallback(onListChangedCallback);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public MainListListaColliAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
// create a new view
|
||||
ListaBancaliListModelBinding viewDataBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.lista_bancali_list_model, parent, false);
|
||||
|
||||
return new ViewHolder(viewDataBinding);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(MainListListaColliAdapter.ViewHolder holder, int position) {
|
||||
MtbColt item = mDataset.get(position);
|
||||
holder.bind(item);
|
||||
|
||||
holder.mViewDataBinding.getRoot().setOnClickListener(x -> {
|
||||
if(mOnItemClickListener != null) {
|
||||
mOnItemClickListener.onItemClick(item, position);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewRecycled(MainListListaColliAdapter.ViewHolder holder) {
|
||||
super.onViewRecycled(holder);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mDataset.size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private ObservableList.OnListChangedCallback onListChangedCallback = new ObservableList.OnListChangedCallback<ObservableList<MtbColt>>() {
|
||||
@Override
|
||||
public void onChanged(ObservableList<MtbColt> sender) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeChanged(ObservableList<MtbColt> sender, int positionStart, int itemCount) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeInserted(ObservableList<MtbColt> sender, int positionStart, int itemCount) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeMoved(ObservableList<MtbColt> sender, int fromPosition, int toPosition, int itemCount) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeRemoved(ObservableList<MtbColt> sender, int positionStart, int itemCount) {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@ -0,0 +1,112 @@
|
||||
package it.integry.integrywmsnative.gest.lista_bancali.viewmodel;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.databinding.ObservableArrayList;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.DividerItemDecoration;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivity;
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.core.MainListListaColliAdapter;
|
||||
|
||||
public class ListaBancaliViewModel implements IRecyclerItemClicked<MtbColt> {
|
||||
|
||||
private ListaBancaliActivity mContext;
|
||||
private ObservableArrayList<MtbColt> mMtbColts;
|
||||
|
||||
private MainListListaColliAdapter mAdapter;
|
||||
|
||||
public ListaBancaliViewModel(ListaBancaliActivity context, List<MtbColt> mtbColts){
|
||||
mContext = context;
|
||||
mMtbColts = new ObservableArrayList<>();
|
||||
mMtbColts.addAll(mtbColts);
|
||||
|
||||
initRecyclerView();
|
||||
}
|
||||
|
||||
public void initRecyclerView() {
|
||||
mContext.bindings.listaColliMainList.setHasFixedSize(true);
|
||||
|
||||
mContext.bindings.listaColliMainList.setLayoutManager(new LinearLayoutManager(mContext));
|
||||
|
||||
DividerItemDecoration itemDecorator = new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL);
|
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(mContext, R.drawable.divider));
|
||||
mContext.bindings.listaColliMainList.addItemDecoration(itemDecorator);
|
||||
|
||||
|
||||
mAdapter = new MainListListaColliAdapter(mContext, mMtbColts, this);
|
||||
mContext.bindings.listaColliMainList.setAdapter(mAdapter);
|
||||
|
||||
mContext.bindings.waterfallToolbar.setRecyclerView(mContext.bindings.listaColliMainList);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(MtbColt item, int position) {
|
||||
|
||||
final ProgressDialog progress = ProgressDialog.show(mContext, mContext.getText(R.string.waiting),
|
||||
mContext.getText(R.string.loading) + " ...", true);
|
||||
|
||||
try {
|
||||
String sql = "SELECT *, mtb_aart.descrizione, mtb_aart.unt_mis " +
|
||||
"FROM mtb_colr " +
|
||||
"LEFT OUTER JOIN mtb_aart ON mtb_colr.cod_mart = mtb_aart.cod_mart " +
|
||||
"WHERE " +
|
||||
"mtb_colr.data_collo = " + UtilityDB.valueToString(item.getDataColloD()) + " AND " +
|
||||
"mtb_colr.ser_collo = " + UtilityDB.valueToString(item.getSerCollo()) + " AND " +
|
||||
"mtb_colr.num_collo = " + UtilityDB.valueToString(item.getNumCollo()) + " AND " +
|
||||
"mtb_colr.gestione = " + UtilityDB.valueToString(item.getGestione());
|
||||
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColr>>() {}.getType();
|
||||
SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<List<MtbColr>>() {
|
||||
@Override
|
||||
public void onSuccess(List<MtbColr> value) {
|
||||
ObservableArrayList<MtbColr> mtbColrObservableArrayList = new ObservableArrayList<>();
|
||||
mtbColrObservableArrayList.addAll(value);
|
||||
item.setMtbColr(mtbColrObservableArrayList);
|
||||
|
||||
progress.dismiss();
|
||||
|
||||
Intent myIntent = new Intent(mContext, ContenutoBancaleActivity.class);
|
||||
myIntent.putExtra("key", item); //Optional parameters
|
||||
mContext.startActivity(myIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
UtilityExceptions.defaultException(mContext, e, progress);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -116,6 +116,7 @@ public class LoginViewModel {
|
||||
public void onSuccess(final LoginDTO loginDTO) {
|
||||
|
||||
SettingsManager.iDB().setAvailableProfiles(loginDTO.availableProfiles);
|
||||
SettingsManager.i().user.fullname = loginDTO.full_name;
|
||||
|
||||
|
||||
mActivity.runOnUiThread(() -> onLoginSuccess(
|
||||
@ -150,7 +151,11 @@ public class LoginViewModel {
|
||||
}
|
||||
|
||||
|
||||
private void loadDepo(Runnable onComplete) {
|
||||
private void loadDepo(String host, int port, Runnable onComplete) {
|
||||
|
||||
SettingsManager.i().server.codAzienda = codAzienda.get();
|
||||
SettingsManager.i().server.host = host;
|
||||
SettingsManager.i().server.port = port;
|
||||
|
||||
SettingsManager.i().user.username = username.get();
|
||||
SettingsManager.i().user.password = password.get();
|
||||
@ -212,9 +217,7 @@ public class LoginViewModel {
|
||||
builder.setItems(profiles, (dialog, which) -> {
|
||||
SettingsManager.i().userSession.profileDB = availableProfiles.get(which);
|
||||
|
||||
loadDepo(() -> {
|
||||
onLoginCompleted(host, port);
|
||||
});
|
||||
loadDepo(host, port, this::onLoginCompleted);
|
||||
});
|
||||
|
||||
// create and show the alert dialog
|
||||
@ -222,14 +225,10 @@ public class LoginViewModel {
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
public void onLoginCompleted(String host, int port) {
|
||||
public void onLoginCompleted() {
|
||||
loginButtonEnabled.set(true);
|
||||
|
||||
|
||||
SettingsManager.i().server.codAzienda = codAzienda.get();
|
||||
SettingsManager.i().server.host = host;
|
||||
SettingsManager.i().server.port = port;
|
||||
|
||||
SettingsManager.update();
|
||||
|
||||
Intent myIntent = new Intent(mActivity, MainActivity.class);
|
||||
|
||||
BIN
app/src/main/res/drawable/abc.jpg
Normal file
BIN
app/src/main/res/drawable/abc.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 517 KiB |
12
app/src/main/res/drawable/bottom_list_background_round16.xml
Normal file
12
app/src/main/res/drawable/bottom_list_background_round16.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<solid android:color="#ebebeb" />
|
||||
|
||||
<padding
|
||||
android:left="4dp"
|
||||
android:right="4dp"
|
||||
android:top="4dp" />
|
||||
|
||||
<corners android:topLeftRadius="16dp" android:topRightRadius="16dp" />
|
||||
</shape>
|
||||
6
app/src/main/res/drawable/divider.xml
Normal file
6
app/src/main/res/drawable/divider.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#61818181"/>
|
||||
<size android:height="0.5dp"/>
|
||||
</shape>
|
||||
@ -8,5 +8,5 @@
|
||||
android:right="1dp"
|
||||
android:top="1dp" />
|
||||
|
||||
<corners android:radius="5dp" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
12
app/src/main/res/drawable/gray_detail_background_round16.xml
Normal file
12
app/src/main/res/drawable/gray_detail_background_round16.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<solid android:color="#ebebeb" />
|
||||
|
||||
<padding
|
||||
android:left="1dp"
|
||||
android:right="1dp"
|
||||
android:top="1dp" />
|
||||
|
||||
<corners android:radius="16dp" />
|
||||
</shape>
|
||||
12
app/src/main/res/drawable/gray_detail_background_round8.xml
Normal file
12
app/src/main/res/drawable/gray_detail_background_round8.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<solid android:color="#ebebeb" />
|
||||
|
||||
<padding
|
||||
android:left="1dp"
|
||||
android:right="1dp"
|
||||
android:top="1dp" />
|
||||
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
9
app/src/main/res/drawable/ic_print_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_print_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="@color/colorPrimary"
|
||||
android:pathData="M19,8L5,8c-1.66,0 -3,1.34 -3,3v6h4v4h12v-4h4v-6c0,-1.66 -1.34,-3 -3,-3zM16,19L8,19v-5h8v5zM19,12c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1 1,0.45 1,1 -0.45,1 -1,1zM18,3L6,3v4h12L18,3z"/>
|
||||
</vector>
|
||||
13
app/src/main/res/drawable/ripple_effect.xml
Normal file
13
app/src/main/res/drawable/ripple_effect.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/colorRipple"> <!-- ripple color -->
|
||||
|
||||
<!-- for Button -->
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/full_white"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</ripple>
|
||||
@ -60,7 +60,7 @@
|
||||
android:id="@+id/accettazione_ordine_inevaso_main_list_group_item_qta_evasa"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/green_700"
|
||||
style="@android:style/TextAppearance.Medium"
|
||||
|
||||
250
app/src/main/res/layout/activity_contenuto_bancale.xml
Normal file
250
app/src/main/res/layout/activity_contenuto_bancale.xml
Normal file
@ -0,0 +1,250 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:fab="http://schemas.android.com/apk/res-auto">
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel.ContenutoBancaleViewModel" />
|
||||
|
||||
</data>
|
||||
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/full_white">
|
||||
|
||||
<it.integry.plugins.waterfalltoolbar.WaterfallToolbar
|
||||
android:id="@+id/waterfall_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
tools:title="Contenuto bancale"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"/>
|
||||
|
||||
</it.integry.plugins.waterfalltoolbar.WaterfallToolbar>
|
||||
|
||||
<android.support.v4.widget.NestedScrollView
|
||||
android:id="@+id/scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp"
|
||||
android:focusableInTouchMode="true"
|
||||
tools:context=".gest.contenuto_bancale.ContenutoBancaleActivity">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/gray_detail_background_round8"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:padding="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Data creazione: "
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.mtbColt.getDataColloHumanLong()}"
|
||||
tools:text="22 ottobre 2018"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Preparato da "
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.mtbColt.getPreparatoDa() != null ? viewModel.mtbColt.getPreparatoDa() : `N/D`}"
|
||||
tools:text="Vito Falagario"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="italic" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="12dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Posizione "
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.mtbColt.getPosizione() != null ? viewModel.mtbColt.getPosizione() : `N/D`}"
|
||||
tools:text="A00F00C00L00"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Deposito "
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.mtbColt.getCodMdep()}"
|
||||
tools:text="10"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="4sp"
|
||||
android:text="@{viewModel.descrizioneDepo}"
|
||||
tools:text="(Bari)"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/contenuto_bancale_main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="92dp"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="2dp">
|
||||
|
||||
</android.support.v7.widget.RecyclerView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v4.widget.NestedScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.github.clans.fab.FloatingActionMenu
|
||||
android:id="@+id/contenuto_bancale_fab"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="@{viewModel.isFabVisible ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
fab:menu_animationDelayPerItem="50"
|
||||
fab:menu_backgroundColor="@color/white_bg_alpha"
|
||||
fab:menu_buttonSpacing="0dp"
|
||||
fab:menu_colorNormal="@color/colorPrimary"
|
||||
fab:menu_colorPressed="@color/colorPrimaryDark"
|
||||
fab:menu_fab_size="normal"
|
||||
fab:menu_labels_colorNormal="@color/white"
|
||||
fab:menu_labels_colorPressed="@color/white_pressed"
|
||||
fab:menu_labels_colorRipple="#66FFFFFF"
|
||||
fab:menu_labels_cornerRadius="3dp"
|
||||
fab:menu_labels_hideAnimation="@anim/fab_slide_out_to_right"
|
||||
fab:menu_labels_margin="0dp"
|
||||
fab:menu_labels_padding="8dp"
|
||||
fab:menu_labels_paddingBottom="4dp"
|
||||
fab:menu_labels_paddingLeft="8dp"
|
||||
fab:menu_labels_paddingRight="8dp"
|
||||
fab:menu_labels_paddingTop="4dp"
|
||||
fab:menu_labels_position="left"
|
||||
fab:menu_labels_showAnimation="@anim/fab_slide_in_from_right"
|
||||
fab:menu_labels_showShadow="true"
|
||||
fab:menu_labels_textColor="@color/black_semi_transparent"
|
||||
fab:menu_labels_textSize="18sp"
|
||||
fab:menu_openDirection="up"
|
||||
fab:menu_shadowColor="#66000000"
|
||||
fab:menu_shadowRadius="4dp"
|
||||
fab:menu_shadowXOffset="1dp"
|
||||
fab:menu_shadowYOffset="3dp"
|
||||
fab:menu_showShadow="true">
|
||||
|
||||
<com.github.clans.fab.FloatingActionButton
|
||||
android:id="@+id/accettazione_ordine_inevaso_fab_item1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_box"
|
||||
app:fab_colorNormal="@color/white"
|
||||
app:fab_colorPressed="@color/white_pressed"
|
||||
app:fab_colorRipple="#66FFFFFF"
|
||||
app:onClick="@{() -> viewModel.recoverUL()}"
|
||||
fab:fab_label="@string/action_recover_ul" />
|
||||
|
||||
<com.github.clans.fab.FloatingActionButton
|
||||
android:id="@+id/accettazione_ordine_inevaso_fab_item2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_print_24dp"
|
||||
app:fab_colorNormal="@color/white"
|
||||
app:fab_colorPressed="@color/white_pressed"
|
||||
app:fab_colorRipple="#66FFFFFF"
|
||||
app:onClick="@{() -> viewModel.printUL()}"
|
||||
fab:fab_label="@string/action_print_ul" />
|
||||
|
||||
</com.github.clans.fab.FloatingActionMenu>
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
</layout>
|
||||
43
app/src/main/res/layout/activity_lista_bancali.xml
Normal file
43
app/src/main/res/layout/activity_lista_bancali.xml
Normal file
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<data>
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@color/full_white">
|
||||
|
||||
|
||||
<it.integry.plugins.waterfalltoolbar.WaterfallToolbar
|
||||
android:id="@+id/waterfall_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?actionBarSize"/>
|
||||
|
||||
</it.integry.plugins.waterfalltoolbar.WaterfallToolbar>
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".gest.lista_bancali.ListaBancaliActivity">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/lista_colli_main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
18
app/src/main/res/layout/fragment_contenuto_bancale.xml
Normal file
18
app/src/main/res/layout/fragment_contenuto_bancale.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/show_sheet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="1000dp"
|
||||
android:text="Hello World!"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
103
app/src/main/res/layout/lista_bancali_list_model.xml
Normal file
103
app/src/main/res/layout/lista_bancali_list_model.xml
Normal file
@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout>
|
||||
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.core.model.MtbColt"></import>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString"></import>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityDate"></import>
|
||||
<import type="android.view.View"></import>
|
||||
|
||||
<variable
|
||||
name="mtbColt"
|
||||
type="MtbColt"></variable>
|
||||
|
||||
</data>
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:clickable="true"
|
||||
android:background="@drawable/ripple_effect">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp">
|
||||
|
||||
<android.support.v7.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@{mtbColt.numCollo.toString()}"
|
||||
tools:text="22222"
|
||||
android:background="@drawable/badge1_round_corner"
|
||||
android:textColor="@android:color/white"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_toLeftOf="@id/posizione_collo"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:text="@{mtbColt.getDataColloHumanLong()}"
|
||||
tools:text="28 ottobre 2018" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/posizione_collo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@{mtbColt.posizione}"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(mtbColt.posizione) ? View.INVISIBLE : View.VISIBLE}"
|
||||
tools:text="A01F01C01L01" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:text="@{`Preparato da: ` + mtbColt.preparatoDa}"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(mtbColt.preparatoDa) ? View.INVISIBLE : View.VISIBLE}"
|
||||
tools:text="Preparato da: Lisa Sportelli" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</layout>
|
||||
@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
<variable
|
||||
name="mtbColr"
|
||||
type="it.integry.integrywmsnative.core.model.MtbColr" />
|
||||
</data>
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toStartOf="@+id/qta_box"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
|
||||
<android.support.v7.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{mtbColr.codMart}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="COD MART" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toLeftOf="@id/posizione_collo"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@{mtbColr.getDescrizione()}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
tools:text="Descrizione lunga articolo" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{`Lotto: ` + mtbColr.getPartitaMag()}"
|
||||
android:textSize="14sp"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(mtbColr.getPartitaMag()) ? View.INVISIBLE : View.VISIBLE}"
|
||||
tools:text="Lotto: ABCDE" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/qta_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<android.support.v7.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/badge1_round_corner"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:text="@{UtilityNumber.decimalToString(mtbColr.getQtaCol()) + `\n` + mtbColr.getUntMis()}"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
tools:text="280.45\nCONF" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
|
||||
</layout>
|
||||
@ -3,6 +3,7 @@
|
||||
<string name="app_name">Integry WMS Native</string>
|
||||
<string name="waiting">Attendere</string>
|
||||
<string name="loading">Caricamento</string>
|
||||
<string name="completed">Completato</string>
|
||||
<string name="ord_acq_testata"><![CDATA[Ord. Acq. <b>%s</b> del <b>%s</b>]]></string>
|
||||
<string name="search">Cerca...</string>
|
||||
<string name="accettazione_title_fragment">Accettazione</string>
|
||||
@ -25,6 +26,8 @@
|
||||
<string name="action_orderBy">Ordina</string>
|
||||
<string name="action_create_ul">Crea nuova UL</string>
|
||||
<string name="action_show_created_ul">Mostra UL già create</string>
|
||||
<string name="action_recover_ul">Recupera UL</string>
|
||||
<string name="action_print_ul">Stampa UL</string>
|
||||
<string name="confirm">Conferma</string>
|
||||
<string name="hint_additional_notes">Note Aggiuntive</string>
|
||||
<string name="dialog_message_additional_notes">Inserisci eventuali note aggiuntive della tua UL</string>
|
||||
@ -87,9 +90,15 @@
|
||||
|
||||
<string name="saving">Salvataggio</string>
|
||||
<string name="data_saved">Salvataggio completato</string>
|
||||
<string name="alert_print_completed_message">Stampa completata</string>
|
||||
|
||||
<string name="wrong_quantity_input"><![CDATA[La quantità inserita non è valida]]></string>
|
||||
<string name="settings_category">Impostazioni</string>
|
||||
<string name="check_box_preference_title">Check box</string>
|
||||
<string name="check_box_preference_summary">This is a regular preference</string>
|
||||
|
||||
<string name="activity_lista_bancali_title">Lista UL</string>
|
||||
<string name="activity_contenuto_bancale_title">Contenuto UL</string>
|
||||
|
||||
|
||||
</resources>
|
||||
@ -3,6 +3,7 @@
|
||||
<color name="colorPrimary">@color/indigo_500</color>
|
||||
<color name="colorPrimaryDark">@color/indigo_700</color>
|
||||
<color name="colorAccent">#387ef5</color>
|
||||
<color name="colorRipple">#3f3f51b5</color>
|
||||
|
||||
<color name="mainGreen">@color/green_500</color>
|
||||
<color name="mainOrange">#32db64</color>
|
||||
@ -10,6 +11,7 @@
|
||||
|
||||
<!-- FAB DEFINITIONS -->
|
||||
<color name="black_semi_transparent">#B2000000</color>
|
||||
<color name="full_white">#FFFFFF</color>
|
||||
<color name="white">#fafafa</color>
|
||||
<color name="white_bg_alpha">#88BCBCBC</color>
|
||||
<color name="white_pressed">#f1f1f1</color>
|
||||
|
||||
@ -5,4 +5,5 @@
|
||||
<dimen name="nav_header_vertical_spacing">16dp</dimen>
|
||||
<dimen name="nav_header_height">160dp</dimen>
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
<dimen name="bottom_sheet_round16">16dp</dimen>
|
||||
</resources>
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
<!-- Generic strings -->
|
||||
<string name="waiting">Waiting</string>
|
||||
<string name="loading">Loading</string>
|
||||
<string name="completed">Completed</string>
|
||||
<string name="search">Search...</string>
|
||||
|
||||
|
||||
@ -28,7 +29,9 @@
|
||||
<string name="action_filter">Filter</string>
|
||||
<string name="action_orderBy">Order</string>
|
||||
<string name="action_create_ul">Create new LU</string>
|
||||
<string name="action_show_created_ul">Show already created UL</string>
|
||||
<string name="action_show_created_ul">Show already created LU</string>
|
||||
<string name="action_recover_ul">Recover LU</string>
|
||||
<string name="action_print_ul">Print LU</string>
|
||||
<string name="confirm">Confirm</string>
|
||||
<string name="hint_additional_notes">Additional notes</string>
|
||||
<string name="dialog_message_additional_notes">Enter any additional notes in your logistics unit</string>
|
||||
@ -93,6 +96,7 @@
|
||||
|
||||
<string name="saving">Saving</string>
|
||||
<string name="data_saved">Data saved</string>
|
||||
<string name="alert_print_completed_message">Printing job completed</string>
|
||||
|
||||
<string name="wrong_quantity_input">The quantity entered is not valid, please check it</string>
|
||||
<string name="settings_category">Settings</string>
|
||||
@ -102,4 +106,7 @@
|
||||
|
||||
<string name="warehouse">Warehouse</string>
|
||||
|
||||
<string name="activity_lista_bancali_title">LU List</string>
|
||||
<string name="activity_contenuto_bancale_title">LU Content</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@ -19,6 +19,15 @@
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.AppCompat.Dark.NoActionBar" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark" />
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.2.61'
|
||||
ext.kotlin_version = '1.2.71'
|
||||
ext{
|
||||
kotlin_version = '1.2.71'
|
||||
gradle_version = '3.2.1'
|
||||
}
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
@ -11,7 +16,7 @@ buildscript {
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
classpath "com.android.tools.build:gradle:$gradle_version"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
||||
@ -1 +1 @@
|
||||
include ':app', ':pointmobilescannerlibrary'
|
||||
include ':app', ':pointmobilescannerlibrary', ':waterfall_toolbar'
|
||||
|
||||
1
waterfall_toolbar/.gitignore
vendored
Normal file
1
waterfall_toolbar/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
||||
43
waterfall_toolbar/build.gradle
Normal file
43
waterfall_toolbar/build.gradle
Normal file
@ -0,0 +1,43 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
android {
|
||||
compileSdkVersion 27
|
||||
|
||||
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 27
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
// google
|
||||
implementation "com.android.support:cardview-v7:27.1.1"
|
||||
implementation "com.android.support:design:27.1.1"
|
||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
21
waterfall_toolbar/proguard-rules.pro
vendored
Normal file
21
waterfall_toolbar/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@ -0,0 +1,26 @@
|
||||
package it.integry.plugins.waterfalltoolbar;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.test.InstrumentationRegistry;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("it.integry.plugins.waterfall_toolbar.test", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
2
waterfall_toolbar/src/main/AndroidManifest.xml
Normal file
2
waterfall_toolbar/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,2 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="it.integry.plugins.waterfalltoolbar" />
|
||||
@ -0,0 +1,19 @@
|
||||
package it.integry.plugins.waterfalltoolbar
|
||||
|
||||
var density: Float? = null
|
||||
|
||||
data class Dp(var value: Float) {
|
||||
fun toPx(): Px {
|
||||
val innerDensity: Float = density ?: throw NullPointerException(
|
||||
"You must set density before using DimensionUnits classes.")
|
||||
return Px((value * innerDensity + 0.5f).toInt())
|
||||
}
|
||||
}
|
||||
|
||||
data class Px(var value: Int) {
|
||||
fun toDp(): Dp {
|
||||
val innerDensity: Float = density ?: throw NullPointerException(
|
||||
"You must set density before using DimensionUnits classes.")
|
||||
return Dp(value / innerDensity + 0.5f)
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,310 @@
|
||||
package it.integry.plugins.waterfalltoolbar
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
import android.support.annotation.RequiresApi
|
||||
import android.support.v4.widget.NestedScrollView
|
||||
import android.support.v7.widget.CardView
|
||||
import android.support.v7.widget.RecyclerView
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.widget.ScrollView
|
||||
|
||||
/**
|
||||
* Created by Hugo Castelani
|
||||
* Date: 19/09/17
|
||||
* Time: 19:30
|
||||
*/
|
||||
|
||||
open class WaterfallToolbar : CardView {
|
||||
init {
|
||||
// set density to be able to use DimensionUnits
|
||||
// this code must run before all the signings using DimensionUnits
|
||||
if (density == null) density = resources.displayMetrics.density
|
||||
}
|
||||
|
||||
/**
|
||||
* The recycler view whose scroll is going to be listened
|
||||
*/
|
||||
var recyclerView: RecyclerView? = null
|
||||
set(value) {
|
||||
field = value
|
||||
addRecyclerViewScrollListener()
|
||||
}
|
||||
|
||||
/**
|
||||
* The scroll view whose scroll is going to be listened
|
||||
*/
|
||||
var scrollView: ScrollView? = null
|
||||
set(value) {
|
||||
field = value
|
||||
addScrollViewScrollListener()
|
||||
}
|
||||
|
||||
/**
|
||||
* The scroll view whose scroll is going to be listened
|
||||
*/
|
||||
var nestedScrollView: NestedScrollView? = null
|
||||
set(value) {
|
||||
field = value
|
||||
addNestedScrollViewScrollListener()
|
||||
}
|
||||
|
||||
/**
|
||||
* The three variables ahead are null safe, since they are always set
|
||||
* at least once in init() and a null value can't be assigned to them
|
||||
* after that. So all the "!!" involving them below are fully harmless.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The elevation with which the toolbar starts
|
||||
*/
|
||||
var initialElevation: Px? = null
|
||||
set(value) {
|
||||
if (value != null) {
|
||||
field = value
|
||||
|
||||
// got to update elevation in case this value have
|
||||
// been set in a running and visible activity
|
||||
if (isSetup) adjustCardElevation()
|
||||
|
||||
} else throw NullPointerException("This field cannot be null.")
|
||||
}
|
||||
|
||||
/**
|
||||
* The elevation the toolbar gets when it reaches final scroll elevation
|
||||
*/
|
||||
var finalElevation: Px? = null
|
||||
set(value) {
|
||||
if (value != null) {
|
||||
field = value
|
||||
|
||||
// got to update elevation in case this value have
|
||||
// been set in a running and visible activity
|
||||
if (isSetup) adjustCardElevation()
|
||||
|
||||
} else throw NullPointerException("This field cannot be null.")
|
||||
}
|
||||
|
||||
/**
|
||||
* The percentage of the screen's height that is
|
||||
* going to be scrolled to reach the final elevation
|
||||
*/
|
||||
var scrollFinalPosition: Int? = null
|
||||
set(value) {
|
||||
if (value != null) {
|
||||
val screenHeight = resources.displayMetrics.heightPixels
|
||||
field = Math.round(screenHeight * (value / 100.0f))
|
||||
|
||||
// got to update elevation in case this value have
|
||||
// been set in a running and visible activity
|
||||
if (isSetup) adjustCardElevation()
|
||||
|
||||
} else throw NullPointerException("This field cannot be null.")
|
||||
}
|
||||
|
||||
/**
|
||||
* Dimension units (dp and pixel) auxiliary
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Values related to Waterfall Toolbar behavior in their default forms
|
||||
*/
|
||||
val defaultInitialElevation = Dp(0f).toPx()
|
||||
val defaultFinalElevation = Dp(4f).toPx()
|
||||
val defaultScrollFinalElevation = 12
|
||||
|
||||
/**
|
||||
* Auxiliary that indicates if the view is already setup
|
||||
*/
|
||||
private var isSetup: Boolean = false
|
||||
|
||||
/**
|
||||
* Position in which toolbar must be to reach expected shadow
|
||||
*/
|
||||
private var orthodoxPosition = Px(0)
|
||||
|
||||
/**
|
||||
* Recycler/scroll view real position
|
||||
*/
|
||||
private var realPosition = Px(0)
|
||||
|
||||
constructor(context: Context) : super(context) {
|
||||
init(context, null)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
|
||||
init(context, attrs)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int?)
|
||||
: super(context, attrs, defStyleAttr!!) {
|
||||
init(context, attrs)
|
||||
}
|
||||
|
||||
private fun init(context: Context?, attrs: AttributeSet?) {
|
||||
// leave card corners square
|
||||
radius = 0f
|
||||
|
||||
if (context != null && attrs != null) {
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.WaterfallToolbar)
|
||||
|
||||
val rawInitialElevation = typedArray.getDimensionPixelSize(
|
||||
R.styleable.WaterfallToolbar_initial_elevation, defaultInitialElevation.value)
|
||||
|
||||
val rawFinalElevation = typedArray.getDimensionPixelSize(
|
||||
R.styleable.WaterfallToolbar_final_elevation, defaultFinalElevation.value)
|
||||
|
||||
scrollFinalPosition = typedArray.getInteger(
|
||||
R.styleable.WaterfallToolbar_scroll_final_elevation, defaultScrollFinalElevation)
|
||||
|
||||
this.initialElevation = Px(rawInitialElevation)
|
||||
this.finalElevation = Px(rawFinalElevation)
|
||||
|
||||
typedArray.recycle()
|
||||
|
||||
} else {
|
||||
|
||||
initialElevation = defaultInitialElevation
|
||||
finalElevation = defaultFinalElevation
|
||||
scrollFinalPosition = defaultScrollFinalElevation
|
||||
}
|
||||
|
||||
adjustCardElevation() // just to make sure card elevation is set
|
||||
|
||||
isSetup = true
|
||||
}
|
||||
|
||||
private fun addRecyclerViewScrollListener() {
|
||||
recyclerView?.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||
override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) {
|
||||
super.onScrolled(recyclerView, dx, dy)
|
||||
// real position must always get updated
|
||||
realPosition.value = realPosition.value + dy
|
||||
mutualScrollListenerAction()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun addScrollViewScrollListener() {
|
||||
scrollView?.viewTreeObserver?.addOnScrollChangedListener {
|
||||
// real position must always get updated
|
||||
realPosition.value = scrollView!!.scrollY
|
||||
mutualScrollListenerAction()
|
||||
}
|
||||
}
|
||||
|
||||
private fun addNestedScrollViewScrollListener() {
|
||||
nestedScrollView?.viewTreeObserver?.addOnScrollChangedListener {
|
||||
realPosition.value = nestedScrollView!!.scrollY
|
||||
mutualScrollListenerAction()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* These lines are common in both scroll listeners, so they are better joined
|
||||
*/
|
||||
private fun mutualScrollListenerAction() {
|
||||
// orthodoxPosition can't be higher than scrollFinalPosition because
|
||||
// the last one holds the position in which shadow reaches ideal size
|
||||
|
||||
if (realPosition.value <= scrollFinalPosition!!) {
|
||||
orthodoxPosition.value = realPosition.value
|
||||
} else {
|
||||
orthodoxPosition.value = scrollFinalPosition!!
|
||||
}
|
||||
|
||||
adjustCardElevation()
|
||||
}
|
||||
|
||||
/**
|
||||
* Speed up the card elevation setting
|
||||
*/
|
||||
private fun adjustCardElevation() {
|
||||
cardElevation = calculateElevation().value.toFloat()
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the elevation based on given attributes and scroll
|
||||
* @return New calculated elevation
|
||||
*/
|
||||
private fun calculateElevation(): Px {
|
||||
// getting back to rule of three:
|
||||
// finalElevation = scrollFinalPosition
|
||||
// newElevation = orthodoxPosition
|
||||
var newElevation: Int = finalElevation!!.value * orthodoxPosition.value / scrollFinalPosition!!
|
||||
|
||||
// avoid values under minimum value
|
||||
if (newElevation < initialElevation!!.value) newElevation = initialElevation!!.value
|
||||
|
||||
return Px(newElevation)
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the view's current dynamic state in a parcelable object
|
||||
* @return A parcelable with the saved data
|
||||
*/
|
||||
override fun onSaveInstanceState(): Parcelable? {
|
||||
val savedState = SavedState(super.onSaveInstanceState())
|
||||
|
||||
savedState.elevation = cardElevation.toInt()
|
||||
savedState.orthodoxPosition = orthodoxPosition
|
||||
savedState.realPosition = realPosition
|
||||
|
||||
return savedState
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore the view's dynamic state
|
||||
* @param state The frozen state that had previously been returned by onSaveInstanceState()
|
||||
*/
|
||||
override fun onRestoreInstanceState(state: Parcelable) {
|
||||
if (state is SavedState) {
|
||||
super.onRestoreInstanceState(state.superState)
|
||||
|
||||
// setting card elevation doesn't work until view is created
|
||||
post {
|
||||
// it's safe to use "!!" here, since savedState will
|
||||
// always store values properly set in onSaveInstanceState()
|
||||
cardElevation = state.elevation!!.toFloat()
|
||||
orthodoxPosition = state.orthodoxPosition!!
|
||||
realPosition = state.realPosition!!
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
super.onRestoreInstanceState(state)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom parcelable to store this view's dynamic state
|
||||
*/
|
||||
private class SavedState : View.BaseSavedState {
|
||||
var elevation: Int? = null
|
||||
var orthodoxPosition: Px? = null
|
||||
var realPosition: Px? = null
|
||||
|
||||
internal constructor(source: Parcel) : super(source)
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
internal constructor(source: Parcel, loader: ClassLoader) : super(source, loader)
|
||||
|
||||
internal constructor(superState: Parcelable) : super(superState)
|
||||
|
||||
companion object {
|
||||
internal val CREATOR: Parcelable.Creator<SavedState> = object : Parcelable.Creator<SavedState> {
|
||||
override fun createFromParcel(source: Parcel): SavedState {
|
||||
return SavedState(source)
|
||||
}
|
||||
|
||||
override fun newArray(size: Int): Array<SavedState?> {
|
||||
return arrayOfNulls(size)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
8
waterfall_toolbar/src/main/res/values/attrs.xml
Normal file
8
waterfall_toolbar/src/main/res/values/attrs.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<declare-styleable name="WaterfallToolbar">
|
||||
<attr format="dimension" name="initial_elevation" />
|
||||
<attr format="dimension" name="final_elevation" />
|
||||
<attr format="integer" name="scroll_final_elevation" />
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
3
waterfall_toolbar/src/main/res/values/strings.xml
Normal file
3
waterfall_toolbar/src/main/res/values/strings.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">Waterfall Toolbar</string>
|
||||
</resources>
|
||||
@ -0,0 +1,17 @@
|
||||
package it.integry.plugins.waterfalltoolbar;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user