diff --git a/.gradle/5.4.1/executionHistory/executionHistory.bin b/.gradle/5.4.1/executionHistory/executionHistory.bin index dd09cb7..798b2c1 100644 Binary files a/.gradle/5.4.1/executionHistory/executionHistory.bin and b/.gradle/5.4.1/executionHistory/executionHistory.bin differ diff --git a/.gradle/5.4.1/executionHistory/executionHistory.lock b/.gradle/5.4.1/executionHistory/executionHistory.lock index 41b05b6..b4bf239 100644 Binary files a/.gradle/5.4.1/executionHistory/executionHistory.lock and b/.gradle/5.4.1/executionHistory/executionHistory.lock differ diff --git a/.gradle/5.4.1/fileHashes/fileHashes.bin b/.gradle/5.4.1/fileHashes/fileHashes.bin index 5f42a1c..abf2334 100644 Binary files a/.gradle/5.4.1/fileHashes/fileHashes.bin and b/.gradle/5.4.1/fileHashes/fileHashes.bin differ diff --git a/.gradle/5.4.1/fileHashes/fileHashes.lock b/.gradle/5.4.1/fileHashes/fileHashes.lock index 8fd5c15..b069111 100644 Binary files a/.gradle/5.4.1/fileHashes/fileHashes.lock and b/.gradle/5.4.1/fileHashes/fileHashes.lock differ diff --git a/.gradle/5.4.1/fileHashes/resourceHashesCache.bin b/.gradle/5.4.1/fileHashes/resourceHashesCache.bin index 91c880b..211a36c 100644 Binary files a/.gradle/5.4.1/fileHashes/resourceHashesCache.bin and b/.gradle/5.4.1/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/5.4.1/javaCompile/classAnalysis.bin b/.gradle/5.4.1/javaCompile/classAnalysis.bin index 13f3185..d3a1c0f 100644 Binary files a/.gradle/5.4.1/javaCompile/classAnalysis.bin and b/.gradle/5.4.1/javaCompile/classAnalysis.bin differ diff --git a/.gradle/5.4.1/javaCompile/jarAnalysis.bin b/.gradle/5.4.1/javaCompile/jarAnalysis.bin index 4c9c01d..aa1d18d 100644 Binary files a/.gradle/5.4.1/javaCompile/jarAnalysis.bin and b/.gradle/5.4.1/javaCompile/jarAnalysis.bin differ diff --git a/.gradle/5.4.1/javaCompile/javaCompile.lock b/.gradle/5.4.1/javaCompile/javaCompile.lock index e7da753..1f56630 100644 Binary files a/.gradle/5.4.1/javaCompile/javaCompile.lock and b/.gradle/5.4.1/javaCompile/javaCompile.lock differ diff --git a/.gradle/5.4.1/javaCompile/taskHistory.bin b/.gradle/5.4.1/javaCompile/taskHistory.bin index c28b162..5d3a8fd 100644 Binary files a/.gradle/5.4.1/javaCompile/taskHistory.bin and b/.gradle/5.4.1/javaCompile/taskHistory.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 0537e5e..562182b 100644 Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin index cbdca2a..80c8fe4 100644 Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.idea/compiler.xml b/.idea/compiler.xml index fb7f4a8..61a9130 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml deleted file mode 100644 index 716b52b..0000000 --- a/.idea/deploymentTargetDropDown.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 4660ee8..c49333c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -96,7 +96,7 @@ - + diff --git a/.idea/modules/app/vn-delivery.app.iml b/.idea/modules/app/vn-delivery.app.iml index b6290d5..eaa4acc 100644 --- a/.idea/modules/app/vn-delivery.app.iml +++ b/.idea/modules/app/vn-delivery.app.iml @@ -10,17 +10,12 @@ - diff --git a/.idea/modules/app/vn-delivery.app.main.iml b/.idea/modules/app/vn-delivery.app.main.iml index 068e68c..c201235 100644 --- a/.idea/modules/app/vn-delivery.app.main.iml +++ b/.idea/modules/app/vn-delivery.app.main.iml @@ -7,12 +7,15 @@ - + - - - + + + - - - + + + - - + + - - - + + + + - - - - - + + + @@ -98,17 +95,16 @@ + + - - - @@ -153,6 +149,8 @@ + + diff --git a/.idea/modules/app/vn-delivery.app.unitTest.iml b/.idea/modules/app/vn-delivery.app.unitTest.iml index 8f59da8..c69c224 100644 --- a/.idea/modules/app/vn-delivery.app.unitTest.iml +++ b/.idea/modules/app/vn-delivery.app.unitTest.iml @@ -3,17 +3,12 @@ - @@ -23,18 +18,18 @@ - + - + - + - - - - + + + @@ -91,6 +85,7 @@ + @@ -99,9 +94,7 @@ - - @@ -147,6 +140,8 @@ + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5c6b7eb..e569763 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -40,157 +40,45 @@ - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - + - - - - - - + + + - + - + @@ -241,11 +129,16 @@ - + + - - + + + + + + @@ -255,43 +148,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + { + "keyToString": { + "ApkExportedModule": "vn-delivery.app", + "ExportApk.ApkPathForvn-delivery.app": "C:\\Users\\sergiodt\\AndroidStudioProjects\\vn-delivery\\", + "PROJECT_TRUSTED_KEY": "true", + "RunOnceActivity.cidr.known.project.marker": "true", + "android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-28/android/widget/AbsListView.java_SELECTED": "AbsListView", + "android-custom-viewC:/Users/sergiodt/AppData/Local/Android/Sdk/sources/android-28/android/widget/ListView.java_SELECTED": "ListView", + "cidr.known.project.marker": "true", + "last_opened_file_path": "C:/Users/sergiodt/AndroidStudioProjects/vn-picture/platforms/android" + }, + "keyToStringList": { + "ExportApk.BuildVariants": [ + "release" + ] + } +} @@ -473,14 +354,26 @@ - - + + + + + file://$PROJECT_DIR$/app/src/main/java/verdnatura/es/repartoverdnatura/ExpeditionSummaryActivity.kt + 319 + + + diff --git a/apk/release/output.json b/apk/release/output.json deleted file mode 100644 index 0178c9f..0000000 --- a/apk/release/output.json +++ /dev/null @@ -1 +0,0 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":30,"versionName":"23.2Beta","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 421fc27..1794cca 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,9 @@ android { applicationId "verdnatura.es.repartoverdnatura" minSdkVersion 19 //targetSdkVersion 28 - versionCode 30 + versionCode 33 versionName "23.2Beta" + //versionName "23.2Beta" Madrid 33 //versionName "9.6.1Beta" //versionCode 27 //versionName "9.6" //versionName "9.5" versionCode 26 @@ -22,9 +23,19 @@ android { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } - getByName("release") { + /* getByName("release") { applicationIdSuffix = ".sfusion" } + getByName("debug") { + applicationIdSuffix = ".sfusion" + }*/ + getByName("release") { + applicationIdSuffix = ".sfusionMadrid" + } + getByName("debug") { + applicationIdSuffix = ".sfusionMadrid" + } + } } diff --git a/app/google-services.json b/app/google-services.json index 1a1dca9..856ce03 100644 --- a/app/google-services.json +++ b/app/google-services.json @@ -10,7 +10,7 @@ "client_info": { "mobilesdk_app_id": "1:622584359076:android:49dda1d8a6dc59f9", "android_client_info": { - "package_name": "verdnatura.es.repartoverdnatura.sfusion" + "package_name": "verdnatura.es.repartoverdnatura.sfusionMadrid" } }, "oauth_client": [ @@ -18,7 +18,7 @@ "client_id": "622584359076-0ph8u7jfg7ifgs6qe4ueb6oqj9c8mv36.apps.googleusercontent.com", "client_type": 1, "android_info": { - "package_name": "verdnatura.es.repartoverdnatura.sfusion", + "package_name": "verdnatura.es.repartoverdnatura.sfusionMadrid", "certificate_hash": "1495f9252766a51f3c48f2e9c8789c85cee831d0" } }, diff --git a/app/release/app-release.apk b/app/release/app-release.apk deleted file mode 100644 index 14bf209..0000000 Binary files a/app/release/app-release.apk and /dev/null differ diff --git a/app/release/output.json b/app/release/output.json index f1e2939..0178c9f 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":9,"versionName":"9","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":30,"versionName":"23.2Beta","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/verdnatura/es/repartoverdnatura/ExpeditionSummaryActivity.kt b/app/src/main/java/verdnatura/es/repartoverdnatura/ExpeditionSummaryActivity.kt index 84c066f..129f852 100644 --- a/app/src/main/java/verdnatura/es/repartoverdnatura/ExpeditionSummaryActivity.kt +++ b/app/src/main/java/verdnatura/es/repartoverdnatura/ExpeditionSummaryActivity.kt @@ -6,13 +6,10 @@ import android.content.Intent import android.media.MediaPlayer import android.os.Bundle import android.support.v7.app.AppCompatActivity +import android.util.Log.d import android.view.View -import android.view.View.OnFocusChangeListener import android.view.inputmethod.InputMethodManager -import android.widget.EditText -import android.widget.ListView -import android.widget.TextView -import android.widget.Toast +import android.widget.* import retrofit2.Call import retrofit2.Callback import retrofit2.Response @@ -25,7 +22,6 @@ import verdnatura.es.repartoverdnatura.UTILS.ApiUtils import verdnatura.es.repartoverdnatura.UTILS.LocalStorage import verdnatura.es.repartoverdnatura.UTILS.Utils - class ExpeditionSummaryActivity : AppCompatActivity() { var mpError: MediaPlayer? = null var mpOk: MediaPlayer? = null @@ -56,7 +52,7 @@ class ExpeditionSummaryActivity : AppCompatActivity() { var totalSend = 0 var totalSendSuccessful = 0 var positionSelected: Int? = null - + var positionOnScreen: Int = 0 override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -89,6 +85,7 @@ class ExpeditionSummaryActivity : AppCompatActivity() { changeTitle(route = routeOfLoad) setEvents() + setViews() } @@ -97,14 +94,30 @@ class ExpeditionSummaryActivity : AppCompatActivity() { } + private fun setViews() { + listView!!.setOnScrollListener(object : AbsListView.OnScrollListener { + override fun onScrollStateChanged(view: AbsListView, scrollState: Int) { + } + + override fun onScroll( + view: AbsListView, + firstVisibleItem: Int, + visibleItemCount: Int, + totalItemCount: Int + ) { + positionOnScreen = firstVisibleItem + + } + }) + } override fun onResume() { - super.onResume() + super.onResume() listExpeditionSummary.clear() + expedition_getSummary() if (textAddressSelected!!.text.isNotEmpty()) { - checks txtScan!!.requestFocus() } @@ -114,25 +127,40 @@ class ExpeditionSummaryActivity : AppCompatActivity() { adress: String?, position: Int ) { - //itemScaneed es para ver si se ha escaneado algo y es diferente los consignatarios positionSelected = position if (itemScanned && !(textAddressSelected!!.text).equals(adress)) { totalSend = 2 - Utils.progressBar.show(this, getResources().getString(R.string.please_wait)) - expeditionState_addByExpeditionMulti(listCheck - .filter { it.addressFk == textAddressSelected!!.text } - .filter { it.routeFk == textViewRoute!!.text } - .filter { it.code == "ON DELIVERY" }, "ON DELIVERY" - ) + if (listCheck + .filter { it.addressFk == textAddressSelected!!.text } + .filter { it.routeFk == textViewRoute!!.text } + .filter { it.code == "ON DELIVERY" }.isNotEmpty() + ) { + Utils.progressBar.show(this, getResources().getString(R.string.please_wait)) + expeditionState_addByExpeditionMulti(listCheck + .filter { it.addressFk == textAddressSelected!!.text } + .filter { it.routeFk == textViewRoute!!.text } + .filter { it.code == "ON DELIVERY" }, "ON DELIVERY" + ) + } else { + totalSend = -1 + } - expeditionState_addByExpeditionMulti(listCheck - .filter { it.addressFk == textAddressSelected!!.text } - .filter { it.routeFk == textViewRoute!!.text } - .filter { it.code != "ON DELIVERY" }, "LOST" - ) + if (listCheck + .filter { it.addressFk == textAddressSelected!!.text } + .filter { it.routeFk == textViewRoute!!.text } + .filter { it.code != "ON DELIVERY" }.isNotEmpty() + ) { + expeditionState_addByExpeditionMulti(listCheck + .filter { it.addressFk == textAddressSelected!!.text } + .filter { it.routeFk == textViewRoute!!.text } + .filter { it.code != "ON DELIVERY" }, "LOST" + ) + } else { + totalSend = -1 + } itemScanned = false } @@ -145,7 +173,8 @@ class ExpeditionSummaryActivity : AppCompatActivity() { } - private val checks: Unit + private + val checks: Unit get() { val listDownload: ArrayList = ArrayList() @@ -166,7 +195,6 @@ class ExpeditionSummaryActivity : AppCompatActivity() { if (response.isSuccessful) { for (c in response.body()!!) { - if (!c.code.isNullOrBlank()) { if (c.code.equals("ON DELIVERY")) { @@ -208,7 +236,6 @@ class ExpeditionSummaryActivity : AppCompatActivity() { fun getLocalDataExpedition() { - val list: List = LocalStorage.getExpeditions(this) listCheck = LocalStorage.getExpeditions(this) if (list.size > 0) { @@ -221,19 +248,18 @@ class ExpeditionSummaryActivity : AppCompatActivity() { .filter { it.routeFk == textViewRoute!!.text } .filter { it.checked == "1" || it.code == "ON DELIVERY" }.size - textLoaded!!.text = checked.toString() + "/" + totalChecks.toString() + " cargadas" + textLoaded!!.text = + checked.toString() + "/" + totalChecks.toString() + " cargadas" hideKeyboard() } - } - private fun expedition_getSummary() { - + var oldPosition = positionOnScreen Utils.progressBar.show(this, resources.getString(R.string.please_wait)) val routeData: Array = arrayOfNulls(1) @@ -242,7 +268,6 @@ class ExpeditionSummaryActivity : AppCompatActivity() { restClient!!.route_getExpeditionSummary(Utils.getMapWhitUser(this), routeData) .enqueue(object : Callback> { - override fun onResponse( call: Call>, response: Response> @@ -263,6 +288,8 @@ class ExpeditionSummaryActivity : AppCompatActivity() { } setAdapter(listExpeditionSummary) + listView!!.setSelection(oldPosition) + } else { Utils.progressBar.dialog.dismiss() @@ -275,7 +302,10 @@ class ExpeditionSummaryActivity : AppCompatActivity() { } - override fun onFailure(call: Call>, t: Throwable) { + override fun onFailure( + call: Call>, + t: Throwable + ) { Utils.progressBar.dialog.dismiss() Utils.showErrorDialog( this@ExpeditionSummaryActivity, @@ -285,27 +315,29 @@ class ExpeditionSummaryActivity : AppCompatActivity() { }) } - private fun setEvents() { - - txtScan!!.setOnEditorActionListener { _, _, _ -> - Toast.makeText(this, "Expedición :" + txtScan!!.text, Toast.LENGTH_SHORT).show() - findExpedition(txtScan!!.text.toString()) - itemScanned = true - false - } - txtScan!!.onFocusChangeListener = OnFocusChangeListener { _, b -> - - - if (b) { - txtScan!!.setText("") + txtScan!!.setOnEditorActionListener { _, actionId, _ -> + if (!txtScan!!.text.isNullOrEmpty()) { + Toast.makeText(this, "Expedición :" + txtScan!!.text, Toast.LENGTH_SHORT).show() + findExpedition(txtScan!!.text.toString()) + itemScanned = true } - } - - listView!!.setOnFocusChangeListener { _, _ -> - txtScan!!.requestFocus() + true + //txtScan!!.requestFocus() } + /* txtScan!!.onFocusChangeListener = OnFocusChangeListener { _, b -> + + if (b) { + txtScan!!.setText("") + + }else{} + } + + listView!!.setOnFocusChangeListener { _, _ -> + txtScan!!.requestFocus() + + }*/ } @@ -342,7 +374,7 @@ class ExpeditionSummaryActivity : AppCompatActivity() { } txtScan!!.setText("") - txtScan!!.requestFocus() + txtScan!!.requestFocus() } @@ -372,14 +404,20 @@ class ExpeditionSummaryActivity : AppCompatActivity() { } - private fun expeditionState_addByExpeditionMulti(expeditions: List, state: String) { + private fun expeditionState_addByExpeditionMulti( + expeditions: List, + state: String + ) { val stateData: Array = arrayOfNulls(2) stateData[0] = expeditions stateData[1] = state - restClient!!.expeditionState_addByExpeditionMulti(Utils.getMapWhitUser(this), stateData) + restClient!!.expeditionState_addByExpeditionMulti( + Utils.getMapWhitUser(this), + stateData + ) .enqueue(object : Callback { override fun onResponse(call: Call, response: Response) { Utils.progressBar.dialog.dismiss() @@ -424,17 +462,21 @@ class ExpeditionSummaryActivity : AppCompatActivity() { private fun checkNextAddress(totalSendSuccessful: Int) { + if (listExpeditionSummary.size > positionSelected!! + 1) { + textAddressSelected!!.text = + if (checked == totalChecks) { + listExpeditionSummary.get(positionSelected!! + 1).address + } else { + listExpeditionSummary.get(positionSelected!!).address - if (listExpeditionSummary.size >= positionSelected!! + 1) { - textAddressSelected!!.text = listExpeditionSummary.get(positionSelected!! + 1).address - positionSelected = positionSelected!! + 1 + } + //positionSelected = positionSelected!! + 1 } onResume() } - fun Activity.hideKeyboard() { hideKeyboard(currentFocus ?: View(this)) } @@ -456,7 +498,6 @@ class ExpeditionSummaryActivity : AppCompatActivity() { } - fun exit(view: View) { if (itemScanned && textAddressSelected!!.text.isNotEmpty()) { @@ -467,13 +508,20 @@ class ExpeditionSummaryActivity : AppCompatActivity() { .filter { it.routeFk == textViewRoute!!.text } .filter { it.code == "ON DELIVERY" }, "ON DELIVERY" ) + if (listCheck + .filter { it.addressFk == textAddressSelected!!.text } + .filter { it.routeFk == textViewRoute!!.text } + .filter { it.code != "ON DELIVERY" }.isNotEmpty() + ) { - expeditionState_addByExpeditionMulti(listCheck - .filter { it.addressFk == textAddressSelected!!.text } - .filter { it.routeFk == textViewRoute!!.text } - .filter { it.code != "ON DELIVERY" }, "LOST" - ) - + expeditionState_addByExpeditionMulti(listCheck + .filter { it.addressFk == textAddressSelected!!.text } + .filter { it.routeFk == textViewRoute!!.text } + .filter { it.code != "ON DELIVERY" }, "LOST" + ) + } else { + totalSend = 1 + } itemScanned = false } diff --git a/app/src/main/java/verdnatura/es/repartoverdnatura/Tickets.java b/app/src/main/java/verdnatura/es/repartoverdnatura/Tickets.java index fc46d2f..b6474d0 100644 --- a/app/src/main/java/verdnatura/es/repartoverdnatura/Tickets.java +++ b/app/src/main/java/verdnatura/es/repartoverdnatura/Tickets.java @@ -9,11 +9,11 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.net.Uri; import android.os.Build; +import android.os.Bundle; 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; @@ -30,14 +30,12 @@ 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.Check; import verdnatura.es.repartoverdnatura.MODELS.ClientTickets; import verdnatura.es.repartoverdnatura.MODELS.Cliente; import verdnatura.es.repartoverdnatura.MODELS.Ruta; @@ -49,18 +47,20 @@ import verdnatura.es.repartoverdnatura.UTILS.Utils; public class Tickets extends AppCompatActivity { public String tlf; + private int positionOnScreen = 0; private ListView listViewClients; private ArrayList listClientesTickets = new ArrayList<>(); private ArrayList listClientesTicketsFirmados = new ArrayList<>(); private ClientAdapter adapter; public Ruta route; private RestClient restClient; - private TextView txtZona, txtLines,btnVolver,txtClientsToSign,btnShowSigned; + private TextView txtZona, txtLines, btnVolver, txtClientsToSign, btnShowSigned; private boolean isSignedShowed = false; private ListView dialogListView; public String uri = ""; private int posForNote = 0; public ArrayList listData = new ArrayList<>(); + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -77,20 +77,22 @@ public class Tickets extends AppCompatActivity { @Override protected void onRestart() { + super.onRestart(); - setViews(); + // setViews(); checkPendingSigns(); + } - public void checkPendingSigns(){ + public void checkPendingSigns() { Set pendingSigns = LocalStorage.getPendingSigns(this); - if (pendingSigns.size() == 0){ + if (pendingSigns.size() == 0) { getData(-1); - }else{ + } else { Gson gson = new Gson(); listData = new ArrayList<>(); - for (String s : pendingSigns){ - listData.add(gson.fromJson(s,SignDataUpload.class)); + for (String s : pendingSigns) { + listData.add(gson.fromJson(s, SignDataUpload.class)); } confirmSave(0); @@ -98,7 +100,7 @@ public class Tickets extends AppCompatActivity { } } - public void confirmSave(final int pos){ + public void confirmSave(final int pos) { if (pos < listData.size()) { Utils.progressBar.show(this, getResources().getString(R.string.please_wait)); final Tickets that = this; @@ -110,8 +112,8 @@ public class Tickets extends AppCompatActivity { Utils.progressBar.getDialog().dismiss(); if (response.isSuccessful()) { - // if (response.body().equals("OK")) {*/ - confirmSave(pos+1); + // if (response.body().equals("OK")) {*/ + confirmSave(pos + 1); /* }else{ getData(pos); }*/ @@ -129,27 +131,28 @@ public class Tickets extends AppCompatActivity { getData(pos); } }); - }else{ + } else { Utils.progressBar.getDialog().dismiss(); getData(pos); } } - private void setViews(){ + private void setViews() { listViewClients = this.findViewById(R.id.listClientes); //Tarea 4659 - /* listViewClients.setOnScrollListener(new AbsListView.OnScrollListener() { + listViewClients.setOnScrollListener(new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { - Log.d("VERDNATURA::","has changed"); + //Log.d("VERDNATURA::","has changed"); } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { - Log.d("VERDNATURA::","has scroll"+firstVisibleItem); + // Log.d("VERDNATURA::","has scroll"+firstVisibleItem); + positionOnScreen = firstVisibleItem; } - });*/ + }); txtZona = this.findViewById(R.id.textView19); txtLines = this.findViewById(R.id.textView35); @@ -161,17 +164,17 @@ public class Tickets extends AppCompatActivity { } - private void getData(int pos){ + private void getData(int pos) { //han quedado firmas por subir ArrayList listAux = new ArrayList<>(); - if(pos < listData.size() && pos != -1){ + if (pos < listData.size() && pos != -1) { - for(int i = pos; i < listData.size(); i++){ + 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()); + LocalStorage.udpatePendingSigns(this, listAux, route.getId()); + } else { + LocalStorage.udpatePendingSigns(this, listAux, route.getId()); } txtLines.setText(""); @@ -179,64 +182,63 @@ public class Tickets extends AppCompatActivity { listClientesTickets = new ArrayList<>(); listClientesTicketsFirmados = new ArrayList<>(); listViewClients.setVisibility(View.VISIBLE); - Utils.progressBar.show(this,getResources().getString(R.string.please_wait)); + 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>() { + restClient.getClients(Utils.getMapWhitUser(this), routeData).enqueue(new Callback>() { @Override public void onResponse(Call> call, Response> response) { Utils.progressBar.getDialog().dismiss(); - Log.i("VERDNATURA","Vamos a por los clientes o tickets"); + Log.i("VERDNATURA", "Vamos a por los clientes o tickets"); Boolean exists = false; - if(response.isSuccessful()){ - for(Cliente cliente : response.body()){ + if (response.isSuccessful()) { + for (Cliente cliente : response.body()) { exists = false; - for (ClientTickets c : listClientesTicketsFirmados){ - if(c.getAddress().equals(cliente.getAddress())){ - Map values = new HashMap<>(); - values.put("Packages",cliente.getPackages()); - values.put("Warehouse",cliente.getWarehouse()); - values.put("Id",cliente.getId()); - values.put("Polizon",cliente.getPolizon()); - values.put("PackingType",cliente.getPackingType()); + for (ClientTickets c : listClientesTicketsFirmados) { + if (c.getAddress().equals(cliente.getAddress())) { + Map values = new HashMap<>(); + values.put("Packages", cliente.getPackages()); + values.put("Warehouse", cliente.getWarehouse()); + values.put("Id", cliente.getId()); + values.put("Polizon", cliente.getPolizon()); + values.put("PackingType", cliente.getPackingType()); c.addTicket(values); - c.setNote(c.getNote()+" - "+ cliente.getNote()); + c.setNote(c.getNote() + " - " + cliente.getNote()); exists = true; break; } } - for (ClientTickets c : listClientesTickets){ - if(c.getAddress().equals(cliente.getAddress())){ - Map values = new HashMap<>(); - values.put("Packages",cliente.getPackages()); - values.put("Warehouse",cliente.getWarehouse()); - values.put("Id",cliente.getId()); - values.put("Polizon",cliente.getPolizon()); - values.put("PackingType",cliente.getPackingType()); + for (ClientTickets c : listClientesTickets) { + if (c.getAddress().equals(cliente.getAddress())) { + Map values = new HashMap<>(); + values.put("Packages", cliente.getPackages()); + values.put("Warehouse", cliente.getWarehouse()); + values.put("Id", cliente.getId()); + values.put("Polizon", cliente.getPolizon()); + values.put("PackingType", cliente.getPackingType()); c.addTicket(values); - c.setNote(c.getNote()+" - "+ cliente.getNote()); + c.setNote(c.getNote() + " - " + cliente.getNote()); exists = true; break; } } - - if(!exists){ - Map values = new HashMap<>(); - values.put("Packages",cliente.getPackages()); - values.put("Warehouse",cliente.getWarehouse()); - values.put("Id",cliente.getId()); - values.put("Polizon",cliente.getPolizon()); - values.put("PackingType",cliente.getPackingType()); - ArrayList> arrayValues = new ArrayList<>(); + if (!exists) { + Map values = new HashMap<>(); + values.put("Packages", cliente.getPackages()); + values.put("Warehouse", cliente.getWarehouse()); + values.put("Id", cliente.getId()); + values.put("Polizon", cliente.getPolizon()); + values.put("PackingType", cliente.getPackingType()); + ArrayList> arrayValues = new ArrayList<>(); arrayValues.add(values); - if(cliente.getSigned().equals("0")){ + if (cliente.getSigned().equals("0")) { listClientesTickets.add(new ClientTickets(cliente.getClient(), cliente.getClientName(), cliente.getAddress(), @@ -251,7 +253,7 @@ public class Tickets extends AppCompatActivity { cliente.getPhones(), arrayValues, cliente.getPolizon())); - }else{ + } else { listClientesTicketsFirmados.add(new ClientTickets(cliente.getClient(), cliente.getClientName(), cliente.getAddress(), @@ -275,11 +277,11 @@ public class Tickets extends AppCompatActivity { Set localSigns = LocalStorage.getPendingSigns(that); Gson gson = new Gson(); ArrayList listAux = new ArrayList<>(); - for (String s : localSigns){ - SignDataUpload sdu = gson.fromJson(s,SignDataUpload.class); + for (String s : localSigns) { + SignDataUpload sdu = gson.fromJson(s, SignDataUpload.class); int count = 0; - for(ClientTickets c : listClientesTickets){ - if (sdu.getIdClient().equals(c.getClient())){ + for (ClientTickets c : listClientesTickets) { + if (sdu.getIdClient().equals(c.getClient())) { listAux.add(listClientesTickets.get(count)); break; } @@ -292,22 +294,22 @@ public class Tickets extends AppCompatActivity { } - - if (isSignedShowed){ - adapter = new ClientAdapter(that,listClientesTicketsFirmados); - }else{ - adapter = new ClientAdapter(that,listClientesTickets); + 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)); + 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()); + LocalStorage.saveListClientesTickets(that, listClientesTickets, route.getId()); + LocalStorage.saveListClientesTicketsFirmados(that, listClientesTicketsFirmados, route.getId()); + setPositionListView(); - - }else{ + } else { getLocalData(); + setPositionListView(); } } @@ -321,40 +323,47 @@ public class Tickets extends AppCompatActivity { }); - } - public void getLocalData(){ - listClientesTicketsFirmados = LocalStorage.getClientesTicketsFirmados(this,route.getId()); - listClientesTickets = LocalStorage.getClientesTickets(this,route.getId()); + private void setPositionListView() { + try { + listViewClients.setSelection(positionOnScreen); + } catch (Exception e){ + listViewClients.setSelection(0); + } + } - if (listClientesTicketsFirmados.size()== 0 && listClientesTickets.size() == 0){ - Utils.showErrorDialogAndFinish(this,this.getResources().getString(R.string.error_conexion)); - listViewClients.setVisibility(View.GONE); + 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); + 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)); + txtLines.setText("" + listClientesTicketsFirmados.size() + "/" + (listClientesTicketsFirmados.size() + listClientesTickets.size()) + " " + this.getResources().getString(R.string.clientes_firmados)); } - public void showPhones(int pos){ + public void showPhones(int pos) { ArrayList phones = new ArrayList<>(); - if (isSignedShowed){ - for (String phone : listClientesTicketsFirmados.get(pos).getPhones()){ - if (phone!=""){ + 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!=""){ + } else { + for (String phone : listClientesTickets.get(pos).getPhones()) { + if (phone != "") { phones.add(phone); } } @@ -367,18 +376,19 @@ public class Tickets extends AppCompatActivity { alertDialog.setView(convertView); alertDialog.setTitle(getResources().getString(R.string.telefono)); ListView lv = convertView.findViewById(R.id.dialoglist); - PhonesAdapter adapter = new PhonesAdapter(this,phones){}; + PhonesAdapter adapter = new PhonesAdapter(this, phones) { + }; lv.setAdapter(adapter); alertDialog.show(); } - public void llamarTelefono(String phone){ + 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 ); + ActivityCompat.requestPermissions((Activity) this, PERMISSIONS, 112); } else { makeCall(); } @@ -414,26 +424,26 @@ public class Tickets extends AppCompatActivity { } } - public void makeCall(){ - String uri = "tel:" + tlf.trim() ; + 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){ + public void goMaps(int pos) { final Tickets that = this; final int posicion = pos; - if(isGoogleMapsInstalled()){ + 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()+ + 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{ + 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); @@ -442,11 +452,11 @@ public class Tickets extends AppCompatActivity { 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()+ + 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))); + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(uri))); } }); @@ -455,9 +465,9 @@ public class Tickets extends AppCompatActivity { 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))); + uri = "geo:0,0?q=" + listClientesTicketsFirmados.get(posicion).getLatitude() + + " " + listClientesTicketsFirmados.get(posicion).getLongitude(); + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(uri))); } }); @@ -467,14 +477,14 @@ public class Tickets extends AppCompatActivity { } - }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()+ + } 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 { + 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); @@ -483,11 +493,11 @@ public class Tickets extends AppCompatActivity { 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()+ + 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))); + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(uri))); } }); @@ -496,9 +506,9 @@ public class Tickets extends AppCompatActivity { 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))); + uri = "geo:0,0?q=" + listClientesTickets.get(posicion).getLatitude() + + " " + listClientesTickets.get(posicion).getLongitude(); + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(uri))); } }); @@ -509,8 +519,7 @@ public class Tickets extends AppCompatActivity { } - - }else{ + } else { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage("Please install Google Maps"); builder.setCancelable(false); @@ -528,45 +537,42 @@ public class Tickets extends AppCompatActivity { } - public void goSign(int pos){ - // Intent i = new Intent(this,SignActivity.class); - Intent i = new Intent(this,UnLoadVanActivity.class); + public void goSign(int pos) { + // Intent i = new Intent(this,SignActivity.class); + Intent i = new Intent(this, UnLoadVanActivity.class); - if (isSignedShowed){ - i.putExtra("clientTicket",listClientesTicketsFirmados.get(pos)); + if (isSignedShowed) { + i.putExtra("clientTicket", listClientesTicketsFirmados.get(pos)); - }else{ - i.putExtra("clientTicket",listClientesTickets.get(pos)); + } else { + i.putExtra("clientTicket", listClientesTickets.get(pos)); } - i.putExtra("idRuta",route.getId()); + i.putExtra("idRuta", route.getId()); - startActivityForResult(i,1); + startActivityForResult(i, 1); } public boolean isGoogleMapsInstalled() { - try - { - ApplicationInfo info = getPackageManager().getApplicationInfo("com.google.android.apps.maps", 0 ); + try { + ApplicationInfo info = getPackageManager().getApplicationInfo("com.google.android.apps.maps", 0); return true; - } - catch(PackageManager.NameNotFoundException e) - { + } catch (PackageManager.NameNotFoundException e) { return false; } } - public void showSigned(View v){ - if(isSignedShowed){ - adapter = new ClientAdapter(this,listClientesTickets); + 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); + } 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)); @@ -574,11 +580,11 @@ public class Tickets extends AppCompatActivity { listViewClients.setAdapter(adapter); } - public void showNote(int pos){ + public void showNote(int pos) { String mensaje = ""; - if(isSignedShowed){ + if (isSignedShowed) { mensaje = listClientesTicketsFirmados.get(pos).getNote(); - }else{ + } else { mensaje = listClientesTickets.get(pos).getNote(); } AlertDialog alertDialog = new AlertDialog.Builder(this).create(); @@ -593,11 +599,11 @@ public class Tickets extends AppCompatActivity { alertDialog.show(); } - public void showPolizon(int pos,int posTicket){ + public void showPolizon(int pos, int posTicket) { String polizon = ""; - if (isSignedShowed){ + if (isSignedShowed) { polizon = listClientesTicketsFirmados.get(pos).getTickets().get(posTicket).get("Polizon"); - }else{ + } else { polizon = listClientesTickets.get(pos).getTickets().get(posTicket).get("Polizon"); } AlertDialog alertDialog = new AlertDialog.Builder(this).create(); @@ -612,55 +618,55 @@ public class Tickets extends AppCompatActivity { alertDialog.show(); } - public void goToConfig(View v){ - Intent i = new Intent(this,ConfigureActivity.class); - i.putExtra("route",route); - startActivityForResult(i,2); + public void goToConfig(View v) { + Intent i = new Intent(this, ConfigureActivity.class); + i.putExtra("route", route); + startActivityForResult(i, 2); } - public void goToInfo(View v){ + public void goToInfo(View v) { - Intent i = new Intent(this,InfoActivity.class); - i.putExtra("route",route); - startActivityForResult(i,2); + Intent i = new Intent(this, InfoActivity.class); + i.putExtra("route", route); + startActivityForResult(i, 2); } - public void goToNotes(int position){ + 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)); + 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); + i.putExtra("isSignedShowed", isSignedShowed); - startActivityForResult(i,3); + startActivityForResult(i, 3); } - public void goToExpeditionByAddress(int pos,String adress){ + public void goToExpeditionByAddress(int pos, String adress) { - Intent i = new Intent(this,UnLoadVanActivity.class); - i.putExtra("adress",adress); - i.putExtra("routeId",route.getId()); - i.putExtra("route",route); + Intent i = new Intent(this, UnLoadVanActivity.class); + i.putExtra("adress", adress); + i.putExtra("routeId", route.getId()); + i.putExtra("route", route); - if (isSignedShowed){ - i.putExtra("clientTicket",listClientesTicketsFirmados.get(pos)); + if (isSignedShowed) { + i.putExtra("clientTicket", listClientesTicketsFirmados.get(pos)); - }else{ - i.putExtra("clientTicket",listClientesTickets.get(pos)); + } else { + i.putExtra("clientTicket", listClientesTickets.get(pos)); } - i.putExtra("idRuta",route.getId()); + i.putExtra("idRuta", route.getId()); - startActivityForResult(i,1); + startActivityForResult(i, 1); - // startActivity(i); + // startActivity(i); /* List listExpeditions= LocalStorage.getExpeditions(this); @@ -684,24 +690,23 @@ public class Tickets extends AppCompatActivity { } - @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { - if (requestCode == 1){ - if (resultCode == Activity.RESULT_OK){ + if (requestCode == 1) { + if (resultCode == Activity.RESULT_OK) { checkPendingSigns(); } - }else if (requestCode == 2){ + } else if (requestCode == 2) { if (resultCode == Activity.RESULT_OK) { route = (Ruta) data.getSerializableExtra("route"); } - }else if (requestCode == 3){ + } else if (requestCode == 3) { if (resultCode == Activity.RESULT_OK) { ClientTickets ct = (ClientTickets) data.getSerializableExtra("clientTicket"); - if (data.getBooleanExtra("isSignedShowed",false)){ + if (data.getBooleanExtra("isSignedShowed", false)) { listClientesTicketsFirmados.get(posForNote).setNote(ct.getNote()); - }else{ + } else { listClientesTickets.get(posForNote).setNote(ct.getNote()); } diff --git a/app/src/main/java/verdnatura/es/repartoverdnatura/UTILS/ApiUtils.java b/app/src/main/java/verdnatura/es/repartoverdnatura/UTILS/ApiUtils.java index 441c11f..894c35f 100644 --- a/app/src/main/java/verdnatura/es/repartoverdnatura/UTILS/ApiUtils.java +++ b/app/src/main/java/verdnatura/es/repartoverdnatura/UTILS/ApiUtils.java @@ -5,11 +5,11 @@ import verdnatura.es.repartoverdnatura.INTERFACES.RestClient; public class ApiUtils { private ApiUtils() {} - //public static final String BASE_URL = "http://10.1.4.42:9000/"; - //public static final String BASE_URL = "http://192.168.1.132:9000/"; - //public static final String BASE_URL = "https://test-app.verdnatura.es/"; + //public static final String BASE_URL = "http://10.1.4.42:9000/"; + //public static final String BASE_URL = "http://192.168.1.128:9000/"; + public static final String BASE_URL = "https://test-app.verdnatura.es/"; - public static final String BASE_URL = "https://app.verdnatura.es/"; + //public static final String BASE_URL = "https://app.verdnatura.es/"; public static RestClient getAPIService() { return RetrofitClient.getClient(BASE_URL).create(RestClient.class); diff --git a/app/src/main/java/verdnatura/es/repartoverdnatura/UTILS/ApiUtilsSalix.java b/app/src/main/java/verdnatura/es/repartoverdnatura/UTILS/ApiUtilsSalix.java index 75625ed..24c6a38 100644 --- a/app/src/main/java/verdnatura/es/repartoverdnatura/UTILS/ApiUtilsSalix.java +++ b/app/src/main/java/verdnatura/es/repartoverdnatura/UTILS/ApiUtilsSalix.java @@ -6,9 +6,9 @@ public class ApiUtilsSalix { private ApiUtilsSalix() {} - public static final String BASE_URL_SALIX = "https://salix.verdnatura.es/"; - //public static final String BASE_URL_SALIX = "https://test-salix.verdnatura.es/"; - //public static final String BASE_URL_SALIX = "http://localhost:3000/"; + //public static final String BASE_URL_SALIX = "https://salix.verdnatura.es/"; + public static final String BASE_URL_SALIX = "https://test-salix.verdnatura.es/"; + // public static final String BASE_URL_SALIX = "http://localhost:3000/"; public static RestClientSalix getAPIService() { return RetrofitClientSalix.getClient(BASE_URL_SALIX).create(RestClientSalix.class); } diff --git a/build/intermediates/lint-cache/maven.google/com/google/firebase/group-index.xml b/build/intermediates/lint-cache/maven.google/com/google/firebase/group-index.xml index 377ca0d..8adfa63 100644 --- a/build/intermediates/lint-cache/maven.google/com/google/firebase/group-index.xml +++ b/build/intermediates/lint-cache/maven.google/com/google/firebase/group-index.xml @@ -2,25 +2,25 @@ - - + + - - - - - - - - + + + + + + + + - + @@ -31,22 +31,22 @@ - - - + + + - - - + + + - + - - + + @@ -61,18 +61,18 @@ - - - - + + + + - - - - + + + + @@ -85,8 +85,8 @@ - - + + @@ -100,8 +100,8 @@ - - + + diff --git a/build/intermediates/lint-cache/maven.google/master-index.xml b/build/intermediates/lint-cache/maven.google/master-index.xml index fad63ca..8386c26 100644 --- a/build/intermediates/lint-cache/maven.google/master-index.xml +++ b/build/intermediates/lint-cache/maven.google/master-index.xml @@ -37,6 +37,7 @@ + @@ -81,6 +82,8 @@ + + @@ -115,6 +118,7 @@ + @@ -164,6 +168,7 @@ + @@ -189,6 +194,7 @@ + diff --git a/vn-delivery.iml b/vn-delivery.iml index 0a534c9..c433a9b 100644 --- a/vn-delivery.iml +++ b/vn-delivery.iml @@ -1,12 +1,5 @@ - - - - - -