First commit
9
.gitignore
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
*.iml
|
||||||
|
.gradle
|
||||||
|
/local.properties
|
||||||
|
/.idea/workspace.xml
|
||||||
|
/.idea/libraries
|
||||||
|
.DS_Store
|
||||||
|
/build
|
||||||
|
/captures
|
||||||
|
.externalNativeBuild
|
||||||
22
.idea/compiler.xml
generated
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<resourceExtensions />
|
||||||
|
<wildcardResourcePatterns>
|
||||||
|
<entry name="!?*.java" />
|
||||||
|
<entry name="!?*.form" />
|
||||||
|
<entry name="!?*.class" />
|
||||||
|
<entry name="!?*.groovy" />
|
||||||
|
<entry name="!?*.scala" />
|
||||||
|
<entry name="!?*.flex" />
|
||||||
|
<entry name="!?*.kt" />
|
||||||
|
<entry name="!?*.clj" />
|
||||||
|
<entry name="!?*.aj" />
|
||||||
|
</wildcardResourcePatterns>
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile default="true" name="Default" enabled="false">
|
||||||
|
<processorPath useClasspath="true" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
3
.idea/copyright/profiles_settings.xml
generated
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<component name="CopyrightManager">
|
||||||
|
<settings default="" />
|
||||||
|
</component>
|
||||||
19
.idea/gradle.xml
generated
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GradleSettings">
|
||||||
|
<option name="linkedExternalProjectsSettings">
|
||||||
|
<GradleProjectSettings>
|
||||||
|
<option name="distributionType" value="LOCAL" />
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="gradleHome" value="C:\Program Files\Android\Android Studio\gradle\gradle-4.1" />
|
||||||
|
<option name="modules">
|
||||||
|
<set>
|
||||||
|
<option value="$PROJECT_DIR$" />
|
||||||
|
<option value="$PROJECT_DIR$/app" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
<option name="resolveModulePerSourceSet" value="false" />
|
||||||
|
</GradleProjectSettings>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
33
.idea/misc.xml
generated
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="NullableNotNullManager">
|
||||||
|
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
||||||
|
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||||
|
<option name="myNullables">
|
||||||
|
<value>
|
||||||
|
<list size="4">
|
||||||
|
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||||
|
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||||
|
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||||
|
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
<option name="myNotNulls">
|
||||||
|
<value>
|
||||||
|
<list size="4">
|
||||||
|
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
||||||
|
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
||||||
|
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
||||||
|
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
||||||
|
</list>
|
||||||
|
</value>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectType">
|
||||||
|
<option name="id" value="Android" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
9
.idea/modules.xml
generated
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<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" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
12
.idea/runConfigurations.xml
generated
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RunConfigurationProducerService">
|
||||||
|
<option name="ignoredProducers">
|
||||||
|
<set>
|
||||||
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||||
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||||
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||||
|
</set>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
1
app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/build
|
||||||
42
app/build.gradle
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 25
|
||||||
|
buildToolsVersion "27.0.0"
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "it.integry.integrywmsnative"
|
||||||
|
minSdkVersion 21
|
||||||
|
targetSdkVersion 25
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||||
|
exclude group: 'com.android.support', module: 'support-annotations'
|
||||||
|
})
|
||||||
|
compile 'com.android.support:appcompat-v7:25.3.1'
|
||||||
|
compile 'com.android.support:support-v4:25.3.1'
|
||||||
|
compile 'com.android.support:design:25.3.1'
|
||||||
|
compile 'com.android.support.constraint:constraint-layout:1.0.2'
|
||||||
|
compile 'com.android.support:cardview-v7:25.3.1'
|
||||||
|
compile 'com.android.support:recyclerview-v7:25.3.1'
|
||||||
|
|
||||||
|
compile 'com.squareup.retrofit2:retrofit:2.3.0'
|
||||||
|
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
|
||||||
|
|
||||||
|
compile 'com.jakewharton:butterknife:8.8.1'
|
||||||
|
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
|
||||||
|
|
||||||
|
|
||||||
|
testCompile 'junit:junit:4.12'
|
||||||
|
}
|
||||||
25
app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# By default, the flags in this file are appended to flags specified
|
||||||
|
# in C:\Users\GiuseppeS\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
|
||||||
|
# You can edit the include path and order by changing the proguardFiles
|
||||||
|
# directive in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# Add any project specific keep options here:
|
||||||
|
|
||||||
|
# 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.integrywmsnative;
|
||||||
|
|
||||||
|
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.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instrumentation 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() throws Exception {
|
||||||
|
// Context of the app under test.
|
||||||
|
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||||
|
|
||||||
|
assertEquals("it.integry.integrywmsnative", appContext.getPackageName());
|
||||||
|
}
|
||||||
|
}
|
||||||
30
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="it.integry.integrywmsnative">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:hardwareAccelerated="true"
|
||||||
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
|
android:supportsRtl="true"
|
||||||
|
android:theme="@style/AppTheme">
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivity"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".gest.accettazione_ordine_inevaso.AccettazioneOrdineInevasoActivity"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar"></activity>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
168
app/src/main/java/it/integry/integrywmsnative/MainActivity.java
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
package it.integry.integrywmsnative;
|
||||||
|
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.ColorMatrixColorFilter;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.ColorRes;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.support.v4.app.FragmentManager;
|
||||||
|
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.widget.DrawerLayout;
|
||||||
|
import android.support.v7.app.ActionBarDrawerToggle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.widget.SearchView;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.text.style.ForegroundColorSpan;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import butterknife.BindView;
|
||||||
|
import butterknife.ButterKnife;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ITitledFragment;
|
||||||
|
|
||||||
|
public class MainActivity extends AppCompatActivity
|
||||||
|
implements NavigationView.OnNavigationItemSelectedListener {
|
||||||
|
|
||||||
|
@BindView(R.id.main_search) SearchView mSearchView;
|
||||||
|
|
||||||
|
@BindView(R.id.nav_view) NavigationView mNavigationView;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_main);
|
||||||
|
|
||||||
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
|
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
||||||
|
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||||
|
drawer.setDrawerListener(toggle);
|
||||||
|
toggle.syncState();
|
||||||
|
|
||||||
|
mNavigationView = (NavigationView) findViewById(R.id.nav_view);
|
||||||
|
mNavigationView.setNavigationItemSelectedListener(this);
|
||||||
|
|
||||||
|
mSearchView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
|
if (drawer.isDrawerOpen(GravityCompat.START)) {
|
||||||
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
|
} else {
|
||||||
|
super.onBackPressed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
getMenuInflater().inflate(R.menu.main, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle action bar item clicks here. The action bar will
|
||||||
|
// automatically handle clicks on the Home/Up button, so long
|
||||||
|
// as you specify a parent activity in AndroidManifest.xml.
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
//noinspection SimplifiableIfStatement
|
||||||
|
// if (id == R.id.action_search) {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("StatementWithEmptyBody")
|
||||||
|
@Override
|
||||||
|
public boolean onNavigationItemSelected(MenuItem item) {
|
||||||
|
// Handle navigation view item clicks here.
|
||||||
|
// resetAllMenuItemsTextColor(mNavigationView);
|
||||||
|
|
||||||
|
// int[] menuColorArray = this.getResources().getIntArray(R.array.menuColors);
|
||||||
|
|
||||||
|
|
||||||
|
Fragment fragment = null;
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
if (id == R.id.nav_accettazione) {
|
||||||
|
// setTextColorForMenuItem(item, menuColorArray[0]);
|
||||||
|
|
||||||
|
fragment = MainAccettazioneFragment.newInstance();
|
||||||
|
this.adaptViewToFragment(fragment);
|
||||||
|
} else if (id == R.id.nav_gallery) {
|
||||||
|
|
||||||
|
} else if (id == R.id.nav_slideshow) {
|
||||||
|
|
||||||
|
} else if (id == R.id.nav_manage) {
|
||||||
|
|
||||||
|
} else if (id == R.id.nav_share) {
|
||||||
|
|
||||||
|
} else if (id == R.id.nav_send) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fragment != null) {
|
||||||
|
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||||
|
fragmentManager.beginTransaction()
|
||||||
|
.replace(R.id.frame_container, fragment).commit();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||||
|
drawer.closeDrawer(GravityCompat.START);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetAllMenuItemsTextColor(NavigationView navigationView) {
|
||||||
|
for (int i = 0; i < navigationView.getMenu().size(); i++)
|
||||||
|
setTextColorForMenuItem(navigationView.getMenu().getItem(i), R.color.colorPrimary);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setTextColorForMenuItem(MenuItem menuItem, int color) {
|
||||||
|
SpannableString spanString = new SpannableString(menuItem.getTitle().toString());
|
||||||
|
spanString.setSpan(new ForegroundColorSpan(color), 0, spanString.length(), 0);
|
||||||
|
menuItem.setTitle(spanString);
|
||||||
|
|
||||||
|
if(menuItem.getIcon() != null){
|
||||||
|
Drawable icon = menuItem.getIcon();
|
||||||
|
icon.mutate();
|
||||||
|
icon.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void adaptViewToFragment(Fragment fragment){
|
||||||
|
if(fragment instanceof SearchView.OnQueryTextListener) {
|
||||||
|
mSearchView.setOnQueryTextListener((SearchView.OnQueryTextListener) fragment);
|
||||||
|
mSearchView.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
mSearchView.setOnQueryTextListener(null);
|
||||||
|
mSearchView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(fragment instanceof ITitledFragment) {
|
||||||
|
getSupportActionBar().setTitle(((ITitledFragment) fragment).getTitle(this));
|
||||||
|
} else {
|
||||||
|
getSupportActionBar().setTitle(R.string.app_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST;
|
||||||
|
|
||||||
|
import java.net.SocketException;
|
||||||
|
import java.net.SocketTimeoutException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 22/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CommonRESTException {
|
||||||
|
|
||||||
|
public static String tryRecognizeThenGetMessage(Exception ex){
|
||||||
|
|
||||||
|
if(ex instanceof SocketException){
|
||||||
|
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 {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST;
|
||||||
|
|
||||||
|
import android.util.Base64;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import okhttp3.HttpUrl;
|
||||||
|
import okhttp3.Interceptor;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class HttpInterceptor implements Interceptor {
|
||||||
|
|
||||||
|
private final String USERNAME = "magazzino";
|
||||||
|
private final String PASSWORD = "m";
|
||||||
|
private final String PROFILE_DB = "IME_TE";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response intercept(Chain chain) throws IOException {
|
||||||
|
final Request request = chain.request();
|
||||||
|
final HttpUrl url = request.url().newBuilder()
|
||||||
|
.addQueryParameter("profileDb", PROFILE_DB)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
String string = "Basic " + Base64.encodeToString((USERNAME + ":" + PASSWORD).getBytes(), Base64.NO_WRAP);
|
||||||
|
|
||||||
|
final Request newRequest = chain.request().newBuilder()
|
||||||
|
.addHeader("Authorization", string)
|
||||||
|
.addHeader("Content-Type", "application/json")
|
||||||
|
.addHeader("Accept", "*/*")
|
||||||
|
.addHeader("username", USERNAME)
|
||||||
|
.addHeader("password", PASSWORD)
|
||||||
|
.url(url).build();
|
||||||
|
|
||||||
|
return chain.proceed(newRequest);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST;
|
||||||
|
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import retrofit2.Retrofit;
|
||||||
|
import retrofit2.converter.gson.GsonConverterFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class RESTBuilder {
|
||||||
|
|
||||||
|
public static <T> T getService(final Class<T> service) {
|
||||||
|
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(new HttpInterceptor()).build();
|
||||||
|
|
||||||
|
Retrofit retrofit = new Retrofit.Builder()
|
||||||
|
.baseUrl("http://192.168.2.13:8080/ems-api/")
|
||||||
|
// .baseUrl("http://www2.studioml.it/ems-api/")
|
||||||
|
.client(client)
|
||||||
|
.addConverterFactory(GsonConverterFactory.create())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
return retrofit.create(service);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public enum EsitoType {
|
||||||
|
|
||||||
|
OK(1),
|
||||||
|
KO(-1);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return value.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Integer value;
|
||||||
|
|
||||||
|
public Integer value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EsitoType fromString(String val) {
|
||||||
|
return EsitoType.valueOf(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EsitoType fromIntValue(Integer val) {
|
||||||
|
if(val==1)
|
||||||
|
return EsitoType.OK;
|
||||||
|
else if(val==-1)
|
||||||
|
return EsitoType.KO;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
EsitoType(Integer v) {
|
||||||
|
this.value = v;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
package it.integry.integrywmsnative.core.REST.model;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ServiceRESTResponse<T> {
|
||||||
|
|
||||||
|
private int esito;
|
||||||
|
private String execDate;
|
||||||
|
private String profileDB;
|
||||||
|
private String errorMessage;
|
||||||
|
|
||||||
|
private T dto;
|
||||||
|
private T entity;
|
||||||
|
|
||||||
|
public EsitoType getEsito() {
|
||||||
|
return EsitoType.fromIntValue(esito);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getExecDate() {
|
||||||
|
try {
|
||||||
|
return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse(execDate);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProfileDB() {
|
||||||
|
return profileDB;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorMessage() {
|
||||||
|
return errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T getDto() {
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T getEntity() {
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.custom.Contains;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.custom.Equals;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.custom.EqualsIgnoreCase;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.custom.GreaterThan;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.custom.IsNull;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.custom.LessThan;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.custom.Not;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.query.Query;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
public class Coollection {
|
||||||
|
|
||||||
|
public static <T> Query<T> from(Collection<T> collection) {
|
||||||
|
return new Query<T>(collection);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Matcher eq(Object value) {
|
||||||
|
return new Equals(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Matcher contains(String value) {
|
||||||
|
return new Contains(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Matcher eqIgnoreCase(String value) {
|
||||||
|
return new EqualsIgnoreCase(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Matcher not(Matcher matcher) {
|
||||||
|
return new Not(matcher);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Matcher greaterThan(Number value) {
|
||||||
|
return new GreaterThan(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Matcher lessThan(Number value) {
|
||||||
|
return new LessThan(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Matcher isNull() {
|
||||||
|
return new IsNull();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.matcher;
|
||||||
|
|
||||||
|
public interface Matcher {
|
||||||
|
|
||||||
|
boolean match(Object value);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||||
|
|
||||||
|
public class Contains implements Matcher {
|
||||||
|
|
||||||
|
private final String matcherValue;
|
||||||
|
|
||||||
|
public Contains(String matcherValue) {
|
||||||
|
this.matcherValue = matcherValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean match(Object value) {
|
||||||
|
return String.valueOf(value).contains(matcherValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||||
|
|
||||||
|
public class Equals implements Matcher {
|
||||||
|
|
||||||
|
private final Object value;
|
||||||
|
|
||||||
|
public Equals(Object value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean match(Object anotherValue) {
|
||||||
|
return value.equals(anotherValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||||
|
|
||||||
|
public class EqualsIgnoreCase implements Matcher {
|
||||||
|
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
public EqualsIgnoreCase(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean match(Object anotherValue) {
|
||||||
|
return (value).equalsIgnoreCase((String) anotherValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||||
|
|
||||||
|
public class GreaterThan implements Matcher {
|
||||||
|
|
||||||
|
private final Number value;
|
||||||
|
|
||||||
|
public GreaterThan(Number value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean match(Object matchValue) {
|
||||||
|
if (matchValue == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return ((Number) matchValue).doubleValue() > value.doubleValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||||
|
|
||||||
|
public class IsNull implements Matcher {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean match(Object value) {
|
||||||
|
return value == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||||
|
|
||||||
|
public class LessThan implements Matcher {
|
||||||
|
|
||||||
|
private final Number value;
|
||||||
|
|
||||||
|
public LessThan(Number value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean match(Object matchValue) {
|
||||||
|
if (matchValue == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return ((Number) matchValue).doubleValue() < value.doubleValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.matcher.custom;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||||
|
|
||||||
|
public class Not implements Matcher {
|
||||||
|
|
||||||
|
private final Matcher matcher;
|
||||||
|
|
||||||
|
public Not(Matcher matcher) {
|
||||||
|
this.matcher = matcher;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean match(Object value) {
|
||||||
|
return !matcher.match(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,90 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.query;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.query.criteria.Criteria;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.query.criteria.CriteriaList;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.query.order.Order;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.query.order.OrderCriteria;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.query.specification.custom.AndSpecification;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.query.specification.custom.OrSpecification;
|
||||||
|
|
||||||
|
public class Query<T> {
|
||||||
|
|
||||||
|
private final Collection<T> collection;
|
||||||
|
private CriteriaList<T> criterias;
|
||||||
|
private OrderCriteria<T> orderCriteria;
|
||||||
|
|
||||||
|
public Query(Collection<T> collection) {
|
||||||
|
this.collection = collection;
|
||||||
|
criterias = new CriteriaList<T>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Query<T> where(String method, Matcher matcher) {
|
||||||
|
Criteria<T> criteria = new Criteria<T>(method, matcher);
|
||||||
|
criterias.add(criteria);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Query<T> and(String method, Matcher matcher) {
|
||||||
|
Criteria<T> criteria = new Criteria<T>(method, matcher);
|
||||||
|
criteria.setSpecification(new AndSpecification<T>());
|
||||||
|
criterias.add(criteria);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Query<T> or(String method, Matcher matcher) {
|
||||||
|
Criteria<T> criteria = new Criteria<T>(method, matcher);
|
||||||
|
criteria.setSpecification(new OrSpecification<T>());
|
||||||
|
criterias.add(criteria);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Query<T> orderBy(String method, Order order) {
|
||||||
|
orderCriteria = new OrderCriteria<T>(method, order);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Query<T> orderBy(String method) {
|
||||||
|
return orderBy(method, Order.ASC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<T> all() {
|
||||||
|
List<T> all = new ArrayList<T>();
|
||||||
|
for (T item : collection) {
|
||||||
|
if (criterias.match(item)) {
|
||||||
|
all.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (orderCriteria != null) {
|
||||||
|
all = orderCriteria.sort(all);
|
||||||
|
}
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T first() {
|
||||||
|
List<T> all = cloneCollection(collection);
|
||||||
|
if (orderCriteria != null) {
|
||||||
|
all = orderCriteria.sort(all);
|
||||||
|
}
|
||||||
|
for (T item : all) {
|
||||||
|
if (criterias.match(item)) {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<T> cloneCollection(Collection<T> collection) {
|
||||||
|
List<T> list = new ArrayList<T>();
|
||||||
|
for (T item : collection) {
|
||||||
|
list.add(item);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.query.criteria;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.matcher.Matcher;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.query.specification.Specification;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.reflection.Phanton;
|
||||||
|
|
||||||
|
public class Criteria<T> {
|
||||||
|
|
||||||
|
private final String method;
|
||||||
|
private final Matcher matcher;
|
||||||
|
private Specification<T> specification;
|
||||||
|
|
||||||
|
public Criteria(String method, Matcher matcher) {
|
||||||
|
this.method = method;
|
||||||
|
this.matcher = matcher;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpecification(Specification<T> specification) {
|
||||||
|
this.specification = specification;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Specification<T> specification() {
|
||||||
|
return specification;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean match(T item) {
|
||||||
|
try {
|
||||||
|
Object value = Phanton.from(item).call(method);
|
||||||
|
return matcher.match(value);
|
||||||
|
} catch (Exception err) {
|
||||||
|
throw new RuntimeException(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.query.criteria;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class CriteriaList<T> {
|
||||||
|
|
||||||
|
private List<Criteria<T>> criterias;
|
||||||
|
|
||||||
|
public CriteriaList() {
|
||||||
|
criterias = new ArrayList<Criteria<T>>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void add(Criteria<T> criteria) {
|
||||||
|
criterias.add(criteria);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean match(T item) {
|
||||||
|
if (criterias.size() == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (criterias.size() == 1) {
|
||||||
|
return criterias.get(0).match(item);
|
||||||
|
}
|
||||||
|
boolean matched = true;
|
||||||
|
for (int i = criterias.size() - 1; i > 0; i--) {
|
||||||
|
Criteria<T> one = criterias.get(i);
|
||||||
|
Criteria<T> other = criterias.get(i - 1);
|
||||||
|
matched = matched && one.specification().match(item, one, other);
|
||||||
|
}
|
||||||
|
return matched;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.query.order;
|
||||||
|
|
||||||
|
public enum Order {
|
||||||
|
ASC, DESC
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.query.order;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.reflection.Phanton;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
|
|
||||||
|
public class OrderComparator<T> implements Comparator<T> {
|
||||||
|
|
||||||
|
private final String method;
|
||||||
|
|
||||||
|
public OrderComparator(String method) {
|
||||||
|
this.method = method;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public int compare(T one, T other) {
|
||||||
|
Object oneValue = Phanton.from(one).call(method);
|
||||||
|
Object otherValue = Phanton.from(other).call(method);
|
||||||
|
if (oneValue == null || otherValue == null) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (oneValue instanceof Comparable) {
|
||||||
|
return ((Comparable<Object>) oneValue).compareTo(otherValue);
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.query.order;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class OrderCriteria<T> {
|
||||||
|
|
||||||
|
private final String method;
|
||||||
|
private final Order order;
|
||||||
|
|
||||||
|
public OrderCriteria(String method, Order order) {
|
||||||
|
this.method = method;
|
||||||
|
this.order = order;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<T> sort(List<T> list) {
|
||||||
|
Collections.sort(list, new OrderComparator<T>(method));
|
||||||
|
if (order == Order.DESC) {
|
||||||
|
Collections.reverse(list);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.query.specification;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.query.criteria.Criteria;
|
||||||
|
|
||||||
|
public interface Specification<T> {
|
||||||
|
|
||||||
|
boolean match(T item, Criteria<T> one, Criteria<T> other);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.query.specification.custom;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.query.criteria.Criteria;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.query.specification.Specification;
|
||||||
|
|
||||||
|
public class AndSpecification<T> implements Specification<T> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean match(T item, Criteria<T> one, Criteria<T> other) {
|
||||||
|
return one.match(item) && other.match(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.query.specification.custom;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.coollection.query.criteria.Criteria;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.query.specification.Specification;
|
||||||
|
|
||||||
|
public class OrSpecification<T> implements Specification<T> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean match(T item, Criteria<T> one, Criteria<T> other) {
|
||||||
|
return one.match(item) || other.match(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
package it.integry.integrywmsnative.core.coollection.reflection;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
public class Phanton<T> {
|
||||||
|
|
||||||
|
private final T target;
|
||||||
|
private Class<?> clazz;
|
||||||
|
|
||||||
|
private Phanton(T target) {
|
||||||
|
this.target = target;
|
||||||
|
clazz = target.getClass();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Phanton<T> from(T target) {
|
||||||
|
return new Phanton<T>(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object call(String name) {
|
||||||
|
return invoke(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Object invoke(String name) {
|
||||||
|
for (final Field field : clazz.getDeclaredFields()) {
|
||||||
|
try {
|
||||||
|
if (name.equals(field.getName())) {
|
||||||
|
field.setAccessible(Boolean.TRUE);
|
||||||
|
return field.get(target);
|
||||||
|
}
|
||||||
|
} catch (final IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new RuntimeException("No such property with name " + name);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class AppComponent {
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package it.integry.integrywmsnative.core.interfaces;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 07/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface ICheckBoxCallback {
|
||||||
|
|
||||||
|
void onToggle(boolean newValue);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,282 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class MtbAart implements Parcelable{
|
||||||
|
|
||||||
|
public String codMart;
|
||||||
|
public String descrizione;
|
||||||
|
public String untMis;
|
||||||
|
public String barCode;
|
||||||
|
public BigDecimal pesoKg;
|
||||||
|
public BigDecimal qtaCnf;
|
||||||
|
public String codAliq;
|
||||||
|
public String codScoArt;
|
||||||
|
public String codTcolUi;
|
||||||
|
public String codTcolUl;
|
||||||
|
public String articoloComposto;
|
||||||
|
public String esposizioneComp;
|
||||||
|
public String descrizioneEstesa;
|
||||||
|
public String codUltForn;
|
||||||
|
public String dataUltCar;
|
||||||
|
public BigDecimal valUltCar;
|
||||||
|
public String codUltClie;
|
||||||
|
public String dataUltScar;
|
||||||
|
public BigDecimal valUltScar;
|
||||||
|
public String tipoCodice;
|
||||||
|
public String note;
|
||||||
|
public String posizione;
|
||||||
|
public BigDecimal colliPedana;
|
||||||
|
public String untMis2;
|
||||||
|
public BigDecimal rapConv2;
|
||||||
|
public String flagInclListino;
|
||||||
|
public String untMis3;
|
||||||
|
public BigDecimal rapConv3;
|
||||||
|
public String codMartStat;
|
||||||
|
public String codMcon;
|
||||||
|
public String codMgrp;
|
||||||
|
public String codMsfa;
|
||||||
|
public String codMsgr;
|
||||||
|
public String codMstp;
|
||||||
|
public String codMtip;
|
||||||
|
public String descrizioneStat;
|
||||||
|
public String flagStato;
|
||||||
|
public BigDecimal cambioDiviCar;
|
||||||
|
public BigDecimal cambioDiviScar;
|
||||||
|
public Integer ggScadPartita;
|
||||||
|
public BigDecimal volumeMc;
|
||||||
|
public String flagEsponiPrz;
|
||||||
|
public String dataUltVar;
|
||||||
|
public BigDecimal percSfrido;
|
||||||
|
public String codBarreImb;
|
||||||
|
public String flagCalcPrz;
|
||||||
|
public String esposizioneCompAcq;
|
||||||
|
public String flagCalcPrzAcq;
|
||||||
|
public String diacod;
|
||||||
|
public String plu;
|
||||||
|
public String partIvaProd;
|
||||||
|
public String ragSocProd;
|
||||||
|
public String flagRapConvVariabile;
|
||||||
|
public String flagMovArtMag;
|
||||||
|
public String flagTracciabilita;
|
||||||
|
public BigDecimal taraKg;
|
||||||
|
public BigDecimal colliStrato;
|
||||||
|
public String flagQtaCnfFissa;
|
||||||
|
public String flagColliPedanaFisso;
|
||||||
|
public String codCconCosti;
|
||||||
|
public String codCconRicavi;
|
||||||
|
public String codDgrpArt;
|
||||||
|
public String codDiviCar;
|
||||||
|
public String codDiviScar;
|
||||||
|
public String codEcrCat;
|
||||||
|
public String codEcrMcat;
|
||||||
|
public String codEcrRep;
|
||||||
|
public String codEcrStipo;
|
||||||
|
public String codEcrTipo;
|
||||||
|
public String codGrpBolla;
|
||||||
|
public String ingredienti;
|
||||||
|
public String idArtEqui;
|
||||||
|
public String descrCassa;
|
||||||
|
public String codNcIntracee;
|
||||||
|
public String marchio;
|
||||||
|
public Integer sezione;
|
||||||
|
|
||||||
|
|
||||||
|
public MtbAart(){}
|
||||||
|
|
||||||
|
protected MtbAart(Parcel in) {
|
||||||
|
codMart = in.readString();
|
||||||
|
descrizione = in.readString();
|
||||||
|
untMis = in.readString();
|
||||||
|
barCode = in.readString();
|
||||||
|
pesoKg = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||||
|
qtaCnf = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||||
|
codAliq = in.readString();
|
||||||
|
codScoArt = in.readString();
|
||||||
|
codTcolUi = in.readString();
|
||||||
|
codTcolUl = in.readString();
|
||||||
|
articoloComposto = in.readString();
|
||||||
|
esposizioneComp = in.readString();
|
||||||
|
descrizioneEstesa = in.readString();
|
||||||
|
codUltForn = in.readString();
|
||||||
|
dataUltCar = in.readString();
|
||||||
|
valUltCar = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||||
|
codUltClie = in.readString();
|
||||||
|
dataUltScar = in.readString();
|
||||||
|
valUltScar = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||||
|
tipoCodice = in.readString();
|
||||||
|
note = in.readString();
|
||||||
|
posizione = in.readString();
|
||||||
|
colliPedana = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||||
|
untMis2 = in.readString();
|
||||||
|
rapConv2 = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||||
|
flagInclListino = in.readString();
|
||||||
|
untMis3 = in.readString();
|
||||||
|
rapConv3 = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||||
|
codMartStat = in.readString();
|
||||||
|
codMcon = in.readString();
|
||||||
|
codMgrp = in.readString();
|
||||||
|
codMsfa = in.readString();
|
||||||
|
codMsgr = in.readString();
|
||||||
|
codMstp = in.readString();
|
||||||
|
codMtip = in.readString();
|
||||||
|
descrizioneStat = in.readString();
|
||||||
|
flagStato = in.readString();
|
||||||
|
cambioDiviCar = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||||
|
cambioDiviScar = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||||
|
ggScadPartita = in.readByte() == 0x00 ? null : in.readInt();
|
||||||
|
volumeMc = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||||
|
flagEsponiPrz = in.readString();
|
||||||
|
dataUltVar = in.readString();
|
||||||
|
percSfrido = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||||
|
codBarreImb = in.readString();
|
||||||
|
flagCalcPrz = in.readString();
|
||||||
|
esposizioneCompAcq = in.readString();
|
||||||
|
flagCalcPrzAcq = in.readString();
|
||||||
|
diacod = in.readString();
|
||||||
|
plu = in.readString();
|
||||||
|
partIvaProd = in.readString();
|
||||||
|
ragSocProd = in.readString();
|
||||||
|
flagRapConvVariabile = in.readString();
|
||||||
|
flagMovArtMag = in.readString();
|
||||||
|
flagTracciabilita = in.readString();
|
||||||
|
taraKg = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||||
|
colliStrato = (BigDecimal) in.readValue(BigDecimal.class.getClassLoader());
|
||||||
|
flagQtaCnfFissa = in.readString();
|
||||||
|
flagColliPedanaFisso = in.readString();
|
||||||
|
codCconCosti = in.readString();
|
||||||
|
codCconRicavi = in.readString();
|
||||||
|
codDgrpArt = in.readString();
|
||||||
|
codDiviCar = in.readString();
|
||||||
|
codDiviScar = in.readString();
|
||||||
|
codEcrCat = in.readString();
|
||||||
|
codEcrMcat = in.readString();
|
||||||
|
codEcrRep = in.readString();
|
||||||
|
codEcrStipo = in.readString();
|
||||||
|
codEcrTipo = in.readString();
|
||||||
|
codGrpBolla = in.readString();
|
||||||
|
ingredienti = in.readString();
|
||||||
|
idArtEqui = in.readString();
|
||||||
|
descrCassa = in.readString();
|
||||||
|
codNcIntracee = in.readString();
|
||||||
|
marchio = in.readString();
|
||||||
|
sezione = in.readByte() == 0x00 ? null : in.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(codMart);
|
||||||
|
dest.writeString(descrizione);
|
||||||
|
dest.writeString(untMis);
|
||||||
|
dest.writeString(barCode);
|
||||||
|
dest.writeValue(pesoKg);
|
||||||
|
dest.writeValue(qtaCnf);
|
||||||
|
dest.writeString(codAliq);
|
||||||
|
dest.writeString(codScoArt);
|
||||||
|
dest.writeString(codTcolUi);
|
||||||
|
dest.writeString(codTcolUl);
|
||||||
|
dest.writeString(articoloComposto);
|
||||||
|
dest.writeString(esposizioneComp);
|
||||||
|
dest.writeString(descrizioneEstesa);
|
||||||
|
dest.writeString(codUltForn);
|
||||||
|
dest.writeString(dataUltCar);
|
||||||
|
dest.writeValue(valUltCar);
|
||||||
|
dest.writeString(codUltClie);
|
||||||
|
dest.writeString(dataUltScar);
|
||||||
|
dest.writeValue(valUltScar);
|
||||||
|
dest.writeString(tipoCodice);
|
||||||
|
dest.writeString(note);
|
||||||
|
dest.writeString(posizione);
|
||||||
|
dest.writeValue(colliPedana);
|
||||||
|
dest.writeString(untMis2);
|
||||||
|
dest.writeValue(rapConv2);
|
||||||
|
dest.writeString(flagInclListino);
|
||||||
|
dest.writeString(untMis3);
|
||||||
|
dest.writeValue(rapConv3);
|
||||||
|
dest.writeString(codMartStat);
|
||||||
|
dest.writeString(codMcon);
|
||||||
|
dest.writeString(codMgrp);
|
||||||
|
dest.writeString(codMsfa);
|
||||||
|
dest.writeString(codMsgr);
|
||||||
|
dest.writeString(codMstp);
|
||||||
|
dest.writeString(codMtip);
|
||||||
|
dest.writeString(descrizioneStat);
|
||||||
|
dest.writeString(flagStato);
|
||||||
|
dest.writeValue(cambioDiviCar);
|
||||||
|
dest.writeValue(cambioDiviScar);
|
||||||
|
if (ggScadPartita == null) {
|
||||||
|
dest.writeByte((byte) (0x00));
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) (0x01));
|
||||||
|
dest.writeInt(ggScadPartita);
|
||||||
|
}
|
||||||
|
dest.writeValue(volumeMc);
|
||||||
|
dest.writeString(flagEsponiPrz);
|
||||||
|
dest.writeString(dataUltVar);
|
||||||
|
dest.writeValue(percSfrido);
|
||||||
|
dest.writeString(codBarreImb);
|
||||||
|
dest.writeString(flagCalcPrz);
|
||||||
|
dest.writeString(esposizioneCompAcq);
|
||||||
|
dest.writeString(flagCalcPrzAcq);
|
||||||
|
dest.writeString(diacod);
|
||||||
|
dest.writeString(plu);
|
||||||
|
dest.writeString(partIvaProd);
|
||||||
|
dest.writeString(ragSocProd);
|
||||||
|
dest.writeString(flagRapConvVariabile);
|
||||||
|
dest.writeString(flagMovArtMag);
|
||||||
|
dest.writeString(flagTracciabilita);
|
||||||
|
dest.writeValue(taraKg);
|
||||||
|
dest.writeValue(colliStrato);
|
||||||
|
dest.writeString(flagQtaCnfFissa);
|
||||||
|
dest.writeString(flagColliPedanaFisso);
|
||||||
|
dest.writeString(codCconCosti);
|
||||||
|
dest.writeString(codCconRicavi);
|
||||||
|
dest.writeString(codDgrpArt);
|
||||||
|
dest.writeString(codDiviCar);
|
||||||
|
dest.writeString(codDiviScar);
|
||||||
|
dest.writeString(codEcrCat);
|
||||||
|
dest.writeString(codEcrMcat);
|
||||||
|
dest.writeString(codEcrRep);
|
||||||
|
dest.writeString(codEcrStipo);
|
||||||
|
dest.writeString(codEcrTipo);
|
||||||
|
dest.writeString(codGrpBolla);
|
||||||
|
dest.writeString(ingredienti);
|
||||||
|
dest.writeString(idArtEqui);
|
||||||
|
dest.writeString(descrCassa);
|
||||||
|
dest.writeString(codNcIntracee);
|
||||||
|
dest.writeString(marchio);
|
||||||
|
if (sezione == null) {
|
||||||
|
dest.writeByte((byte) (0x00));
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) (0x01));
|
||||||
|
dest.writeInt(sezione);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public static final Parcelable.Creator<MtbAart> CREATOR = new Parcelable.Creator<MtbAart>() {
|
||||||
|
@Override
|
||||||
|
public MtbAart createFromParcel(Parcel in) {
|
||||||
|
return new MtbAart(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MtbAart[] newArray(int size) {
|
||||||
|
return new MtbAart[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class MtbColt {
|
||||||
|
private String gestione;
|
||||||
|
private String dataCollo;
|
||||||
|
private String serCollo;
|
||||||
|
private Integer numCollo;
|
||||||
|
private String rifOrd;
|
||||||
|
private String codAnag;
|
||||||
|
private String codVdes;
|
||||||
|
private String codMdep;
|
||||||
|
private String codVlis;
|
||||||
|
private String codDtip;
|
||||||
|
private String codTcol;
|
||||||
|
private String serDoc;
|
||||||
|
private String filtroOrdini;
|
||||||
|
private String preparatoDa;
|
||||||
|
private String annotazioni;
|
||||||
|
private String posizione;
|
||||||
|
private String codDtipProvv;
|
||||||
|
private String serDocProvv;
|
||||||
|
private String codJfas;
|
||||||
|
private String dataOrd;
|
||||||
|
private String dataDoc;
|
||||||
|
private String oraInizPrep;
|
||||||
|
private String oraFinePrep;
|
||||||
|
private String dataDocProvv;
|
||||||
|
private String dataVers;
|
||||||
|
private Integer segno;
|
||||||
|
private Integer numOrd;
|
||||||
|
private Integer numDoc;
|
||||||
|
private Integer numDocProvv;
|
||||||
|
private BigDecimal pesoKg;
|
||||||
|
private BigDecimal lunghezzaCm;
|
||||||
|
private BigDecimal larghezzaCm;
|
||||||
|
private BigDecimal altezzaCm;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 07/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class UtilityDate {
|
||||||
|
|
||||||
|
public static class COMMONS_DATE_FORMATS {
|
||||||
|
public static final String DMY_SLASH = "dd/MM/yyyy";
|
||||||
|
public static final String YMD_SLASH = "yyyy/MM/dd";
|
||||||
|
public static final String DMY_TIME_SLASH = DMY_SLASH + " hh:mm";
|
||||||
|
public static final String YMD_TIME_SLASH = YMD_SLASH + " hh:mm";
|
||||||
|
|
||||||
|
|
||||||
|
public static final String DMY_HUMAN = "dd MMM yyyy";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Date recognizeDate(String dateString) throws Exception{
|
||||||
|
|
||||||
|
if (dateString == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//SE SONO PIU' DI 10 caratteri allora c'è anche l'ora
|
||||||
|
|
||||||
|
SimpleDateFormat format = null;
|
||||||
|
char dateSeparator;
|
||||||
|
|
||||||
|
String onlyDateSubstring = dateString.substring(0, 10);
|
||||||
|
if(onlyDateSubstring.contains("/")) dateSeparator = '/';
|
||||||
|
else if(onlyDateSubstring.contains("-")) dateSeparator = '-';
|
||||||
|
else if(onlyDateSubstring.contains(".")) dateSeparator = '.';
|
||||||
|
else throw new Exception("Data non riconosciuta (" + dateString + ")");
|
||||||
|
|
||||||
|
String dateFormatString = (dateString.charAt(2) == dateSeparator)
|
||||||
|
? "dd" + dateSeparator + "MM" + dateSeparator + "yyyy"
|
||||||
|
: "yyyy" + dateSeparator + "MM" + dateSeparator + "dd";
|
||||||
|
|
||||||
|
|
||||||
|
if(dateString.length() > 10){
|
||||||
|
|
||||||
|
char timeSeparator;
|
||||||
|
|
||||||
|
String onlyTimeSubstring = dateString.substring(10, 14);
|
||||||
|
if(onlyTimeSubstring.contains("-")) timeSeparator = '-';
|
||||||
|
else if(onlyTimeSubstring.contains(":")) timeSeparator = ':';
|
||||||
|
else throw new Exception("Time non riconosciuto (" + dateString + ")");
|
||||||
|
|
||||||
|
String timeFormatString = "HH" + timeSeparator + "mm" + timeSeparator + "ss";
|
||||||
|
|
||||||
|
format = new SimpleDateFormat(dateFormatString + " " + timeFormatString);
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
format = new SimpleDateFormat(dateFormatString);
|
||||||
|
}
|
||||||
|
|
||||||
|
return format.parse(dateString);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String formatDate(Date dateToFormat, String format) {
|
||||||
|
return new SimpleDateFormat(format).format(dateToFormat);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.support.design.widget.FloatingActionButton;
|
||||||
|
import android.view.animation.AccelerateInterpolator;
|
||||||
|
import android.view.animation.AnimationUtils;
|
||||||
|
import android.view.animation.DecelerateInterpolator;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 07/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class UtilityFAB {
|
||||||
|
|
||||||
|
public static void show(Context context, FloatingActionButton fab){
|
||||||
|
fab.startAnimation(AnimationUtils.loadAnimation(context, R.anim.scale_up));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void hide(Context context, FloatingActionButton fab){
|
||||||
|
fab.startAnimation(AnimationUtils.loadAnimation(context, R.anim.scale_down));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 07/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class UtilityString {
|
||||||
|
|
||||||
|
public static boolean isNullOrEmpty(String stringToCheck){
|
||||||
|
return stringToCheck == null || stringToCheck.equalsIgnoreCase("");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,291 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione;
|
||||||
|
|
||||||
|
|
||||||
|
import android.app.ProgressDialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.design.widget.FloatingActionButton;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.support.v7.widget.SearchView;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import java.net.SocketException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import butterknife.BindView;
|
||||||
|
import butterknife.ButterKnife;
|
||||||
|
import butterknife.OnClick;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.REST.CommonRESTException;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.Coollection;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ICheckBoxCallback;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.core.AccettazioneHelper;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.core.MainListAccettazioneAdapter;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ILoadOrdiniCallback;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ILoadPickingListCallback;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ITitledFragment;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneGroupedInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.AccettazioneOrdineInevasoActivity;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||||
|
|
||||||
|
public class MainAccettazioneFragment extends Fragment implements ICheckBoxCallback, SearchView.OnQueryTextListener, ITitledFragment {
|
||||||
|
|
||||||
|
|
||||||
|
@BindView(R.id.accettazione_main_fab) FloatingActionButton mFab;
|
||||||
|
|
||||||
|
@BindView(R.id.accettazione_main_list) RecyclerView mRecyclerView;
|
||||||
|
|
||||||
|
private MainListAccettazioneAdapter mAdapter;
|
||||||
|
private RecyclerView.LayoutManager mLayoutManager;
|
||||||
|
|
||||||
|
|
||||||
|
private AccettazioneHelper helper;
|
||||||
|
private List<OrdineAccettazioneGroupedInevasoDTO> groupedOrdiniInevasi;
|
||||||
|
|
||||||
|
|
||||||
|
public MainAccettazioneFragment() {
|
||||||
|
// Required empty public constructor
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MainAccettazioneFragment newInstance() {
|
||||||
|
MainAccettazioneFragment fragment = new MainAccettazioneFragment();
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTitle(Context context){
|
||||||
|
return context.getText(R.string.accettazione_title_fragment).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if (getArguments() != null) {
|
||||||
|
// mParam1 = getArguments().getString(ARG_PARAM1);
|
||||||
|
// mParam2 = getArguments().getString(ARG_PARAM2);
|
||||||
|
}
|
||||||
|
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
View layout = inflater.inflate(R.layout.fragment_main_accettazione, container, false);
|
||||||
|
|
||||||
|
ButterKnife.bind(this, layout);
|
||||||
|
|
||||||
|
mRecyclerView.setHasFixedSize(true);
|
||||||
|
|
||||||
|
mLayoutManager = new LinearLayoutManager(getActivity());
|
||||||
|
mRecyclerView.setLayoutManager(mLayoutManager);
|
||||||
|
|
||||||
|
mFab.hide();
|
||||||
|
|
||||||
|
return layout;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void init(){
|
||||||
|
final ProgressDialog progress = ProgressDialog.show(getActivity(), getText(R.string.waiting),
|
||||||
|
getText(R.string.loading) + " ...", true);
|
||||||
|
|
||||||
|
helper = new AccettazioneHelper(getActivity());
|
||||||
|
|
||||||
|
helper.loadOrdini(new ILoadOrdiniCallback() {
|
||||||
|
@Override
|
||||||
|
public void onLoadSuccess(List<OrdineAccettazioneInevasoDTO> ordini) {
|
||||||
|
Toast.makeText(getActivity(), "Caricati " + ordini.size() + " ordini", Toast.LENGTH_LONG).show();
|
||||||
|
groupOrdini(ordini);
|
||||||
|
progress.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadFail(Exception ex) {
|
||||||
|
progress.dismiss();
|
||||||
|
|
||||||
|
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||||
|
if(errorMessage == null) errorMessage = ex.getMessage();
|
||||||
|
DialogSimpleMessageHelper.makeErrorDialog(getActivity(), errorMessage, null).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void groupOrdini(List<OrdineAccettazioneInevasoDTO> ordini){
|
||||||
|
|
||||||
|
String prevCodAnag = "";
|
||||||
|
|
||||||
|
for(OrdineAccettazioneInevasoDTO ordine : ordini){
|
||||||
|
if(UtilityString.isNullOrEmpty(ordine.codJcom) || ordine.codJcom.equalsIgnoreCase("MAG")){
|
||||||
|
ordine.codJcom = "MAG";
|
||||||
|
ordine.descrizioneCom = "MAGAZZINO";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
groupedOrdiniInevasi = new ArrayList<>();
|
||||||
|
|
||||||
|
//Splitto gli ordini per codAnagForn
|
||||||
|
for(int i = 0; i < ordini.size(); i++){
|
||||||
|
if(prevCodAnag.equalsIgnoreCase(ordini.get(i).codAnagOrd)) continue;
|
||||||
|
else prevCodAnag = ordini.get(i).codAnagOrd;
|
||||||
|
|
||||||
|
OrdineAccettazioneGroupedInevasoDTO groupedOrdine = new OrdineAccettazioneGroupedInevasoDTO();
|
||||||
|
|
||||||
|
groupedOrdine.codAnagForn = ordini.get(i).codAnagOrd;
|
||||||
|
groupedOrdine.nomeFornitore = ordini.get(i).ragSocOrd;
|
||||||
|
groupedOrdine.ordini = new ArrayList<>();
|
||||||
|
|
||||||
|
List<OrdineAccettazioneInevasoDTO> filteredByCodAnagOrders =
|
||||||
|
Coollection
|
||||||
|
.from(ordini)
|
||||||
|
.where("codAnagOrd", Coollection.eq(ordini.get(i).codAnagOrd)).all();
|
||||||
|
|
||||||
|
|
||||||
|
int prevNumOrd = -1;
|
||||||
|
String prevDataOrd = "";
|
||||||
|
|
||||||
|
|
||||||
|
//Splitto gli ordini di ogni fornitore per data e numero
|
||||||
|
for(int j = 0; j < filteredByCodAnagOrders.size(); j++) {
|
||||||
|
if( prevNumOrd == filteredByCodAnagOrders.get(j).numero &&
|
||||||
|
prevDataOrd.equalsIgnoreCase(filteredByCodAnagOrders.get(j).data)) continue;
|
||||||
|
|
||||||
|
else {
|
||||||
|
prevNumOrd = filteredByCodAnagOrders.get(j).numero;
|
||||||
|
prevDataOrd = filteredByCodAnagOrders.get(j).data;
|
||||||
|
}
|
||||||
|
|
||||||
|
OrdineAccettazioneGroupedInevasoDTO.Ordine rigaOrdine = new OrdineAccettazioneGroupedInevasoDTO.Ordine();
|
||||||
|
|
||||||
|
rigaOrdine.data = filteredByCodAnagOrders.get(j).data;
|
||||||
|
rigaOrdine.numero = filteredByCodAnagOrders.get(j).numero;
|
||||||
|
rigaOrdine.codAnagOrd = filteredByCodAnagOrders.get(j).codAnagOrd;
|
||||||
|
rigaOrdine.ragSocOrd = filteredByCodAnagOrders.get(j).ragSocOrd;
|
||||||
|
rigaOrdine.pesoTotale = filteredByCodAnagOrders.get(j).pesoTotale;
|
||||||
|
rigaOrdine.barcode = filteredByCodAnagOrders.get(j).barcode;
|
||||||
|
rigaOrdine.termCons = filteredByCodAnagOrders.get(j).termCons;
|
||||||
|
rigaOrdine.dataCons = filteredByCodAnagOrders.get(j).dataCons;
|
||||||
|
rigaOrdine.rifOrd = filteredByCodAnagOrders.get(j).rifOrd;
|
||||||
|
rigaOrdine.clienti = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<OrdineAccettazioneInevasoDTO> filteredByCodAnagAndDateAndNumberOrders =
|
||||||
|
Coollection
|
||||||
|
.from(ordini)
|
||||||
|
.where("codAnagOrd", Coollection.eq(filteredByCodAnagOrders.get(j).codAnagOrd))
|
||||||
|
.and("numero", Coollection.eq(filteredByCodAnagOrders.get(j).numero))
|
||||||
|
.and("data", Coollection.eq(filteredByCodAnagOrders.get(j).data)).all();
|
||||||
|
|
||||||
|
|
||||||
|
String prevCodJcom = "";
|
||||||
|
|
||||||
|
//Splitto gli ordini per codJcom
|
||||||
|
for(int k = 0; k < filteredByCodAnagAndDateAndNumberOrders.size(); k++) {
|
||||||
|
if(prevCodJcom.equalsIgnoreCase(filteredByCodAnagAndDateAndNumberOrders.get(k).codJcom)) continue;
|
||||||
|
else prevCodJcom = filteredByCodAnagAndDateAndNumberOrders.get(k).codJcom;
|
||||||
|
|
||||||
|
OrdineAccettazioneGroupedInevasoDTO.Cliente cliente = new OrdineAccettazioneGroupedInevasoDTO.Cliente();
|
||||||
|
|
||||||
|
cliente.codJcom = filteredByCodAnagAndDateAndNumberOrders.get(k).codJcom;
|
||||||
|
cliente.ragSocCom = filteredByCodAnagAndDateAndNumberOrders.get(k).ragSocCom;
|
||||||
|
cliente.descrCom = filteredByCodAnagAndDateAndNumberOrders.get(k).descrizioneCom;
|
||||||
|
cliente.dataCons = filteredByCodAnagAndDateAndNumberOrders.get(k).dataCons;
|
||||||
|
cliente.numCnf = filteredByCodAnagAndDateAndNumberOrders.get(k).numCnf;
|
||||||
|
|
||||||
|
rigaOrdine.clienti.add(cliente);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
groupedOrdine.ordini.add(rigaOrdine);
|
||||||
|
}
|
||||||
|
|
||||||
|
groupedOrdiniInevasi.add(groupedOrdine);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mAdapter = new MainListAccettazioneAdapter(getActivity(), groupedOrdiniInevasi, this);
|
||||||
|
mRecyclerView.setAdapter(mAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OnClick(R.id.accettazione_main_fab)
|
||||||
|
public void onClick(View view) {
|
||||||
|
|
||||||
|
List<OrdineAccettazioneGroupedInevasoDTO> selectedOrders = helper.getSelectedOrders(groupedOrdiniInevasi);
|
||||||
|
List<String> barcodes = new ArrayList<>();
|
||||||
|
|
||||||
|
for(OrdineAccettazioneGroupedInevasoDTO ordine : selectedOrders){
|
||||||
|
for(OrdineAccettazioneGroupedInevasoDTO.Ordine righeOrd : ordine.ordini){
|
||||||
|
barcodes.add(righeOrd.barcode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final ProgressDialog progress = ProgressDialog.show(getActivity(), getText(R.string.waiting),
|
||||||
|
getText(R.string.loading) + " ...", true);
|
||||||
|
|
||||||
|
helper.retrievePiclingList(barcodes, new ILoadPickingListCallback() {
|
||||||
|
@Override
|
||||||
|
public void onLoadSuccess(List<OrdineAccettazioneDTO> ordini) {
|
||||||
|
progress.dismiss();
|
||||||
|
|
||||||
|
Intent myIntent = new Intent(getActivity(), AccettazioneOrdineInevasoActivity.class);
|
||||||
|
myIntent.putExtra("key", (ArrayList<OrdineAccettazioneDTO>) ordini); //Optional parameters
|
||||||
|
getActivity().startActivity(myIntent);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadFail(Exception ex) {
|
||||||
|
// Toast.makeText(getActivity(), errorMessage, Toast.LENGTH_LONG).show();
|
||||||
|
progress.dismiss();
|
||||||
|
|
||||||
|
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||||
|
if(errorMessage == null) errorMessage = ex.getMessage() + "\n" + ex.getCause().getCause().getMessage();
|
||||||
|
DialogSimpleMessageHelper.makeErrorDialog(getActivity(), errorMessage, null).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onToggle(boolean newValue) {
|
||||||
|
if(helper.getSelectedOrders(groupedOrdiniInevasi).size() > 0) mFab.show();
|
||||||
|
else mFab.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onQueryTextSubmit(String query) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onQueryTextChange(String newText) {
|
||||||
|
final List<OrdineAccettazioneGroupedInevasoDTO> filtermodelist = helper.getFilteredOrdersByFornitore(groupedOrdiniInevasi, newText);
|
||||||
|
mAdapter.setFilter(filtermodelist);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,161 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione.core;
|
||||||
|
|
||||||
|
import android.app.ProgressDialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
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.gest.accettazione.core.interfaces.ILoadOrdiniCallback;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.core.interfaces.ILoadPickingListCallback;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneGroupedInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.rest.OrdiniAccettazioneRESTConsumerService;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class AccettazioneHelper {
|
||||||
|
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
public AccettazioneHelper(Context context){
|
||||||
|
mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadOrdini(final ILoadOrdiniCallback callback){
|
||||||
|
|
||||||
|
|
||||||
|
OrdiniAccettazioneRESTConsumerService service = RESTBuilder.getService(OrdiniAccettazioneRESTConsumerService.class);
|
||||||
|
service.listOrdiniInevasi().enqueue(new Callback<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> call, Response<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> response) {
|
||||||
|
|
||||||
|
if(response.isSuccessful()) {
|
||||||
|
|
||||||
|
if(response.body() != null) {
|
||||||
|
if(response.body().getEsito() == EsitoType.OK) {
|
||||||
|
callback.onLoadSuccess(response.body().getDto());
|
||||||
|
} else {
|
||||||
|
Log.e("Accettazione", response.body().getErrorMessage());
|
||||||
|
callback.onLoadFail(new Exception(response.message()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e("Accettazione", response.message());
|
||||||
|
callback.onLoadFail(new Exception(response.message()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e("Accettazione", "Status " + response.code() + ": " + response.message());
|
||||||
|
callback.onLoadFail(new Exception("Status " + response.code() + ": " + response.message()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> call, Throwable t) {
|
||||||
|
Log.e("Accettazione", t.toString());
|
||||||
|
callback.onLoadFail(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void retrievePiclingList(List<String> barcodeOrdini, final ILoadPickingListCallback callback){
|
||||||
|
|
||||||
|
String joinedBarcodes = TextUtils.join(",", barcodeOrdini);
|
||||||
|
|
||||||
|
OrdiniAccettazioneRESTConsumerService service = RESTBuilder.getService(OrdiniAccettazioneRESTConsumerService.class);
|
||||||
|
|
||||||
|
service.pickingListAccettazione(joinedBarcodes).enqueue(new Callback<ServiceRESTResponse<List<OrdineAccettazioneDTO>>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<OrdineAccettazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineAccettazioneDTO>>> response) {
|
||||||
|
if(response.isSuccessful()) {
|
||||||
|
|
||||||
|
if(response.body() != null) {
|
||||||
|
if(response.body().getEsito() == EsitoType.OK) {
|
||||||
|
List<OrdineAccettazioneDTO> dto = response.body().getDto();
|
||||||
|
|
||||||
|
for (OrdineAccettazioneDTO ordine : dto) {
|
||||||
|
for(OrdineAccettazioneDTO.Riga riga : ordine.ordini){
|
||||||
|
riga.numOrd = ordine.numero;
|
||||||
|
riga.dataOrd = ordine.data;
|
||||||
|
riga.gestioneOrd = ordine.gestione;
|
||||||
|
riga.codAlis = ordine.codAlis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
callback.onLoadSuccess(dto);
|
||||||
|
} else {
|
||||||
|
Log.e("Accettazione", response.body().getErrorMessage());
|
||||||
|
callback.onLoadFail(new Exception(response.message()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e("Accettazione", response.message());
|
||||||
|
callback.onLoadFail(new Exception(response.message()));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e("Accettazione", "Status " + response.code() + ": " + response.message());
|
||||||
|
callback.onLoadFail(new Exception("Status " + response.code() + ": " + response.message()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<OrdineAccettazioneDTO>>> call, Throwable t) {
|
||||||
|
Log.e("Accettazione", t.getCause().toString());
|
||||||
|
callback.onLoadFail(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<OrdineAccettazioneGroupedInevasoDTO> getSelectedOrders(List<OrdineAccettazioneGroupedInevasoDTO> groupedOrdiniInevasi){
|
||||||
|
List<OrdineAccettazioneGroupedInevasoDTO> selectedOrdini = new ArrayList<>();
|
||||||
|
|
||||||
|
for(int i = 0; i < groupedOrdiniInevasi.size(); i++){
|
||||||
|
List<OrdineAccettazioneGroupedInevasoDTO.Ordine> selectedOrdiniGroup = new ArrayList<>();
|
||||||
|
|
||||||
|
for(int j = 0; j < groupedOrdiniInevasi.get(i).ordini.size(); j++){
|
||||||
|
if(groupedOrdiniInevasi.get(i).ordini.get(j).checkBox) {
|
||||||
|
selectedOrdiniGroup.add(groupedOrdiniInevasi.get(i).ordini.get(j));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(selectedOrdiniGroup.size() > 0) {
|
||||||
|
try {
|
||||||
|
OrdineAccettazioneGroupedInevasoDTO cloneOrdine = groupedOrdiniInevasi.get(i).clone();
|
||||||
|
cloneOrdine.ordini = selectedOrdiniGroup;
|
||||||
|
selectedOrdini.add(cloneOrdine);
|
||||||
|
} catch (CloneNotSupportedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return selectedOrdini;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<OrdineAccettazioneGroupedInevasoDTO> getFilteredOrdersByFornitore(List<OrdineAccettazioneGroupedInevasoDTO> groupedOrdiniInevasi, String textFilter){
|
||||||
|
List<OrdineAccettazioneGroupedInevasoDTO> selectedOrdini = new ArrayList<>();
|
||||||
|
|
||||||
|
for(int i = 0; i < groupedOrdiniInevasi.size(); i++){
|
||||||
|
|
||||||
|
if(groupedOrdiniInevasi.get(i).nomeFornitore.toLowerCase().contains(textFilter.toLowerCase())){
|
||||||
|
selectedOrdini.add(groupedOrdiniInevasi.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return selectedOrdini;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,164 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione.core;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ICheckBoxCallback;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneGroupedInevasoDTO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class MainListAccettazioneAdapter extends RecyclerView.Adapter<MainListAccettazioneAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
private Context mContext;
|
||||||
|
private List<OrdineAccettazioneGroupedInevasoDTO> mDataset;
|
||||||
|
private ICheckBoxCallback mCheckBoxCallback;
|
||||||
|
|
||||||
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
// each data item is just a string in this case
|
||||||
|
private TextView mTextViewGroupHeader;
|
||||||
|
private LinearLayout mLinearLayoutGroupItemContainer;
|
||||||
|
public ViewHolder(View v) {
|
||||||
|
super(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Provide a suitable constructor (depends on the kind of dataset)
|
||||||
|
public MainListAccettazioneAdapter(Context context, List<OrdineAccettazioneGroupedInevasoDTO> myDataset, ICheckBoxCallback checkBoxCallback) {
|
||||||
|
mContext = context;
|
||||||
|
mDataset = myDataset;
|
||||||
|
mCheckBoxCallback = checkBoxCallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create new views (invoked by the layout manager)
|
||||||
|
@Override
|
||||||
|
public MainListAccettazioneAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
|
||||||
|
int viewType) {
|
||||||
|
// create a new view
|
||||||
|
View v = LayoutInflater.from(parent.getContext())
|
||||||
|
.inflate(R.layout.accettazione_main_list_model, parent, false);
|
||||||
|
|
||||||
|
v.setHasTransientState(true);
|
||||||
|
|
||||||
|
ViewHolder vh = new ViewHolder(v);
|
||||||
|
|
||||||
|
TextView groupHeader = (TextView) v.findViewById(R.id.accettazione_main_list_group_header);
|
||||||
|
vh.mTextViewGroupHeader = groupHeader;
|
||||||
|
|
||||||
|
LinearLayout groupItemContainer = (LinearLayout) v.findViewById(R.id.accettazione_main_list_group_item_container);
|
||||||
|
vh.mLinearLayoutGroupItemContainer = groupItemContainer;
|
||||||
|
|
||||||
|
return vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Replace the contents of a view (invoked by the layout manager)
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(ViewHolder holder, int position) {
|
||||||
|
// - get element from your dataset at this position
|
||||||
|
// - replace the contents of the view with that element
|
||||||
|
|
||||||
|
final List<OrdineAccettazioneGroupedInevasoDTO.Ordine> subGroup = mDataset.get(position).ordini;
|
||||||
|
|
||||||
|
holder.mTextViewGroupHeader.setText(mDataset.get(position).nomeFornitore);
|
||||||
|
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
boolean newValue = true;
|
||||||
|
|
||||||
|
for(int i = 0; i < subGroup.size(); i++){
|
||||||
|
if(subGroup.get(i).checkBox) newValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < subGroup.size(); i++){
|
||||||
|
subGroup.get(i).setCheckbox(newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
mCheckBoxCallback.onToggle(newValue);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
for(int i = 0; i < subGroup.size(); i++){
|
||||||
|
final OrdineAccettazioneGroupedInevasoDTO.Ordine ordine = subGroup.get(i);
|
||||||
|
View groupModelView = LayoutInflater.from(mContext)
|
||||||
|
.inflate(R.layout.accettazione_main_list_group_model, holder.mLinearLayoutGroupItemContainer, false);
|
||||||
|
|
||||||
|
if(i % 2 == 1){
|
||||||
|
groupModelView.setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
|
||||||
|
}
|
||||||
|
|
||||||
|
final CheckBox checkBox = (CheckBox) groupModelView.findViewById(R.id.accettazione_main_list_group_item_container_checkBox);
|
||||||
|
checkBox.setChecked(ordine.checkBox);
|
||||||
|
|
||||||
|
ordine.checkBoxCallback.add(new ICheckBoxCallback() {
|
||||||
|
@Override
|
||||||
|
public void onToggle(boolean newValue) {
|
||||||
|
checkBox.setChecked(newValue);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
groupModelView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
checkBox.toggle();
|
||||||
|
ordine.checkBox = checkBox.isChecked();
|
||||||
|
mCheckBoxCallback.onToggle(checkBox.isChecked());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
TextView testataOrdTextView = (TextView) groupModelView.findViewById(R.id.accettazione_main_list_group_item_container_testata_ord);
|
||||||
|
String testataOrdString = String.format(mContext.getString(R.string.ord_acq_testata), String.valueOf(ordine.numero), UtilityDate.formatDate(ordine.getData(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN));
|
||||||
|
testataOrdTextView.setText(Html.fromHtml(testataOrdString));
|
||||||
|
|
||||||
|
LinearLayout clientLinearLayout = (LinearLayout) groupModelView.findViewById(R.id.accettazione_main_list_group_item_container_clienti_ord) ;
|
||||||
|
List<OrdineAccettazioneGroupedInevasoDTO.Cliente> subGroupClienti = ordine.clienti;
|
||||||
|
|
||||||
|
for(int k = 0; k < subGroupClienti.size(); k++){
|
||||||
|
View groupClienteModelView = LayoutInflater.from(mContext)
|
||||||
|
.inflate(R.layout.accettazione_main_list_group_clienti, clientLinearLayout, false);
|
||||||
|
|
||||||
|
TextView clienteComm = (TextView) groupClienteModelView.findViewById(R.id.accettazione_main_list_group_clienti_comm);
|
||||||
|
String clienteText;
|
||||||
|
clienteText = subGroupClienti.get(k).codJcom + " - " + subGroupClienti.get(k).descrCom;
|
||||||
|
clienteComm.setText(clienteText);
|
||||||
|
|
||||||
|
TextView dataCons = (TextView) groupClienteModelView.findViewById(R.id.accettazione_main_list_group_clienti_datacons);
|
||||||
|
dataCons.setText(UtilityDate.formatDate(subGroupClienti.get(k).getDataCons(), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH));
|
||||||
|
|
||||||
|
|
||||||
|
clientLinearLayout.addView(groupClienteModelView);
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.mLinearLayoutGroupItemContainer.addView(groupModelView);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return the size of your dataset (invoked by the layout manager)
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return mDataset.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setFilter(List<OrdineAccettazioneGroupedInevasoDTO> newDataset) {
|
||||||
|
mDataset = new ArrayList<>();
|
||||||
|
mDataset.addAll(newDataset);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione.core.interfaces;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface ILoadOrdiniCallback {
|
||||||
|
|
||||||
|
|
||||||
|
void onLoadSuccess(List<OrdineAccettazioneInevasoDTO> ordini);
|
||||||
|
|
||||||
|
void onLoadFail(Exception ex);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione.core.interfaces;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 22/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface ILoadPickingListCallback {
|
||||||
|
|
||||||
|
void onLoadSuccess(List<OrdineAccettazioneDTO> ordini);
|
||||||
|
|
||||||
|
void onLoadFail(Exception ex);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione.core.interfaces;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 07/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface ITitledFragment {
|
||||||
|
|
||||||
|
String getTitle(Context context);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,189 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione.dto;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class OrdineAccettazioneDTO implements Parcelable {
|
||||||
|
|
||||||
|
public String ragSoc;
|
||||||
|
public int numero;
|
||||||
|
public String data;
|
||||||
|
public String gestione;
|
||||||
|
public String codMdep;
|
||||||
|
public String codAnag;
|
||||||
|
public String codVdes;
|
||||||
|
public String termCons;
|
||||||
|
public ArrayList<Riga> ordini;
|
||||||
|
public String codAlis;
|
||||||
|
public String rifOrd;
|
||||||
|
|
||||||
|
|
||||||
|
public static class Riga implements Parcelable {
|
||||||
|
public Float qtaOrd;
|
||||||
|
public Float qtaRiservate;
|
||||||
|
public int rigaOrd;
|
||||||
|
public String codJcom;
|
||||||
|
public String ragSocCom;
|
||||||
|
public MtbAart mtbAart;
|
||||||
|
public PickingObjectDTO[] colliAssociati;
|
||||||
|
public boolean hidden = false;
|
||||||
|
public String partitaMag;
|
||||||
|
public String codArtFor;
|
||||||
|
public String descrizioneEstesa;
|
||||||
|
public String codAlis;
|
||||||
|
|
||||||
|
public int numOrd;
|
||||||
|
public String dataOrd;
|
||||||
|
public String gestioneOrd;
|
||||||
|
|
||||||
|
public String dataCons;
|
||||||
|
|
||||||
|
public Float getQtaDaEvadere() {
|
||||||
|
return this.qtaOrd - this.qtaRiservate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Riga(){}
|
||||||
|
|
||||||
|
protected Riga(Parcel in) {
|
||||||
|
qtaOrd = in.readByte() == 0x00 ? null : in.readFloat();
|
||||||
|
qtaRiservate = in.readByte() == 0x00 ? null : in.readFloat();
|
||||||
|
rigaOrd = in.readInt();
|
||||||
|
codJcom = in.readString();
|
||||||
|
ragSocCom = in.readString();
|
||||||
|
mtbAart = (MtbAart) in.readValue(MtbAart.class.getClassLoader());
|
||||||
|
hidden = in.readByte() != 0x00;
|
||||||
|
partitaMag = in.readString();
|
||||||
|
codArtFor = in.readString();
|
||||||
|
descrizioneEstesa = in.readString();
|
||||||
|
codAlis = in.readString();
|
||||||
|
numOrd = in.readInt();
|
||||||
|
dataOrd = in.readString();
|
||||||
|
gestioneOrd = in.readString();
|
||||||
|
dataCons = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
if (qtaOrd == null) {
|
||||||
|
dest.writeByte((byte) (0x00));
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) (0x01));
|
||||||
|
dest.writeFloat(qtaOrd);
|
||||||
|
}
|
||||||
|
if (qtaRiservate == null) {
|
||||||
|
dest.writeByte((byte) (0x00));
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) (0x01));
|
||||||
|
dest.writeFloat(qtaRiservate);
|
||||||
|
}
|
||||||
|
dest.writeInt(rigaOrd);
|
||||||
|
dest.writeString(codJcom);
|
||||||
|
dest.writeString(ragSocCom);
|
||||||
|
dest.writeValue(mtbAart);
|
||||||
|
dest.writeByte((byte) (hidden ? 0x01 : 0x00));
|
||||||
|
dest.writeString(partitaMag);
|
||||||
|
dest.writeString(codArtFor);
|
||||||
|
dest.writeString(descrizioneEstesa);
|
||||||
|
dest.writeString(codAlis);
|
||||||
|
dest.writeInt(numOrd);
|
||||||
|
dest.writeString(dataOrd);
|
||||||
|
dest.writeString(gestioneOrd);
|
||||||
|
dest.writeString(dataCons);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public static final Parcelable.Creator<Riga> CREATOR = new Parcelable.Creator<Riga>() {
|
||||||
|
@Override
|
||||||
|
public Riga createFromParcel(Parcel in) {
|
||||||
|
return new Riga(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Riga[] newArray(int size) {
|
||||||
|
return new Riga[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class PickingObjectDTO extends MtbColt{
|
||||||
|
public boolean hidden = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdineAccettazioneDTO() {}
|
||||||
|
|
||||||
|
protected OrdineAccettazioneDTO(Parcel in) {
|
||||||
|
ragSoc = in.readString();
|
||||||
|
numero = in.readInt();
|
||||||
|
data = in.readString();
|
||||||
|
gestione = in.readString();
|
||||||
|
codMdep = in.readString();
|
||||||
|
codAnag = in.readString();
|
||||||
|
codVdes = in.readString();
|
||||||
|
termCons = in.readString();
|
||||||
|
codAlis = in.readString();
|
||||||
|
rifOrd = in.readString();
|
||||||
|
if (in.readByte() == 0x01) {
|
||||||
|
ordini = new ArrayList<Riga>();
|
||||||
|
in.readList(ordini, Riga.class.getClassLoader());
|
||||||
|
} else {
|
||||||
|
ordini = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(ragSoc);
|
||||||
|
dest.writeInt(numero);
|
||||||
|
dest.writeString(data);
|
||||||
|
dest.writeString(gestione);
|
||||||
|
dest.writeString(codMdep);
|
||||||
|
dest.writeString(codAnag);
|
||||||
|
dest.writeString(codVdes);
|
||||||
|
dest.writeString(termCons);
|
||||||
|
dest.writeString(codAlis);
|
||||||
|
dest.writeString(rifOrd);
|
||||||
|
if (ordini == null) {
|
||||||
|
dest.writeByte((byte) (0x00));
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) (0x01));
|
||||||
|
dest.writeList(ordini);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public static final Parcelable.Creator<OrdineAccettazioneDTO> CREATOR = new Parcelable.Creator<OrdineAccettazioneDTO>() {
|
||||||
|
@Override
|
||||||
|
public OrdineAccettazioneDTO createFromParcel(Parcel in) {
|
||||||
|
return new OrdineAccettazioneDTO(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OrdineAccettazioneDTO[] newArray(int size) {
|
||||||
|
return new OrdineAccettazioneDTO[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,229 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione.dto;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ICheckBoxCallback;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class OrdineAccettazioneGroupedInevasoDTO implements Cloneable, Serializable, Parcelable {
|
||||||
|
|
||||||
|
public String codAnagForn;
|
||||||
|
public String nomeFornitore;
|
||||||
|
public List<Ordine> ordini;
|
||||||
|
|
||||||
|
public OrdineAccettazioneGroupedInevasoDTO clone() throws CloneNotSupportedException {
|
||||||
|
return (OrdineAccettazioneGroupedInevasoDTO) super.clone();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class Ordine implements Parcelable{
|
||||||
|
public String data;
|
||||||
|
public int numero;
|
||||||
|
public String codAnagOrd = "";
|
||||||
|
public String ragSocOrd = "";
|
||||||
|
public Float pesoTotale;
|
||||||
|
public String barcode;
|
||||||
|
public String termCons;
|
||||||
|
public String dataCons;
|
||||||
|
public String rifOrd;
|
||||||
|
|
||||||
|
public boolean checkBox;
|
||||||
|
public List<ICheckBoxCallback> checkBoxCallback = new ArrayList<>();
|
||||||
|
public void setCheckbox(boolean newValue){
|
||||||
|
checkBox = newValue;
|
||||||
|
if(checkBoxCallback != null && checkBoxCallback.size() > 0) {
|
||||||
|
for(ICheckBoxCallback callback : checkBoxCallback) callback.onToggle(newValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Cliente> clienti;
|
||||||
|
|
||||||
|
|
||||||
|
public Date getData(){
|
||||||
|
try {
|
||||||
|
return UtilityDate.recognizeDate(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public Ordine(){}
|
||||||
|
|
||||||
|
protected Ordine(Parcel in) {
|
||||||
|
data = in.readString();
|
||||||
|
numero = in.readInt();
|
||||||
|
codAnagOrd = in.readString();
|
||||||
|
ragSocOrd = in.readString();
|
||||||
|
pesoTotale = in.readByte() == 0x00 ? null : in.readFloat();
|
||||||
|
barcode = in.readString();
|
||||||
|
termCons = in.readString();
|
||||||
|
dataCons = in.readString();
|
||||||
|
rifOrd = in.readString();
|
||||||
|
if (in.readByte() == 0x01) {
|
||||||
|
clienti = new ArrayList<Cliente>();
|
||||||
|
in.readList(clienti, Cliente.class.getClassLoader());
|
||||||
|
} else {
|
||||||
|
clienti = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(data);
|
||||||
|
dest.writeInt(numero);
|
||||||
|
dest.writeString(codAnagOrd);
|
||||||
|
dest.writeString(ragSocOrd);
|
||||||
|
if (pesoTotale == null) {
|
||||||
|
dest.writeByte((byte) (0x00));
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) (0x01));
|
||||||
|
dest.writeFloat(pesoTotale);
|
||||||
|
}
|
||||||
|
dest.writeString(barcode);
|
||||||
|
dest.writeString(termCons);
|
||||||
|
dest.writeString(dataCons);
|
||||||
|
dest.writeString(rifOrd);
|
||||||
|
if (clienti == null) {
|
||||||
|
dest.writeByte((byte) (0x00));
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) (0x01));
|
||||||
|
dest.writeList(clienti);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public static final Parcelable.Creator<Ordine> CREATOR = new Parcelable.Creator<Ordine>() {
|
||||||
|
@Override
|
||||||
|
public Ordine createFromParcel(Parcel in) {
|
||||||
|
return new Ordine(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ordine[] newArray(int size) {
|
||||||
|
return new Ordine[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Cliente implements Parcelable{
|
||||||
|
public String codJcom;
|
||||||
|
public String ragSocCom;
|
||||||
|
public int idRiga;
|
||||||
|
public String dataCons;
|
||||||
|
public Integer numCnf;
|
||||||
|
public String descrCom;
|
||||||
|
|
||||||
|
public Date getDataCons(){
|
||||||
|
try {
|
||||||
|
return UtilityDate.recognizeDate(dataCons);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cliente(){}
|
||||||
|
|
||||||
|
protected Cliente(Parcel in) {
|
||||||
|
codJcom = in.readString();
|
||||||
|
ragSocCom = in.readString();
|
||||||
|
idRiga = in.readInt();
|
||||||
|
dataCons = in.readString();
|
||||||
|
numCnf = in.readByte() == 0x00 ? null : in.readInt();
|
||||||
|
descrCom = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(codJcom);
|
||||||
|
dest.writeString(ragSocCom);
|
||||||
|
dest.writeInt(idRiga);
|
||||||
|
dest.writeString(dataCons);
|
||||||
|
if (numCnf == null) {
|
||||||
|
dest.writeByte((byte) (0x00));
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) (0x01));
|
||||||
|
dest.writeInt(numCnf);
|
||||||
|
}
|
||||||
|
dest.writeString(descrCom);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public static final Parcelable.Creator<Cliente> CREATOR = new Parcelable.Creator<Cliente>() {
|
||||||
|
@Override
|
||||||
|
public Cliente createFromParcel(Parcel in) {
|
||||||
|
return new Cliente(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Cliente[] newArray(int size) {
|
||||||
|
return new Cliente[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdineAccettazioneGroupedInevasoDTO(){}
|
||||||
|
|
||||||
|
protected OrdineAccettazioneGroupedInevasoDTO(Parcel in) {
|
||||||
|
codAnagForn = in.readString();
|
||||||
|
nomeFornitore = in.readString();
|
||||||
|
if (in.readByte() == 0x01) {
|
||||||
|
ordini = new ArrayList<Ordine>();
|
||||||
|
in.readList(ordini, Ordine.class.getClassLoader());
|
||||||
|
} else {
|
||||||
|
ordini = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(codAnagForn);
|
||||||
|
dest.writeString(nomeFornitore);
|
||||||
|
if (ordini == null) {
|
||||||
|
dest.writeByte((byte) (0x00));
|
||||||
|
} else {
|
||||||
|
dest.writeByte((byte) (0x01));
|
||||||
|
dest.writeList(ordini);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public static final Parcelable.Creator<OrdineAccettazioneGroupedInevasoDTO> CREATOR = new Parcelable.Creator<OrdineAccettazioneGroupedInevasoDTO>() {
|
||||||
|
@Override
|
||||||
|
public OrdineAccettazioneGroupedInevasoDTO createFromParcel(Parcel in) {
|
||||||
|
return new OrdineAccettazioneGroupedInevasoDTO(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OrdineAccettazioneGroupedInevasoDTO[] newArray(int size) {
|
||||||
|
return new OrdineAccettazioneGroupedInevasoDTO[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione.dto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class OrdineAccettazioneInevasoDTO {
|
||||||
|
|
||||||
|
public String data;
|
||||||
|
public int numero;
|
||||||
|
public String termCons;
|
||||||
|
public String codAuto;
|
||||||
|
public String descrizioneAuto;
|
||||||
|
public String rifOrd;
|
||||||
|
public String codVvet;
|
||||||
|
public String descrizioneVettore;
|
||||||
|
public String dataInizTrasp;
|
||||||
|
public String codJcom = "";
|
||||||
|
public String descrizioneCom = "";
|
||||||
|
public String codAnagOrd = "";
|
||||||
|
public String ragSocOrd = "";
|
||||||
|
public String ragSocCom = "";
|
||||||
|
public Float pesoTotale;
|
||||||
|
public Integer numCnf;
|
||||||
|
public String dataCons;
|
||||||
|
public String barcode;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione.rest;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.REST.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 06/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface OrdiniAccettazioneRESTConsumerService {
|
||||||
|
|
||||||
|
@POST("SM2GetOrdiniAccettazioneInevasi")
|
||||||
|
Call<ServiceRESTResponse<List<OrdineAccettazioneInevasoDTO>>> listOrdiniInevasi();
|
||||||
|
|
||||||
|
@POST("WMSGetPickingListAccettazione")
|
||||||
|
Call<ServiceRESTResponse<List<OrdineAccettazioneDTO>>> pickingListAccettazione(@Query("codBarreBancale") String codBarreBacale);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,180 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso;
|
||||||
|
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import butterknife.BindView;
|
||||||
|
import butterknife.ButterKnife;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
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.MainListOrdineAccettazioneAdapter;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.dto.AccettazioneOrdineInevasoOrderBy;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||||
|
|
||||||
|
public class AccettazioneOrdineInevasoActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
@BindView(R.id.toolbar) Toolbar toolbar;
|
||||||
|
|
||||||
|
@BindView(R.id.accettazione_ordine_main_list) RecyclerView mRecyclerView;
|
||||||
|
|
||||||
|
|
||||||
|
private MainListOrdineAccettazioneAdapter mAdapter;
|
||||||
|
private RecyclerView.LayoutManager mLayoutManager;
|
||||||
|
|
||||||
|
private List<List<OrdineAccettazioneDTO.Riga>> groupedRighe;
|
||||||
|
private List<OrdineAccettazioneDTO.Riga> groupedOrdini;
|
||||||
|
|
||||||
|
private AccettazioneOrdineInevasoHelper helper;
|
||||||
|
|
||||||
|
private AccettazioneOrdineInevasoOrderBy.Enum currentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.COD_ART_FOR;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_accettazione_ordine_inevaso);
|
||||||
|
|
||||||
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
List<OrdineAccettazioneDTO> orders = new ArrayList<OrdineAccettazioneDTO>();
|
||||||
|
orders = (ArrayList<OrdineAccettazioneDTO>)getIntent().getSerializableExtra("key");
|
||||||
|
|
||||||
|
setTitle(orders);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
groupedOrdini = new ArrayList<>();
|
||||||
|
for (OrdineAccettazioneDTO ordine : orders){
|
||||||
|
groupedOrdini.addAll(ordine.ordini);
|
||||||
|
}
|
||||||
|
|
||||||
|
helper = new AccettazioneOrdineInevasoHelper(this);
|
||||||
|
|
||||||
|
groupedRighe = helper.getOrdiniRaggruppatiPerCodArtForn(groupedOrdini);
|
||||||
|
|
||||||
|
initRecyclerView(groupedRighe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onSupportNavigateUp() {
|
||||||
|
onBackPressed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
getMenuInflater().inflate(R.menu.activity_accettazione_ordine_inevaso, menu);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
// Handle item selection
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case R.id.action_filter:
|
||||||
|
this.showOrderDialog();
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void setTitle(List<OrdineAccettazioneDTO> ordini){
|
||||||
|
if(ordini.size() > 0){
|
||||||
|
if(ordini.size() == 1){
|
||||||
|
setTitle(ordini.get(0).ragSoc);
|
||||||
|
} else {
|
||||||
|
setTitle(R.string.accettazione_ordine_inevaso_title_multiple_order);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setTitle(R.string.accettazione_ordine_inevaso_title_empty);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initRecyclerView(List<List<OrdineAccettazioneDTO.Riga>> groupedRighe){
|
||||||
|
//RecyclerView setup
|
||||||
|
mRecyclerView.setHasFixedSize(true);
|
||||||
|
|
||||||
|
mLayoutManager = new LinearLayoutManager(this);
|
||||||
|
mRecyclerView.setLayoutManager(mLayoutManager);
|
||||||
|
|
||||||
|
try {
|
||||||
|
mAdapter = helper.getRightListAdapter(AccettazioneOrdineInevasoOrderBy.Enum.COD_ART_FOR, groupedRighe);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
DialogSimpleMessageHelper.makeErrorDialog(this, e.toString(), null).show();
|
||||||
|
}
|
||||||
|
mRecyclerView.setAdapter(mAdapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void showOrderDialog() {
|
||||||
|
|
||||||
|
AlertDialog dialog = new AlertDialog.Builder(this)
|
||||||
|
.setTitle(AccettazioneOrdineInevasoActivity.this.getText(R.string.action_orderBy))
|
||||||
|
.setSingleChoiceItems(AccettazioneOrdineInevasoOrderBy.descriptions, currentOrderBy.getVal(), new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
currentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.fromInt(which);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
refreshOrderBy();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.create();
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void refreshOrderBy(){
|
||||||
|
switch (currentOrderBy){
|
||||||
|
case COD_ART_FOR:
|
||||||
|
groupedRighe = helper.getOrdiniRaggruppatiPerCodArtForn(groupedOrdini);
|
||||||
|
break;
|
||||||
|
case DESCR_ART:
|
||||||
|
groupedRighe = helper.getOrdiniRaggruppatiPerDescrArt(groupedOrdini);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RAG_SOC_COM:
|
||||||
|
groupedRighe = helper.getOrdiniRaggruppatiPerRagSocCommessa(groupedOrdini);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
mRecyclerView.setAdapter(helper.getRightListAdapter(currentOrderBy, groupedRighe));
|
||||||
|
mRecyclerView.invalidate();
|
||||||
|
|
||||||
|
// mAdapter = helper.getRightListAdapter(currentOrderBy, groupedRighe);
|
||||||
|
// mAdapter.notifyDataSetChanged();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Toast.makeText(this, e.getMessage().toString(), Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,269 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SyncRequest;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.SortedSet;
|
||||||
|
import java.util.TreeSet;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.coollection.Coollection;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.dto.AccettazioneOrdineInevasoListViewModel;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.dto.AccettazioneOrdineInevasoOrderBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 21/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class AccettazioneOrdineInevasoHelper {
|
||||||
|
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
public AccettazioneOrdineInevasoHelper(Context context){
|
||||||
|
mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public MainListOrdineAccettazioneAdapter getRightListAdapter(AccettazioneOrdineInevasoOrderBy.Enum orderByEnum, List<List<OrdineAccettazioneDTO.Riga>> mDataset) throws Exception {
|
||||||
|
|
||||||
|
List<AccettazioneOrdineInevasoListViewModel> listViewModels = null;
|
||||||
|
|
||||||
|
switch (orderByEnum){
|
||||||
|
case COD_ART_FOR:
|
||||||
|
case DESCR_ART:
|
||||||
|
listViewModels = getListViewModelPerArtForn(mDataset);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RAG_SOC_COM:
|
||||||
|
listViewModels = getListViewModelPerRagSocCommessa(mDataset);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new Exception("Cannot find right list adapter: " + orderByEnum.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return new MainListOrdineAccettazioneAdapter(mContext, listViewModels);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<List<OrdineAccettazioneDTO.Riga>> getOrdiniRaggruppatiPerCodArtForn(List<OrdineAccettazioneDTO.Riga> mDataset){
|
||||||
|
List<String> codArtForns = new ArrayList<>();
|
||||||
|
|
||||||
|
for(int i = 0; i < mDataset.size(); i++){
|
||||||
|
if(!codArtForns.contains(mDataset.get(i).codArtFor)){
|
||||||
|
codArtForns.add(mDataset.get(i).codArtFor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Collections.sort(codArtForns, new Comparator<String>() {
|
||||||
|
public int compare(String str1, String str2) {
|
||||||
|
return str1.compareToIgnoreCase(str2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
List<List<OrdineAccettazioneDTO.Riga>> groupedRighe = new ArrayList<>();
|
||||||
|
for (String codArtForn : codArtForns) {
|
||||||
|
List<OrdineAccettazioneDTO.Riga> tmpList = Coollection.from(mDataset)
|
||||||
|
.where("codArtFor", Coollection.eqIgnoreCase(codArtForn)).all();
|
||||||
|
|
||||||
|
for(int i = 0; i < tmpList.size(); i++){
|
||||||
|
if(tmpList.get(i).qtaRiservate >= tmpList.get(i).qtaOrd){
|
||||||
|
tmpList.remove(i);
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(tmpList.size() > 0){
|
||||||
|
groupedRighe.add(tmpList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return groupedRighe;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<List<OrdineAccettazioneDTO.Riga>> getOrdiniRaggruppatiPerDescrArt(List<OrdineAccettazioneDTO.Riga> mDataset){
|
||||||
|
List<String> descrArtForns = new ArrayList<>();
|
||||||
|
|
||||||
|
for(int i = 0; i < mDataset.size(); i++){
|
||||||
|
if(!descrArtForns.contains(mDataset.get(i).descrizioneEstesa)){
|
||||||
|
descrArtForns.add(mDataset.get(i).descrizioneEstesa);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Collections.sort(descrArtForns, new Comparator<String>() {
|
||||||
|
public int compare(String str1, String str2) {
|
||||||
|
return str1.compareToIgnoreCase(str2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
List<List<OrdineAccettazioneDTO.Riga>> groupedRighe = new ArrayList<>();
|
||||||
|
for (String descrArtForn : descrArtForns) {
|
||||||
|
List<OrdineAccettazioneDTO.Riga> tmpList = Coollection.from(mDataset)
|
||||||
|
.where("descrizioneEstesa", Coollection.eqIgnoreCase(descrArtForn)).all();
|
||||||
|
|
||||||
|
for(int i = 0; i < tmpList.size(); i++){
|
||||||
|
if(tmpList.get(i).qtaRiservate >= tmpList.get(i).qtaOrd){
|
||||||
|
tmpList.remove(i);
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(tmpList.size() > 0){
|
||||||
|
groupedRighe.add(tmpList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return groupedRighe;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private class RaggruppaPerCommessaUtilDTO {
|
||||||
|
public String codJcom;
|
||||||
|
public String ragSocCom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<List<OrdineAccettazioneDTO.Riga>> getOrdiniRaggruppatiPerRagSocCommessa(List<OrdineAccettazioneDTO.Riga> mDataset) {
|
||||||
|
List<RaggruppaPerCommessaUtilDTO> commessaList = new ArrayList<>();
|
||||||
|
|
||||||
|
//ragSocList.add(mContext.getText(R.string.stock).toString());
|
||||||
|
|
||||||
|
for(int i = 0; i < mDataset.size(); i++){
|
||||||
|
boolean alreadyExists = false;
|
||||||
|
|
||||||
|
for(int k = 0; k < commessaList.size(); k++){
|
||||||
|
if(commessaList.get(k).codJcom.equalsIgnoreCase(mDataset.get(i).codJcom)){
|
||||||
|
alreadyExists = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mDataset.get(i).codJcom != null && !alreadyExists){
|
||||||
|
RaggruppaPerCommessaUtilDTO dto = new RaggruppaPerCommessaUtilDTO();
|
||||||
|
dto.codJcom = mDataset.get(i).codJcom;
|
||||||
|
dto.ragSocCom = mDataset.get(i).ragSocCom;
|
||||||
|
commessaList.add(dto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Collections.sort(commessaList, new Comparator<RaggruppaPerCommessaUtilDTO>() {
|
||||||
|
public int compare(RaggruppaPerCommessaUtilDTO dto1, RaggruppaPerCommessaUtilDTO dto2) {
|
||||||
|
if(dto1.ragSocCom == null) return -1;
|
||||||
|
if(dto2.ragSocCom == null) return 1;
|
||||||
|
|
||||||
|
return dto1.ragSocCom.compareToIgnoreCase(dto2.ragSocCom);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
List<List<OrdineAccettazioneDTO.Riga>> groupedRighe = new ArrayList<>();
|
||||||
|
|
||||||
|
for (RaggruppaPerCommessaUtilDTO dto : commessaList) {
|
||||||
|
|
||||||
|
List<OrdineAccettazioneDTO.Riga> tmpList = Coollection.from(mDataset)
|
||||||
|
.where("codJcom", Coollection.eqIgnoreCase(dto.codJcom)).all();
|
||||||
|
|
||||||
|
for(int i = 0; i < tmpList.size(); i++){
|
||||||
|
if(tmpList.get(i).qtaRiservate >= tmpList.get(i).qtaOrd){
|
||||||
|
tmpList.remove(i);
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Collections.sort(tmpList, new Comparator<OrdineAccettazioneDTO.Riga>() {
|
||||||
|
public int compare(OrdineAccettazioneDTO.Riga obj1, OrdineAccettazioneDTO.Riga obj2) {
|
||||||
|
return obj1.mtbAart.descrizioneEstesa.compareToIgnoreCase(obj2.mtbAart.descrizioneEstesa);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(tmpList.size() > 0){
|
||||||
|
groupedRighe.add(tmpList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Raggruppo tutti quelli per il magazzino e li aggiungo alla fine
|
||||||
|
|
||||||
|
List<OrdineAccettazioneDTO.Riga> tmpList = Coollection.from(mDataset)
|
||||||
|
.where("ragSocCom", Coollection.eqIgnoreCase("MAG")).all();
|
||||||
|
|
||||||
|
return groupedRighe;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<AccettazioneOrdineInevasoListViewModel> getListViewModelPerArtForn(List<List<OrdineAccettazioneDTO.Riga>> groupedRighe){
|
||||||
|
|
||||||
|
List<AccettazioneOrdineInevasoListViewModel> listModel = new ArrayList<>();
|
||||||
|
|
||||||
|
DecimalFormat decimalFormat = new DecimalFormat("#.#");
|
||||||
|
for(int i = 0; i < groupedRighe.size(); i++){
|
||||||
|
AccettazioneOrdineInevasoListViewModel itemModel = new AccettazioneOrdineInevasoListViewModel();
|
||||||
|
|
||||||
|
itemModel.descrizioneGroup = groupedRighe.get(i).get(0).codArtFor + " - " + groupedRighe.get(i).get(0).descrizioneEstesa;
|
||||||
|
|
||||||
|
itemModel.rows = new ArrayList<>();
|
||||||
|
|
||||||
|
for(int k = 0; k < groupedRighe.get(i).size(); k++){
|
||||||
|
final OrdineAccettazioneDTO.Riga rowItem = groupedRighe.get(i).get(k);
|
||||||
|
final AccettazioneOrdineInevasoListViewModel.SubItem rowModel = new AccettazioneOrdineInevasoListViewModel.SubItem();
|
||||||
|
|
||||||
|
rowModel.badge1 = rowItem.codJcom != null ? rowItem.codJcom : "MAG";
|
||||||
|
rowModel.badge2 = String.valueOf(rowItem.numOrd);
|
||||||
|
|
||||||
|
rowModel.descrizione = rowItem.ragSocCom;
|
||||||
|
|
||||||
|
rowModel.qtaRiservata = decimalFormat.format(rowItem.qtaRiservate);
|
||||||
|
rowModel.qtaOrdinata = decimalFormat.format(rowItem.qtaOrd);
|
||||||
|
|
||||||
|
itemModel.rows.add(rowModel);
|
||||||
|
}
|
||||||
|
listModel.add(itemModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
return listModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<AccettazioneOrdineInevasoListViewModel> getListViewModelPerRagSocCommessa(List<List<OrdineAccettazioneDTO.Riga>> groupedRighe) {
|
||||||
|
List<AccettazioneOrdineInevasoListViewModel> listModel = new ArrayList<>();
|
||||||
|
|
||||||
|
DecimalFormat decimalFormat = new DecimalFormat("#.#");
|
||||||
|
for(int i = 0; i < groupedRighe.size(); i++){
|
||||||
|
AccettazioneOrdineInevasoListViewModel itemModel = new AccettazioneOrdineInevasoListViewModel();
|
||||||
|
|
||||||
|
itemModel.descrizioneGroup = groupedRighe.get(i).get(0).codJcom;
|
||||||
|
|
||||||
|
if(groupedRighe.get(i).get(0).ragSocCom != null && groupedRighe.get(i).get(0).ragSocCom.trim().length() > 0){
|
||||||
|
itemModel.descrizioneGroup += " - " + groupedRighe.get(i).get(0).ragSocCom;
|
||||||
|
}
|
||||||
|
|
||||||
|
itemModel.rows = new ArrayList<>();
|
||||||
|
|
||||||
|
for(int k = 0; k < groupedRighe.get(i).size(); k++){
|
||||||
|
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.descrizione = rowItem.mtbAart.descrizioneEstesa;
|
||||||
|
|
||||||
|
rowModel.qtaRiservata = decimalFormat.format(rowItem.qtaRiservate);
|
||||||
|
rowModel.qtaOrdinata = decimalFormat.format(rowItem.qtaOrd);
|
||||||
|
|
||||||
|
itemModel.rows.add(rowModel);
|
||||||
|
}
|
||||||
|
listModel.add(itemModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
return listModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,128 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneGroupedInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.dto.AccettazioneOrdineInevasoListViewModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 21/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class MainListOrdineAccettazioneAdapter extends RecyclerView.Adapter<MainListOrdineAccettazioneAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
protected Context mContext;
|
||||||
|
protected List<AccettazioneOrdineInevasoListViewModel> mDataset;
|
||||||
|
|
||||||
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
// each data item is just a string in this case
|
||||||
|
protected View mGroupTitle;
|
||||||
|
protected LinearLayout mLinearLayoutGroupItemContainer;
|
||||||
|
public ViewHolder(View v) {
|
||||||
|
super(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public MainListOrdineAccettazioneAdapter(Context context, List<AccettazioneOrdineInevasoListViewModel> myDataset) {
|
||||||
|
mContext = context;
|
||||||
|
mDataset = myDataset;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MainListOrdineAccettazioneAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
// create a new view
|
||||||
|
View v = LayoutInflater.from(parent.getContext())
|
||||||
|
.inflate(R.layout.accettazione_ordine_inevaso_main_list___cod_art_for, parent, false);
|
||||||
|
|
||||||
|
v.setHasTransientState(true);
|
||||||
|
|
||||||
|
ViewHolder vh = new ViewHolder(v);
|
||||||
|
|
||||||
|
TextView descrizioneArtForn = (TextView) v.findViewById(R.id.accettazione_ordine_inevaso_main_list_descrArtFor);
|
||||||
|
vh.mGroupTitle = descrizioneArtForn;
|
||||||
|
|
||||||
|
LinearLayout groupItemContainer = (LinearLayout) v.findViewById(R.id.accettazione_ordine_inevaso_main_list_group_item_container);
|
||||||
|
vh.mLinearLayoutGroupItemContainer = groupItemContainer;
|
||||||
|
|
||||||
|
return vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Replace the contents of a view (invoked by the layout manager)
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(MainListOrdineAccettazioneAdapter.ViewHolder holder, int position) {
|
||||||
|
// - get element from your dataset at this position
|
||||||
|
// - replace the contents of the view with that element
|
||||||
|
|
||||||
|
((TextView)holder.mGroupTitle).setText(mDataset.get(position).descrizioneGroup);
|
||||||
|
|
||||||
|
List<AccettazioneOrdineInevasoListViewModel.SubItem> subset = mDataset.get(position).rows;
|
||||||
|
|
||||||
|
for(int i = 0; i < subset.size(); i++) {
|
||||||
|
|
||||||
|
final AccettazioneOrdineInevasoListViewModel.SubItem rowItem = subset.get(i);
|
||||||
|
|
||||||
|
View groupModelView = LayoutInflater.from(mContext)
|
||||||
|
.inflate(R.layout.accettazione_ordine_inevaso_main_list___cod_art_for_group_model, holder.mLinearLayoutGroupItemContainer, false);
|
||||||
|
|
||||||
|
if(i % 2 == 1){
|
||||||
|
groupModelView.setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
final TextView badge1 = (TextView) groupModelView.findViewById(R.id.accettazione_ordine_inevaso_main_list_group_item_badge1);
|
||||||
|
badge1.setText(rowItem.badge1);
|
||||||
|
|
||||||
|
final TextView badge2 = (TextView) groupModelView.findViewById(R.id.accettazione_ordine_inevaso_main_list_group_item_badge2);
|
||||||
|
badge2.setText(rowItem.badge2);
|
||||||
|
|
||||||
|
|
||||||
|
final TextView descrizione = (TextView) groupModelView.findViewById(R.id.accettazione_ordine_inevaso_main_list_group_item_descrizione);
|
||||||
|
|
||||||
|
String descrizioneString = rowItem.descrizione;
|
||||||
|
int descrizioneColor = Color.BLACK;
|
||||||
|
|
||||||
|
if(descrizioneString == null || descrizioneString.trim().length() == 0) {
|
||||||
|
descrizioneString = mContext.getString(R.string.no_description);
|
||||||
|
descrizioneColor = Color.GRAY;
|
||||||
|
} else if(descrizioneString.equalsIgnoreCase("MAG")){
|
||||||
|
descrizioneString = mContext.getString(R.string.stock);
|
||||||
|
}
|
||||||
|
|
||||||
|
descrizione.setText(descrizioneString);
|
||||||
|
descrizione.setTextColor(descrizioneColor);
|
||||||
|
|
||||||
|
final TextView qtaEvasa = (TextView) groupModelView.findViewById(R.id.accettazione_ordine_inevaso_main_list_group_item_qta_evasa);
|
||||||
|
qtaEvasa.setText(rowItem.qtaRiservata);
|
||||||
|
|
||||||
|
final TextView qtaTot = (TextView) groupModelView.findViewById(R.id.accettazione_ordine_inevaso_main_list_group_item_qta_tot);
|
||||||
|
qtaTot.setText(rowItem.qtaOrdinata);
|
||||||
|
|
||||||
|
|
||||||
|
holder.mLinearLayoutGroupItemContainer.addView(groupModelView);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Return the size of your dataset (invoked by the layout manager)
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return mDataset.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.dto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 27/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class AccettazioneOrdineInevasoListViewModel {
|
||||||
|
|
||||||
|
public String descrizioneGroup;
|
||||||
|
public List<SubItem> rows;
|
||||||
|
|
||||||
|
public static class SubItem {
|
||||||
|
|
||||||
|
public String badge1;
|
||||||
|
public String badge2;
|
||||||
|
|
||||||
|
public String descrizione;
|
||||||
|
public String qtaRiservata;
|
||||||
|
public String qtaOrdinata;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.dto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 21/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class AccettazioneOrdineInevasoOrderBy {
|
||||||
|
|
||||||
|
public static String[] descriptions = new String[] {
|
||||||
|
"Cod articolo fornitore",
|
||||||
|
"Descrizione articolo",
|
||||||
|
"Ragione sociale commessa"
|
||||||
|
};
|
||||||
|
|
||||||
|
public enum Enum {
|
||||||
|
COD_ART_FOR(0),
|
||||||
|
DESCR_ART(1),
|
||||||
|
RAG_SOC_COM(2);
|
||||||
|
|
||||||
|
|
||||||
|
private int val;
|
||||||
|
Enum(int val) {
|
||||||
|
this.val = val;
|
||||||
|
}
|
||||||
|
public int getVal() {
|
||||||
|
return this.val;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Enum fromInt(int val) {
|
||||||
|
for (Enum b : Enum.values()) {
|
||||||
|
if (b.val == val) return b;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,118 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 22/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class DialogSimpleMessageHelper {
|
||||||
|
|
||||||
|
public enum TYPE {
|
||||||
|
INFO(1),
|
||||||
|
WARNING(2),
|
||||||
|
ERROR(3);
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
TYPE(int value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
public int getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TYPE fromInt(int value) {
|
||||||
|
for (TYPE b : TYPE.values()) {
|
||||||
|
if (b.value == value) return b;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static AlertDialog makeBase(TYPE type, Context mContext, String titleText, String messageText, DialogInterface.OnClickListener onPositiveClick, DialogInterface.OnClickListener onNegativeClick){
|
||||||
|
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
|
||||||
|
View titleView = inflater.inflate(R.layout.dialog_custom_header, null);
|
||||||
|
|
||||||
|
int colorBackgroundTitle = -1;
|
||||||
|
int colorTextTitle = -1;
|
||||||
|
|
||||||
|
switch (type){
|
||||||
|
case INFO:
|
||||||
|
colorBackgroundTitle = mContext.getResources().getColor(R.color.colorPrimary);
|
||||||
|
colorTextTitle = mContext.getResources().getColor(android.R.color.white);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WARNING:
|
||||||
|
colorBackgroundTitle = mContext.getResources().getColor(R.color.yellow_600);
|
||||||
|
colorTextTitle = mContext.getResources().getColor(android.R.color.black);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ERROR:
|
||||||
|
colorBackgroundTitle = mContext.getResources().getColor(R.color.red_600);
|
||||||
|
colorTextTitle = mContext.getResources().getColor(android.R.color.white);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
View backgroundView = titleView.findViewById(R.id.llsubhead);
|
||||||
|
backgroundView.setBackgroundColor(colorBackgroundTitle);
|
||||||
|
TextView title = (TextView) titleView.findViewById(R.id.exemptionSubHeading4);
|
||||||
|
title.setText(titleText);
|
||||||
|
title.setTextColor(colorTextTitle);
|
||||||
|
|
||||||
|
|
||||||
|
AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext)
|
||||||
|
.setCustomTitle(titleView)
|
||||||
|
.setMessage(messageText)
|
||||||
|
.setPositiveButton(mContext.getText(R.string.ok), onPositiveClick);
|
||||||
|
|
||||||
|
if(onNegativeClick != null){
|
||||||
|
alertDialog.setNegativeButton(mContext.getText(R.string.abort), onNegativeClick);
|
||||||
|
}
|
||||||
|
|
||||||
|
AlertDialog alert = alertDialog.create();
|
||||||
|
alert.setCanceledOnTouchOutside(false);
|
||||||
|
|
||||||
|
return alert;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static AlertDialog makeInfoDialog(Context mContext, String titleText, String messageText, DialogInterface.OnClickListener onPositiveClick){
|
||||||
|
return makeBase(TYPE.INFO,
|
||||||
|
mContext,
|
||||||
|
titleText,
|
||||||
|
messageText,
|
||||||
|
onPositiveClick,
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static AlertDialog makeWarningDialog(Context mContext, String messageText, DialogInterface.OnClickListener onPositiveClick){
|
||||||
|
return makeBase(TYPE.WARNING,
|
||||||
|
mContext,
|
||||||
|
mContext.getText(R.string.warning).toString(),
|
||||||
|
messageText,
|
||||||
|
onPositiveClick,
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static AlertDialog makeErrorDialog(Context mContext, String messageText, DialogInterface.OnClickListener onPositiveClick){
|
||||||
|
|
||||||
|
return makeBase(TYPE.ERROR,
|
||||||
|
mContext,
|
||||||
|
mContext.getText(R.string.error).toString(),
|
||||||
|
messageText,
|
||||||
|
onPositiveClick,
|
||||||
|
null);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package it.integry.integrywmsnative.view.dialogs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by GiuseppeS on 22/03/2018.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface IButtonDialogAction {
|
||||||
|
|
||||||
|
void onPositiveButtonClicked();
|
||||||
|
void onNegativeButtonClicked();
|
||||||
|
|
||||||
|
}
|
||||||
11
app/src/main/res/anim/scale_down.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
|
<scale
|
||||||
|
android:duration="100"
|
||||||
|
android:fromXScale="1.0"
|
||||||
|
android:fromYScale="1.0"
|
||||||
|
android:pivotX="85%"
|
||||||
|
android:pivotY="85%"
|
||||||
|
android:toXScale="0"
|
||||||
|
android:toYScale="0" />
|
||||||
|
</set>
|
||||||
18
app/src/main/res/anim/scale_up.xml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:fillAfter="true">
|
||||||
|
<scale
|
||||||
|
android:duration="300"
|
||||||
|
android:fromXScale="0.0"
|
||||||
|
android:fromYScale="0.0"
|
||||||
|
android:interpolator="@android:anim/linear_interpolator"
|
||||||
|
android:toXScale="0.8"
|
||||||
|
android:pivotX="50%"
|
||||||
|
android:pivotY="50%"
|
||||||
|
android:toYScale="0.8" />
|
||||||
|
<alpha
|
||||||
|
android:fromAlpha="0.0"
|
||||||
|
android:toAlpha="1.0"
|
||||||
|
android:interpolator="@android:anim/accelerate_interpolator"
|
||||||
|
android:duration="300"/>
|
||||||
|
</set>
|
||||||
12
app/src/main/res/drawable/badge1_round_corner.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="@color/blue_700" />
|
||||||
|
|
||||||
|
<padding
|
||||||
|
android:left="1dp"
|
||||||
|
android:right="1dp"
|
||||||
|
android:top="1dp" />
|
||||||
|
|
||||||
|
<corners android:radius="5dp" />
|
||||||
|
</shape>
|
||||||
12
app/src/main/res/drawable/badge2_round_corner.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="@color/orange_600" />
|
||||||
|
|
||||||
|
<padding
|
||||||
|
android:left="1dp"
|
||||||
|
android:right="1dp"
|
||||||
|
android:top="1dp" />
|
||||||
|
|
||||||
|
<corners android:radius="5dp" />
|
||||||
|
</shape>
|
||||||
9
app/src/main/res/drawable/ic_check_black_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="#FF000000"
|
||||||
|
android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
|
||||||
|
</vector>
|
||||||
9
app/src/main/res/drawable/ic_filter_list_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="#FFFFFFFF"
|
||||||
|
android:pathData="M10,18h4v-2h-4v2zM3,6v2h18L21,6L3,6zM6,13h12v-2L6,11v2z"/>
|
||||||
|
</vector>
|
||||||
12
app/src/main/res/drawable/ic_menu_camera.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
|
||||||
|
</vector>
|
||||||
9
app/src/main/res/drawable/ic_menu_gallery.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z" />
|
||||||
|
</vector>
|
||||||
9
app/src/main/res/drawable/ic_menu_manage.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M22.7,19l-9.1,-9.1c0.9,-2.3 0.4,-5 -1.5,-6.9 -2,-2 -5,-2.4 -7.4,-1.3L9,6 6,9 1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1c1.9,1.9 4.6,2.4 6.9,1.5l9.1,9.1c0.4,0.4 1,0.4 1.4,0l2.3,-2.3c0.5,-0.4 0.5,-1.1 0.1,-1.4z" />
|
||||||
|
</vector>
|
||||||
9
app/src/main/res/drawable/ic_menu_send.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z" />
|
||||||
|
</vector>
|
||||||
9
app/src/main/res/drawable/ic_menu_share.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z" />
|
||||||
|
</vector>
|
||||||
9
app/src/main/res/drawable/ic_menu_slideshow.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z" />
|
||||||
|
</vector>
|
||||||
9
app/src/main/res/drawable/ic_search_black_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="#FF000000"
|
||||||
|
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
|
||||||
|
</vector>
|
||||||
9
app/src/main/res/drawable/side_nav_bar.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="135"
|
||||||
|
android:centerColor="#4CAF50"
|
||||||
|
android:endColor="#2E7D32"
|
||||||
|
android:startColor="#81C784"
|
||||||
|
android:type="linear" />
|
||||||
|
</shape>
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/accettazione_main_list_group_clienti_comm"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_toLeftOf="@+id/accettazione_main_list_group_clienti_datacons"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:text="TextView" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/accettazione_main_list_group_clienti_datacons"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="TextView" />
|
||||||
|
</RelativeLayout>
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout 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:padding="8dp">
|
||||||
|
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/accettazione_main_list_group_item_container_checkBox"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
tools:layout_editor_absoluteX="0dp"
|
||||||
|
tools:layout_editor_absoluteY="1dp" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_toRightOf="@id/accettazione_main_list_group_item_container_checkBox">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/accettazione_main_list_group_item_container_testata_ord"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Ord. Acq. 39 del 27 ott 2017"
|
||||||
|
android:textColor="#000" />
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/accettazione_main_list_group_item_container_clienti_ord"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/accettazione_main_list_group_item_container_testata_ord"
|
||||||
|
android:orientation="vertical">
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
60
app/src/main/res/layout/accettazione_main_list_model.xml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:id="@+id/card_view"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
card_view:cardUseCompatPadding="true"
|
||||||
|
card_view:cardCornerRadius="4dp"
|
||||||
|
card_view:cardElevation="4dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/mainGreen"
|
||||||
|
android:padding="8dp">
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:checked="true"
|
||||||
|
android:enabled="false" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/accettazione_main_list_group_header"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
style="@android:style/TextAppearance.Medium"
|
||||||
|
android:text="NOME GRUPPO"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:id="@+id/accettazione_main_list_group_item_container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<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">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/mainGreen"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/accettazione_ordine_inevaso_main_list_descrArtFor"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="XXX - DESCR ART FORNITORE"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
style="@android:style/TextAppearance.Medium" />
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/white"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:id="@+id/accettazione_ordine_inevaso_main_list_group_item_container"> </LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
@ -0,0 +1,100 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:padding="8dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/accettazione_ordine_inevaso_main_list_group_item_badge1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="BADGE 1"
|
||||||
|
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"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/accettazione_ordine_inevaso_main_list_group_item_badge2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="BADGE 2"
|
||||||
|
android:background="@drawable/badge2_round_corner"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:paddingLeft="6dp"
|
||||||
|
android:paddingRight="6dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="right">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@color/green_700"
|
||||||
|
style="@android:style/TextAppearance.Medium"
|
||||||
|
android:text="@string/dispatched"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
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:textStyle="bold"
|
||||||
|
android:textColor="@color/green_700"
|
||||||
|
style="@android:style/TextAppearance.Medium"
|
||||||
|
android:text="QTA"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
style="@android:style/TextAppearance.Medium"
|
||||||
|
android:text=" / "/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/accettazione_ordine_inevaso_main_list_group_item_qta_tot"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
style="@android:style/TextAppearance.Medium"
|
||||||
|
android:text="QTA"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/accettazione_ordine_inevaso_main_list_group_item_descrizione"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
style="@android:style/TextAppearance.Medium"
|
||||||
|
android:text="DESCRIZIONE"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context="it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.AccettazioneOrdineInevasoActivity">
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:theme="@style/AppTheme.AppBarOverlay"
|
||||||
|
android:id="@+id/appbarlayout">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay">
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/accettazione_ordine_main_list"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:scrollbars="vertical"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/appbarlayout"
|
||||||
|
app:layout_constraintWidth_default="spread" />
|
||||||
|
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
25
app/src/main/res/layout/activity_main.xml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/drawer_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
tools:openDrawer="start">
|
||||||
|
|
||||||
|
<include
|
||||||
|
layout="@layout/app_bar_main"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
<android.support.design.widget.NavigationView
|
||||||
|
android:id="@+id/nav_view"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="start"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
app:headerLayout="@layout/nav_header_main"
|
||||||
|
app:menu="@menu/activity_main_drawer" />
|
||||||
|
|
||||||
|
</android.support.v4.widget.DrawerLayout>
|
||||||
36
app/src/main/res/layout/app_bar_main.xml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context="it.integry.integrywmsnative.MainActivity">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
|
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
android:id="@+id/toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay">
|
||||||
|
|
||||||
|
<android.support.v7.widget.SearchView
|
||||||
|
android:id="@+id/main_search"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:iconifiedByDefault="true"
|
||||||
|
app:defaultQueryHint="@string/search"
|
||||||
|
app:iconifiedByDefault="true"
|
||||||
|
android:layout_gravity="right"/>
|
||||||
|
|
||||||
|
</android.support.v7.widget.Toolbar>
|
||||||
|
|
||||||
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
|
<include layout="@layout/content_main" />
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
16
app/src/main/res/layout/content_main.xml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?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"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
tools:context="it.integry.integrywmsnative.MainActivity"
|
||||||
|
tools:showIn="@layout/app_bar_main">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/frame_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
||||||
25
app/src/main/res/layout/dialog_custom_header.xml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical" android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
android:id="@+id/llsubhead"
|
||||||
|
android:background="@color/colorPrimary">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/exemptionSubHeading4"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="Exemption Sub Head"
|
||||||
|
android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
|
||||||
|
android:textColor="@android:color/white" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
28
app/src/main/res/layout/fragment_main_accettazione.xml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
tools:context="it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/accettazione_main_list"
|
||||||
|
android:scrollbars="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/accettazione_main_fab"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom|end"
|
||||||
|
android:layout_margin="@dimen/fab_margin"
|
||||||
|
android:tint="@android:color/white"
|
||||||
|
app:srcCompat="@drawable/ic_check_black_24dp" />
|
||||||
|
</FrameLayout>
|
||||||
35
app/src/main/res/layout/nav_header_main.xml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout 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="@dimen/nav_header_height"
|
||||||
|
android:background="@drawable/side_nav_bar"
|
||||||
|
android:gravity="bottom"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||||
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
|
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
||||||
|
app:srcCompat="@android:drawable/sym_def_app_icon" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="@dimen/nav_header_vertical_spacing"
|
||||||
|
android:text="Android Studio"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="android.studio@android.com" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
11
app/src/main/res/layout/switch_item.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_centerVertical="true" />
|
||||||
|
</RelativeLayout>
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_filter"
|
||||||
|
android:icon="@drawable/ic_filter_list_24dp"
|
||||||
|
android:title="@string/action_orderBy"
|
||||||
|
app:showAsAction="ifRoom"/>
|
||||||
|
</menu>
|
||||||
36
app/src/main/res/menu/activity_main_drawer.xml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<group android:checkableBehavior="single">
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_accettazione"
|
||||||
|
android:icon="@drawable/ic_menu_camera"
|
||||||
|
android:title="Accettazione" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_gallery"
|
||||||
|
android:icon="@drawable/ic_menu_gallery"
|
||||||
|
android:title="Gallery" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_slideshow"
|
||||||
|
android:icon="@drawable/ic_menu_slideshow"
|
||||||
|
android:title="Slideshow" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_manage"
|
||||||
|
android:icon="@drawable/ic_menu_manage"
|
||||||
|
android:title="Tools" />
|
||||||
|
</group>
|
||||||
|
|
||||||
|
<item android:title="Communicate">
|
||||||
|
<menu>
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_share"
|
||||||
|
android:icon="@drawable/ic_menu_share"
|
||||||
|
android:title="Share" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_send"
|
||||||
|
android:icon="@drawable/ic_menu_send"
|
||||||
|
android:title="Send" />
|
||||||
|
</menu>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</menu>
|
||||||
9
app/src/main/res/menu/main.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<!--<item-->
|
||||||
|
<!--android:id="@+id/action_settings"-->
|
||||||
|
<!--android:orderInCategory="100"-->
|
||||||
|
<!--android:title="@string/action_settings"-->
|
||||||
|
<!--app:showAsAction="never" />-->
|
||||||
|
</menu>
|
||||||
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 9.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 10 KiB |