New version

This commit is contained in:
quique 2018-12-10 08:37:41 +01:00
parent c7093c679f
commit 51fbb0f2ae
409 changed files with 7148 additions and 7832 deletions

4
Android-CleanArchitecture.iml → REPARTO.iml Executable file → Normal file
View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="Android-CleanArchitecture" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<module external.linked.project.id="REPARTO" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
@ -13,7 +13,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

1
app/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

183
app/app.iml Normal file
View File

@ -0,0 +1,183 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":app" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<afterSyncTasks>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<output url="file://$MODULE_DIR$/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes" />
<output-test url="file://$MODULE_DIR$/build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/not_namespaced_r_class_sources/debugAndroidTest/processDebugAndroidTestResources/r" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/.DS_Store" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotation_processor_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/apk_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/build-info" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-libraries" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/checkDebugClasspath" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/checkReleaseClasspath" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/compatible_screen_manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-apk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_split_apk_resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javac" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint_jar" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifest-checker" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/processed_res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shader_assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/split-apk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/split_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 28 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Gradle: com.android.support:localbroadcastmanager-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-vector-drawable-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.simplify:ink-1.0.2" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:interpolator-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-core-utils-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:drawerlayout-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:coordinatorlayout-28.0.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.squareup:javawriter:2.1.1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support.constraint:constraint-layout-1.1.3" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:swiperefreshlayout-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:livedata-1.1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: javax.inject:javax.inject:1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:versionedparcelable-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.retrofit2:retrofit:2.3.0@jar" level="project" />
<orderEntry type="library" name="Gradle: android.arch.core:runtime-1.1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test:monitor-1.0.2" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:loader-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okhttp3:okhttp:3.8.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.retrofit2:converter-gson:2.0.2@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:viewpager-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-annotations:28.0.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support.constraint:constraint-layout-solver:1.1.3@jar" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:runtime-1.1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: net.sf.kxml:kxml2:2.3.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:customview-28.0.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test:runner-1.0.2" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.retrofit2:converter-scalars:2.3.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-core-ui-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.squareup.okio:okio:1.13.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:slidingpanelayout-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:viewmodel-1.1.1" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:collections:28.0.0@jar" level="project" />
<orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.6.1@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:documentfile-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:recyclerview-v7-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:cursoradapter-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:asynclayoutinflater-28.0.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.google.code.findbugs:jsr305:2.0.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test.espresso:espresso-core-3.0.2" level="project" />
<orderEntry type="library" name="Gradle: android.arch.core:common:1.1.1@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: junit:junit:4.12@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-core:1.3@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:print-28.0.0" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: com.android.support.test.espresso:espresso-idling-resource-3.0.2" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-integration:1.3@jar" level="project" />
<orderEntry type="library" scope="TEST" name="Gradle: org.hamcrest:hamcrest-library:1.3@jar" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-fragment-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:common:1.1.1@jar" level="project" />
<orderEntry type="library" name="Gradle: android.arch.lifecycle:livedata-core-1.1.1" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:support-compat-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:animated-vector-drawable-28.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.android.support:appcompat-v7-28.0.0" level="project" />
</component>
</module>

33
app/build.gradle Normal file
View File

@ -0,0 +1,33 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "verdnatura.es.repartoverdnatura"
minSdkVersion 19
targetSdkVersion 28
versionCode 2
versionName "1.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation 'com.simplify:ink:1.0.2'
}

21
app/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

1
app/release/output.json Normal file
View File

@ -0,0 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":2,"versionName":"1.2","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

BIN
app/release/vndelivery.apk Normal file

Binary file not shown.

View File

@ -0,0 +1,26 @@
package verdnatura.es.repartoverdnatura;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("verdnatura.es.repartoverdnatura", appContext.getPackageName());
}
}

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="verdnatura.es.repartoverdnatura">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="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=".LoginActivity"
android:configChanges="orientation"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
<activity android:name=".MainActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
<activity android:name=".Tickets"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
<activity android:name=".SignActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
<activity android:name=".InfoActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
<activity android:name=".ConfigureActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
<activity android:name=".LoadersActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
<activity android:name=".NoteActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"></activity>
<receiver android:name=".NetworkStateReveiver">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
</application>
</manifest>

View File

@ -0,0 +1,148 @@
package verdnatura.es.repartoverdnatura.ADAPTERS;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.List;
import verdnatura.es.repartoverdnatura.MODELS.ClientTickets;
import verdnatura.es.repartoverdnatura.MODELS.Cliente;
import verdnatura.es.repartoverdnatura.MODELS.Ticket;
import verdnatura.es.repartoverdnatura.R;
import verdnatura.es.repartoverdnatura.Tickets;
public class ClientAdapter extends ArrayAdapter<ClientTickets> {
public ClientAdapter(Context context, List<ClientTickets> clientes) {
super(context,0,clientes);
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
ClientTickets clientes = getItem(position);
if (convertView == null){
convertView = LayoutInflater.from(getContext()).inflate(R.layout.row_ticket,parent,false);
}
TextView txtCliente = convertView.findViewById(R.id.textView21);
TextView txtConsignatorio = convertView.findViewById(R.id.textView17);
TextView txtTienda = convertView.findViewById(R.id.textView25);
TextView txtCalle = convertView.findViewById(R.id.textView24);
TextView txtPC = convertView.findViewById(R.id.textView27);
TextView txtCiudad = convertView.findViewById(R.id.textView26);
TextView txtNote = convertView.findViewById(R.id.txtNote);
txtCliente.setText(clientes.getClient());
txtConsignatorio.setText(clientes.getAddress());
txtTienda.setText(clientes.getClientName());
txtCalle.setText(clientes.getAddressName());
txtPC.setText(clientes.getPostalCode());
txtCiudad.setText(clientes.getCity());
/*if(clientes.getNote()!= null ){
txtNote.setText(clientes.getNote());
txtNote.setVisibility(View.VISIBLE);
}else{
txtNote.setVisibility(View.GONE);
}*/
LayoutInflater vi = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout viewTickets = convertView.findViewById(R.id.layoutTickets);
viewTickets.removeAllViews();
View v;
for (int i =0; i < clientes.getTickets().size();i++){
v = vi.inflate(R.layout.row_sub_ticket,null);
TextView txtTicket = v.findViewById(R.id.textView29);
TextView txtPackage = v.findViewById(R.id.textView31);
TextView txtWarehouse = v.findViewById(R.id.textView33);
ImageView btnPolizon = v.findViewById(R.id.btnPolizon);
txtTicket.setText(clientes.getTickets().get(i).get("Id"));
txtPackage.setText(clientes.getTickets().get(i).get("Packages"));
txtWarehouse.setText(clientes.getTickets().get(i).get("Warehouse"));
if(clientes.getTickets().get(i).get("Polizon") != null){
final int posTicket = i;
btnPolizon.setVisibility(View.VISIBLE);
btnPolizon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(getContext() instanceof Tickets){
((Tickets) getContext()).showPolizon(position,posTicket);
}
}
});
}else{
btnPolizon.setVisibility(View.GONE);
}
//rellenamos datos
viewTickets.addView(v);
}
ImageView btnPhone = convertView.findViewById(R.id.imageView4);
ImageView btnMap = convertView.findViewById(R.id.imageView5);
ImageView btnSign = convertView.findViewById(R.id.imageView6);
ImageView btnNote = convertView.findViewById(R.id.imageView7);
LinearLayout lyNote = convertView.findViewById(R.id.btnNote);
ImageView btnAddNote = convertView.findViewById(R.id.imageView9);
if (clientes.getNote() != null && clientes.getNote().length()>0){
lyNote.setVisibility(View.VISIBLE);
}else{
lyNote.setVisibility(View.GONE);
}
btnPhone.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(getContext() instanceof Tickets){
((Tickets) getContext()).showPhones(position);
}
}
});
btnMap.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(getContext() instanceof Tickets){
((Tickets) getContext()).goMaps(position);
}
}
});
btnSign.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(getContext() instanceof Tickets){
((Tickets) getContext()).goSign(position);
}
}
});
btnNote.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(getContext() instanceof Tickets){
((Tickets) getContext()).showNote(position);
}
}
});
btnAddNote.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(getContext() instanceof Tickets){
((Tickets) getContext()).goToNotes(position);
}
}
});
return convertView;
}
}

View File

@ -0,0 +1,50 @@
package verdnatura.es.repartoverdnatura.ADAPTERS;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import org.w3c.dom.Text;
import java.util.List;
import verdnatura.es.repartoverdnatura.MODELS.SignDataUpload;
import verdnatura.es.repartoverdnatura.MODELS.Ticket;
import verdnatura.es.repartoverdnatura.MainActivity;
import verdnatura.es.repartoverdnatura.R;
public class PendingTickets extends ArrayAdapter<SignDataUpload> {
public PendingTickets(Context context, List<SignDataUpload> signs) {
super(context,0,signs);
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
SignDataUpload sign = getItem(position);
if (convertView == null){
convertView = LayoutInflater.from(getContext()).inflate(R.layout.ticket_pending_row,parent,false);
}
TextView txtIdCliente = convertView.findViewById(R.id.txtIdCliente);
TextView txtNameCliente = convertView.findViewById(R.id.txtNameCliente);
txtIdCliente.setText(sign.getIdClient());
txtNameCliente.setText(sign.getClientName());
convertView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (getContext() instanceof MainActivity) {
((MainActivity) getContext()).savePending(position);
}
}
});
return convertView;
}
}

View File

@ -0,0 +1,60 @@
package verdnatura.es.repartoverdnatura.ADAPTERS;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.List;
import verdnatura.es.repartoverdnatura.R;
import verdnatura.es.repartoverdnatura.Tickets;
public class PhonesAdapter extends ArrayAdapter<String> {
private DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
public List<String> phones;
public PhonesAdapter(Context context, List<String> phones) {
super(context,0,phones);
this.phones = phones;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
final String phone = getItem(position);
if (convertView == null){
convertView = LayoutInflater.from(getContext()).inflate(R.layout.phone_row,parent,false);
}
TextView txtTitulo = convertView.findViewById(R.id.txtTitulo);
TextView txtPhone = convertView.findViewById(R.id.txtPhone);
if(position < (phones.size() - 1)){
txtTitulo.setText(getContext().getResources().getString(R.string.telefono)+" "+(position+1));
}else{
txtTitulo.setText(getContext().getResources().getString(R.string.comercial));
}
txtPhone.setText(phone);
convertView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if(getContext() instanceof Tickets){
((Tickets) getContext()).llamarTelefono(phone);
}
return false;
}
});
return convertView;
}
}

View File

@ -0,0 +1,93 @@
package verdnatura.es.repartoverdnatura.ADAPTERS;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.List;
import verdnatura.es.repartoverdnatura.MODELS.Ruta;
import verdnatura.es.repartoverdnatura.MainActivity;
import verdnatura.es.repartoverdnatura.R;
import verdnatura.es.repartoverdnatura.UTILS.LocalStorage;
public class RutaAdapter extends ArrayAdapter<Ruta> {
private DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
public RutaAdapter(Context context, List<Ruta> rutas) {
super(context,0,rutas);
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
Ruta ruta = getItem(position);
if (ruta.getHeader()){
convertView = LayoutInflater.from(getContext()).inflate(R.layout.header_route,parent,false);
TextView txtHour = convertView.findViewById(R.id.textView16);
try {
txtHour.setText(new SimpleDateFormat("dd/MM/yyyy").format(format.parse(ruta.getDate())));
}catch (Exception e){
}
}else{
convertView = LayoutInflater.from(getContext()).inflate(R.layout.row_route,parent,false);
TextView txtIdRuta = convertView.findViewById(R.id.textView11);
TextView txtZona = convertView.findViewById(R.id.textView8);
TextView txtPalete = convertView.findViewById(R.id.textView12);
TextView txtM3 = convertView.findViewById(R.id.txtM3);
TextView txtHour = convertView.findViewById(R.id.textView15);
LinearLayout btnShow = convertView.findViewById(R.id.linearLayout);
TextView btnCargador = convertView.findViewById(R.id.btnCargadores);
TextView txtOnline = convertView.findViewById(R.id.txtOnline);
ImageView imgNoWeb = convertView.findViewById(R.id.imageView10);
txtIdRuta.setText(ruta.getId());
txtZona.setText(ruta.getAgency());
txtPalete.setText(ruta.getPlate());
txtM3.setText(ruta.getM3());
txtHour.setText(ruta.getHour());
btnShow.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (getContext() instanceof MainActivity) {
((MainActivity) getContext()).onRouteSelected(position);
}
}
});
btnCargador.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (getContext() instanceof MainActivity) {
((MainActivity) getContext()).goToLoaders(position);
}
}
});
if (LocalStorage.isOfflineAviable(getContext(),ruta.getId())){
txtOnline.setText(getContext().getResources().getString(R.string.disponible_offline));
txtOnline.setTextColor(getContext().getResources().getColor(R.color.colorGreen));
imgNoWeb.setVisibility(View.GONE);
}else{
txtOnline.setText(getContext().getResources().getString(R.string.no_disponible));
txtOnline.setTextColor(getContext().getResources().getColor(R.color.colorGray));
imgNoWeb.setVisibility(View.VISIBLE);
}
}
return convertView;
}
}

View File

@ -0,0 +1,122 @@
package verdnatura.es.repartoverdnatura.ADAPTERS;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.LinearLayout;
import android.widget.TextView;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import verdnatura.es.repartoverdnatura.LoadersActivity;
import verdnatura.es.repartoverdnatura.MODELS.Worker;
import verdnatura.es.repartoverdnatura.R;
public class WorkerAdapter extends ArrayAdapter<Worker> implements Filterable {
private DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
List<Worker> workers;
List<Worker> allWorkers;
public WorkerAdapter(Context context, List<Worker> workers) {
super(context,0,workers);
this.workers = workers;
this.allWorkers = workers;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
final Worker worker = getItem(position);
convertView = LayoutInflater.from(getContext()).inflate(R.layout.row_worker,parent,false);
TextView txtId = convertView.findViewById(R.id.textView11);
TextView txtFullName = convertView.findViewById(R.id.textView8);
TextView txtWorkerCode = convertView.findViewById(R.id.textView13);
TextView txtName = convertView.findViewById(R.id.txtCity);
LinearLayout layerSelected = convertView.findViewById(R.id.layerSelected);
if (worker.getSelected()){
layerSelected.setBackgroundColor(getContext().getResources().getColor(R.color.colorPrimary));
}else{
layerSelected.setBackgroundColor(getContext().getResources().getColor(R.color.colorMainBg));
}
txtId.setText(worker.getId());
txtFullName.setText(worker.getFullName());
txtWorkerCode.setText(worker.getWorkerCode());
txtName.setText(worker.getName());
convertView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (getContext() instanceof LoadersActivity){
((LoadersActivity) getContext()).setSelectedWorker(worker);
}
}
});
return convertView;
}
@Override
public int getCount() {
return workers.size();
}
@Override
public Worker getItem(int position) {
return workers.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
public List<Worker> getAllWorkers(){
return allWorkers;
}
@Override
public Filter getFilter() {
Filter filter = new Filter() {
@SuppressWarnings("unchecked")
@Override
protected void publishResults(CharSequence constraint, FilterResults results) {
workers = (List<Worker>) results.values;
notifyDataSetChanged();
}
@Override
protected FilterResults performFiltering(CharSequence constraint) {
FilterResults results = new FilterResults();
ArrayList<Worker> FilteredArrayNames = new ArrayList<>();
constraint = constraint.toString().toLowerCase();
for (int i = 0; i < allWorkers.size(); i++) {
String dataNames = allWorkers.get(i).getFullName();
String dataCode = allWorkers.get(i).getWorkerCode();
if (dataNames.toLowerCase().contains(constraint.toString()) || dataCode.toLowerCase().contains(constraint.toString())) {
FilteredArrayNames.add(allWorkers.get(i));
}
}
results.count = FilteredArrayNames.size();
results.values = FilteredArrayNames;
Log.e("VALUES", results.values.toString());
return results;
}
};
return filter;
}
}

View File

@ -0,0 +1,156 @@
package verdnatura.es.repartoverdnatura;
import android.app.Activity;
import android.app.TimePickerDialog;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.TimePicker;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import verdnatura.es.repartoverdnatura.INTERFACES.RestClient;
import verdnatura.es.repartoverdnatura.MODELS.Ruta;
import verdnatura.es.repartoverdnatura.UTILS.ApiUtils;
import verdnatura.es.repartoverdnatura.UTILS.Utils;
public class ConfigureActivity extends AppCompatActivity {
private TextView txtTitle;
private EditText txtKmStart,txtKmFinish,txtHourStart,txtHourFinish;
public Ruta route;
private RestClient restClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
restClient = ApiUtils.getAPIService();
Intent intent = this.getIntent();
Bundle bundle = intent.getExtras();
route = (Ruta) bundle.getSerializable("route");
setContentView(R.layout.activity_configure);
setViews();
setEvents();
}
private void setViews(){
txtTitle = findViewById(R.id.textView19);
txtTitle.setText(route.getAgency());
txtKmStart = findViewById(R.id.editText);
txtKmStart.setText(route.getKmStart());
txtKmFinish = findViewById(R.id.editText1);
txtKmFinish.setText(route.getKmEnd());
txtHourStart = findViewById(R.id.editText12);
txtHourStart.setText(getHour(route.getdStart()));
txtHourFinish = findViewById(R.id.editText123);
txtHourFinish.setText(getHour(route.getdEnd()));
}
private void setEvents(){
txtHourStart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
TimePickerDialog mTimePicker;
Calendar mcurrentTime = Calendar.getInstance();
int hour = mcurrentTime.get(Calendar.HOUR_OF_DAY);
int minute = mcurrentTime.get(Calendar.MINUTE);
mTimePicker = new TimePickerDialog(ConfigureActivity.this, new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
txtHourStart.setText( selectedHour + ":" + selectedMinute);
}
}, hour, minute, true);//Yes 24 hour time
mTimePicker.setTitle("Select Time");
mTimePicker.show();
}
});
txtHourFinish.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
TimePickerDialog mTimePicker;
Calendar mcurrentTime = Calendar.getInstance();
int hour = mcurrentTime.get(Calendar.HOUR_OF_DAY);
int minute = mcurrentTime.get(Calendar.MINUTE);
mTimePicker = new TimePickerDialog(ConfigureActivity.this, new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
txtHourFinish.setText( selectedHour + ":" + selectedMinute);
}
}, hour, minute, true);//Yes 24 hour time
mTimePicker.setTitle("Select Time");
mTimePicker.show();
}
});
}
private String getHour(String date) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar cal = Calendar.getInstance();
try {
cal.setTime(format.parse(date));
DecimalFormat f = new DecimalFormat("00");
return ""+f.format(cal.get(Calendar.HOUR_OF_DAY))+":"+f.format(cal.get(Calendar.MINUTE));
} catch (ParseException e) {
e.printStackTrace();
return "00:00";
}
}
public void sendConfig(View v){
Utils.progressBar.show(this,getResources().getString(R.string.please_wait));
final ConfigureActivity that = this;
Object[] args = new Object[5];
args[0] = route.getId();
args[1] = txtKmStart.getText().toString().trim();
args[2] = txtKmFinish.getText().toString().trim();
args[3] = txtHourStart.getText().toString().trim();
args[4] = txtHourFinish.getText().toString().trim();
restClient.saveConfig(Utils.getMapWhitUser(this),args).enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
Utils.progressBar.getDialog().dismiss();
if(response.isSuccessful()){
if (response.body().equals("Finish")){
Log.i("INFO","guardado");
Intent returnIntent = new Intent();
route.setKmStart(txtKmStart.getText().toString().trim());
route.setKmEnd(txtKmFinish.getText().toString().trim());
route.setdStart("2019-03-09 "+txtHourStart.getText().toString().trim()+":00");
route.setdEnd("2019-03-09 "+txtHourFinish.getText().toString().trim()+":00");
returnIntent.putExtra("route",route);
setResult(Activity.RESULT_OK,returnIntent);
finish();
}else{
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
}else{
Log.i("ERROR","error al guardar");
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
}
@Override
public void onFailure(Call<String> call, Throwable t) {
Utils.progressBar.getDialog().dismiss();
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
});
}
}

View File

@ -0,0 +1,44 @@
package verdnatura.es.repartoverdnatura.INTERFACES;
import java.util.List;
import java.util.Map;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.HeaderMap;
import retrofit2.http.POST;
import verdnatura.es.repartoverdnatura.MODELS.Cliente;
import verdnatura.es.repartoverdnatura.MODELS.Ruta;
import verdnatura.es.repartoverdnatura.MODELS.Version;
import verdnatura.es.repartoverdnatura.MODELS.Worker;
public interface RestClient {
@POST("/security/login")
Call<String> login(@HeaderMap Map<String,String> headers, @Body String[] userData);
@POST("/security/getVersion")
Call<Version> getVersion(@HeaderMap Map<String,String> headers, @Body String[] userData);
@POST("/delivery/get_routes")
Call<List<Ruta>> getRoutes(@HeaderMap Map<String,String> headers);
@POST("/delivery/get_tickets")
Call<List<Cliente>> getClients(@HeaderMap Map<String,String> headers, @Body String[] route);
@POST("/delivery/save_sign")
Call<String> saveSign(@HeaderMap Map<String,String> headers,@Body Object[] args);
@POST("/delivery/update_routes")
Call<String> saveConfig(@HeaderMap Map<String,String> headers,@Body Object[] args);
@POST("/delivery/getWorkers")
Call<List<Worker>> getWorkers(@HeaderMap Map<String,String> headers);
@POST("/delivery/saveLoadersWorkers")
Call<String> saveLoadersWorkers(@HeaderMap Map<String,String> headers,@Body Object[] args);
@POST("/delivery/addNote")
Call<String> addNote(@HeaderMap Map<String,String> headers,@Body Object[] args);
}

View File

@ -0,0 +1,13 @@
package verdnatura.es.repartoverdnatura;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class InfoActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_info);
}
}

View File

@ -0,0 +1,196 @@
package verdnatura.es.repartoverdnatura;
import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Stream;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import verdnatura.es.repartoverdnatura.ADAPTERS.RutaAdapter;
import verdnatura.es.repartoverdnatura.ADAPTERS.WorkerAdapter;
import verdnatura.es.repartoverdnatura.INTERFACES.RestClient;
import verdnatura.es.repartoverdnatura.MODELS.Ruta;
import verdnatura.es.repartoverdnatura.MODELS.Worker;
import verdnatura.es.repartoverdnatura.MODELS.WorkerSave;
import verdnatura.es.repartoverdnatura.UTILS.ApiUtils;
import verdnatura.es.repartoverdnatura.UTILS.Utils;
public class LoadersActivity extends AppCompatActivity {
private ListView workersListView;
private ArrayList<Worker> listWorkers = new ArrayList<>();
private ArrayList<Worker> listWorkersSelected = new ArrayList<>();
private ArrayList<Worker> listWorkersNoSelected = new ArrayList<>();
private WorkerAdapter adapter;
private TextView txtTotal;
private EditText txtWorker;
private RestClient restClient;
public String idRoute = "0";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_loaders);
restClient = ApiUtils.getAPIService();
Intent intent = this.getIntent();
Bundle bundle = intent.getExtras();
idRoute = bundle.getString("idRoute");
setViews();
getWorkers();
setEvents();
}
private void setViews(){
workersListView = findViewById(R.id.listWorkers);
txtTotal = findViewById(R.id.textView38);
txtWorker = findViewById(R.id.editText2);
}
private void setEvents(){
txtWorker.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
Log.i("Worker",txtWorker.getText().toString());
filterList();
}
});
}
public void filterList(){
this.adapter.getFilter().filter(txtWorker.getText());
}
private void getWorkers(){
listWorkers = new ArrayList<>();
final LoadersActivity that = this;
Utils.progressBar.show(this,getResources().getString(R.string.please_wait));
restClient.getWorkers(Utils.getMapWhitUser(this)).enqueue(new Callback<List<Worker>>() {
@Override
public void onResponse(Call<List<Worker>> call, Response<List<Worker>> response) {
Utils.progressBar.getDialog().dismiss();
if (response.isSuccessful()){
for (Worker w : response.body()){
if(w.getRouteLoader() != null && w.getRouteLoader().equals(idRoute)){
w.setSelected(true);
listWorkersSelected.add(w);
}else{
if(w.getRouteLoader() == null){
w.setSelected(false);
listWorkersNoSelected.add(w);
}
}
}
listWorkers.addAll(listWorkersSelected);
listWorkers.addAll(listWorkersNoSelected);
adapter = new WorkerAdapter(that,listWorkers);
workersListView.setAdapter(adapter);
txtTotal.setText(""+getSelecteds()+" "+getResources().getString(R.string.seleccionados));
}else{
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
}
@Override
public void onFailure(Call<List<Worker>> call, Throwable t) {
Utils.progressBar.getDialog().dismiss();
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
});
}
public void setSelectedWorker(Worker worker){
int pos = 0;
for (Worker w : listWorkers){
if (worker == w){
break;
}
pos+=1;
}
listWorkers.get(pos).setSelected(!listWorkers.get(pos).getSelected());
adapter.notifyDataSetChanged();
txtTotal.setText(""+getSelecteds()+" "+getResources().getString(R.string.seleccionados));
}
private int getSelecteds(){
int count = 0;
for(Worker w : listWorkers){
if (w.getSelected()) count += 1;
}
return count;
}
public void saveWorkers(View v){
Utils.progressBar.show(this,getResources().getString(R.string.please_wait));
final LoadersActivity that = this;
ArrayList<String> workersId = new ArrayList<>();
for (Worker w:listWorkers){
if (w.getSelected()){
workersId.add(w.getId());
}
}
WorkerSave ws = new WorkerSave(idRoute,workersId);
Object[] args = new Object[1];
args[0] = ws;
restClient.saveLoadersWorkers(Utils.getMapWhitUser(this),args).enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
Utils.progressBar.getDialog().dismiss();
if(response.isSuccessful()){
if (response.body().equals("Finish")){
finish();
}else{
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
}else{
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
}
@Override
public void onFailure(Call<String> call, Throwable t) {
Utils.progressBar.getDialog().dismiss();
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
});
}
public void orderWorkers(){
}
}

View File

@ -0,0 +1,110 @@
package verdnatura.es.repartoverdnatura;
import android.app.AlertDialog;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.InputType;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.util.Log;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import java.util.HashMap;
import java.util.Map;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import verdnatura.es.repartoverdnatura.INTERFACES.RestClient;
import verdnatura.es.repartoverdnatura.UTILS.ApiUtils;
import verdnatura.es.repartoverdnatura.UTILS.CustomProgressBar;
import verdnatura.es.repartoverdnatura.UTILS.Utils;
public class LoginActivity extends AppCompatActivity {
private RestClient restClient;
private EditText txtUser,txtPassword;
private CheckBox checkVerPass;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
restClient = ApiUtils.getAPIService();
setViews();
setEvents();
checkUser();
}
private void checkUser(){
if (!Utils.getIdUser(this).equals("nouser")){
startActivity(new Intent(this,MainActivity.class));
}
}
private void setViews(){
txtUser = findViewById(R.id.txtUsuario);
txtPassword = findViewById(R.id.txtPassword);
checkVerPass = findViewById(R.id.checkVerPass);
}
private void setEvents(){
checkVerPass.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
if(!isChecked){
txtPassword.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
}else{
txtPassword.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
}
}
});
}
public void logIn(View v){
Utils.progressBar.show(this,"Check user");
final String user = txtUser.getText().toString();
final String password = txtPassword.getText().toString();
String[] userData = new String[2];
final LoginActivity that = this;
restClient.login(Utils.getMap(user,password),userData).enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
Utils.progressBar.getDialog().dismiss();
if(response.isSuccessful()){
Log.i("API","Respuesta: "+response.body());
Utils.saveIdUser(that,response.body());
Utils.saveUserPass(that,user,password);
startActivity(new Intent(that,MainActivity.class));
txtUser.setText("");
txtPassword.setText("");
}else{
Utils.showErrorDialog(that,that.getResources().getString(R.string.usuario_incorrecto));
Log.e("API", "Response is not successful "+response.message());
}
}
@Override
public void onFailure(Call<String> call, Throwable t) {
Utils.progressBar.getDialog().dismiss();
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
});
}
public void showPassword(View v){
txtPassword.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
}
}

View File

@ -0,0 +1,149 @@
package verdnatura.es.repartoverdnatura.MODELS;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Map;
public class ClientTickets implements Serializable {
private String Client,ClientName,Address,AddressName,PostalCode,City,SalePersonPhone,Note,Latitude,Longitude,Polizon;
private Boolean Signed;
private ArrayList<String> Phones;
private ArrayList<Map<String,String>> tickets;
public ClientTickets(String client, String clientName, String address, String addressName, String postalCode, String city, String salePersonPhone, String note, String latitude, String longitude, Boolean signed, ArrayList<String> phones, ArrayList<Map<String, String>> tickets,String polizon) {
Client = client;
ClientName = clientName;
Address = address;
AddressName = addressName;
PostalCode = postalCode;
City = city;
SalePersonPhone = salePersonPhone;
Note = note;
Latitude = latitude;
Longitude = longitude;
Signed = signed;
Phones = phones;
this.tickets = tickets;
Polizon = polizon;
}
public String getPolizon() {
return Polizon;
}
public void setPolizon(String polizon) {
Polizon = polizon;
}
public ArrayList<Map<String, String>> getTickets() {
return tickets;
}
public void setTickets(ArrayList<Map<String, String>> tickets) {
this.tickets = tickets;
}
public void addTicket(Map<String,String> values){
tickets.add(values);
}
public String getClient() {
return Client;
}
public void setClient(String client) {
Client = client;
}
public String getClientName() {
return ClientName;
}
public void setClientName(String clientName) {
ClientName = clientName;
}
public String getAddress() {
return Address;
}
public void setAddress(String address) {
Address = address;
}
public String getAddressName() {
return AddressName;
}
public void setAddressName(String addressName) {
AddressName = addressName;
}
public String getPostalCode() {
return PostalCode;
}
public void setPostalCode(String postalCode) {
PostalCode = postalCode;
}
public String getCity() {
return City;
}
public void setCity(String city) {
City = city;
}
public String getSalePersonPhone() {
return SalePersonPhone;
}
public void setSalePersonPhone(String salePersonPhone) {
SalePersonPhone = salePersonPhone;
}
public String getNote() {
return Note;
}
public void setNote(String note) {
Note = note;
}
public String getLatitude() {
return Latitude;
}
public void setLatitude(String latitude) {
Latitude = latitude;
}
public String getLongitude() {
return Longitude;
}
public void setLongitude(String longitude) {
Longitude = longitude;
}
public Boolean getSigned() {
return Signed;
}
public void setSigned(Boolean signed) {
Signed = signed;
}
public ArrayList<String> getPhones() {
return Phones;
}
public void setPhones(ArrayList<String> phones) {
Phones = phones;
}
}

View File

@ -0,0 +1,187 @@
package verdnatura.es.repartoverdnatura.MODELS;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
public class Cliente {
@SerializedName("Id")
private String Id;
@SerializedName("Client")
private String Client;
@SerializedName("ClientName")
private String ClientName;
@SerializedName("Address")
private String Address;
@SerializedName("Packages")
private String Packages;
@SerializedName("AddressName")
private String AddressName;
@SerializedName("PostalCode")
private String PostalCode;
@SerializedName("City")
private String City;
@SerializedName("Warehouse")
private String Warehouse;
@SerializedName("SalePersonPhone")
private String SalePersonPhone;
@SerializedName("Note")
private String Note;
@SerializedName("Phones")
private ArrayList<String> Phones;
@SerializedName("Signed")
private String Signed;
@SerializedName("Latitude")
private String Latitude;
@SerializedName("Longitude")
private String Longitude;
@SerializedName("Polizon")
private String Polizon;
public Cliente(String id, String client, String clientName, String address, String packages, String addressName, String postalCode, String city, String warehouse, String salePersonPhone, String note, ArrayList<String> phones, String signed, String latitude, String longitude, String polizon) {
Id = id;
Client = client;
ClientName = clientName;
Address = address;
Packages = packages;
AddressName = addressName;
PostalCode = postalCode;
City = city;
Warehouse = warehouse;
SalePersonPhone = salePersonPhone;
Note = note;
Phones = phones;
Signed = signed;
Latitude = latitude;
Longitude = longitude;
Polizon = polizon;
}
public String getId() {
return Id;
}
public void setId(String id) {
Id = id;
}
public String getClient() {
return Client;
}
public void setClient(String client) {
Client = client;
}
public String getClientName() {
return ClientName;
}
public void setClientName(String clientName) {
ClientName = clientName;
}
public String getAddress() {
return Address;
}
public void setAddress(String address) {
Address = address;
}
public String getPackages() {
return Packages;
}
public void setPackages(String packages) {
Packages = packages;
}
public String getAddressName() {
return AddressName;
}
public void setAddressName(String addressName) {
AddressName = addressName;
}
public String getPostalCode() {
return PostalCode;
}
public void setPostalCode(String postalCode) {
PostalCode = postalCode;
}
public String getCity() {
return City;
}
public void setCity(String city) {
City = city;
}
public String getWarehouse() {
return Warehouse;
}
public void setWarehouse(String warehouse) {
Warehouse = warehouse;
}
public String getSalePersonPhone() {
return SalePersonPhone;
}
public void setSalePersonPhone(String salePersonPhone) {
SalePersonPhone = salePersonPhone;
}
public String getNote() {
return Note;
}
public void setNote(String note) {
Note = note;
}
public ArrayList<String> getPhones() {
return Phones;
}
public void setPhones(ArrayList<String> phones) {
Phones = phones;
}
public String getSigned() {
return Signed;
}
public void setSigned(String signed) {
Signed = signed;
}
public String getLatitude() {
return Latitude;
}
public void setLatitude(String latitude) {
Latitude = latitude;
}
public String getLongitude() {
return Longitude;
}
public void setLongitude(String longitude) {
Longitude = longitude;
}
public String getPolizon() {
return Polizon;
}
public void setPolizon(String polizon) {
Polizon = polizon;
}
}

View File

@ -0,0 +1,12 @@
package verdnatura.es.repartoverdnatura.MODELS;
public class Location {
public String Longitude,Latitude;
public Location(String longitude, String latitude) {
Longitude = longitude;
Latitude = latitude;
}
}

View File

@ -0,0 +1,14 @@
package verdnatura.es.repartoverdnatura.MODELS;
import java.util.List;
public class NoteSave {
private String note;
private List<String> Tickets;
public NoteSave(String note, List<String> tickets) {
this.note = note;
Tickets = tickets;
}
}

View File

@ -0,0 +1,156 @@
package verdnatura.es.repartoverdnatura.MODELS;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
public class Ruta implements Serializable {
@SerializedName("Id")
private String Id;
@SerializedName("Hour")
private String Hour;
@SerializedName("Date")
private String Date;
@SerializedName("M3")
private String M3;
@SerializedName("Plate")
private String Plate;
@SerializedName("Agency")
private String Agency;
@SerializedName("Driver")
private String Driver;
@SerializedName("kmStart")
private String kmStart;
@SerializedName("kmEnd")
private String kmEnd;
@SerializedName("dStart")
private String dStart;
@SerializedName("dEnd")
private String dEnd;
@SerializedName("Chofer")
private String Chofer;
private Boolean isHeader = false;
public Ruta(String id, String hour, String date, String m3, String plate, String agency, String driver, String kmStart, String kmEnd, String dStart, String dEnd, String chofer) {
Id = id;
Hour = hour;
Date = date;
M3 = m3;
Plate = plate;
Agency = agency;
Driver = driver;
this.kmStart = kmStart;
this.kmEnd = kmEnd;
this.dStart = dStart;
this.dEnd = dEnd;
Chofer = chofer;
}
public Ruta(){}
public Boolean getHeader() {
return isHeader;
}
public void setHeader(Boolean header) {
isHeader = header;
}
public String getId() {
return Id;
}
public void setId(String id) {
Id = id;
}
public String getHour() {
return Hour;
}
public void setHour(String hour) {
Hour = hour;
}
public String getDate() {
return Date;
}
public void setDate(String date) {
Date = date;
}
public String getM3() {
return M3;
}
public void setM3(String m3) {
M3 = m3;
}
public String getPlate() {
return Plate;
}
public void setPlate(String plate) {
Plate = plate;
}
public String getAgency() {
return Agency;
}
public void setAgency(String agency) {
Agency = agency;
}
public String getDriver() {
return Driver;
}
public void setDriver(String driver) {
Driver = driver;
}
public String getKmStart() {
return kmStart;
}
public void setKmStart(String kmStart) {
this.kmStart = kmStart;
}
public String getKmEnd() {
return kmEnd;
}
public void setKmEnd(String kmEnd) {
this.kmEnd = kmEnd;
}
public String getdStart() {
return dStart;
}
public void setdStart(String dStart) {
this.dStart = dStart;
}
public String getdEnd() {
return dEnd;
}
public void setdEnd(String dEnd) {
this.dEnd = dEnd;
}
public String getChofer() {
return Chofer;
}
public void setChofer(String chofer) {
Chofer = chofer;
}
}

View File

@ -0,0 +1,59 @@
package verdnatura.es.repartoverdnatura.MODELS;
import android.location.Location;
import java.util.List;
public class SignDataUpload {
private String Sign;
private List<Integer> Tickets;
private verdnatura.es.repartoverdnatura.MODELS.Location Location;
private String clientName = "";
private String idClient = "";
public SignDataUpload(String sign, List<Integer> tickets, verdnatura.es.repartoverdnatura.MODELS.Location location) {
Sign = sign;
Tickets = tickets;
Location = location;
}
public String getSign() {
return Sign;
}
public void setSign(String sign) {
Sign = sign;
}
public List<Integer> getTickets() {
return Tickets;
}
public void setTickets(List<Integer> tickets) {
Tickets = tickets;
}
public verdnatura.es.repartoverdnatura.MODELS.Location getLocation() {
return Location;
}
public void setLocation(verdnatura.es.repartoverdnatura.MODELS.Location location) {
Location = location;
}
public String getClientName() {
return clientName;
}
public void setClientName(String clientName) {
this.clientName = clientName;
}
public String getIdClient() {
return idClient;
}
public void setIdClient(String idClient) {
this.idClient = idClient;
}
}

View File

@ -0,0 +1,41 @@
package verdnatura.es.repartoverdnatura.MODELS;
public class Ticket {
private String idTicket,txtTitulo,txtDireccion;
public Ticket() {
this.idTicket = "";
this.txtTitulo = "";
this.txtDireccion = "";
}
public Ticket(String idTicket, String txtTitulo, String txtDireccion) {
this.idTicket = idTicket;
this.txtTitulo = txtTitulo;
this.txtDireccion = txtDireccion;
}
public String getIdTicket() {
return idTicket;
}
public void setIdTicket(String idTicket) {
this.idTicket = idTicket;
}
public String getTxtTitulo() {
return txtTitulo;
}
public void setTxtTitulo(String txtTitulo) {
this.txtTitulo = txtTitulo;
}
public String getTxtDireccion() {
return txtDireccion;
}
public void setTxtDireccion(String txtDireccion) {
this.txtDireccion = txtDireccion;
}
}

View File

@ -0,0 +1,26 @@
package verdnatura.es.repartoverdnatura.MODELS;
public class User {
private String name,idUser;
public User(String name, String idUser) {
this.name = name;
this.idUser = idUser;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIdUser() {
return idUser;
}
public void setIdUser(String idUser) {
this.idUser = idUser;
}
}

View File

@ -0,0 +1,43 @@
package verdnatura.es.repartoverdnatura.MODELS;
import com.google.gson.annotations.SerializedName;
public class Version {
@SerializedName("id")
private String id;
@SerializedName("appName")
private String appName;
@SerializedName("version")
private String version;
public Version(String id, String appName, String version) {
this.id = id;
this.appName = appName;
this.version = version;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
}

View File

@ -0,0 +1,74 @@
package verdnatura.es.repartoverdnatura.MODELS;
import com.google.gson.annotations.SerializedName;
public class Worker {
@SerializedName("id")
private String id;
@SerializedName("fullName")
private String fullName;
@SerializedName("workerCode")
private String workerCode;
@SerializedName("name")
private String name;
@SerializedName("routeLoader")
private String routeLoader;
private Boolean isSelected = false;
public Worker(String id, String fullName, String workerCode, String name, String routeLoader) {
this.id = id;
this.fullName = fullName;
this.workerCode = workerCode;
this.name = name;
this.routeLoader = routeLoader;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public String getWorkerCode() {
return workerCode;
}
public void setWorkerCode(String workerCode) {
this.workerCode = workerCode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Boolean getSelected() {
return isSelected;
}
public void setSelected(Boolean selected) {
isSelected = selected;
}
public String getRouteLoader() {
return routeLoader;
}
public void setRouteLoader(String routeLoader) {
this.routeLoader = routeLoader;
}
}

View File

@ -0,0 +1,14 @@
package verdnatura.es.repartoverdnatura.MODELS;
import java.util.ArrayList;
import java.util.List;
public class WorkerSave {
private String idRoute;
private List<String> Workers;
public WorkerSave(String idRoute, List<String> workers) {
this.idRoute = idRoute;
Workers = workers;
}
}

View File

@ -0,0 +1,428 @@
package verdnatura.es.repartoverdnatura;
import android.Manifest;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.google.gson.Gson;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import verdnatura.es.repartoverdnatura.ADAPTERS.PendingTickets;
import verdnatura.es.repartoverdnatura.ADAPTERS.RutaAdapter;
import verdnatura.es.repartoverdnatura.INTERFACES.RestClient;
import verdnatura.es.repartoverdnatura.MODELS.Ruta;
import verdnatura.es.repartoverdnatura.MODELS.SignDataUpload;
import verdnatura.es.repartoverdnatura.MODELS.Ticket;
import verdnatura.es.repartoverdnatura.MODELS.Version;
import verdnatura.es.repartoverdnatura.UTILS.ApiUtils;
import verdnatura.es.repartoverdnatura.UTILS.LocalStorage;
import verdnatura.es.repartoverdnatura.UTILS.Utils;
public class MainActivity extends AppCompatActivity {
private ListView listViewRutas, listViewPendingTickets;
private ArrayList<Ruta> listaRutas = new ArrayList<>();
private ArrayList<SignDataUpload> listaPendientes = new ArrayList<>();
private RutaAdapter rutaAdapter;
private PendingTickets pendingAdapter;
private int heightCellRoute;
private int heightCellHeader;
private RestClient restClient;
private DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
private Date date = new Date();
private TextView txtDriver;
private final int MY_PERMISSIONS_REQUEST_FINE_LOCATION = 1;
private ImageView btnUpload;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
restClient = ApiUtils.getAPIService();
setViews();
getRoutes(null);
getPending();
registerReceiver(broadcastReceiver, new IntentFilter("UPDATEPENDING"));
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_FINE_LOCATION);
}
}
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
getPending();
}
};
@Override
protected void onRestart() {
getRoutes(null);
getPending();
super.onRestart();
}
private void setViews(){
listViewRutas = findViewById(R.id.listRutas);
listViewPendingTickets = findViewById(R.id.listPendingTickets);
heightCellRoute = Utils.convertDipToPixels(120f,this);
heightCellHeader = Utils.convertDipToPixels(45f,this);
txtDriver = findViewById(R.id.textView3);
btnUpload = findViewById(R.id.btnUpload);
}
public void getRoutes(View v){
date = new Date();
final MainActivity that = this;
listaRutas = new ArrayList<>();
listViewRutas.setVisibility(View.VISIBLE);
Utils.progressBar.show(this,getResources().getString(R.string.please_wait));
restClient.getRoutes(Utils.getMapWhitUser(this)).enqueue(new Callback<List<Ruta>>() {
@Override
public void onResponse(Call<List<Ruta>> call, Response<List<Ruta>> response) {
Utils.progressBar.getDialog().dismiss();
if(response.isSuccessful()){
for (Ruta ruta : response.body()){
LocalStorage.saveRutas(that,response.body());
txtDriver.setText(ruta.getDriver());
try {
if (date.compareTo(format.parse(ruta.getDate())) == 0){
listaRutas.add(ruta);
}else{
date = format.parse(ruta.getDate());
Ruta rutaHeader = new Ruta();
rutaHeader.setHeader(true);
rutaHeader.setDate(ruta.getDate());
listaRutas.add(rutaHeader);
listaRutas.add(ruta);
}
} catch (ParseException e) {
e.printStackTrace();
}
}
that.rutaAdapter = new RutaAdapter(that,listaRutas);
that.listViewRutas.setAdapter(that.rutaAdapter);
ViewGroup.LayoutParams params = listViewRutas.getLayoutParams();
params.height = (heightCellRoute * (listaRutas.size()));
listViewRutas.setLayoutParams(params);
checkVersion();
}else{
getLocalData();
}
}
@Override
public void onFailure(Call<List<Ruta>> call, Throwable t) {
Utils.progressBar.getDialog().dismiss();
getLocalData();
}
});
}
public void getLocalData(){
List<Ruta> list = LocalStorage.getRutas(this);
if (list.size() > 0){
for (Ruta ruta : list){
txtDriver.setText(ruta.getDriver());
try {
if (date.compareTo(format.parse(ruta.getDate())) == 0){
listaRutas.add(ruta);
}else{
date = format.parse(ruta.getDate());
Ruta rutaHeader = new Ruta();
rutaHeader.setHeader(true);
rutaHeader.setDate(ruta.getDate());
listaRutas.add(rutaHeader);
listaRutas.add(ruta);
}
} catch (ParseException e) {
e.printStackTrace();
}
}
this.rutaAdapter = new RutaAdapter(this,listaRutas);
this.listViewRutas.setAdapter(this.rutaAdapter);
ViewGroup.LayoutParams params = listViewRutas.getLayoutParams();
params.height = (heightCellRoute * (listaRutas.size()));
listViewRutas.setLayoutParams(params);
}else{
txtDriver.setText(this.getResources().getString(R.string.reparto));
listViewRutas.setVisibility(View.GONE);
}
}
private void getPending(){
listaPendientes = new ArrayList<>();
Set<String> listPendientes = LocalStorage.getPendingSigns(this);
Gson gson = new Gson();
for(String s : listPendientes){
listaPendientes.add(gson.fromJson(s,SignDataUpload.class));
}
ViewGroup.LayoutParams params = listViewPendingTickets.getLayoutParams();
params.height = (heightCellRoute * (listaPendientes.size()));
listViewPendingTickets.setLayoutParams(params);
pendingAdapter = new PendingTickets(this,listaPendientes);
listViewPendingTickets.setAdapter(pendingAdapter);
if (listPendientes.size() > 0 ){
btnUpload.setVisibility(View.VISIBLE);
}else{
btnUpload.setVisibility(View.GONE);
}
}
public void onRouteSelected(int pos){
Intent i = new Intent(this,Tickets.class);
i.putExtra("route",listaRutas.get(pos));
startActivity(i);
}
public void logOut(View v){
final MainActivity that = this;
if (listaPendientes.size() > 0){
new AlertDialog.Builder(this)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle("ATENCIÓN")
.setMessage("Tienes tickets pendientes de actualizar,¿Estás seguro de cerrar sesión?")
.setPositiveButton("Si", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which) {
Utils.logOut(that);
finish();
}
})
.setNegativeButton("No", null)
.show();
}else{
new AlertDialog.Builder(this)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle("Cerrar sesión")
.setMessage("¿Estás seguro de cerrar sesión?")
.setPositiveButton("Si", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which) {
Utils.logOut(that);
finish();
}
})
.setNegativeButton("No", null)
.show();
}
}
public void goToInfo(View v){
startActivity(new Intent(this,InfoActivity.class));
}
public void goToLoaders(int pos){
Intent i = new Intent(this,LoadersActivity.class);
i.putExtra("idRoute",listaRutas.get(pos).getId());
startActivity(i);
}
public void savePending(int pos){
SignDataUpload data = listaPendientes.get(pos);
confirmSave(data);
}
public void confirmSave(final SignDataUpload data){
Utils.progressBar.show(this,getResources().getString(R.string.please_wait));
final MainActivity that = this;
Object[] args = new Object[1];
args[0] = data;
restClient.saveSign(Utils.getMapWhitUser(this),args).enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
Utils.progressBar.getDialog().dismiss();
if(response.isSuccessful()){
if (response.body().equals("OK")){
ArrayList<SignDataUpload> listAux = new ArrayList<>();
listaPendientes.remove(data);
LocalStorage.udpatePendingSigns(that,listaPendientes);
getPending();
}else{
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
}else{
Log.i("ERROR","error al guardar");
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
}
@Override
public void onFailure(Call<String> call, Throwable t) {
Utils.progressBar.getDialog().dismiss();
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
});
}
public void confirmSavePos(View v){
if (listaPendientes.size() > 0) {
Utils.progressBar.show(this, getResources().getString(R.string.please_wait));
final SignDataUpload data = listaPendientes.get(0);
final MainActivity that = this;
Object[] args = new Object[1];
args[0] = data;
restClient.saveSign(Utils.getMapWhitUser(this), args).enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
if (response.isSuccessful()) {
if (response.body().equals("OK")) {
ArrayList<SignDataUpload> listAux = new ArrayList<>();
listaPendientes.remove(data);
LocalStorage.udpatePendingSigns(that, listaPendientes);
confirmSavePos(null);
} else {
Utils.showErrorDialog(that, that.getResources().getString(R.string.error_conexion));
}
} else {
Log.i("ERROR", "error al guardar");
Utils.showErrorDialog(that, that.getResources().getString(R.string.error_conexion));
}
}
@Override
public void onFailure(Call<String> call, Throwable t) {
Utils.progressBar.getDialog().dismiss();
Utils.showErrorDialog(that, that.getResources().getString(R.string.error_conexion));
}
});
}else{
Utils.progressBar.getDialog().dismiss();
getPending();
}
}
public void checkVersion(){
String[] userData = new String[1];
userData[0] = "delivery";
final MainActivity that = this;
restClient.getVersion(Utils.getMapWhitUser(this),userData).enqueue(new Callback<Version>() {
@Override
public void onResponse(Call<Version> call, Response<Version> response) {
if (response.isSuccessful()){
Version v = response.body();
PackageManager manager = that.getPackageManager();
try{
PackageInfo info = manager.getPackageInfo(that.getPackageName(), 0);
int versionCode = info.versionCode;
if (versionCode != Integer.parseInt(v.getVersion())){
AlertDialog.Builder builder1 = new AlertDialog.Builder(that);
builder1.setMessage("Existe una nueva versión. Se recomienda actualizar.");
builder1.setCancelable(true);
builder1.setPositiveButton(
"Actualizar",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
} catch (android.content.ActivityNotFoundException anfe) {
//startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://app.verdnatura.es/bin/vndelivery.apk")));
}
}
});
builder1.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
AlertDialog alert11 = builder1.create();
alert11.show();
}
}catch (Exception e){
}
}
}
@Override
public void onFailure(Call<Version> call, Throwable t) {
}
});
}
@Override
protected void onDestroy() {
super.onDestroy();
unregisterReceiver(broadcastReceiver);
}
@Override
public void onBackPressed() {
}
}

View File

@ -0,0 +1,103 @@
package verdnatura.es.repartoverdnatura;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.Set;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import verdnatura.es.repartoverdnatura.INTERFACES.RestClient;
import verdnatura.es.repartoverdnatura.MODELS.SignDataUpload;
import verdnatura.es.repartoverdnatura.UTILS.ApiUtils;
import verdnatura.es.repartoverdnatura.UTILS.LocalStorage;
import verdnatura.es.repartoverdnatura.UTILS.Utils;
public class NetworkStateReveiver extends BroadcastReceiver {
public ArrayList<SignDataUpload> listData = new ArrayList<>();
private RestClient restClient;
public Context context;
public void onReceive(Context context, Intent intent) {
this.context = context;
Log.d("app", "Network connectivity change");
if (intent.getExtras() != null) {
NetworkInfo ni = (NetworkInfo) intent.getExtras().get(ConnectivityManager.EXTRA_NETWORK_INFO);
if (ni != null && ni.getState() == NetworkInfo.State.CONNECTED) {
Log.i("app", "Network " + ni.getTypeName() + " connected");
//TENEMOS INTERNET
Set<String> listPendientes = LocalStorage.getPendingSigns(context);
if (listPendientes.size() != 0){
restClient = ApiUtils.getAPIService();
Gson gson = new Gson();
listData = new ArrayList<>();
for (String s : listPendientes){
listData.add(gson.fromJson(s,SignDataUpload.class));
}
confirmSave(0);
}
confirmSave(0);
} else if (intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, Boolean.FALSE)) {
Log.d("app", "There's no network connectivity");
}
}
}
public void confirmSave(final int pos){
if (pos < listData.size()) {
//Utils.progressBar.show(this, getResources().getString(R.string.please_wait));
Object[] args = new Object[1];
args[0] = listData.get(pos);
restClient.saveSign(Utils.getMapWhitUser(context), args).enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
if (response.isSuccessful()) {
if (response.body().equals("OK")) {
confirmSave(pos+1);
}else{
updateLocal(pos);
}
} else {
Log.i("ERROR", "error al guardar");
updateLocal(pos);
}
}
@Override
public void onFailure(Call<String> call, Throwable t) {
updateLocal(pos);
}
});
}else{
updateLocal(pos);
}
}
public void updateLocal(int pos){
ArrayList<SignDataUpload> listAux = new ArrayList<>();
if(pos < listData.size() && pos != -1){
for(int i = pos; i < listData.size(); i++){
listAux.add(listData.get(i));
}
LocalStorage.udpatePendingSigns(context,listAux,"0");
}else{
LocalStorage.udpatePendingSigns(context,listAux,"0");
}
context.sendBroadcast(new Intent("UPDATEPENDING"));
}
}

View File

@ -0,0 +1,147 @@
package verdnatura.es.repartoverdnatura;
import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.Map;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import verdnatura.es.repartoverdnatura.INTERFACES.RestClient;
import verdnatura.es.repartoverdnatura.MODELS.ClientTickets;
import verdnatura.es.repartoverdnatura.MODELS.NoteSave;
import verdnatura.es.repartoverdnatura.MODELS.Worker;
import verdnatura.es.repartoverdnatura.MODELS.WorkerSave;
import verdnatura.es.repartoverdnatura.UTILS.ApiUtils;
import verdnatura.es.repartoverdnatura.UTILS.Utils;
public class NoteActivity extends AppCompatActivity {
private RestClient restClient;
private EditText txtNota;
private TextView txtNumCharacters;
private final int MAX_CHARACTERS = 90;
public int total = 90;
private ClientTickets clientTicket;
private boolean isSignedShowed;
private ListView listViewMnesaje;
private ArrayList<String> listMensajes = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_note);
restClient = ApiUtils.getAPIService();
Intent intent = this.getIntent();
Bundle bundle = intent.getExtras();
clientTicket = (ClientTickets) bundle.getSerializable("clientTicket");
isSignedShowed = bundle.getBoolean("isSignedShowed");
setViews();
setEvents();
setMensajes();
}
private void setViews(){
txtNota = findViewById(R.id.editText2);
txtNumCharacters = findViewById(R.id.txtNumCharacters);
total = MAX_CHARACTERS - txtNota.getText().toString().length();
txtNumCharacters.setText(""+total+" "+getResources().getString(R.string.caract_restantes));
listViewMnesaje = findViewById(R.id.listMensajes);
}
private void setMensajes(){
listMensajes.add("CLIENTE AUSENTE");
listMensajes.add("CLIENTE AUTORIZA DESCARGA A REPARTIDOR");
listMensajes.add("CLIENTE RECHAZA PEDIDO");
listMensajes.add("FALTAN BULTOS: ");
listMensajes.add("RECOGER DEVOLUCIÓN, NÚMERO DE RECLAMACIÓN: ");
ArrayAdapter<String> adapter = new ArrayAdapter<>(this,R.layout.row_mensaje,listMensajes);
listViewMnesaje.setAdapter(adapter);
}
private void setEvents(){
txtNota.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
total = MAX_CHARACTERS - txtNota.getText().toString().length();
txtNumCharacters.setText(""+total+" "+getResources().getString(R.string.caract_restantes));
}
});
listViewMnesaje.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int pos, long l) {
txtNota.setText(listMensajes.get(pos) + " ");
}
});
}
public void addNote(View v){
Utils.progressBar.show(this,getResources().getString(R.string.please_wait));
final NoteActivity that = this;
ArrayList<String> listTickets = new ArrayList<>();
for (Map<String,String> ticket : clientTicket.getTickets()){
listTickets.add(ticket.get("Id"));
}
NoteSave na = new NoteSave("-"+txtNota.getText().toString(),listTickets);
Object[] args = new Object[1];
args[0] = na;
restClient.addNote(Utils.getMapWhitUser(this),args).enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
Utils.progressBar.getDialog().dismiss();
if (response.isSuccessful()){
if(response.body().equals("Finish")){
finish();
}else{
clientTicket.setNote(response.body());
Intent returnIntent = new Intent();
returnIntent.putExtra("clientTicket",clientTicket);
returnIntent.putExtra("isSignedShowed",isSignedShowed);
setResult(Activity.RESULT_OK,returnIntent);
finish();
}
}else{
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
}
@Override
public void onFailure(Call<String> call, Throwable t) {
Utils.progressBar.getDialog().dismiss();
Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
}
});
}
}

View File

@ -0,0 +1,281 @@
package verdnatura.es.repartoverdnatura;
import android.Manifest;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Base64;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import com.simplify.ink.InkView;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import verdnatura.es.repartoverdnatura.INTERFACES.RestClient;
import verdnatura.es.repartoverdnatura.MODELS.ClientTickets;
import verdnatura.es.repartoverdnatura.MODELS.SignDataUpload;
import verdnatura.es.repartoverdnatura.UTILS.ApiUtils;
import verdnatura.es.repartoverdnatura.UTILS.LocalStorage;
import verdnatura.es.repartoverdnatura.UTILS.Utils;
public class SignActivity extends AppCompatActivity implements LocationListener{
private InkView ink;
public ClientTickets clientTickets;
private TextView txtTickets, txtPackages, txtCliente;
private RestClient restClient;
public LocationManager locationManager;
public Location location;
public List<Integer> tickets = new ArrayList<>();
public String idRuta = "";
private final int MY_PERMISSIONS_REQUEST_FINE_LOCATION = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign);
restClient = ApiUtils.getAPIService();
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
Criteria criteria = new Criteria();
String provider = locationManager.getBestProvider(criteria, true);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_FINE_LOCATION);
}else{
location = locationManager.getLastKnownLocation(provider);
}
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,0, 0,this);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0, 0,this);
Intent intent = this.getIntent();
Bundle bundle = intent.getExtras();
clientTickets = (ClientTickets) bundle.getSerializable("clientTicket");
idRuta = bundle.getString("idRuta");
setViews();
setScreen();
}
private void setViews(){
ink = findViewById(R.id.ink);
ink.setColor(getResources().getColor(R.color.colorWhite));
ink.setMinStrokeWidth(1.5f);
ink.setMaxStrokeWidth(6f);
txtTickets = findViewById(R.id.textView5);
txtPackages = findViewById(R.id.textView8);
txtCliente = findViewById(R.id.txtCliente);
}
private void setScreen(){
StringBuffer auxText = new StringBuffer();
int sumPackages = 0;
boolean isFirst = true;
for(Map<String,String> ticket : clientTickets.getTickets()){
if (isFirst){
auxText.append(ticket.get("Id"));
isFirst = false;
}else{
auxText.append(" , "+ticket.get("Id"));
}
sumPackages += Integer.parseInt(ticket.get("Packages"));
tickets.add(Integer.parseInt(ticket.get("Id")));
}
txtTickets.setText(auxText.toString());
txtPackages.setText(""+sumPackages);
txtCliente.setText(clientTickets.getClientName());
}
public void saveSign(View v){
final SignActivity that = this;
new AlertDialog.Builder(this)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(getResources().getString(R.string.firma))
.setMessage(getResources().getString(R.string.estas_seguro_firma))
.setPositiveButton(getResources().getString(R.string.si), new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which) {
final Bitmap drawing = ink.getBitmap();
if(clientTickets.getLongitude()!=null && !clientTickets.getLongitude().equals("")){
Location l2 = new Location("");
l2.setLatitude(Double.parseDouble(clientTickets.getLatitude()));
l2.setLongitude(Double.parseDouble(clientTickets.getLongitude()));
if(location != null && distanceTwoPoints(location,l2)>30.0){
AlertDialog alertDialog = new AlertDialog.Builder(that).create();
alertDialog.setTitle("Alert");
alertDialog.setMessage(that.getResources().getString(R.string.diferente_loc));
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, that.getResources().getString(R.string.mantener),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
SignDataUpload data = new SignDataUpload(that.BitMapToString(drawing),tickets,new verdnatura.es.repartoverdnatura.MODELS.Location(clientTickets.getLongitude(),clientTickets.getLatitude()));
confirmSave(data);
}
});
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, that.getResources().getString(R.string.actualizar),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
SignDataUpload data = new SignDataUpload(that.BitMapToString(drawing),tickets,new verdnatura.es.repartoverdnatura.MODELS.Location(String.valueOf(location.getLongitude()),String.valueOf(location.getLatitude())));
confirmSave(data);
}
});
alertDialog.show();
}else{
SignDataUpload data = new SignDataUpload(that.BitMapToString(drawing),tickets,new verdnatura.es.repartoverdnatura.MODELS.Location(String.valueOf(location.getLongitude()),String.valueOf(location.getLatitude())));
confirmSave(data);
}
}else{
if (location != null){
SignDataUpload data = new SignDataUpload(that.BitMapToString(drawing),tickets,new verdnatura.es.repartoverdnatura.MODELS.Location(String.valueOf(location.getLongitude()),String.valueOf(location.getLatitude())));
confirmSave(data);
}else{
SignDataUpload data = new SignDataUpload(that.BitMapToString(drawing),tickets,new verdnatura.es.repartoverdnatura.MODELS.Location("0.0","0.0"));
confirmSave(data);
}
}
}
})
.setNegativeButton(getResources().getString(R.string.no), null)
.show();
}
public void confirmSave(final SignDataUpload data){
Utils.progressBar.show(this,getResources().getString(R.string.please_wait));
final SignActivity that = this;
Object[] args = new Object[1];
args[0] = data;
restClient.saveSign(Utils.getMapWhitUser(this),args).enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
Utils.progressBar.getDialog().dismiss();
if(response.isSuccessful()){
if (response.body().equals("OK")){
Log.i("INFO","guardado");
Intent returnIntent = new Intent();
returnIntent.putExtra("idCliente",clientTickets.getClient());
setResult(Activity.RESULT_OK,returnIntent);
finish();
}else{
saveLocal(data);
}
}else{
Log.i("ERROR","error al guardar");
saveLocal(data);
}
}
@Override
public void onFailure(Call<String> call, Throwable t) {
Utils.progressBar.getDialog().dismiss();
saveLocal(data);
}
});
}
public void saveLocal(SignDataUpload data){
data.setIdClient(clientTickets.getClient());
LocalStorage.saveSign(this,data,clientTickets.getClientName(),idRuta);
Intent returnIntent = new Intent();
returnIntent.putExtra("idCliente",clientTickets.getClient());
setResult(Activity.RESULT_OK,returnIntent);
finish();
}
public String BitMapToString(Bitmap bitmap){
ByteArrayOutputStream baos=new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG,100, baos);
byte [] b=baos.toByteArray();
String temp=Base64.encodeToString(b, Base64.DEFAULT);
return temp;
}
public void clearSign(View v){
ink.clear();
}
public float distanceTwoPoints(Location l1 , Location l2){
return l1.distanceTo(l2);
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
switch (requestCode) {
case MY_PERMISSIONS_REQUEST_FINE_LOCATION: {
// If request is cancelled, the result arrays are empty.
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// permission was granted
} else {
// permission denied, boo! Disable the
// functionality that depends on this permission.
}
}
// other 'case' lines to check for other
// permissions this app might request
}
}
@Override
public void onLocationChanged(Location location) {
Log.v("COORDENADAS", "IN ON LOCATION CHANGE, lat=" + location.getLatitude() + ", lon=" + location.getLongitude());
this.location = location;
}
@Override
public void onStatusChanged(String s, int i, Bundle bundle) {
}
@Override
public void onProviderEnabled(String s) {
}
@Override
public void onProviderDisabled(String s) {
}
}

View File

@ -0,0 +1,625 @@
package verdnatura.es.repartoverdnatura;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import okhttp3.Route;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import verdnatura.es.repartoverdnatura.ADAPTERS.ClientAdapter;
import verdnatura.es.repartoverdnatura.ADAPTERS.PhonesAdapter;
import verdnatura.es.repartoverdnatura.INTERFACES.RestClient;
import verdnatura.es.repartoverdnatura.MODELS.ClientTickets;
import verdnatura.es.repartoverdnatura.MODELS.Cliente;
import verdnatura.es.repartoverdnatura.MODELS.Ruta;
import verdnatura.es.repartoverdnatura.MODELS.SignDataUpload;
import verdnatura.es.repartoverdnatura.UTILS.ApiUtils;
import verdnatura.es.repartoverdnatura.UTILS.LocalStorage;
import verdnatura.es.repartoverdnatura.UTILS.Utils;
public class Tickets extends AppCompatActivity {
public String tlf;
private ListView listViewClients;
private ArrayList<ClientTickets> listClientesTickets = new ArrayList<>();
private ArrayList<ClientTickets> listClientesTicketsFirmados = new ArrayList<>();
private ClientAdapter adapter;
public Ruta route;
private RestClient restClient;
private TextView txtZona, txtLines,btnVolver,txtClientsToSign,btnShowSigned;
private boolean isSignedShowed = false;
private ListView dialogListView;
public String uri = "";
private int posForNote = 0;
public ArrayList<SignDataUpload> listData = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tickets);
Intent intent = this.getIntent();
Bundle bundle = intent.getExtras();
route = (Ruta) bundle.getSerializable("route");
restClient = ApiUtils.getAPIService();
setViews();
checkPendingSigns();
}
public void checkPendingSigns(){
Set<String> pendingSigns = LocalStorage.getPendingSigns(this);
if (pendingSigns.size() == 0){
getData(-1);
}else{
Gson gson = new Gson();
listData = new ArrayList<>();
for (String s : pendingSigns){
listData.add(gson.fromJson(s,SignDataUpload.class));
}
confirmSave(0);
}
}
public void confirmSave(final int pos){
if (pos < listData.size()) {
Utils.progressBar.show(this, getResources().getString(R.string.please_wait));
final Tickets that = this;
Object[] args = new Object[1];
args[0] = listData.get(pos);
restClient.saveSign(Utils.getMapWhitUser(this), args).enqueue(new Callback<String>() {
@Override
public void onResponse(Call<String> call, Response<String> response) {
Utils.progressBar.getDialog().dismiss();
if (response.isSuccessful()) {
if (response.body().equals("OK")) {
confirmSave(pos+1);
}else{
getData(pos);
}
} else {
Log.i("ERROR", "error al guardar");
Utils.showErrorDialog(that, that.getResources().getString(R.string.error_conexion));
getData(pos);
}
}
@Override
public void onFailure(Call<String> call, Throwable t) {
Utils.progressBar.getDialog().dismiss();
getData(pos);
}
});
}else{
Utils.progressBar.getDialog().dismiss();
getData(pos);
}
}
private void setViews(){
listViewClients = this.findViewById(R.id.listClientes);
txtZona = this.findViewById(R.id.textView19);
txtLines = this.findViewById(R.id.textView35);
btnVolver = this.findViewById(R.id.textView3);
txtClientsToSign = this.findViewById(R.id.textView20);
btnShowSigned = this.findViewById(R.id.textView22);
txtZona.setText(route.getAgency());
}
private void getData(int pos){
//han quedado firmas por subir
ArrayList<SignDataUpload> listAux = new ArrayList<>();
if(pos < listData.size() && pos != -1){
for(int i = pos; i < listData.size(); i++){
listAux.add(listData.get(i));
}
LocalStorage.udpatePendingSigns(this,listAux,route.getId());
}else{
LocalStorage.udpatePendingSigns(this,listAux,route.getId());
}
txtLines.setText("");
final Tickets that = this;
listClientesTickets = new ArrayList<>();
listClientesTicketsFirmados = new ArrayList<>();
listViewClients.setVisibility(View.VISIBLE);
Utils.progressBar.show(this,getResources().getString(R.string.please_wait));
String idR = route.getId();
String[] routeData = new String[1];
routeData[0] = idR;
restClient.getClients(Utils.getMapWhitUser(this),routeData).enqueue(new Callback<List<Cliente>>() {
@Override
public void onResponse(Call<List<Cliente>> call, Response<List<Cliente>> response) {
Utils.progressBar.getDialog().dismiss();
Boolean exists = false;
if(response.isSuccessful()){
for(Cliente cliente : response.body()){
exists = false;
for (ClientTickets c : listClientesTicketsFirmados){
if(c.getClient().equals(cliente.getClient())){
Map<String,String> values = new HashMap<>();
values.put("Packages",cliente.getPackages());
values.put("Warehouse",cliente.getWarehouse());
values.put("Id",cliente.getId());
values.put("Polizon",cliente.getPolizon());
c.addTicket(values);
exists = true;
break;
}
}
for (ClientTickets c : listClientesTickets){
if(c.getClient().equals(cliente.getClient())){
Map<String,String> values = new HashMap<>();
values.put("Packages",cliente.getPackages());
values.put("Warehouse",cliente.getWarehouse());
values.put("Id",cliente.getId());
values.put("Polizon",cliente.getPolizon());
c.addTicket(values);
exists = true;
break;
}
}
if(!exists){
Map<String,String> values = new HashMap<>();
values.put("Packages",cliente.getPackages());
values.put("Warehouse",cliente.getWarehouse());
values.put("Id",cliente.getId());
values.put("Polizon",cliente.getPolizon());
ArrayList<Map<String,String>> arrayValues = new ArrayList<>();
arrayValues.add(values);
if(cliente.getSigned().equals("0")){
listClientesTickets.add(new ClientTickets(cliente.getClient(),
cliente.getClientName(),
cliente.getAddress(),
cliente.getAddressName(),
cliente.getPostalCode(),
cliente.getCity(),
cliente.getSalePersonPhone(),
cliente.getNote(),
cliente.getLatitude(),
cliente.getLongitude(),
Boolean.parseBoolean(cliente.getSigned()),
cliente.getPhones(),
arrayValues,
cliente.getPolizon()));
}else{
listClientesTicketsFirmados.add(new ClientTickets(cliente.getClient(),
cliente.getClientName(),
cliente.getAddress(),
cliente.getAddressName(),
cliente.getPostalCode(),
cliente.getCity(),
cliente.getSalePersonPhone(),
cliente.getNote(),
cliente.getLatitude(),
cliente.getLongitude(),
Boolean.parseBoolean(cliente.getSigned()),
cliente.getPhones(),
arrayValues,
cliente.getPolizon()));
}
}
}
//ACTUALIZAR RESPECTO LOCAL
Set<String> localSigns = LocalStorage.getPendingSigns(that);
Gson gson = new Gson();
ArrayList<ClientTickets> listAux = new ArrayList<>();
for (String s : localSigns){
SignDataUpload sdu = gson.fromJson(s,SignDataUpload.class);
int count = 0;
for(ClientTickets c : listClientesTickets){
if (sdu.getIdClient().equals(c.getClient())){
listAux.add(listClientesTickets.get(count));
break;
}
count += 1;
}
}
for (ClientTickets c : listAux) {
listClientesTickets.remove(c);
}
if (isSignedShowed){
adapter = new ClientAdapter(that,listClientesTicketsFirmados);
}else{
adapter = new ClientAdapter(that,listClientesTickets);
}
listViewClients.setAdapter(adapter);
txtLines.setText(""+listClientesTicketsFirmados.size()+"/"+(listClientesTicketsFirmados.size()+listClientesTickets.size())+" "+that.getResources().getString(R.string.clientes_firmados));
//GUARDAR EN LOCAL
LocalStorage.saveListClientesTickets(that,listClientesTickets,route.getId());
LocalStorage.saveListClientesTicketsFirmados(that,listClientesTicketsFirmados,route.getId());
}else{
getLocalData();
}
}
@Override
public void onFailure(Call<List<Cliente>> call, Throwable t) {
Utils.progressBar.getDialog().dismiss();
/* Utils.showErrorDialog(that,that.getResources().getString(R.string.error_conexion));
listViewClients.setVisibility(View.GONE);*/
getLocalData();
}
});
}
public void getLocalData(){
listClientesTicketsFirmados = LocalStorage.getClientesTicketsFirmados(this,route.getId());
listClientesTickets = LocalStorage.getClientesTickets(this,route.getId());
if (listClientesTicketsFirmados.size()== 0 && listClientesTickets.size() == 0){
Utils.showErrorDialogAndFinish(this,this.getResources().getString(R.string.error_conexion));
listViewClients.setVisibility(View.GONE);
}
if (isSignedShowed){
adapter = new ClientAdapter(this,listClientesTicketsFirmados);
}else{
adapter = new ClientAdapter(this,listClientesTickets);
}
listViewClients.setAdapter(adapter);
txtLines.setText(""+listClientesTicketsFirmados.size()+"/"+(listClientesTicketsFirmados.size()+listClientesTickets.size())+" "+this.getResources().getString(R.string.clientes_firmados));
}
public void showPhones(int pos){
ArrayList<String> phones = new ArrayList<>();
if (isSignedShowed){
for (String phone : listClientesTicketsFirmados.get(pos).getPhones()){
if (phone!=""){
phones.add(phone);
}
}
phones.add(listClientesTicketsFirmados.get(pos).getSalePersonPhone());
}else{
for (String phone : listClientesTickets.get(pos).getPhones()){
if (phone!=""){
phones.add(phone);
}
}
phones.add(listClientesTickets.get(pos).getSalePersonPhone());
}
AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
LayoutInflater inflater = getLayoutInflater();
View convertView = inflater.inflate(R.layout.phone_dialog, null);
alertDialog.setView(convertView);
alertDialog.setTitle(getResources().getString(R.string.telefono));
ListView lv = convertView.findViewById(R.id.dialoglist);
PhonesAdapter adapter = new PhonesAdapter(this,phones){};
lv.setAdapter(adapter);
alertDialog.show();
}
public void llamarTelefono(String phone){
tlf = phone;
if (Build.VERSION.SDK_INT >= 23) {
String[] PERMISSIONS = {android.Manifest.permission.CALL_PHONE};
if (!hasPermissions(this, PERMISSIONS)) {
ActivityCompat.requestPermissions((Activity) this, PERMISSIONS, 112 );
} else {
makeCall();
}
} else {
makeCall();
}
}
private static boolean hasPermissions(Context context, String... permissions) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && context != null && permissions != null) {
for (String permission : permissions) {
if (ActivityCompat.checkSelfPermission(context, permission) != PackageManager.PERMISSION_GRANTED) {
return false;
}
}
}
return true;
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode) {
case 112: {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
makeCall();
} else {
Toast.makeText(this, "No tienes permisos para llamar.", Toast.LENGTH_LONG).show();
}
}
}
}
public void makeCall(){
String uri = "tel:" + tlf.trim() ;
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse(uri));
startActivity(intent);
}
public void goMaps(int pos){
final Tickets that = this;
final int posicion = pos;
if(isGoogleMapsInstalled()){
if (isSignedShowed){
if (listClientesTicketsFirmados.get(pos).getLatitude() == null || listClientesTicketsFirmados.get(pos).getLatitude().equals("0.0")){
uri = "geo:0,0?q="+listClientesTicketsFirmados.get(pos).getClientName() +
" " + listClientesTicketsFirmados.get(pos).getAddressName() +
" " + listClientesTicketsFirmados.get(pos).getCity()+
" " + listClientesTicketsFirmados.get(pos).getPostalCode();
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(uri)));
}else{
AlertDialog.Builder builder1 = new AlertDialog.Builder(this);
builder1.setMessage(that.getResources().getString(R.string.ver_loc));
builder1.setCancelable(true);
builder1.setPositiveButton(
that.getResources().getString(R.string.nombre),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
uri = "geo:0,0?q="+listClientesTicketsFirmados.get(posicion).getClientName() +
" " + listClientesTicketsFirmados.get(posicion).getAddressName() +
" " + listClientesTicketsFirmados.get(posicion).getCity()+
" " + listClientesTicketsFirmados.get(posicion).getPostalCode();
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(uri)));
}
});
builder1.setNegativeButton(
that.getResources().getString(R.string.coordenadas),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
uri = "geo:0,0?q="+listClientesTicketsFirmados.get(posicion).getLatitude() +
" " + listClientesTicketsFirmados.get(posicion).getLongitude();
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(uri)));
}
});
AlertDialog alert11 = builder1.create();
alert11.show();
}
}else{
if (listClientesTickets.get(pos).getLatitude() == null || listClientesTickets.get(pos).getLatitude().equals("0.0")){
uri = "geo:0,0?q="+listClientesTickets.get(pos).getClientName() +
" " + listClientesTickets.get(pos).getAddressName() +
" " + listClientesTickets.get(pos).getCity()+
" " + listClientesTickets.get(pos).getPostalCode();
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(uri)));
}else {
AlertDialog.Builder builder1 = new AlertDialog.Builder(this);
builder1.setMessage(that.getResources().getString(R.string.ver_loc));
builder1.setCancelable(true);
builder1.setPositiveButton(
that.getResources().getString(R.string.nombre),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
uri = "geo:0,0?q="+listClientesTickets.get(posicion).getClientName() +
" " + listClientesTickets.get(posicion).getAddressName() +
" " + listClientesTickets.get(posicion).getCity()+
" " + listClientesTickets.get(posicion).getPostalCode();
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(uri)));
}
});
builder1.setNegativeButton(
that.getResources().getString(R.string.coordenadas),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
uri = "geo:0,0?q="+listClientesTickets.get(posicion).getLatitude() +
" " + listClientesTickets.get(posicion).getLongitude();
startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(uri)));
}
});
AlertDialog alert11 = builder1.create();
alert11.show();
}
}
}else{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Please install Google Maps");
builder.setCancelable(false);
builder.setPositiveButton("Install", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.google.android.apps.maps"));
startActivity(intent);
finish();
}
});
AlertDialog dialog = builder.create();
dialog.show();
}
}
public void goSign(int pos){
Intent i = new Intent(this,SignActivity.class);
if (isSignedShowed){
i.putExtra("clientTicket",listClientesTicketsFirmados.get(pos));
}else{
i.putExtra("clientTicket",listClientesTickets.get(pos));
}
i.putExtra("idRuta",route.getId());
startActivityForResult(i,1);
}
public boolean isGoogleMapsInstalled() {
try
{
ApplicationInfo info = getPackageManager().getApplicationInfo("com.google.android.apps.maps", 0 );
return true;
}
catch(PackageManager.NameNotFoundException e)
{
return false;
}
}
public void showSigned(View v){
if(isSignedShowed){
adapter = new ClientAdapter(this,listClientesTickets);
isSignedShowed = false;
txtClientsToSign.setText(getResources().getString(R.string.tickets_por_firmar));
btnShowSigned.setText(getResources().getString(R.string.ver_firmados));
}else{
adapter = new ClientAdapter(this,listClientesTicketsFirmados);
isSignedShowed = true;
txtClientsToSign.setText(getResources().getString(R.string.clientes_firmados));
btnShowSigned.setText(getResources().getString(R.string.ver_por_firmar));
}
listViewClients.setAdapter(adapter);
}
public void showNote(int pos){
String mensaje = "";
if(isSignedShowed){
mensaje = listClientesTicketsFirmados.get(pos).getNote();
}else{
mensaje = listClientesTickets.get(pos).getNote();
}
AlertDialog alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setTitle("Alert");
alertDialog.setMessage(mensaje);
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertDialog.show();
}
public void showPolizon(int pos,int posTicket){
String polizon = "";
if (isSignedShowed){
polizon = listClientesTicketsFirmados.get(pos).getTickets().get(posTicket).get("Polizon");
}else{
polizon = listClientesTickets.get(pos).getTickets().get(posTicket).get("Polizon");
}
AlertDialog alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setTitle(this.getResources().getString(R.string.polizon));
alertDialog.setMessage(polizon);
alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertDialog.show();
}
public void goToConfig(View v){
Intent i = new Intent(this,ConfigureActivity.class);
i.putExtra("route",route);
startActivityForResult(i,2);
}
public void goToNotes(int position){
posForNote = position;
Intent i = new Intent(this,NoteActivity.class);
if (isSignedShowed){
i.putExtra("clientTicket",listClientesTicketsFirmados.get(position));
}else{
i.putExtra("clientTicket",listClientesTickets.get(position));
}
i.putExtra("isSignedShowed",isSignedShowed);
startActivityForResult(i,3);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
if (requestCode == 1){
if (resultCode == Activity.RESULT_OK){
checkPendingSigns();
}
}else if (requestCode == 2){
if (resultCode == Activity.RESULT_OK) {
route = (Ruta) data.getSerializableExtra("route");
}
}else if (requestCode == 3){
if (resultCode == Activity.RESULT_OK) {
ClientTickets ct = (ClientTickets) data.getSerializableExtra("clientTicket");
if (data.getBooleanExtra("isSignedShowed",false)){
listClientesTicketsFirmados.get(posForNote).setNote(ct.getNote());
}else{
listClientesTickets.get(posForNote).setNote(ct.getNote());
}
adapter.notifyDataSetChanged();
}
}
}
}

View File

@ -0,0 +1,14 @@
package verdnatura.es.repartoverdnatura.UTILS;
import verdnatura.es.repartoverdnatura.INTERFACES.RestClient;
public class ApiUtils {
private ApiUtils() {}
//public static final String BASE_URL = "http://172.16.198.34:8080/";
public static final String BASE_URL = "https://app.verdnatura.es/";
public static RestClient getAPIService() {
return RetrofitClient.getClient(BASE_URL).create(RestClient.class);
}
}

View File

@ -0,0 +1,50 @@
package verdnatura.es.repartoverdnatura.UTILS;
import android.app.Dialog;
import android.app.SearchManager;
import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import verdnatura.es.repartoverdnatura.R;
public class CustomProgressBar {
private Dialog dialog;
public Dialog show(Context context) {
return show(context, null);
}
public Dialog show(Context context, CharSequence title) {
return show(context, title, false);
}
public Dialog show(Context context, CharSequence title, boolean cancelable) {
return show(context, title, cancelable, null);
}
public Dialog show(Context context, CharSequence title, boolean cancelable,
SearchManager.OnCancelListener cancelListener) {
LayoutInflater inflator = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View view = inflator.inflate(R.layout.progress_bar, null);
if(title != null) {
final TextView tv = (TextView) view.findViewById(R.id.id_title);
tv.setText(title);
}
dialog = new Dialog(context, R.style.NewDialog);
dialog.setContentView(view);
dialog.setCancelable(cancelable);
dialog.setOnCancelListener((DialogInterface.OnCancelListener) cancelListener);
dialog.show();
return dialog;
}
public Dialog getDialog() {
return dialog;
}
}

View File

@ -0,0 +1,309 @@
package verdnatura.es.repartoverdnatura.UTILS;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import com.google.gson.Gson;
import com.google.gson.internal.LinkedTreeMap;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import verdnatura.es.repartoverdnatura.MODELS.ClientTickets;
import verdnatura.es.repartoverdnatura.MODELS.Ruta;
import verdnatura.es.repartoverdnatura.MODELS.SignDataUpload;
public class LocalStorage {
static SharedPreferences sp;
public static void saveRutas(Context context, List<Ruta> rutas){
clearClients(context,rutas);
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
Gson gson = new Gson();
String json = gson.toJson(rutas);
editor.putString("rutas",json);
editor.commit();
}
public static void saveListClientesTickets(Context context, List<ClientTickets> listClientesTickets,String idRuta){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
Gson gson = new Gson();
String json = gson.toJson(listClientesTickets);
editor.putString("clientTickets_"+idRuta,json);
editor.commit();
}
public static void saveListClientesTicketsFirmados(Context context, List<ClientTickets> listClientesTicketsFirmados,String idRuta){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
Gson gson = new Gson();
String json = gson.toJson(listClientesTicketsFirmados);
editor.putString("clientTicketsFirmados_"+idRuta,json);
editor.commit();
}
public static ArrayList<Ruta> getRutas(Context context){
Gson gson = new Gson();
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
String json = sp.getString("rutas","");
if (json.length() > 0 ){
ArrayList<Ruta> listRutas = new ArrayList<>();
List<LinkedTreeMap> list = gson.fromJson(json,List.class);
for (int i = 0; i<list.size();i++){
listRutas.add(new Ruta(((list.get(i) == null) || (list.get(i).get("Id") == null) ? "" : list.get(i).get("Id")).toString(),
((list.get(i) == null) || (list.get(i).get("Hour") == null) ? "" : list.get(i).get("Hour")).toString(),
((list.get(i) == null) || (list.get(i).get("Date") == null) ? "" : list.get(i).get("Date")).toString(),
((list.get(i) == null) || (list.get(i).get("M3") == null) ? "" : list.get(i).get("M3")).toString(),
((list.get(i) == null) || (list.get(i).get("Plate") == null) ? "" : list.get(i).get("Plate")).toString(),
((list.get(i) == null) || (list.get(i).get("Agency") == null) ? "" : list.get(i).get("Agency")).toString(),
((list.get(i) == null) || (list.get(i).get("Driver") == null) ? "" : list.get(i).get("Driver")).toString(),
((list.get(i) == null) || (list.get(i).get("kmStart") == null) ? "" : list.get(i).get("kmStart")).toString(),
((list.get(i) == null) || (list.get(i).get("kmEnd") == null) ? "" : list.get(i).get("kmEnd")).toString(),
((list.get(i) == null) || (list.get(i).get("dStart") == null) ? "" : list.get(i).get("dStart")).toString(),
((list.get(i) == null) || (list.get(i).get("dEnd") == null) ? "" : list.get(i).get("dEnd")).toString(),
((list.get(i) == null) || (list.get(i).get("Chofer") == null) ? "" : list.get(i).get("Chofer")).toString()));
}
return listRutas;
}else{
return new ArrayList<>();
}
}
public static ArrayList<ClientTickets> getClientesTickets(Context context,String idRuta){
Gson gson = new Gson();
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
String json = sp.getString("clientTickets_"+idRuta,"");
if (json.length() > 0 ){
ArrayList<ClientTickets> listRutas = new ArrayList<>();
List<LinkedTreeMap> list = gson.fromJson(json,List.class);
String nota = "";
String polizon = "";
for (int i = 0; i<list.size();i++){
if (list.get(i).containsKey("Note")){
nota = list.get(i).get("Note").toString();
}else{
nota = "";
}
if (list.get(i).containsKey("Polizon")){
polizon = list.get(i).get("Polizon").toString();
}else{
polizon = "";
}
listRutas.add(new ClientTickets(((list.get(i) == null) || (list.get(i).get("Client") == null) ? "" : list.get(i).get("Client")).toString(),
((list.get(i) == null) || (list.get(i).get("ClientName") == null) ? "" : list.get(i).get("ClientName")).toString(),
((list.get(i) == null) || (list.get(i).get("Address") == null) ? "" : list.get(i).get("Address")).toString(),
((list.get(i) == null) || (list.get(i).get("AddressName") == null) ? "" : list.get(i).get("AddressName")).toString(),
((list.get(i) == null) || (list.get(i).get("PostalCode") == null) ? "" : list.get(i).get("PostalCode")).toString(),
((list.get(i) == null) || (list.get(i).get("City") == null) ? "" : list.get(i).get("City")).toString(),
((list.get(i) == null) || (list.get(i).get("SalePersonPhone") == null) ? "" : list.get(i).get("SalePersonPhone")).toString(),
((list.get(i) == null) || (list.get(i).get("Note") == null) ? "" : list.get(i).get("Note")).toString(),
((list.get(i) == null) || (list.get(i).get("Latitude") == null) ? "" : list.get(i).get("Latitude")).toString(),
((list.get(i) == null) || (list.get(i).get("Longitude") == null) ? "" : list.get(i).get("Longitude")).toString(),
((list.get(i) == null) || (list.get(i).get("Signed") == null) ? false : Boolean.parseBoolean((list.get(i).get("Signed")).toString())),
(ArrayList<String>) list.get(i).get("Phones"),
(ArrayList<Map<String, String>>) list.get(i).get("tickets"),
((list.get(i) == null) || (list.get(i).get("Polizon") == null) ? "" : list.get(i).get("Polizon")).toString()));
}
return listRutas;
}else{
return new ArrayList<>();
}
}
public static ArrayList<ClientTickets> getClientesTicketsFirmados(Context context,String idRuta){
Gson gson = new Gson();
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
String json = sp.getString("clientTicketsFirmados_"+idRuta,"");
if (json.length() > 0 ){
ArrayList<ClientTickets> listRutas = new ArrayList<>();
List<LinkedTreeMap> list = gson.fromJson(json,List.class);
String nota = "";
String polizon = "";
for (int i = 0; i<list.size();i++){
if (list.get(i).containsKey("Note")){
nota = list.get(i).get("Note").toString();
}else{
nota = "";
}
if (list.get(i).containsKey("Polizon")){
polizon = list.get(i).get("Polizon").toString();
}else{
polizon = "";
}
listRutas.add(new ClientTickets(((list.get(i) == null) || (list.get(i).get("Client") == null) ? "" : list.get(i).get("Client")).toString(),
((list.get(i) == null) || (list.get(i).get("ClientName") == null) ? "" : list.get(i).get("ClientName")).toString(),
((list.get(i) == null) || (list.get(i).get("Address") == null) ? "" : list.get(i).get("Address")).toString(),
((list.get(i) == null) || (list.get(i).get("AddressName") == null) ? "" : list.get(i).get("AddressName")).toString(),
((list.get(i) == null) || (list.get(i).get("PostalCode") == null) ? "" : list.get(i).get("PostalCode")).toString(),
((list.get(i) == null) || (list.get(i).get("City") == null) ? "" : list.get(i).get("City")).toString(),
((list.get(i) == null) || (list.get(i).get("SalePersonPhone") == null) ? "" : list.get(i).get("SalePersonPhone")).toString(),
((list.get(i) == null) || (list.get(i).get("Note") == null) ? "" : list.get(i).get("Note")).toString(),
((list.get(i) == null) || (list.get(i).get("Latitude") == null) ? "" : list.get(i).get("Latitude")).toString(),
((list.get(i) == null) || (list.get(i).get("Longitude") == null) ? "" : list.get(i).get("Longitude")).toString(),
((list.get(i) == null) || (list.get(i).get("Signed") == null) ? false : Boolean.parseBoolean((list.get(i).get("Signed")).toString())),
(ArrayList<String>) list.get(i).get("Phones"),
(ArrayList<Map<String, String>>) list.get(i).get("tickets"),
((list.get(i) == null) || (list.get(i).get("Polizon") == null) ? "" : list.get(i).get("Polizon")).toString()));
}
return listRutas;
}else{
return new ArrayList<>();
}
}
public static boolean isOfflineAviable(Context context,String idRuta){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
String clientTickets = sp.getString("clientTickets_"+idRuta,"");
String clientTicketsFirmados = sp.getString("clientTicketsFirmados_"+idRuta,"");
if (clientTickets.equals("") && clientTicketsFirmados.equals("")){
return false;
}else{
return true;
}
}
private static void clearClients(Context context,List<Ruta> rutas){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
//1 Obtenemos todos los clientes que si queremos
ArrayList<Map<String,String>> listClientesFirmados = new ArrayList<>();
ArrayList<Map<String,String>> listClientes = new ArrayList<>();
String aux = "";
Map<String,String> mapClientes = new HashMap<>();
for(Ruta r : rutas){
mapClientes = new HashMap<>();
aux = sp.getString("clientTicketsFirmados_"+r.getId(),"");
if(!aux.equals("")){
mapClientes.put("localid","clientTicketsFirmados_"+r.getId());
mapClientes.put("json",aux);
listClientesFirmados.add(mapClientes);
}
mapClientes = new HashMap<>();
aux = sp.getString("clientTickets_"+r.getId(),"");
if(!aux.equals("")){
mapClientes.put("localid","clientTickets_"+r.getId());
mapClientes.put("json",aux);
listClientes.add(mapClientes);
}
}
//2 Obtenemos la info del usuario
Map<String, String> userInfo = Utils.getMapWhitUser(context);
//3 Obtenemos los clientes pendientes de firmar
Set<String> pendingSigns = getPendingSigns(context);
//4 Limpiamos todos los datos locales
SharedPreferences.Editor editor = sp.edit();
editor.clear();
editor.commit();
//5 Guardamos los datos que queremos
Utils.saveIdUser(context,userInfo.get("user"));
Utils.saveUserPass(context,userInfo.get("user"),userInfo.get("pass"));
for (Map<String,String> map : listClientes){
editor.putString(map.get("localid"),map.get("json"));
}
for (Map<String,String> map : listClientesFirmados){
editor.putString(map.get("localid"),map.get("json"));
}
saveSignSet(context,pendingSigns);
editor.commit();
}
public static void saveSign(Context context,SignDataUpload data, String clientName,String idRuta){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
data.setClientName(clientName);
Gson gson = new Gson();
String dataJson = gson.toJson(data);
Set<String> listSigns = sp.getStringSet("listSigns",new HashSet<String>());
listSigns.add(dataJson);
editor.putStringSet("listSigns",listSigns);
editor.commit();
updateListClients(context,idRuta,clientName);
}
public static void saveSignSet(Context context,Set<String> data){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putStringSet("listSigns",data);
editor.commit();
}
private static void updateListClients(Context context, String idRuta, String clientName){
ArrayList<ClientTickets> clientesTickets = getClientesTickets(context,idRuta);
ArrayList<ClientTickets> clientesTicketsFirmados = getClientesTicketsFirmados(context,idRuta);
int cont = 0;
ClientTickets aux = null;
for (ClientTickets c : clientesTickets){
if (c.getClientName().equals(clientName)){
clientesTickets.get(cont).setSigned(true);
clientesTicketsFirmados.add(clientesTickets.get(cont));
aux = c;
break;
}
cont += 1;
}
cont = 0;
clientesTickets.remove(aux);
saveListClientesTickets(context,clientesTickets,idRuta);
saveListClientesTicketsFirmados(context,clientesTicketsFirmados,idRuta);
}
public static Set<String> getPendingSigns(Context context){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
return sp.getStringSet("listSigns",new HashSet<String>());
}
public static void udpatePendingSigns(Context context,ArrayList<SignDataUpload> list,String idRuta){
for(SignDataUpload s : list){
saveSign(context,s,s.getClientName(),idRuta);
}
if (list.size() == 0) {
clearPendingSigns(context);
}
}
public static void udpatePendingSigns(Context context,ArrayList<SignDataUpload> list){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
Set<String> listString = new HashSet<>();
Gson gson = new Gson();
for(SignDataUpload s : list){
listString.add(gson.toJson(s));
}
editor.putStringSet("listSigns",listString);
editor.commit();
}
private static void clearPendingSigns(Context context){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.remove("listSigns");
editor.commit();
}
}

View File

@ -0,0 +1,19 @@
package verdnatura.es.repartoverdnatura.UTILS;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.converter.scalars.ScalarsConverterFactory;
public class RetrofitClient {
private static Retrofit retrofit = null;
public static Retrofit getClient(String baseUrl){
if (retrofit==null) {
retrofit = new Retrofit.Builder()
.baseUrl(baseUrl)
.addConverterFactory(GsonConverterFactory.create())
.build();
}
return retrofit;
}
}

View File

@ -0,0 +1,108 @@
package verdnatura.es.repartoverdnatura.UTILS;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import java.util.HashMap;
import java.util.Map;
public class Utils {
static SharedPreferences sp;
static Map<String, String> map = new HashMap<>();
public static CustomProgressBar progressBar = new CustomProgressBar();
public static int convertDipToPixels(float dips, Context context) {
return (int) (dips * context.getResources().getDisplayMetrics().density + 0.5f);
}
public static Map<String, String> getMap(String user,String password){
map.put("version", "1");
map.put("aplicacion", "json");
map.put("user", user);
map.put("pass", password);
map.put("Content-Type", "application/x-www-form-urlencoded");
return map;
}
public static Map<String, String> getMapWhitUser(Context context){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
String user = sp.getString("user","");
String password = sp.getString("pass","");
map.put("version", "1");
map.put("aplicacion", "json");
map.put("user", user);
map.put("pass", password);
map.put("Content-Type", "application/x-www-form-urlencoded");
return map;
}
public static void showErrorDialog(Context context,String mensaje){
AlertDialog.Builder builder1 = new AlertDialog.Builder(context);
builder1.setMessage(mensaje);
builder1.setCancelable(true);
builder1.setPositiveButton(
"Ok",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert11 = builder1.create();
alert11.show();
}
public static void showErrorDialogAndFinish(final Context context, String mensaje){
AlertDialog.Builder builder1 = new AlertDialog.Builder(context);
builder1.setMessage(mensaje);
builder1.setCancelable(true);
builder1.setPositiveButton(
"Ok",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
((Activity) context).finish();
dialog.cancel();
}
});
AlertDialog alert11 = builder1.create();
alert11.show();
}
public static void saveIdUser(Context context,String idUser){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putString("idUser",idUser);
editor.commit();
}
public static void saveUserPass(Context context,String user,String pass){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putString("user",user);
editor.putString("pass",pass);
editor.commit();
}
public static String getIdUser(Context context){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
return sp.getString("idUser","nouser");
}
public static void logOut(Context context){
sp = context.getSharedPreferences("delivery",Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.clear();
editor.commit();
}
}

View File

@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 520 B

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorPrimary"/>
<corners android:radius="50dp"/>
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorMainBg"/>
<corners android:radius="50dp"/>
<padding android:left="0dp" android:top="0dp" android:right="0dp" android:bottom="0dp" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
app:fontProviderAuthority="com.google.android.gms.fonts"
app:fontProviderPackage="com.google.android.gms"
app:fontProviderQuery="Roboto"
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
app:fontProviderAuthority="com.google.android.gms.fonts"
app:fontProviderPackage="com.google.android.gms"
app:fontProviderQuery="name=Roboto&amp;weight=700"
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
app:fontProviderAuthority="com.google.android.gms.fonts"
app:fontProviderPackage="com.google.android.gms"
app:fontProviderQuery="name=Roboto&amp;weight=300"
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
app:fontProviderAuthority="com.google.android.gms.fonts"
app:fontProviderPackage="com.google.android.gms"
app:fontProviderQuery="name=Roboto&amp;weight=100"
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>

View File

@ -0,0 +1,264 @@
<?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=".MainActivity"
android:background="@color/colorPrimaryDark">
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="0dp"
android:layout_height="50dp"
android:background="@color/colorMainHeader"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView19"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:fontFamily="@font/roboto_bold"
android:text="Zona20 MADRID"
android:textColor="@color/colorMainBg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<TextView
android:id="@+id/textView20"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/roboto"
android:text="@string/kilometros"
android:textAllCaps="true"
android:textColor="@color/colorGray"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
<TextView
android:id="@+id/textView28"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/roboto"
android:text="@string/horas"
android:textAllCaps="true"
android:textColor="@color/colorGray"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout7" />
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:background="@color/colorPrimary"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView20" />
<LinearLayout
android:id="@+id/linearLayout6"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2">
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/roboto"
android:text="@string/km_inicio"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/colorWhite"
android:ems="10"
android:fontFamily="@font/roboto"
android:inputType="number"
android:padding="5dp"
android:text="0"
android:imeOptions="actionDone"
android:maxLines="1"/>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout7"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout6">
<TextView
android:id="@+id/textView21"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/roboto"
android:text="@string/km_fin"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/colorWhite"
android:ems="10"
android:fontFamily="@font/roboto"
android:inputType="number"
android:padding="5dp"
android:text="0"
android:imeOptions="actionDone"
android:maxLines="1"/>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout8"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:background="@color/colorPrimary"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView28" />
<LinearLayout
android:id="@+id/linearLayout9"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout8">
<TextView
android:id="@+id/textView212"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/roboto"
android:text="@string/hora_inicio"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
<EditText
android:id="@+id/editText12"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/colorWhite"
android:ems="10"
android:fontFamily="@font/roboto"
android:padding="5dp"
android:text="00:00"
android:imeOptions="actionDone"
android:maxLines="1"
android:focusable="false"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout9">
<TextView
android:id="@+id/textView2123"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/roboto"
android:text="@string/hora_fin"
android:textColor="@color/colorWhite"
android:textSize="18sp" />
<EditText
android:id="@+id/editText123"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/colorWhite"
android:ems="10"
android:fontFamily="@font/roboto"
android:padding="5dp"
android:text="00:00"
android:imeOptions="actionDone"
android:maxLines="1"
android:focusable="false"/>
</LinearLayout>
<TextView
android:id="@+id/textView37"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="17dp"
android:fontFamily="@font/roboto_bold"
android:text="@string/guardar"
android:textAlignment="center"
android:textColor="@color/colorAccent"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:onClick="sendConfig"/>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,144 @@
<?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=".MainActivity"
android:background="@color/colorPrimaryDark">
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="0dp"
android:layout_height="50dp"
android:background="@color/colorMainHeader"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/roboto"
android:text="@string/info"
android:textColor="@color/colorMainBg"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<ScrollView
android:id="@+id/scrollView2"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="visible">
<TextView
android:id="@+id/textView7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="Verdnatura Levante S.L."
android:textColor="@color/colorMainBg"
android:textSize="14sp" />
<TextView
android:id="@+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto_bold"
android:text="B-97367486"
android:textColor="@color/colorMainBg"
android:textSize="14sp" />
<TextView
android:id="@+id/textView6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="Av.Espioca 100, 446460 Silla (Valencia)"
android:textColor="@color/colorMainBg"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginTop="15dp">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="15dp"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="@string/pendientes_actualizar"
android:textAllCaps="true"
android:textColor="@color/colorGray"
android:textSize="18sp" />
<TextView
android:id="@+id/textView10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="@string/tickets_firmados_pendientes"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:background="@color/colorPrimary"
android:layout_marginBottom="10dp"/>
</LinearLayout>
<ListView
android:visibility="gone"
android:id="@+id/listPendingTickets"
android:layout_width="match_parent"
android:layout_height="200dp"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="308dp"
/>
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,100 @@
<?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=".MainActivity"
android:background="@color/colorPrimaryDark"
android:focusableInTouchMode="true">
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="0dp"
android:layout_height="50dp"
android:background="@color/colorMainHeader"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView19"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:fontFamily="@font/roboto_bold"
android:text="@string/cargadores"
android:textColor="@color/colorMainBg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/textView38"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView38"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:fontFamily="@font/roboto_bold"
android:text="--"
android:textColor="@color/colorPrimary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.533" />
</android.support.constraint.ConstraintLayout>
<EditText
android:id="@+id/editText2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:ems="10"
android:inputType="textPersonName"
android:hint="@string/trabajador"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout"
android:background="@color/colorWhite"
android:padding="10dp"
android:imeOptions="actionDone"/>
<ListView
android:id="@+id/listWorkers"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toTopOf="@+id/textView37"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editText2" />
<TextView
android:id="@+id/textView37"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:fontFamily="@font/roboto_bold"
android:onClick="saveWorkers"
android:text="@string/guardar"
android:textAlignment="center"
android:textColor="@color/colorAccent"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,91 @@
<?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"
android:background="@color/colorMainHeader"
tools:context=".LoginActivity">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.52">
<ImageView
android:id="@+id/imageView"
android:layout_width="70dp"
android:layout_height="70dp"
app:srcCompat="@drawable/logo" />
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="30dp"
android:fontFamily="@font/roboto_light"
android:text="@string/reparto"
android:textAlignment="center"
android:textAllCaps="true"
android:textColor="@color/colorMainBg"
android:textSize="30sp" />
<EditText
android:id="@+id/txtUsuario"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginBottom="20dp"
android:background="@drawable/input_background"
android:ems="10"
android:fontFamily="@font/roboto_bold"
android:hint="@string/username"
android:inputType="textPersonName"
android:textAlignment="center"
android:textColor="@color/colorGray" />
<EditText
android:id="@+id/txtPassword"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginBottom="20dp"
android:background="@drawable/input_background"
android:ems="10"
android:fontFamily="@font/roboto_bold"
android:hint="@string/password"
android:inputType="textPassword"
android:textAlignment="center"
android:textColor="@color/colorGray" />
<CheckBox
android:id="@+id/checkVerPass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:fontFamily="@font/roboto"
android:text="@string/ver_contraseña"
android:textColor="@color/colorPrimary"
android:textSize="18sp"
android:onClick="showPassword"
android:paddingLeft="10dp"/>
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/button_background"
android:fontFamily="@font/roboto_bold"
android:text="@string/login"
android:textColor="@color/colorWhite"
android:onClick="logIn"/>
</LinearLayout>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,186 @@
<?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=".MainActivity"
android:background="@color/colorPrimaryDark">
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="0dp"
android:layout_height="50dp"
android:background="@color/colorMainHeader"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/roboto"
android:text="@string/reparto"
android:textColor="@color/colorMainBg"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/imageView8"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/imageView3"
android:layout_width="30dp"
android:layout_height="0dp"
android:layout_marginEnd="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/exit"
android:padding="5dp"
android:onClick="logOut"/>
<ImageView
android:id="@+id/imageView7"
android:layout_width="30dp"
android:layout_height="0dp"
android:layout_marginEnd="24dp"
android:padding="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/imageView3"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/ficha"
android:onClick="goToInfo"/>
<ImageView
android:id="@+id/imageView8"
android:layout_width="30dp"
android:layout_height="0dp"
android:layout_marginEnd="24dp"
android:onClick="getRoutes"
android:padding="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/imageView7"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/update" />
</android.support.constraint.ConstraintLayout>
<ScrollView
android:id="@+id/scrollView2"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginTop="0dp">
<TextView
android:id="@+id/textView9"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="@string/rutas"
android:textColor="@color/colorGray"
android:textSize="18sp"
android:textAllCaps="true"/>
</LinearLayout>
<ListView
android:id="@+id/listRutas"
android:layout_width="match_parent"
android:layout_height="250dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:orientation="vertical"
android:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="@string/pendientes_actualizar"
android:textAllCaps="true"
android:textColor="@color/colorGray"
android:textSize="18sp" />
<TextView
android:id="@+id/textView10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="@string/tickets_firmados_pendientes"
android:textColor="@color/colorWhite"
android:textSize="14sp" />
</LinearLayout>
<ImageView
android:id="@+id/btnUpload"
android:layout_width="80dp"
android:layout_height="28dp
"
android:src="@drawable/upload"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:layout_marginTop="6dp"
android:onClick="confirmSavePos"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:background="@color/colorPrimary"
android:layout_marginBottom="10dp"/>
</LinearLayout>
<ListView
android:visibility="visible"
android:id="@+id/listPendingTickets"
android:layout_width="match_parent"
android:layout_height="200dp"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="308dp"
/>
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,145 @@
<?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=".MainActivity"
android:background="@color/colorPrimaryDark">
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="0dp"
android:layout_height="50dp"
android:background="@color/colorMainHeader"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView19"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:fontFamily="@font/roboto_bold"
android:text="@string/notas"
android:textColor="@color/colorMainBg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<EditText
android:id="@+id/editText2"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:background="@color/colorGray"
android:ems="10"
android:gravity="top"
android:padding="10dp"
android:textColor="@color/colorWhite"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView39"
android:inputType="textMultiLine"
android:maxLength="90"
android:imeOptions="actionDone"/>
<TextView
android:id="@+id/textView37"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="17dp"
android:fontFamily="@font/roboto_bold"
android:text="@string/guardar"
android:textAlignment="center"
android:textColor="@color/colorAccent"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:onClick="addNote"/>
<TextView
android:id="@+id/textView39"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/roboto"
android:text="@string/nueva_nota"
android:textColor="@color/colorWhite"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
<TextView
android:id="@+id/txtNumCharacters"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/roboto"
android:text="140 carácteres restantes"
android:textColor="@color/colorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editText2" />
<TextView
android:id="@+id/textView14"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/roboto_bold"
android:text="Mensajes predeterminados:"
android:textColor="@color/colorMainBg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtNumCharacters" />
<TextView
android:id="@+id/textView40"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/roboto"
android:text="(selecciona uno)"
android:textColor="@color/colorGray"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView14" />
<ListView
android:id="@+id/listMensajes"
android:layout_width="368dp"
android:layout_height="267dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toTopOf="@+id/textView37"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView40" />
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,150 @@
<?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=".SignActivity"
android:background="@color/colorPrimaryDark">
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="0dp"
android:layout_height="50dp"
android:background="@color/colorMainHeader"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:fontFamily="@font/roboto"
android:text="@string/borrar"
android:textColor="@color/colorPrimary"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:onClick="clearSign"/>
<TextView
android:id="@+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/roboto"
android:text="@string/firma"
android:textColor="@color/colorMainBg"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/textView4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<LinearLayout
android:id="@+id/linearLayout4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/txtCliente"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="--"
android:textColor="@color/colorMainBg"
android:textSize="14sp"
android:textStyle="bold"/>
<TextView
android:id="@+id/textView7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="@string/ticket"
android:textColor="@color/colorMainBg"
android:textSize="14sp" />
<TextView
android:id="@+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto_bold"
android:text="--"
android:textColor="@color/colorMainBg"
android:textSize="14sp" />
<TextView
android:id="@+id/textView6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="@string/packages"
android:textColor="@color/colorMainBg"
android:textSize="14sp" />
<TextView
android:id="@+id/textView8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto_bold"
android:text="--"
android:textColor="@color/colorMainBg"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<com.simplify.ink.InkView
android:id="@+id/ink"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:background="@color/colorMainHeader"
app:inkFlags="interpolation|responsiveWeight"
app:layout_constraintBottom_toTopOf="@+id/textView36"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout4"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="@+id/textView36"
android:layout_width="0dp"
android:layout_height="44dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:fontFamily="@font/roboto_bold"
android:text="@string/guardar"
android:textAlignment="center"
android:textColor="@color/colorAccent"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:gravity="center"
android:onClick="saveSign"/>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,122 @@
<?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=".MainActivity"
android:background="@color/colorPrimaryDark">
<TextView
android:id="@+id/textView22"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/roboto"
android:gravity="center"
android:text="@string/ver_firmados"
android:textColor="@color/colorPrimary"
android:textSize="14sp"
app:layout_constraintBottom_toTopOf="@+id/linearLayout2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout"
android:onClick="showSigned"/>
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="0dp"
android:layout_height="50dp"
android:background="@color/colorMainHeader"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView35"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:fontFamily="@font/roboto"
android:text="0/15 signed clients"
android:textColor="@color/colorSecundary"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/imageView2"
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="30dp"
android:layout_height="0dp"
android:layout_marginEnd="8dp"
android:onClick="goToConfig"
android:padding="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/settinhgs" />
<TextView
android:id="@+id/textView19"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/roboto_bold"
android:text="--"
android:textColor="@color/colorMainBg"
app:layout_constraintBottom_toTopOf="@+id/textView35"
app:layout_constraintEnd_toStartOf="@+id/imageView2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<TextView
android:id="@+id/textView20"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/roboto"
android:text="@string/tickets_por_firmar"
android:textAllCaps="true"
android:textColor="@color/colorGray"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="@+id/textView22"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:background="@color/colorPrimary"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView20" />
<ListView
android:id="@+id/listClientes"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout2" />
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView16"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:fontFamily="@font/roboto"
android:text="26/10/2018"
android:textColor="@color/colorWhite" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:orientation="horizontal"
android:background="@color/colorPrimary"
android:layout_marginBottom="10dp"/>
</LinearLayout>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/customdialog"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="20dp"
android:minWidth="300dp">
<ListView
android:id="@+id/dialoglist"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>

View File

@ -0,0 +1,37 @@
<?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">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:padding="8dp">
<TextView
android:id="@+id/txtTitulo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto_bold"
android:text="Comercial"
android:textColor="@color/colorPrimaryDark"
android:textSize="18sp" />
<TextView
android:id="@+id/txtPhone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="689314028"
android:textColor="@color/colorPrimaryDark"
android:textSize="18sp" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,30 @@
<?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">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="20dp"
android:background="@color/colorWhite">
<ProgressBar
android:id="@+id/id_pbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/id_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/id_pbar"
android:layout_centerHorizontal="true"
android:fontFamily="@font/roboto"
android:text="@string/please_wait"
android:textSize="18sp" />
</RelativeLayout>
</RelativeLayout>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tv"
android:textColor="@color/colorWhite"
android:padding="5sp"
android:layout_width="fill_parent"
android:singleLine="true"
android:layout_height="fill_parent"/>

View File

@ -0,0 +1,180 @@
<?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">
<LinearLayout
android:layout_width="0dp"
android:layout_height="150dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@color/colorMainHeader">
<LinearLayout
android:layout_width="5dp"
android:layout_height="match_parent"
android:background="@color/darkclear"
android:orientation="horizontal">
</LinearLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:orientation="vertical"
app:layout_constraintEnd_toStartOf="@+id/linearLayout"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="@+id/textView11"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="44393"
android:textColor="@color/colorMainBg" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/textView19"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:fontFamily="@font/roboto"
android:text="@string/hora"
android:textColor="@color/colorGray" />
<TextView
android:id="@+id/textView15"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="09:00"
android:textColor="@color/colorMainBg" />
</LinearLayout>
<TextView
android:id="@+id/textView8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="Zona20 MADRID"
android:textColor="@color/colorMainBg"
android:textSize="18sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:fontFamily="@font/roboto"
android:text="@string/numero_paleta"
android:textColor="@color/colorGray" />
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/roboto"
android:text="1695-DSY"
android:textColor="@color/colorMainBg" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:fontFamily="@font/roboto"
android:text="@string/m3"
android:textColor="@color/colorGray" />
<TextView
android:id="@+id/txtM3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/roboto"
android:text="0.0"
android:textColor="@color/colorMainBg" />
</LinearLayout>
<TextView
android:id="@+id/btnCargadores"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:fontFamily="@font/roboto"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="@string/cargadores"
android:textColor="@color/colorPrimary"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="100dp"
android:layout_height="0dp"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView10"
android:layout_width="match_parent"
android:layout_height="30dp"
app:srcCompat="@drawable/noweb"
android:layout_marginTop="0dp"
android:layout_marginBottom="5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="@string/ver_tickets"
android:textColor="@color/colorPrimary"/>
<TextView
android:id="@+id/txtOnline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="@string/no_disponible"
android:textAlignment="center"
android:textColor="@color/colorGray"
android:visibility="gone"/>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,111 @@
<?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">
<LinearLayout
android:id="@+id/linearLayout5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/colorPrimaryDark"
android:orientation="vertical"
android:padding="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView30"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:layout_weight="0"
android:fontFamily="@font/roboto"
android:text="@string/ticket"
android:textColor="@color/colorGray"
android:textSize="18sp" />
<TextView
android:id="@+id/textView29"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:fontFamily="@font/roboto"
android:text="2041368"
android:textColor="@color/colorMainBg"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView32"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:layout_weight="0"
android:fontFamily="@font/roboto"
android:text="@string/packages"
android:textColor="@color/colorGray" />
<TextView
android:id="@+id/textView31"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:fontFamily="@font/roboto"
android:text="2"
android:textColor="@color/colorMainBg" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView34"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:layout_weight="0"
android:fontFamily="@font/roboto"
android:text="@string/warehouse"
android:textColor="@color/colorGray" />
<TextView
android:id="@+id/textView33"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:fontFamily="@font/roboto"
android:text="Silla FV"
android:textColor="@color/colorMainBg" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/btnPolizon"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_gravity="right"
android:layout_marginEnd="8dp"
android:src="@drawable/polizon"
app:layout_constraintBottom_toTopOf="@+id/linearLayout5"
app:layout_constraintEnd_toEndOf="@+id/linearLayout5"
app:layout_constraintTop_toBottomOf="@+id/linearLayout5"
android:padding="10dp"/>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,260 @@
<?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">
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/colorPrimaryDark"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="5dp"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:orientation="vertical" />
<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/colorMainHeader"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:paddingRight="5dp">
<TextView
android:id="@+id/textView23"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:fontFamily="@font/roboto"
android:text="@string/cliente"
android:textColor="@color/colorGray" />
<TextView
android:id="@+id/textView21"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:fontFamily="@font/roboto"
android:text="5036"
android:textColor="@color/colorMainBg" />
<TextView
android:id="@+id/textView18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:fontFamily="@font/roboto"
android:text="@string/consignatorio"
android:textColor="@color/colorGray" />
<TextView
android:id="@+id/textView17"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="24820"
android:textColor="@color/colorMainBg" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingBottom="5dp">
<TextView
android:id="@+id/textView25"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="TIENDA ATELIER DE KENTIA"
android:textColor="@color/colorMainBg"
android:textSize="18sp" />
<TextView
android:id="@+id/textView24"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="CARRER SANT JOAN, 61"
android:textAllCaps="true"
android:textColor="@color/colorPrimary" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView27"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:layout_weight="0"
android:fontFamily="@font/roboto"
android:text="07860"
android:textColor="@color/colorPrimary" />
<TextView
android:id="@+id/textView26"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:fontFamily="@font/roboto"
android:text="SANT FRANCESC XAVIER"
android:textAllCaps="true"
android:textColor="@color/colorPrimary" />
</LinearLayout>
<TextView
android:id="@+id/txtNote"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:fontFamily="@font/roboto"
android:text=""
android:textAllCaps="true"
android:textColor="@color/colorMainBg"
android:visibility="gone"/>
</LinearLayout>
<LinearLayout
android:id="@+id/layoutTickets"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorMainHeader"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/btnNote"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal"
android:padding="8dp">
<ImageView
android:id="@+id/imageView7"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_weight="1"
app:srcCompat="@drawable/note" />
</LinearLayout>
<LinearLayout
android:id="@+id/btnAddNote"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal"
android:padding="8dp">
<ImageView
android:id="@+id/imageView9"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_weight="1"
app:srcCompat="@drawable/notes" />
</LinearLayout>
<LinearLayout
android:id="@+id/btnPhone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal"
android:padding="8dp">
<ImageView
android:id="@+id/imageView4"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_weight="1"
app:srcCompat="@drawable/telephone" />
</LinearLayout>
<LinearLayout
android:id="@+id/btnMap"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal"
android:padding="8dp">
<ImageView
android:id="@+id/imageView5"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_weight="1"
app:srcCompat="@drawable/placeholder" />
</LinearLayout>
<LinearLayout
android:id="@+id/btnSign"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal"
android:padding="8dp">
<ImageView
android:id="@+id/imageView6"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_weight="1"
app:srcCompat="@drawable/firmar" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="20dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout3"></LinearLayout>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,92 @@
<?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">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@color/colorMainHeader">
<LinearLayout
android:id="@+id/layerSelected"
android:layout_width="5dp"
android:layout_height="match_parent"
android:background="@color/colorMainBg"
android:orientation="horizontal">
</LinearLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textView11"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="44393"
android:textColor="@color/colorMainBg" />
<TextView
android:id="@+id/textView8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="ANTONIO JESUS DIAZ AMARILLO"
android:textColor="@color/colorMainBg"
android:textSize="18sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView13"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:fontFamily="@font/roboto"
android:text="ADA"
android:textColor="@color/colorGray" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/txtCity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:fontFamily="@font/roboto"
android:text="Madrid"
android:textColor="@color/colorGray" />
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,94 @@
<?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">
<LinearLayout
android:layout_width="0dp"
android:layout_height="95dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@color/colorMainHeader">
<LinearLayout
android:layout_width="5dp"
android:layout_height="match_parent"
android:background="@color/darkclear"
android:orientation="horizontal">
</LinearLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/txtIdCliente"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="--"
android:textColor="@color/colorMainBg" />
<TextView
android:id="@+id/txtNameCliente"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/roboto"
android:text="--"
android:textColor="@color/colorMainBg"
android:textSize="18sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:fontFamily="@font/roboto"
android:text=""
android:textColor="@color/colorGray" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:fontFamily="@font/roboto"
android:text="@string/actualizar_tickets"
android:textColor="@color/colorPrimary" />
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Verdnatura Delivery</string>
<string name="reparto">Delivery</string>
<string name="username">Username</string>
<string name="password">Password</string>
<string name="login">Log In</string>
<string name="ver_contraseña">Show password</string>
<string name="cerrar_sesion">log out</string>
<string name="rutas">Routes</string>
<string name="pendientes_actualizar">Pending update</string>
<string name="tickets_firmados_pendientes">Signed tickets pending update</string>
<string name="numero_paleta">Palet number</string>
<string name="ver_tickets">show tickets</string>
<string name="actualizar_tickets">Update ticket</string>
<string name="configurar_ruta">configure</string>
<string name="tickets_por_firmar">Clients to sign</string>
<string name="ver_firmados">show signed</string>
<string name="cliente">Client</string>
<string name="consignatorio">Consigne</string>
<string name="volver">back</string>
<string name="please_wait">please wait</string>
<string name="error_conexion">connection error</string>
<string name="usuario_incorrecto">User or password incorrect</string>
<string name="clientes_firmados">Signed clients</string>
<string name="ver_por_firmar">show not signed</string>
<string name="telefono">Phone</string>
<string name="comercial">Trade</string>
<string name="borrar">clear</string>
<string name="firma">Sign</string>
<string name="guardar">Save</string>
<string name="estas_seguro_firma">¿Are you sure to sign?</string>
<string name="si">Yes</string>
<string name="info">Info</string>
<string name="actualizar">Update</string>
<string name="ver_loc">How do you want to get the position?</string>
<string name="nombre">Name</string>
<string name="coordenadas">Coordinates</string>
<string name="diferente_loc">The last position is different from the current one. Do you want to modify the position or keep the registered one?</string>
<string name="mantener">Keep</string>
<string name="polizon">Stowaway</string>
<string name="kilometros">Kilometers</string>
<string name="horas">Hours</string>
<string name="km_inicio">Start km</string>
<string name="km_fin">Finish km</string>
<string name="hora_inicio">Start hour</string>
<string name="hora_fin">Finish hour</string>
<string name="cargadores">Loaders</string>
<string name="trabajador">Worker</string>
<string name="seleccionados">selecteds</string>
<string name="notas">Notes</string>
<string name="nueva_nota">Text of the note</string>
<string name="caract_restantes">characters remaining</string>
<string name="disponible_offline">Available offline</string>
<string name="no_disponible">DOWNLOAD</string>
<string name="hora">Hour</string>
</resources>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#f7931e</color>
<color name="colorPrimaryDark">#222</color>
<color name="colorAccent">#f7931e</color>
<color name="colorSecundary">#ffdfba</color>
<color name="colorMainHeader">#3D3D3D</color>
<color name="colorWhite">#ffffff</color>
<color name="colorGray">#9b9b9b</color>
<color name="colorMainBg">#e5e5e5</color>
<color name="colorGreen">#85C22E</color>
<color name="darkclear">#7B7B7B</color>
</resources>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="com_google_android_gms_fonts_certs">
<item>@array/com_google_android_gms_fonts_certs_dev</item>
<item>@array/com_google_android_gms_fonts_certs_prod</item>
</array>
<string-array name="com_google_android_gms_fonts_certs_dev">
<item>
MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
</item>
</string-array>
<string-array name="com_google_android_gms_fonts_certs_prod">
<item>
MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
</item>
</string-array>
</resources>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="preloaded_fonts" translatable="false">
<item>@font/roboto</item>
<item>@font/roboto_bold</item>
<item>@font/roboto_light</item>
<item>@font/roboto_thin</item>
</array>
</resources>

View File

@ -0,0 +1,62 @@
<resources>
<string name="app_name">Reparto Verdnatura</string>
<string name="reparto">Reparto</string>
<string name="username">Usuario</string>
<string name="password">Contraseña</string>
<string name="login">Entrar</string>
<string name="ver_contraseña">Ver contraseña</string>
<string name="cerrar_sesion">cerrar sesión</string>
<string name="rutas">Rutas</string>
<string name="pendientes_actualizar">Pendientes de actualizar</string>
<string name="tickets_firmados_pendientes">Tickets firmados pendientes de actualizar</string>
<string name="numero_paleta">Numero palet</string>
<string name="m3" translatable="false">M3</string>
<string name="ver_tickets">ver tickets</string>
<string name="actualizar_tickets">Actualizar ticket</string>
<string name="configurar_ruta">configurar ruta</string>
<string name="tickets_por_firmar">Clientes por firmar</string>
<string name="ver_firmados">ver firmados</string>
<string name="cliente">Cliente</string>
<string name="consignatorio">Consignatorio</string>
<string name="pc" translatable="false">PC</string>
<string name="ticket" translatable="false">Ticket</string>
<string name="packages" translatable="false">Packages</string>
<string name="warehouse" translatable="false">Warehouse</string>
<string name="volver">volver</string>
<string name="please_wait">trabajando</string>
<string name="error_conexion">error de conexión</string>
<string name="usuario_incorrecto">Usuario o contraseña incorrectos</string>
<string name="clientes_firmados">Clientes firmados</string>
<string name="ver_por_firmar">ver por firmar</string>
<string name="telefono">Teléfono</string>
<string name="comercial">Comercial</string>
<string name="borrar">borrar</string>
<string name="firma">Firma</string>
<string name="guardar">Guardar</string>
<string name="estas_seguro_firma">¿Estás seguro de firmar?</string>
<string name="si">Si</string>
<string name="no" translatable="false">No</string>
<string name="info">Información</string>
<string name="actualizar">Actualizar</string>
<string name="ver_loc">¿Cómo quieres obtener la posición?</string>
<string name="nombre">Por nombre</string>
<string name="coordenadas">Por coordenadas</string>
<string name="diferente_loc">La última posición obtenida es distinta a la actual. ¿Quieres modificar la posición o mantener la registrada?</string>
<string name="mantener">Mantener</string>
<string name="polizon">Polizon</string>
<string name="kilometros">Kilometros</string>
<string name="horas">Horas</string>
<string name="km_inicio">Km de inicio</string>
<string name="km_fin">Km fin</string>
<string name="hora_inicio">Hora de inicio</string>
<string name="hora_fin">Hora fin</string>
<string name="cargadores">Cargadores</string>
<string name="trabajador">Trabajador</string>
<string name="seleccionados">seleccionados</string>
<string name="notas">Notas</string>
<string name="nueva_nota">Texto de la nota</string>
<string name="caract_restantes">caracteres restantes</string>
<string name="disponible_offline">Disponible offline</string>
<string name="no_disponible">DESCARGAR</string>
<string name="hora">Hora</string>
</resources>

View File

@ -0,0 +1,23 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="NewDialog" parent="Theme.AppCompat.Dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowTitleStyle">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:background">@android:color/transparent</item>
</style>
</resources>

Some files were not shown because too many files have changed in this diff Show More