Aggiornato Gradle
This commit is contained in:
parent
5dbc5e8c97
commit
1d291e4420
BIN
.idea/caches/build_file_checksums.ser
generated
Normal file
BIN
.idea/caches/build_file_checksums.ser
generated
Normal file
Binary file not shown.
29
.idea/codeStyles/Project.xml
generated
Normal file
29
.idea/codeStyles/Project.xml
generated
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<code_scheme name="Project" version="173">
|
||||||
|
<Objective-C-extensions>
|
||||||
|
<file>
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
|
||||||
|
</file>
|
||||||
|
<class>
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
|
||||||
|
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
|
||||||
|
</class>
|
||||||
|
<extensions>
|
||||||
|
<pair source="cpp" header="h" fileNamingConvention="NONE" />
|
||||||
|
<pair source="c" header="h" fileNamingConvention="NONE" />
|
||||||
|
</extensions>
|
||||||
|
</Objective-C-extensions>
|
||||||
|
</code_scheme>
|
||||||
|
</component>
|
||||||
@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 25
|
compileSdkVersion 25
|
||||||
buildToolsVersion "27.0.0"
|
buildToolsVersion '27.0.3'
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "it.integry.integrywmsnative"
|
applicationId "it.integry.integrywmsnative"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
@ -20,25 +20,25 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||||
exclude group: 'com.android.support', module: 'support-annotations'
|
exclude group: 'com.android.support', module: 'support-annotations'
|
||||||
})
|
})
|
||||||
compile 'com.android.support:appcompat-v7:25.3.1'
|
implementation 'com.android.support:appcompat-v7:25.4.0'
|
||||||
compile 'com.android.support:support-v4:25.3.1'
|
implementation 'com.android.support:support-v4:25.4.0'
|
||||||
compile 'com.android.support:design:25.3.1'
|
implementation 'com.android.support:design:25.4.0'
|
||||||
compile 'com.android.support.constraint:constraint-layout:1.0.2'
|
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
|
||||||
compile 'com.android.support:cardview-v7:25.3.1'
|
implementation 'com.android.support:cardview-v7:25.4.0'
|
||||||
compile 'com.android.support:recyclerview-v7:25.3.1'
|
implementation 'com.android.support:recyclerview-v7:25.4.0'
|
||||||
|
|
||||||
compile 'com.squareup.retrofit2:retrofit:2.3.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
|
||||||
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.0.0'
|
||||||
|
|
||||||
compile 'com.jakewharton:butterknife:8.8.1'
|
implementation 'com.jakewharton:butterknife:8.8.1'
|
||||||
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
|
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
|
||||||
|
|
||||||
//compile 'com.getbase:floatingactionbutton:1.10.1'
|
//implementation 'com.getbase:floatingactionbutton:1.10.1'
|
||||||
compile 'com.github.clans:fab:1.6.4'
|
implementation 'com.github.clans:fab:1.6.4'
|
||||||
|
|
||||||
testCompile 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,16 +1,11 @@
|
|||||||
package it.integry.integrywmsnative;
|
package it.integry.integrywmsnative;
|
||||||
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.ColorMatrixColorFilter;
|
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.ColorRes;
|
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
import android.support.design.widget.NavigationView;
|
import android.support.design.widget.NavigationView;
|
||||||
import android.support.v4.content.ContextCompat;
|
|
||||||
import android.support.v4.graphics.drawable.DrawableCompat;
|
|
||||||
import android.support.v4.view.GravityCompat;
|
import android.support.v4.view.GravityCompat;
|
||||||
import android.support.v4.widget.DrawerLayout;
|
import android.support.v4.widget.DrawerLayout;
|
||||||
import android.support.v7.app.ActionBarDrawerToggle;
|
import android.support.v7.app.ActionBarDrawerToggle;
|
||||||
@ -23,8 +18,11 @@ import android.view.Menu;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import org.xml.sax.ErrorHandler;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
import it.integry.integrywmsnative.core.exception.ExceptionsHandler;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ITitledFragment;
|
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ITitledFragment;
|
||||||
|
|
||||||
@ -38,6 +36,8 @@ public class MainActivity extends AppCompatActivity
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
// ExceptionsHandler.toCatch(this);
|
||||||
|
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
|
||||||
|
public class ColliMagazzinoRESTConsumer {
|
||||||
|
|
||||||
|
|
||||||
|
public static void saveCollo(MtbColt mtbColtToSave, final ISimpleOperationCallback<MtbColt> callback){
|
||||||
|
|
||||||
|
EntityRESTConsumer.processEntity(mtbColtToSave, callback, MtbColt.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
|
||||||
|
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.model.EntityBase;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
public class EntityRESTConsumer {
|
||||||
|
|
||||||
|
public static <T extends EntityBase> void processEntity(T entityToSave, final ISimpleOperationCallback<T> callback, final Type clazzType){
|
||||||
|
|
||||||
|
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();
|
||||||
|
//Type fooType = new TypeToken<T>() {}.getType();
|
||||||
|
String json = gson.toJson(response.body().getEntity());
|
||||||
|
callback.onSuccess((T) gson.fromJson(json, clazzType));
|
||||||
|
} else {
|
||||||
|
Log.e("EntityRESTConsumer", response.body().getErrorMessage());
|
||||||
|
callback.onFailed(new Exception(response.message()));
|
||||||
|
}
|
||||||
|
} 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));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.model.EntityBase;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
|
public interface EntityRESTConsumerService {
|
||||||
|
|
||||||
|
@POST("processEntity")
|
||||||
|
Call<ServiceRESTResponse<Object>> processEntity(@Body Object entity);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.consumers;
|
||||||
|
|
||||||
|
public interface ISimpleOperationCallback<T> {
|
||||||
|
|
||||||
|
void onSuccess(T value);
|
||||||
|
|
||||||
|
void onFailed(Exception ex );
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,382 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.ActivityManager;
|
||||||
|
import android.app.ApplicationErrorReport;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Debug;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.io.StringWriter;
|
||||||
|
|
||||||
|
public class ExceptionsHandler implements Thread.UncaughtExceptionHandler{
|
||||||
|
|
||||||
|
|
||||||
|
private ExceptionsHandler(Activity activity){
|
||||||
|
|
||||||
|
mPackageName = getPackageName(activity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static ExceptionsHandler getINSTANCE(Activity activity){
|
||||||
|
|
||||||
|
if (mExceptionsHandler == null){
|
||||||
|
|
||||||
|
mExceptionsHandler = new ExceptionsHandler(activity);
|
||||||
|
}
|
||||||
|
|
||||||
|
return mExceptionsHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static String getPackageName(Context pContext){
|
||||||
|
|
||||||
|
String packageName = "";
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
ActivityManager activityManager = (ActivityManager) pContext
|
||||||
|
.getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT > 20){
|
||||||
|
|
||||||
|
packageName = activityManager.getRunningAppProcesses().get(0).processName;
|
||||||
|
}else{
|
||||||
|
|
||||||
|
// <uses-permission android:name="android.permission.GET_TASKS" />
|
||||||
|
packageName = activityManager.getRunningTasks(1).get(0).topActivity
|
||||||
|
.getPackageName();
|
||||||
|
}
|
||||||
|
|
||||||
|
// There is a limit to the tag length of 23.
|
||||||
|
packageName = packageName
|
||||||
|
.substring(0, packageName.length() > 22 ? 22 : packageName.length());
|
||||||
|
|
||||||
|
}catch (Exception ex){
|
||||||
|
}
|
||||||
|
|
||||||
|
if (packageName.isEmpty()){
|
||||||
|
packageName = pContext.getPackageName();
|
||||||
|
}
|
||||||
|
|
||||||
|
return packageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void toCatch(Activity activity){
|
||||||
|
|
||||||
|
Thread.setDefaultUncaughtExceptionHandler(getINSTANCE(activity));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void logError(String message){
|
||||||
|
|
||||||
|
if (message.isEmpty()){
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
logError(new Throwable(message.trim()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void logError(Throwable exception){
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
logCrash(exception);
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
Log.e(mPackageName, e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Return the last error message
|
||||||
|
public static String getErrorMessage(){
|
||||||
|
|
||||||
|
return mErrorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void setErrorMessage(String errMsg){
|
||||||
|
|
||||||
|
mErrorMessage = errMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Return the last crash information
|
||||||
|
public static ApplicationErrorReport.CrashInfo crashInfo(){
|
||||||
|
|
||||||
|
return mCrashInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static String getAppLabel(Context pContext){
|
||||||
|
|
||||||
|
PackageManager lPackageManager = pContext.getPackageManager();
|
||||||
|
|
||||||
|
ApplicationInfo lApplicationInfo = null;
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
lApplicationInfo = lPackageManager
|
||||||
|
.getApplicationInfo(pContext.getApplicationInfo().packageName, 0);
|
||||||
|
|
||||||
|
}catch (final PackageManager.NameNotFoundException e){
|
||||||
|
}
|
||||||
|
|
||||||
|
return (String) (lApplicationInfo != null ? lPackageManager
|
||||||
|
.getApplicationLabel(lApplicationInfo) : "Unknown");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static boolean inDebugger(){
|
||||||
|
|
||||||
|
// If in Debugger Environment
|
||||||
|
boolean debugging = Debug.isDebuggerConnected();
|
||||||
|
|
||||||
|
return debugging;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
private static String errorMsg(Throwable exception, String exceptError){
|
||||||
|
|
||||||
|
if (!exceptError.contains("error")){
|
||||||
|
|
||||||
|
mReportBuilder.append(reportError(exception));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!exceptError.contains("callstack")){
|
||||||
|
|
||||||
|
mReportBuilder.append(reportCallStack(exception));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!exceptError.contains("deviceinfo")){
|
||||||
|
|
||||||
|
mReportBuilder.append(reportDeviceInfo());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!exceptError.contains("firmware")){
|
||||||
|
|
||||||
|
mReportBuilder.append(reportFirmware());
|
||||||
|
}
|
||||||
|
|
||||||
|
return mReportBuilder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static String reportError(Throwable exception){
|
||||||
|
|
||||||
|
mCrashInfo = new ApplicationErrorReport.CrashInfo(exception);
|
||||||
|
|
||||||
|
if (mCrashInfo.exceptionMessage == null){
|
||||||
|
|
||||||
|
mErrorMessage = "<unknown error>";
|
||||||
|
}else{
|
||||||
|
|
||||||
|
mErrorMessage = mCrashInfo.exceptionMessage
|
||||||
|
.replace(": " + mCrashInfo.exceptionClassName, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
String throwFile = mCrashInfo.throwFileName == null ? "<unknown file>"
|
||||||
|
: mCrashInfo.throwFileName;
|
||||||
|
|
||||||
|
return "\n************ " + mCrashInfo.exceptionClassName + " ************\n"
|
||||||
|
+ mErrorMessage + LINE_SEPARATOR
|
||||||
|
+ "\n File: " + throwFile
|
||||||
|
+ "\n Method: " + mCrashInfo.throwMethodName + "()"
|
||||||
|
+ "\n Line No.: " + Integer.toString(mCrashInfo.throwLineNumber)
|
||||||
|
+ LINE_SEPARATOR;
|
||||||
|
// + "Class: " + crashInfo.throwClassName + LINE_SEPARATOR
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static String reportCallStack(Throwable exception){
|
||||||
|
|
||||||
|
StringWriter stackTrace = new StringWriter();
|
||||||
|
|
||||||
|
exception.printStackTrace(new PrintWriter(stackTrace));
|
||||||
|
|
||||||
|
String callStack = stackTrace.toString();
|
||||||
|
|
||||||
|
String errMsg = exception.toString();
|
||||||
|
|
||||||
|
return "\n************ CALLSTACK ************\n"
|
||||||
|
+ callStack.replace(errMsg, "")
|
||||||
|
+ LINE_SEPARATOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static String reportDeviceInfo(){
|
||||||
|
|
||||||
|
return "\n************ DEVICE INFORMATION ***********\n"
|
||||||
|
+ "Brand: "
|
||||||
|
+ Build.BRAND
|
||||||
|
+ LINE_SEPARATOR
|
||||||
|
+ "Device: "
|
||||||
|
+ Build.DEVICE
|
||||||
|
+ LINE_SEPARATOR
|
||||||
|
+ "Model: "
|
||||||
|
+ Build.MODEL
|
||||||
|
+ LINE_SEPARATOR
|
||||||
|
+ "Id: "
|
||||||
|
+ Build.ID
|
||||||
|
+ LINE_SEPARATOR
|
||||||
|
+ "Product: "
|
||||||
|
+ Build.PRODUCT
|
||||||
|
+ LINE_SEPARATOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static String reportFirmware(){
|
||||||
|
|
||||||
|
return "\n************ FIRMWARE ************\n"
|
||||||
|
+ "SDK: "
|
||||||
|
+ Build.VERSION.SDK_INT
|
||||||
|
+ LINE_SEPARATOR
|
||||||
|
+ "Release: "
|
||||||
|
+ Build.VERSION.RELEASE
|
||||||
|
+ LINE_SEPARATOR
|
||||||
|
+ "Incremental: "
|
||||||
|
+ Build.VERSION.INCREMENTAL
|
||||||
|
+ LINE_SEPARATOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Empty the report as it is begin re-populated.
|
||||||
|
private static void reportEmptied(){
|
||||||
|
|
||||||
|
// No need to empty
|
||||||
|
if (mReportBuilder.length() == 0){
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mReportBuilder.setLength(0);
|
||||||
|
|
||||||
|
mReportBuilder.trimToSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uncaughtException(Thread thread, Throwable exception){
|
||||||
|
|
||||||
|
// Don't re-enter -- avoid infinite loops if crash-reporting crashes.
|
||||||
|
if (mCrashing) return;
|
||||||
|
|
||||||
|
mCrashing = true;
|
||||||
|
|
||||||
|
catchException(thread, exception);
|
||||||
|
|
||||||
|
defaultExceptionHandler(thread, exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String catchException(Thread thread, Throwable exception){
|
||||||
|
|
||||||
|
String errorMsg = "";
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
errorMsg = logCrash(exception);
|
||||||
|
|
||||||
|
}catch (Exception ex){
|
||||||
|
|
||||||
|
Log.e(mPackageName, ex.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return errorMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void defaultExceptionHandler(Thread thread, Throwable exception){
|
||||||
|
|
||||||
|
try{
|
||||||
|
|
||||||
|
// Execute the old handler.
|
||||||
|
if (mOldHandler != null){
|
||||||
|
|
||||||
|
mOldHandler.uncaughtException(thread, exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch (Exception ex){
|
||||||
|
|
||||||
|
Log.e(mPackageName, ex.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String logCrash(Throwable exception){
|
||||||
|
|
||||||
|
return errorMsg(exception, "deviceinfo firmware");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void onDestroy(){
|
||||||
|
|
||||||
|
mExceptionsHandler = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prevents infinite loops.
|
||||||
|
private static volatile boolean mCrashing = false;
|
||||||
|
|
||||||
|
private static final StringBuilder mReportBuilder = new StringBuilder();
|
||||||
|
|
||||||
|
private static final String LINE_SEPARATOR = "\n";
|
||||||
|
|
||||||
|
private static final Thread.UncaughtExceptionHandler mOldHandler = Thread
|
||||||
|
.getDefaultUncaughtExceptionHandler();
|
||||||
|
|
||||||
|
private static ExceptionsHandler mExceptionsHandler;
|
||||||
|
|
||||||
|
private static String mPackageName;
|
||||||
|
|
||||||
|
private static ApplicationErrorReport.CrashInfo mCrashInfo;
|
||||||
|
|
||||||
|
private static String mErrorMessage = "";
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
public class CommonModelConsts {
|
||||||
|
|
||||||
|
public static class OPERATION {
|
||||||
|
public static String INSERT_OR_UPDATE = "INSERT_OR_UPDATE";
|
||||||
|
public static String INSERT = "INSERT";
|
||||||
|
public static String UPDATE = "UPDATE";
|
||||||
|
public static String SELECT = "SELECT";
|
||||||
|
public static String SELECT_OBJECT = "SELECT_OBJECT";
|
||||||
|
public static String SUBSTITUTE = "SUBSTITUTE";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
public abstract class EntityBase {
|
||||||
|
|
||||||
|
public String operation;
|
||||||
|
public String type;
|
||||||
|
public boolean onlyPkMaster = false;
|
||||||
|
|
||||||
|
public String getOperation() {
|
||||||
|
return operation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityBase setOperation(String operation) {
|
||||||
|
this.operation = operation;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isOnlyPkMaster() {
|
||||||
|
return onlyPkMaster;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityBase setOnlyPkMaster(boolean onlyPkMaster) {
|
||||||
|
this.onlyPkMaster = onlyPkMaster;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,13 +1,16 @@
|
|||||||
package it.integry.integrywmsnative.core.model;
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by GiuseppeS on 06/03/2018.
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class MtbColt {
|
public class MtbColt extends EntityBase{
|
||||||
private String gestione;
|
private String gestione;
|
||||||
private String dataCollo;
|
private String dataCollo;
|
||||||
private String serCollo;
|
private String serCollo;
|
||||||
@ -42,4 +45,322 @@ public class MtbColt {
|
|||||||
private BigDecimal larghezzaCm;
|
private BigDecimal larghezzaCm;
|
||||||
private BigDecimal altezzaCm;
|
private BigDecimal altezzaCm;
|
||||||
|
|
||||||
|
public MtbColt(){
|
||||||
|
type = "mtb_colt";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getGestione() {
|
||||||
|
return gestione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setGestione(String gestione) {
|
||||||
|
this.gestione = gestione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setGestione(GestioneEnum gestione) {
|
||||||
|
this.gestione = gestione.getText();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataCollo() {
|
||||||
|
return dataCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataCollo(String dataCollo) {
|
||||||
|
this.dataCollo = dataCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataCollo(Date dataCollo) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
this.dataCollo = sdf.format(dataCollo);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerCollo() {
|
||||||
|
return serCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setSerCollo(String serCollo) {
|
||||||
|
this.serCollo = serCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumCollo() {
|
||||||
|
return numCollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setNumCollo(Integer numCollo) {
|
||||||
|
this.numCollo = numCollo;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRifOrd() {
|
||||||
|
return rifOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setRifOrd(String rifOrd) {
|
||||||
|
this.rifOrd = rifOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodVdes() {
|
||||||
|
return codVdes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodVdes(String codVdes) {
|
||||||
|
this.codVdes = codVdes;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodVlis() {
|
||||||
|
return codVlis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodVlis(String codVlis) {
|
||||||
|
this.codVlis = codVlis;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDtip() {
|
||||||
|
return codDtip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodDtip(String codDtip) {
|
||||||
|
this.codDtip = codDtip;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodTcol() {
|
||||||
|
return codTcol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodTcol(String codTcol) {
|
||||||
|
this.codTcol = codTcol;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerDoc() {
|
||||||
|
return serDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setSerDoc(String serDoc) {
|
||||||
|
this.serDoc = serDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFiltroOrdini() {
|
||||||
|
return filtroOrdini;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setFiltroOrdini(String filtroOrdini) {
|
||||||
|
this.filtroOrdini = filtroOrdini;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPreparatoDa() {
|
||||||
|
return preparatoDa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setPreparatoDa(String preparatoDa) {
|
||||||
|
this.preparatoDa = preparatoDa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnnotazioni() {
|
||||||
|
return annotazioni;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setAnnotazioni(String annotazioni) {
|
||||||
|
this.annotazioni = annotazioni;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPosizione() {
|
||||||
|
return posizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setPosizione(String posizione) {
|
||||||
|
this.posizione = posizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodDtipProvv() {
|
||||||
|
return codDtipProvv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodDtipProvv(String codDtipProvv) {
|
||||||
|
this.codDtipProvv = codDtipProvv;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSerDocProvv() {
|
||||||
|
return serDocProvv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setSerDocProvv(String serDocProvv) {
|
||||||
|
this.serDocProvv = serDocProvv;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodJfas() {
|
||||||
|
return codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setCodJfas(String codJfas) {
|
||||||
|
this.codJfas = codJfas;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataOrd() {
|
||||||
|
return dataOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataOrd(String dataOrd) {
|
||||||
|
this.dataOrd = dataOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataDoc() {
|
||||||
|
return dataDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataDoc(String dataDoc) {
|
||||||
|
this.dataDoc = dataDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOraInizPrep() {
|
||||||
|
return oraInizPrep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setOraInizPrep(String oraInizPrep) {
|
||||||
|
this.oraInizPrep = oraInizPrep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setOraInizPrep(Date oraInizPrep) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||||
|
this.oraInizPrep = sdf.format(oraInizPrep);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOraFinePrep() {
|
||||||
|
return oraFinePrep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setOraFinePrep(String oraFinePrep) {
|
||||||
|
this.oraFinePrep = oraFinePrep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataDocProvv() {
|
||||||
|
return dataDocProvv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataDocProvv(String dataDocProvv) {
|
||||||
|
this.dataDocProvv = dataDocProvv;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataVers() {
|
||||||
|
return dataVers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setDataVers(String dataVers) {
|
||||||
|
this.dataVers = dataVers;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSegno() {
|
||||||
|
return segno;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setSegno(Integer segno) {
|
||||||
|
this.segno = segno;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumOrd() {
|
||||||
|
return numOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setNumOrd(Integer numOrd) {
|
||||||
|
this.numOrd = numOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumDoc() {
|
||||||
|
return numDoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setNumDoc(Integer numDoc) {
|
||||||
|
this.numDoc = numDoc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getNumDocProvv() {
|
||||||
|
return numDocProvv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setNumDocProvv(Integer numDocProvv) {
|
||||||
|
this.numDocProvv = numDocProvv;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPesoKg() {
|
||||||
|
return pesoKg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setPesoKg(BigDecimal pesoKg) {
|
||||||
|
this.pesoKg = pesoKg;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getLunghezzaCm() {
|
||||||
|
return lunghezzaCm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setLunghezzaCm(BigDecimal lunghezzaCm) {
|
||||||
|
this.lunghezzaCm = lunghezzaCm;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getLarghezzaCm() {
|
||||||
|
return larghezzaCm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setLarghezzaCm(BigDecimal larghezzaCm) {
|
||||||
|
this.larghezzaCm = larghezzaCm;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getAltezzaCm() {
|
||||||
|
return altezzaCm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbColt setAltezzaCm(BigDecimal altezzaCm) {
|
||||||
|
this.altezzaCm = altezzaCm;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,24 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model.secondary;
|
||||||
|
|
||||||
|
public enum GestioneEnum {
|
||||||
|
|
||||||
|
ACQUISTO("A"),
|
||||||
|
LAVORAZIONE("L"),
|
||||||
|
VENDITA("V");
|
||||||
|
|
||||||
|
private String text;
|
||||||
|
GestioneEnum(String text) {
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
public String getText() {
|
||||||
|
return this.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GestioneEnum fromString(String text) {
|
||||||
|
for (GestioneEnum b : GestioneEnum.values()) {
|
||||||
|
if (b.text.equalsIgnoreCase(text)) return b;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
package it.integry.integrywmsnative.core.settings;
|
||||||
|
|
||||||
|
public class SettingsModel {
|
||||||
|
|
||||||
|
public static String currentUserCodMdep = "01";
|
||||||
|
public static String currentUsername = "Magazzino";
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.util.TypedValue;
|
||||||
|
|
||||||
|
public class UtilityDimension {
|
||||||
|
|
||||||
|
public static int convertSizeToDP(Context mContext, int size){
|
||||||
|
Resources r = mContext.getResources();
|
||||||
|
return (int) TypedValue.applyDimension(
|
||||||
|
TypedValue.COMPLEX_UNIT_DIP,
|
||||||
|
size,
|
||||||
|
r.getDisplayMetrics()
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso;
|
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.support.design.widget.Snackbar;
|
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -17,16 +17,25 @@ import com.github.clans.fab.FloatingActionButton;
|
|||||||
import com.github.clans.fab.FloatingActionMenu;
|
import com.github.clans.fab.FloatingActionMenu;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
import it.integry.integrywmsnative.R;
|
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.ISimpleOperationCallback;
|
||||||
|
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsModel;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core.AccettazioneOrdineInevasoHelper;
|
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core.AccettazioneOrdineInevasoHelper;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core.MainListOrdineAccettazioneAdapter;
|
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.dto.AccettazioneOrdineInevasoOrderBy;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.views.NoteAggiuntiveNuovaULDialog;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||||
|
|
||||||
public class AccettazioneOrdineInevasoActivity extends AppCompatActivity {
|
public class AccettazioneOrdineInevasoActivity extends AppCompatActivity {
|
||||||
@ -50,6 +59,9 @@ public class AccettazioneOrdineInevasoActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private AccettazioneOrdineInevasoOrderBy.Enum currentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.COD_ART_FOR;
|
private AccettazioneOrdineInevasoOrderBy.Enum currentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.COD_ART_FOR;
|
||||||
|
|
||||||
|
|
||||||
|
private Context mContext = this;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -184,7 +196,40 @@ public class AccettazioneOrdineInevasoActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
fab.close(true);
|
fab.close(true);
|
||||||
|
|
||||||
// Snackbar.make(AccettazioneOrdineInevasoActivity.this, "Creato nuovo collo", 3000).show();
|
NoteAggiuntiveNuovaULDialog.show(this, new NoteAggiuntiveNuovaULDialog.Callback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String noteString) {
|
||||||
|
|
||||||
|
MtbColt mtbColt = new MtbColt();
|
||||||
|
mtbColt .setDataCollo(new Date())
|
||||||
|
.setGestione(GestioneEnum.ACQUISTO)
|
||||||
|
.setCodMdep(SettingsModel.currentUserCodMdep)
|
||||||
|
.setPreparatoDa(SettingsModel.currentUsername)
|
||||||
|
.setOraInizPrep(new Date())
|
||||||
|
.setAnnotazioni(noteString)
|
||||||
|
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, new ISimpleOperationCallback<MtbColt>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(MtbColt value) {
|
||||||
|
DialogSimpleMessageHelper.makeInfoDialog(mContext, "Salvataggio", "Salvataggio collo avvenuto con successo\nNumero collo: " + value.getNumCollo(), null).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailed(Exception ex) {
|
||||||
|
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||||
|
|
||||||
|
if(errorMessage == null) errorMessage = ex.getMessage();
|
||||||
|
DialogSimpleMessageHelper.makeErrorDialog(mContext, errorMessage, null).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,63 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.views;
|
||||||
|
|
||||||
|
import android.app.ActionBar;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.support.design.widget.TextInputEditText;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDimension;
|
||||||
|
|
||||||
|
public class NoteAggiuntiveNuovaULDialog {
|
||||||
|
|
||||||
|
public interface Callback {
|
||||||
|
void onSuccess(String noteString);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void show(Context mContext, final Callback callback){
|
||||||
|
|
||||||
|
RelativeLayout relativeLayout = new RelativeLayout(mContext);
|
||||||
|
|
||||||
|
relativeLayout.setLayoutParams(
|
||||||
|
new RelativeLayout.LayoutParams(
|
||||||
|
RelativeLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
RelativeLayout.LayoutParams.MATCH_PARENT));
|
||||||
|
|
||||||
|
relativeLayout.setPadding(UtilityDimension.convertSizeToDP(mContext, 22),
|
||||||
|
UtilityDimension.convertSizeToDP(mContext, 8),
|
||||||
|
UtilityDimension.convertSizeToDP(mContext, 24),
|
||||||
|
0);
|
||||||
|
|
||||||
|
final TextInputEditText mTextInputEditText = new TextInputEditText(mContext);
|
||||||
|
mTextInputEditText.setHint(R.string.hint_additional_notes);
|
||||||
|
|
||||||
|
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(
|
||||||
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
|
ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
|
|
||||||
|
mTextInputEditText.setLayoutParams(layoutParams);
|
||||||
|
|
||||||
|
relativeLayout.addView(mTextInputEditText);
|
||||||
|
|
||||||
|
AlertDialog dialog = new AlertDialog.Builder(mContext)
|
||||||
|
.setTitle(mContext.getText(R.string.action_create_ul))
|
||||||
|
.setMessage(R.string.dialog_message_additional_notes)
|
||||||
|
|
||||||
|
.setView(relativeLayout)
|
||||||
|
|
||||||
|
.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
callback.onSuccess(mTextInputEditText.getText().toString());
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(R.string.abort, null)
|
||||||
|
.create();
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -11,6 +11,12 @@
|
|||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/frame_container"
|
android:id="@+id/frame_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" >
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputEditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="hint" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
|||||||
@ -20,4 +20,7 @@
|
|||||||
<string name="action_orderBy">Ordina</string>
|
<string name="action_orderBy">Ordina</string>
|
||||||
<string name="action_create_ul">Crea nuova UL</string>
|
<string name="action_create_ul">Crea nuova UL</string>
|
||||||
<string name="action_show_created_ul">Mostra UL già create</string>
|
<string name="action_show_created_ul">Mostra UL già create</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>
|
||||||
</resources>
|
</resources>
|
||||||
@ -27,5 +27,8 @@
|
|||||||
<string name="action_orderBy">Order</string>
|
<string name="action_orderBy">Order</string>
|
||||||
<string name="action_create_ul">Create new LU</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 UL</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>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
11
build.gradle
11
build.gradle
@ -3,9 +3,14 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
|
maven {
|
||||||
|
url 'https://maven.google.com/'
|
||||||
|
name 'Google'
|
||||||
|
}
|
||||||
|
google()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.0.1'
|
classpath 'com.android.tools.build:gradle:3.1.0'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
@ -15,6 +20,10 @@ buildscript {
|
|||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
|
maven {
|
||||||
|
url 'https://maven.google.com/'
|
||||||
|
name 'Google'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
#Mon Feb 19 12:16:03 CET 2018
|
#Thu Mar 29 10:39:25 CEST 2018
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user