diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index f2c274a9..e68b42dc 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,6 +1,7 @@ + @@ -120,6 +121,7 @@ \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 523c1f36..ac1b3c97 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,11 +3,15 @@ + diff --git a/app/build.gradle b/app/build.gradle index 4ad285cc..7346908c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' +apply plugin: 'kotlin-android-extensions'//deprecated:sergio apply plugin: 'kotlin-kapt' apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' @@ -33,6 +33,9 @@ android { } } + buildFeatures { + viewBinding = false + } dataBinding { enabled = true } @@ -44,6 +47,9 @@ android { } + + + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) debugImplementation fileTree(dir: 'libs/debug', include: ['*.jar']) @@ -68,7 +74,7 @@ dependencies { implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' //preferences - implementation 'androidx.preference:preference:1.1.1' + implementation 'androidx.preference:preference-ktx:1.1.1' //Fragments implementation("androidx.fragment:fragment-ktx:1.3.6") @@ -80,11 +86,20 @@ dependencies { implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle" implementation 'androidx.legacy:legacy-support-v4:1.0.0' + + //Koin new resolve + //kotlin implementation in mavencentral--> jcenter deprecated + + implementation "io.insert-koin:koin-core:$koin" + implementation "io.insert-koin:koin-android:$koin" + implementation "io.insert-koin:koin-androidx-scope:$koin" + implementation "io.insert-koin:koin-androidx-viewmodel:$koin" + // Koin for DI - implementation "org.koin:koin-core:$koin" - implementation "org.koin:koin-android:$koin" - implementation "org.koin:koin-androidx-scope:$koin" - implementation "org.koin:koin-androidx-viewmodel:$koin" + //implementation "org.koin:koin-core:$koin" + //implementation "org.koin:koin-android:$koin" + //implementation "org.koin:koin-androidx-scope:$koin" + //implementation "org.koin:koin-androidx-viewmodel:$koin" // Image libraries diff --git a/app/escenarios.txt b/app/escenarios.txt new file mode 100644 index 00000000..1c249bc3 --- /dev/null +++ b/app/escenarios.txt @@ -0,0 +1,17 @@ +clean_build_2gb_4workers { + tasks = [":app:assembleDebug"] + gradle-args = ["--max-workers=4"] + jvm-args = ["-Xmx2048m"] + cleanup-tasks = ["clean"] +} +clean_build_parallelGC {grad + tasks = [":app:assembleDebug"] + jvm-args = ["-XX:+UseParallelGC"] + cleanup-tasks = ["clean"] +} + +clean_build_G1GC_4gb { + tasks = [":app:assembleDebug"] + jvm-args = ["-Xmx4096m", "-XX:+UseG1GC"] + cleanup-tasks = ["clean"] +} \ No newline at end of file diff --git a/app/release/app-inventario_activity.apk b/app/release/app-inventario_activity.apk deleted file mode 100644 index 603f836b..00000000 Binary files a/app/release/app-inventario_activity.apk and /dev/null differ diff --git a/app/release/app-release.apk b/app/release/app-release.apk new file mode 100644 index 00000000..719dc287 Binary files /dev/null and b/app/release/app-release.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index 625aa2fb..9816e6c1 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -11,8 +11,8 @@ "type": "SINGLE", "filters": [], "attributes": [], - "versionCode": 73, - "versionName": "6.1.8.4.1", + "versionCode": 74, + "versionName": "6.1.8.5", "outputFile": "app-release.apk" } ], diff --git a/app/src/main/java/es/verdnatura/domain/GetInventaryUserCase.kt b/app/src/main/java/es/verdnatura/domain/GetInventaryUserCase.kt index b802e321..fd43a140 100644 --- a/app/src/main/java/es/verdnatura/domain/GetInventaryUserCase.kt +++ b/app/src/main/java/es/verdnatura/domain/GetInventaryUserCase.kt @@ -8,7 +8,7 @@ import retrofit2.Call class GetInventaryUserCase(context: Context) : RestClient(context) { - fun itemShelvingRadar( + /* fun itemShelvingRadar( usuario: String, password: String, sectorFk: String @@ -23,7 +23,7 @@ class GetInventaryUserCase(context: Context) : RestClient(context) { "application/json", params = params ) - } + }*/ fun itemShelvingRadarFilterBuyer( usuario: String, diff --git a/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt b/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt index f138c3b3..b70c71a5 100644 --- a/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt +++ b/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt @@ -1,15 +1,14 @@ package es.verdnatura.domain import android.content.Context -import es.verdnatura.presentation.view.feature.login.model.LoginDevice -import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO -import es.verdnatura.presentation.view.feature.login.model.SalixGrupo -import es.verdnatura.presentation.view.feature.login.model.versionApp +import es.verdnatura.presentation.view.feature.login.model.* import retrofit2.Call -class GetLoginUserCase(context: Context) : RestClient(context) { +class GetLoginUserCase(context: Context) : RestClient(context) +{ - fun login(usuario: String, password: String, androiid: String): Call { + fun login(usuario: String, password: String, androiid: String): Call + { val params: ArrayList = ArrayList() params.add(usuario) params.add(password) @@ -21,7 +20,8 @@ class GetLoginUserCase(context: Context) : RestClient(context) { usuario: String, password: String, android_id: String - ): Call { + ): Call + { val params: ArrayList = ArrayList() params.add(usuario) params.add(android_id) @@ -32,10 +32,11 @@ class GetLoginUserCase(context: Context) : RestClient(context) { password, "application/json", params - ) + ) } - fun worker_getId(usuario: String, password: String): Call { + fun worker_getId(usuario: String, password: String): Call + { val params: ArrayList = ArrayList() return restClient!!.worker_getId("json", "1", usuario, password, "application/json", params) } @@ -46,7 +47,8 @@ class GetLoginUserCase(context: Context) : RestClient(context) { app: String, versionApp: String, android_id: String - ): Call { + ): Call + { val params: ArrayList = ArrayList() params.add(app) params.add(versionApp) @@ -58,10 +60,11 @@ class GetLoginUserCase(context: Context) : RestClient(context) { password, "application/json", params - ) + ) } - fun salixLogin(usuario: String, password: String): Call { + fun salixLogin(usuario: String, password: String): Call + { return salixClient!!.login("application/json", LoginSalixVO(usuario, password)) } //NODEJS TEST @@ -70,13 +73,15 @@ class GetLoginUserCase(context: Context) : RestClient(context) { smarttag: String, wagon: String, shelving: String - ): Call { + ): Call + { return nodejsClient!!.bindShelving("application/json", "A0A3B8224DBF", "ABC", "2") // return nodejsClient!!.bindShelving("application/json", NodeJsService.SmartTagNode(smarttag, wagon, shelving),"A0A3B8224DBF","ABC","2") } - fun checkVersion_old(usuario: String, password: String, version: String): Call { + fun checkVersion_old(usuario: String, password: String, version: String): Call + { val params: ArrayList = ArrayList() params.add(version) return restClient!!.version("json", "1", usuario, password, "application/json", params) @@ -84,22 +89,24 @@ class GetLoginUserCase(context: Context) : RestClient(context) { //SALIX MENSAJE :SERGIO: PARA NO ENVIAR MENSAJES A COMERCIALES PONGO QUE LAS MODIFICACIONES SE ENVIAN AL CANAL CREADO. - /* fun sendChekingPresence(token:String,workerId:Int,message:String) : Call{ - return salixClient!!.sendChekingPresence(content_type = "application/json", authorization = token, params = SalixMessageVO(workerId = workerId,message = message)) - }*/ - // SERGIO: PARA DESARROLLO Y PRUEBAS SE DESCOMENTA ESTAS LÍNEAS Y SE COMENTAN LAS DE ARRIBA - fun sendChekingPresence(token: String, workerId: Int, message: String): Call { - return salixClient!!.sendGroup( - content_type = "application/json", - authorization = token, - params = SalixGrupo(to = "#android-test", message = message) - ) - } + fun sendChekingPresence(token:String,workerId:Int,message:String) : Call{ + return salixClient!!.sendChekingPresence(content_type = "application/json", authorization = token, params = SalixMessageVO(workerId = workerId,message = message)) + } + // SERGIO: PARA DESARROLLO Y PRUEBAS SE DESCOMENTA ESTAS LÍNEAS Y SE COMENTAN LAS DE ARRIBA +/* fun sendChekingPresence(token: String, workerId: Int, message: String): Call +{ + return salixClient!!.sendGroup( + content_type = "application/json", + authorization = token, + params = SalixGrupo(to = "#android-test", message = message) + ) +}*/ - fun checkVersion(usuario: String, password: String, nameApp: String): Call { - val params: ArrayList = ArrayList() - params.add(nameApp) - return restClient!!.getVersion("json", "1", usuario, password, "application/json", params) - } +fun checkVersion(usuario: String, password: String, nameApp: String): Call +{ + val params: ArrayList = ArrayList() + params.add(nameApp) + return restClient!!.getVersion("json", "1", usuario, password, "application/json", params) +} } \ No newline at end of file diff --git a/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt b/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt index 390820dc..70c92627 100644 --- a/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt +++ b/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt @@ -43,14 +43,14 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) { ) } - fun ticket_checkFullyControlled( + fun ticketOrCollection_checkFullyControlled( usuario: String, password: String, collectionFk: String ): Call { val params: ArrayList = ArrayList() params.add(collectionFk) - return restClient!!.ticket_checkFullyControlled( + return restClient!!.ticketOrCollection_checkFullyControlled( "json", "1", usuario, diff --git a/app/src/main/java/es/verdnatura/domain/GetVehicleControlTimeUserCase.kt b/app/src/main/java/es/verdnatura/domain/GetVehicleControlTimeUserCase.kt index 0bcd42ec..d1bd0e78 100644 --- a/app/src/main/java/es/verdnatura/domain/GetVehicleControlTimeUserCase.kt +++ b/app/src/main/java/es/verdnatura/domain/GetVehicleControlTimeUserCase.kt @@ -9,12 +9,10 @@ class GetVehicleControlTimeUserCase(context: Context) : RestClient(context) { fun machineWorker_add( usuario: String, password: String, - plateNumber: String, - workerFk: String + plateNumber: String ): Call { val params: ArrayList = ArrayList() params.add(plateNumber) - params.add(workerFk) return restClient!!.machineWorker_add( "json", "1", @@ -28,12 +26,10 @@ class GetVehicleControlTimeUserCase(context: Context) : RestClient(context) { fun machineWorker_update( usuario: String, password: String, - plateNumber: String, - workerFk: String + plateNumber: String ): Call { val params: ArrayList = ArrayList() params.add(plateNumber) - params.add(workerFk) return restClient!!.machineWorker_update( "json", "1", @@ -44,26 +40,13 @@ class GetVehicleControlTimeUserCase(context: Context) : RestClient(context) { ) } - fun machineWorker_Worker(usuario: String, password: String, userFk: String): Call { - val params: ArrayList = ArrayList() - params.add(userFk) - return restClient!!.machineWorker_Worker( - "json", - "1", - usuario, - password, - "application/json", - params - ) - } + fun workerMachinery_isRegistered( usuario: String, - password: String, - userFk: String + password: String ): Call { val params: ArrayList = ArrayList() - params.add(userFk) return restClient!!.workerMachinery_isRegistered( "json", "1", @@ -74,26 +57,9 @@ class GetVehicleControlTimeUserCase(context: Context) : RestClient(context) { ) } - fun deviceProduction_getdeviceNameFromUser( - usuario: String, - password: String, - userFk: String - ): Call { - val params: ArrayList = ArrayList() - params.add(userFk) - return restClient!!.deviceProduction_getdeviceNameFromUser( - "json", - "1", - usuario, - password, - "application/json", - params - ) - } - fun machine_getWorkerPlate(usuario: String, password: String, userFk: String): Call { + fun machine_getWorkerPlate(usuario: String, password: String): Call { val params: ArrayList = ArrayList() - params.add(userFk) return restClient!!.machine_getWorkerPlate( "json", "1", @@ -124,10 +90,10 @@ class GetVehicleControlTimeUserCase(context: Context) : RestClient(context) { fun deviceProduction_getnameDevice( usuario: String, password: String, - userFk: String + android_id: String ): Call { val params: ArrayList = ArrayList() - params.add(userFk) + params.add(android_id) return restClient!!.deviceProduction_getnameDevice( "json", "1", @@ -141,12 +107,10 @@ class GetVehicleControlTimeUserCase(context: Context) : RestClient(context) { fun machineWorker_getHistorical( usuario: String, password: String, - PlateNumber: String, - nameWorker: String + PlateNumber: String ): Call> { val params: ArrayList = ArrayList() params.add(PlateNumber) - params.add(nameWorker) return restClient!!.machineWorker_getHistorical( "json", "1", diff --git a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt index 61c2ef3c..3a1f08b1 100644 --- a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt +++ b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt @@ -32,7 +32,7 @@ import retrofit2.http.POST interface VerdnaturaService { //LOGIN ========================================================================> - @POST("security/login") + @POST("security/login")//REVISADA fun login( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -43,7 +43,7 @@ interface VerdnaturaService { ): Call - @POST("security/device_checkLogin") + @POST("security/device_checkLogin")//REVISADA fun device_checkLogin( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -54,7 +54,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/worker_getId") + @POST("almacennew/worker_getId")//REVISADA fun worker_getId( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -65,7 +65,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/deviceLog_add") + @POST("almacennew/deviceLog_add")//REVISADA fun deviceLog_add( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -76,7 +76,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/version") + @POST("almacennew/version")//REVISADA fun version( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -87,7 +87,7 @@ interface VerdnaturaService { ): Call - @POST("/security/getVersion") + @POST("/security/getVersion")//REVISADA fun getVersion( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -99,7 +99,7 @@ interface VerdnaturaService { Call //AJUSTES ========================================================================> - @POST("almacennew/sector_get") + @POST("almacennew/sector_get")//REVISADA fun getSectors( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -111,7 +111,7 @@ interface VerdnaturaService { //PRESACADORES ========================================================================> - @POST("almacennew/ticketToPrePrepare") + @POST("almacennew/ticketToPrePrepare")//REVISADA fun ticketToPrePrepare( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -122,7 +122,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/itemPlacementSupplyGetOrder") + @POST("almacennew/itemPlacementSupplyGetOrder")//REVISADA fun itemPlacementSupplyGetOrder( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -133,7 +133,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/itemPlacementSupplyCloseOrder") + @POST("almacennew/itemPlacementSupplyCloseOrder")//REVISADA fun itemPlacementSupplyCloseOrder( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -145,7 +145,7 @@ interface VerdnaturaService { Call //SACADORES / CONTROLADORES ========================================================================> - @POST("almacennew/collectionGet") + @POST("almacennew/collectionGet") //REVISADA fun collectionGet( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -155,7 +155,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/collectionNew") + @POST("almacennew/collectionNew")//REVISADA fun collectionNew( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -166,7 +166,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/collectionTicketGet") + @POST("almacennew/collectionTicketGet")//REVISADA fun collectionTicketGet( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -177,8 +177,8 @@ interface VerdnaturaService { ): Call - @POST("almacennew/ticketOrCollection_checkFullyControlled") - fun ticket_checkFullyControlled( + @POST("almacennew/ticketOrCollection_checkFullyControlled")//REVISADA + fun ticketOrCollection_checkFullyControlled( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @Header("user") user: String, @@ -189,7 +189,7 @@ interface VerdnaturaService { Call //sergio: de momento se separa para ir viendo como funciona. El precontrol llamara a collectionTicketGet con otro parametro. - @POST("almacennew/collection_getTickets") + @POST("almacennew/collection_getTickets")//REVISADA fun collection_getTickets( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -200,7 +200,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/saleTrackingReplace") + @POST("almacennew/saleTrackingReplace")//REVISADA fun saleTrackingReplace( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -211,7 +211,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/itemPlacementSupplyAiming") + @POST("almacennew/itemPlacementSupplyAiming")//REVISADA fun itemPlacementSupplyAiming( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -222,7 +222,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/itemShelvingSaleSupplyAdd") + @POST("almacennew/itemShelvingSaleSupplyAdd")//REVISADA fun itemShelvingSaleSupplyAdd( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -233,7 +233,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/itemShelvingPlacementSupplyAdd") + @POST("almacennew/itemShelvingPlacementSupplyAdd")//REVISADA fun itemShelvingPlacementSupplyAdd( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -244,7 +244,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/collectionStickerPrint") + @POST("almacennew/collectionStickerPrint")//REVISADA fun collectionStickerPrint( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -255,7 +255,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/itemGetAvailable") + @POST("almacennew/itemGetAvailable")//REVISADA fun itemGetAvailable( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -266,7 +266,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/collectionAddItem") + @POST("almacennew/collectionAddItem")//REVISADA fun collectionAddItem( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -277,7 +277,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/saleMove") + @POST("almacennew/saleMove")//REVISADA fun saleMove( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -288,7 +288,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/collectionMissingTrash") + @POST("almacennew/collectionMissingTrash")//REVISADA fun collectionMissingTrash( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -299,7 +299,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/saleTrackingDel") + @POST("almacennew/saleTrackingDel")//REVISADA fun saleTrackingDel( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -310,7 +310,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/collectionUpdateState") + @POST("almacennew/collectionUpdateState")//REVISADA fun collectionUpdateState( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -321,7 +321,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/barcodeToItem") + @POST("almacennew/barcodeToItem")//REVISADA fun getIdFromCode( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -332,7 +332,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/collectionIncreaseQuantity") + @POST("almacennew/collectionIncreaseQuantity")//REVISADA fun collectionIncreaseQuantity( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -343,7 +343,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/saleMistakeAdd") + @POST("almacennew/saleMistakeAdd")//REVISADA fun saleMistakeAdd( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -354,7 +354,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/mistakeType") + @POST("almacennew/mistakeType")//REVISADA fun mistakeType( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -367,7 +367,7 @@ interface VerdnaturaService { //PASILLEROS ========================================================================> //CONSULTAR ARTICULO ========================================================================> - @POST("almacennew/itemDiary") + @POST("almacennew/itemDiary")//REVISADA fun itemDiary( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -378,7 +378,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/item_card") + @POST("almacennew/item_card")//REVISADA fun getItemCard( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -389,7 +389,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/item_getSimilar") + @POST("almacennew/item_getSimilar")//REVISADA fun item_getSimilar( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -400,7 +400,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/get_ItemPackingType") + @POST("almacennew/get_ItemPackingType")//REVISADA fun getItemPackingType( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -411,7 +411,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/itemStockUpdate") + @POST("almacennew/itemStockUpdate")//REVISADA fun itemStockUpdate( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -422,7 +422,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/itemTrash") + @POST("almacennew/itemTrash")//REVISADA fun itemTrash( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -433,7 +433,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/item_placement_save") + @POST("almacennew/item_placement_save")//REVISADA fun itemPlacementSave( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -444,7 +444,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/buy_updateGrouping") + @POST("almacennew/buy_updateGrouping")//REVISADA fun updateGrouping( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -455,7 +455,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/buy_updatePacking") + @POST("almacennew/buy_updatePacking")//REVISADA fun updatePacking( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -466,7 +466,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/update_ItemPackingType") + @POST("almacennew/update_ItemPackingType")//REVISADA fun updatePackingType( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -477,7 +477,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/itemSaveMin") + @POST("almacennew/itemSaveMin")//REVISADA fun itemSaveMin( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -488,7 +488,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/barcodes_edit") + @POST("almacennew/barcodes_edit")//REVISADA fun barcodes_edit( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -500,7 +500,7 @@ interface VerdnaturaService { Call //BUSCAR ITEM ========================================================================> - @POST("almacennew/getItemUbication") + @POST("almacennew/getItemUbication")//REVISADA fun searchItemsUbicador( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -512,7 +512,7 @@ interface VerdnaturaService { Call> // BUSCAR ITEM ALL - @POST("almacennew/getItemUbication") + @POST("almacennew/getItemUbication")//REVISADA fun searchItemsUbicadorAll( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -525,7 +525,7 @@ interface VerdnaturaService { //INVENTARIO ========================================================================> - @POST("almacennew/itemShelvingRadar") + @POST("almacennew/itemShelvingRadar")//REVISADA fun itemShelvingRadar( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -536,7 +536,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/itemShelving_filterBuyer") + @POST("almacennew/itemShelving_filterBuyer")//REVISADA fun itemShelvingRadarFilterBuyer( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -547,7 +547,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/faultsReview") + @POST("almacennew/faultsReview")//REVISADA fun faultsReview( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -558,7 +558,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/faultsReview_isChecked") + @POST("almacennew/faultsReview_isChecked")//REVISADA fun faultsReview_isChecked( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -570,7 +570,7 @@ interface VerdnaturaService { Call //SHELVING PARKING ========================================================================> - @POST("almacennew/shelvingParking_get") + @POST("almacennew/shelvingParking_get")//REVISADA fun shelvingParking_get( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -582,7 +582,7 @@ interface VerdnaturaService { Call> //CONTROL DE VEHICULOS - @POST("almacennew/machineWorker_add") + @POST("almacennew/machineWorker_add")//REVISADA fun machineWorker_add( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -593,7 +593,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/machineWorker_update") + @POST("almacennew/machineWorker_update")//REVISADA fun machineWorker_update( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -604,18 +604,9 @@ interface VerdnaturaService { ): Call - @POST("almacennew/machineWorker_Worker") - fun machineWorker_Worker( - @Header("aplicacion") aplicacion: String, - @Header("version") version: String, - @Header("user") user: String, - @Header("pass") pass: String, - @Header("Content-Type") content_type: String, - @Body params: List - ): - Call - @POST("almacennew/workerMachinery_isRegistered") + + @POST("almacennew/workerMachinery_isRegistered")//REVISADA fun workerMachinery_isRegistered( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -626,7 +617,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/deviceProduction_getnameDevice") + @POST("almacennew/deviceProduction_getnameDevice")//REVISADA fun deviceProduction_getnameDevice( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -637,7 +628,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/deviceProductionUser_getWorker") + @POST("almacennew/deviceProductionUser_getWorker")//REVISADA fun deviceProductionUser_getWorker( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -648,18 +639,8 @@ interface VerdnaturaService { ): Call - @POST("almacennew/deviceProduction_getdeviceNameFromUser") - fun deviceProduction_getdeviceNameFromUser( - @Header("aplicacion") aplicacion: String, - @Header("version") version: String, - @Header("user") user: String, - @Header("pass") pass: String, - @Header("Content-Type") content_type: String, - @Body params: List - ): - Call - @POST("almacennew/machine_getWorkerPlate") + @POST("almacennew/machine_getWorkerPlate")//REVISADA fun machine_getWorkerPlate( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -670,7 +651,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/machineWorker_getHistorical") + @POST("almacennew/machineWorker_getHistorical")//REVISADA fun machineWorker_getHistorical( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -682,7 +663,7 @@ interface VerdnaturaService { Call> //UBICADOR ========================================================================> - @POST("almacennew/itemShelvingList") + @POST("almacennew/itemShelvingList")//REVISADA fun itemShelvingList( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -693,7 +674,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/shelvingPriorityUpdate") + @POST("almacennew/shelvingPriorityUpdate")//REVISADA fun shelvingPriorityUpdate( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -704,7 +685,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/itemShelvingMake") + @POST("almacennew/itemShelvingMake")//REVISADA fun itemShelvingMake( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -715,7 +696,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/itemShelvingMakeEdit") + @POST("almacennew/itemShelvingMakeEdit")//REVISADA fun itemShelvingMakeEdit( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -726,7 +707,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/itemShelvingMake_multi") + @POST("almacennew/itemShelvingMake_multi")//REVISADA fun itemShelvingMake_multi( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -737,7 +718,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/shelvingPark") + @POST("almacennew/shelvingPark")//REVISADA fun shelvingPark( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -748,7 +729,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/shelvingChange") + @POST("almacennew/shelvingChange")//REVISADA fun shelvingChange( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -759,7 +740,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/clearShelvingList") + @POST("almacennew/clearShelvingList")//REVISADA fun clearShelvingList( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -770,7 +751,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/itemShelvingTransfer") + @POST("almacennew/itemShelvingTransfer")//REVISADA fun itemShelvingTransfer( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -781,7 +762,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/itemShelvingDelete") + @POST("almacennew/itemShelvingDelete")//REVISADA fun itemShelvingDelete( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -794,16 +775,7 @@ interface VerdnaturaService { //BUFFER ==============================================================================> - /* @POST("almacennew/buffer_setType") - fun buffer_setType(@Header("aplicacion") aplicacion: String, - @Header("version") version: String, - @Header("user") user: String, - @Header("pass") pass: String, - @Header("Content-Type") content_type: String, - @Body params: List): - Call*/ - - @POST("almacennew/buffer_setTypeByName") + @POST("almacennew/buffer_setTypeByName")//REVISADA fun buffer_setTypeByName( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -816,7 +788,7 @@ interface VerdnaturaService { // Qr reader ========================================================================== - @POST("almacennew/qr_getCall") + @POST("almacennew/qr_getCall")//REVISADA fun qr_getCall( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -829,7 +801,7 @@ interface VerdnaturaService { //PALETIZADORES ========================================================================> - @POST("almacennew/expedition_scan") + @POST("almacennew/expedition_scan")//REVISADA fun expedition_scan( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -840,7 +812,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/expedition_getState") + @POST("almacennew/expedition_getState")//REVISADA fun expedition_getState( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -851,7 +823,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/expedition_getState") + @POST("almacennew/expedition_getState")//REVISADA fun expedition_getStateJSON( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -862,7 +834,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/expeditionTruckList") + @POST("almacennew/expeditionTruckList")//REVISADA fun expeditionTruckList( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -872,7 +844,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/expeditionTruckAdd") + @POST("almacennew/expeditionTruckAdd")//REVISADA fun expeditionTruckAdd( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -883,7 +855,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/expeditionPalletList") + @POST("almacennew/expeditionPalletList")//REVISADA fun expeditionPallet_List( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -894,7 +866,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/expeditionScanAdd") + @POST("almacennew/expeditionScanAdd")//REVISADA fun expeditionScanAdd( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -905,7 +877,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/expeditionScanPut") + @POST("almacennew/expeditionScanPut")//REVISADA fun expeditionScanPut( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -916,7 +888,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/checkRouteExpeditionScanPut") + @POST("almacennew/checkRouteExpeditionScanPut")//REVISADA fun checkRouteExpeditionScanPut( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -927,7 +899,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/expeditionPalletView") + @POST("almacennew/expeditionPalletView")//REVISADA fun expeditionPalletView( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -938,7 +910,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/expeditionPalletDel") + @POST("almacennew/expeditionPalletDel")//REVISADA fun expeditionPalletDel( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -949,7 +921,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/expeditionScanList") + @POST("almacennew/expeditionScanList")//REVISADA fun expeditionScanList( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -960,7 +932,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/expeditionScanDel") + @POST("almacennew/expeditionScanDel")//REVISADA fun expeditionScanDel( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -971,7 +943,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/expeditionPalletPrintSet") + @POST("almacennew/expeditionPalletPrintSet")//REVISADA fun expeditionPalletPrintSet( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -983,7 +955,7 @@ interface VerdnaturaService { Call //CALIDAD - @POST("almacennew/itemShelvingBuyerGet") + @POST("almacennew/itemShelvingBuyerGet")//REVISADA fun itemShelvingBuyerGet( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -993,7 +965,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/itemShelvingBuyerTask") + @POST("almacennew/itemShelvingBuyerTask")//REVISADA fun itemShelvingBuyerTask( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -1004,7 +976,7 @@ interface VerdnaturaService { ): Call> - @POST("almacennew/itemShelvingStarsUpdate") + @POST("almacennew/itemShelvingStarsUpdate")//REVISADA fun itemShelvingStarsUpdate( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -1016,7 +988,7 @@ interface VerdnaturaService { Call //SMARTTAGS ========================================================================> - @POST("almacennew/workerShelving_add") + @POST("almacennew/workerShelving_add")//REVISADA fun workerShelving_add( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -1027,7 +999,7 @@ interface VerdnaturaService { ): Call - @POST("almacennew/workerShelving_delete") + @POST("almacennew/workerShelving_delete")//REVISADA fun workerShelving_delete( @Header("aplicacion") aplicacion: String, @Header("version") version: String, @@ -1038,13 +1010,5 @@ interface VerdnaturaService { ): Call - /* @POST("almacennew/smartTag_nextLevel") - fun smartTag_nextLevel(@Header("aplicacion") aplicacion: String, - @Header("version") version: String, - @Header("user") user: String, - @Header("pass") pass: String, - @Header("Content-Type") content_type: String, - @Body params: List): - Call*/ } diff --git a/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt b/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt index 021a51ec..7ec599ca 100644 --- a/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/base/BaseFragment.kt @@ -19,7 +19,9 @@ import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.activity.result.contract.ActivityResultContracts import androidx.annotation.LayoutRes +import androidx.core.app.ActivityCompat import androidx.databinding.DataBindingUtil import androidx.databinding.ViewDataBinding import androidx.fragment.app.Fragment @@ -31,6 +33,7 @@ import es.verdnatura.presentation.common.mediaCurrentVolume import es.verdnatura.presentation.common.mediaMaxVolume import org.json.JSONObject import org.koin.androidx.viewmodel.ext.android.viewModel +import timber.log.Timber import java.text.SimpleDateFormat import java.util.* import kotlin.reflect.KClass @@ -96,16 +99,28 @@ abstract class BaseFragment(viewModelCla savedInstanceState: Bundle? ): View? = inflater.inflate(getLayoutId(), container, false) + /*sergio:deprecated. Se inicializa con onViewCreated override fun onActivityCreated(savedInstanceState: Bundle?) { super.onActivityCreated(savedInstanceState) - initDataBinding() - getBundleArguments() - observeViewModel() - runSound() - requestRecordAudioPermission() - init() - } + initDataBinding() + getBundleArguments() + observeViewModel() + runSound() + // requestRecordAudioPermission() + requestRecordAudioPermissionNew() + init() + }*/ +override fun onViewCreated(view: View, savedInstanceState: Bundle?) +{ + super.onViewCreated(view,savedInstanceState) + getBundleArguments() + observeViewModel() + runSound() + //requestRecordAudioPermission() + requestRecordAudioPermissionNew() + init() +} @LayoutRes abstract fun getLayoutId(): Int @@ -201,7 +216,8 @@ abstract class BaseFragment(viewModelCla private fun runSound() { // Get the maximum media/music volume - val maxVolume = mAudioManager?.mediaMaxVolume + //sergio: se quita por no utilizar + // val maxVolume = mAudioManager?.mediaMaxVolume // mAudioManager?.setMediaVolume(maxVolume!!) } @@ -344,7 +360,8 @@ abstract class BaseFragment(viewModelCla }*/ - private fun requestRecordAudioPermission() { + /*sergio:deprecated + private fun requestRecordAudioPermission() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { val requiredPermission: String = Manifest.permission.RECORD_AUDIO val res = requireContext().checkCallingOrSelfPermission(requiredPermission) @@ -352,8 +369,26 @@ abstract class BaseFragment(viewModelCla // this permission is needed if (res == PackageManager.PERMISSION_DENIED) { requestPermissions(arrayOf(requiredPermission), 101) + } } + }*/ + private fun requestRecordAudioPermissionNew() { + + val permissionLauncher = registerForActivityResult( + ActivityResultContracts.RequestPermission() + ) + { isGranted -> + if (isGranted) { + Timber.i("permisos ok") + } + + else { + Timber.i("Denegados permisos") + } + } + + permissionLauncher.launch(Manifest.permission.RECORD_AUDIO) } fun cancelSpeech() { diff --git a/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialog.kt b/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialog.kt index 39bf05ef..93807ad4 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialog.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/component/CustomDialog.kt @@ -5,23 +5,37 @@ import android.content.Context import android.view.View import es.verdnatura.R import kotlinx.android.synthetic.main.component_custom_dialog.* +//import es.verdnatura.databinding.ComponentCustomDialogBinding + +//private lateinit var binding: ComponentCustomDialogBinding class CustomDialog(context: Context) : Dialog(context, R.style.DialogTheme) { init { - setContentView(R.layout.component_custom_dialog) + + setContentView(R.layout.component_custom_dialog) + //sergio: lo nuevo para quitar synthetic de kotlin + /* binding = ComponentCustomDialogBinding.inflate(layoutInflater) + val view = binding.root + setContentView(view)*/ + } fun setTitle(title: String): CustomDialog { custom_dialog_title.visibility = View.VISIBLE custom_dialog_title.text = title + /* binding.customDialogTitle.visibility = View.VISIBLE + binding.customDialogTitle.text = title*/ + return this } fun setDescription(description: String): CustomDialog { custom_dialog_description.visibility = View.VISIBLE custom_dialog_description.text = description + /*binding.customDialogDescription.visibility = View.VISIBLE + binding.customDialogDescription.text = description*/ return this } @@ -29,6 +43,9 @@ class CustomDialog(context: Context) : Dialog(context, R.style.DialogTheme) { custom_dialog_button_ok.visibility = View.VISIBLE custom_dialog_button_ok.text = text custom_dialog_button_ok.setOnClickListener { onButtonClicked() } + /*binding.customDialogButtonOk.visibility = View.VISIBLE + binding.customDialogButtonOk.text = text + binding.customDialogButtonOk.setOnClickListener { onButtonClicked() }*/ return this } @@ -36,6 +53,9 @@ class CustomDialog(context: Context) : Dialog(context, R.style.DialogTheme) { custom_dialog_button_ko.visibility = View.VISIBLE custom_dialog_button_ko.text = text custom_dialog_button_ko.setOnClickListener { onButtonClicked() } + /* binding.customDialogButtonKo.visibility = View.VISIBLE + binding.customDialogButtonKo.text = text + binding.customDialogButtonKo.setOnClickListener { onButtonClicked() }*/ return this } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt index 1c107f95..4bf4c9eb 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesFragment.kt @@ -30,6 +30,7 @@ import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.fragment_ajustes.* import kotlinx.android.synthetic.main.fragment_ajustes.splash_progress import kotlinx.android.synthetic.main.fragment_login.* +import timber.log.Timber class AjustesFragment : BaseFragment(AjustesViewModel::class) { @@ -55,8 +56,10 @@ class AjustesFragment : BaseFragment(Aj customDialog = CustomDialog(requireContext()) //modificat el InitilializeAjusts - viewModel.inititializeDefaultAjusts(prefs!!.getString(SECTORDESCRIP,getString(R.string.Sinsector)).toString(),prefs!!.getInt(SECTORFK,0),prefs!!.getInt(WAREHOUSEFK,0),prefs!!.getString(VOZ,"NO").toString(),prefs!!.getInt(WAGON,2).toString(),prefs!!.getString(TAGSTYPE,"Amarillas").toString()) + viewModel.inititializeDefaultAjusts(prefs!!.getString(SECTORDESCRIP,getString(R.string.Sinsector)).toString(),prefs!!.getInt(SECTORFK,0),prefs!!.getInt(WAREHOUSEFK,0),prefs!!.getString(VOZ,"NO").toString(),prefs!!.getInt(WAGON,2).toString(),prefs!!.getString(TAGSTYPE,"Stickers").toString()) super.onCreate(savedInstanceState) + + } @@ -125,8 +128,7 @@ class AjustesFragment : BaseFragment(Aj showDialogCarros(array=listCarros.toArray(array)) - // getString(R.string.Nodisponibleenestaversión).toast(requireContext()) - // getString(R.string.enbreveDisponible).toast(requireContext()) + }else if (item.id == 2){ val listVoz : ArrayList = ArrayList() listVoz.add("NO") @@ -151,10 +153,10 @@ class AjustesFragment : BaseFragment(Aj ajustess_items.adapter = ajustesAdapter ajustess_items.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) - loadSectorList.observe(viewLifecycleOwner, Observer { event -> + loadSectorList.observe(viewLifecycleOwner, { event -> event.getContentIfNotHandled().notNull { splash_progress.visibility = View.INVISIBLE - if (it.list != null && it.list.size > 0 && it.list.get(0).isError){ + if (it.list.isNotEmpty() && it.list.get(0).isError){ customDialog.setTitle("Error").setDescription(it.list.get(0).errorMessage).setOkButton(getString(R.string.Close)){ customDialog.dismiss() }.show() diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemCardAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemCardAdapter.kt index f270fc82..8b45c062 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemCardAdapter.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/adapter/ItemCardAdapter.kt @@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.articulo.adapter import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.core.content.ContextCompat import androidx.recyclerview.widget.RecyclerView import es.verdnatura.R import es.verdnatura.databinding.ItemCardRowBinding @@ -48,10 +49,10 @@ class ItemCardAdapter ( this.item = item if (item.isEditable){ itemImage.visibility = View.VISIBLE - itemRowLayout.setBackgroundColor(res.getColor(R.color.verdnatura_black_5)) + itemRowLayout.setBackgroundColor(ContextCompat.getColor(itemImage.context,R.color.verdnatura_black_5)) }else{ itemImage.visibility = View.INVISIBLE - itemRowLayout.setBackgroundColor(res.getColor(R.color.verdnatura_black_9)) + itemRowLayout.setBackgroundColor(ContextCompat.getColor(itemImage.context,R.color.verdnatura_black_9)) } } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt index 2d0a0f6a..fda19bcc 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt @@ -69,9 +69,9 @@ class ItemCardFragment( private lateinit var customDialogList: CustomDialogList private lateinit var customDialogTwo: CustomDialogTwoButtons - private val _buyersList by lazy { MutableLiveData() } + /*private val _buyersList by lazy { MutableLiveData() } val buyersList: LiveData - get() = _buyersList + get() = _buyersList*/ override fun getLayoutId(): Int = R.layout.fragment_item_card @@ -85,13 +85,14 @@ class ItemCardFragment( customDialogInput = CustomDialogInput(requireContext()) customDialogList = CustomDialogList(requireContext()) customDialogTwo = CustomDialogTwoButtons(requireContext()) + + if (!itemFk.isNullOrEmpty()){ getItemCard(itemFk) } setToolBar() super.init() - Timber.i("test") } @@ -116,7 +117,7 @@ class ItemCardFragment( // //Log.i("VERDNATURA:","el item es ${itemInfoG!!.id}") //(activity as MainActivity).onPasillerosItemClickListener( PasillerosItemVO(title = "Historico"),itemFk) (activity as MainActivity).onPasillerosItemClickListener( PasillerosItemVO(title = "Historico"),itemInfoG!!.id) - ////Log.i("VERDNATURA:","El item es ${itemInfoG!!.id}") + } } @@ -159,8 +160,8 @@ class ItemCardFragment( warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString() this.itemFk = itemFk splash_progress.visibility = View.VISIBLE - viewModel.getItemCard(itemFk,warehouseFk,user!!,password!!) - viewModel.getItemPackingType(user!!,password!!) + viewModel.getItemCard(itemFk,warehouseFk,user,password) + viewModel.getItemPackingType(user,password) } override fun observeViewModel() { @@ -244,7 +245,7 @@ class ItemCardFragment( listItemsRow.add(ItemCardRowVO(title = "Artículos similares",isEditable = true, action = "itemProposal")) listItemsRow.add(ItemCardRowVO(title = getString(R.string.DARALTA),value = "",isEditable = true, action = "itemStockUpdateAdd")) listItemsRow.add(ItemCardRowVO(title = getString(R.string.DARBAJA),value = "",isEditable = true, action = "itemStockUpdateRemove")) - listItemsRow.add(ItemCardRowVO(title = getString(R.string.BUSCARITEM),value = "",isEditable = true, action = "buscarItem")) + listItemsRow.add(ItemCardRowVO(title = getString(R.string.BuscarItem),value = "",isEditable = true, action = "buscarItem")) //listItemsRow.add(ItemCardRowVO(title = "NICHO",value = itemInfo.nicho,isEditable = true, action = "itemPlacementSave")) // listItemsRow.add(ItemCardRowVO(title = "RESERVA",value = itemInfo.reserva,isEditable = true, action = "itemPlacementSave")) listItemsRow.add(ItemCardRowVO(title = getString(R.string.Grouping),value = itemInfo.grouping,isEditable = true, action = "updateGrouping")) @@ -268,9 +269,6 @@ class ItemCardFragment( ), itemFk ) - //viewModel.getItemProposal("30244","3280137","TRUE",user=user,password=password) - - // Log.i("VERDNATURA::", "ME HAS PULSADO") } else{ if (item.action == "updateSector") { @@ -368,7 +366,7 @@ class ItemCardFragment( itemcard_recyclerview.adapter = adapter itemcard_recyclerview.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false) - scroll_view.post(Runnable { + scroll_view.post({ val position = IntArray(2) if (itemcard_image != null){ itemcard_image.getLocationInWindow(position) @@ -392,13 +390,22 @@ class ItemCardFragment( } if(item.action != "itemStockUpdate") - changeOfflineValue(item,value, listBarcodes) + // changeOfflineValue(item,value, listBarcodes) + showProgress() } - private fun changeOfflineValue(item:ItemCardRowVO,newValue:String, barcodes:List){ + //sergio: changeOffLineValue solo hace visible el progress + + private fun showProgress(){ + splash_progress.visibility = View.VISIBLE + } + + /* private fun changeOfflineValue(item:ItemCardRowVO,newValue:String, barcodes:List){ splash_progress.visibility = View.VISIBLE - /*var i = 0 + + //sergio: esta parte ya estaba comentada + /*var i = 0 var position = 0 listItemsRow.forEach { if (it.title == item.title) { @@ -409,7 +416,7 @@ class ItemCardFragment( if (listItemsRow.get(position).title != "BARCODE") listItemsRow.get(position).value = newValue else listItemsRow.get(position).barcodes = barcodes adapter?.notifyDataSetChanged()*/ - } + }*/ /* private fun prepareItemStockUpdate(itemB:ItemCardRowVO,value:String){ @@ -450,12 +457,14 @@ class ItemCardFragment( if (itemB.action == "itemStockUpdateRemove") { customDialogTwo.setTitle(itemB.title!!).setDescription("Indica la causa de eliminar stock:").setOkButton("Falta"){ viewModel.itemTrash(itemFk = itemFk,warehouseFk = warehouseFk,user = user,password = password,newValue = value,isTrash = "0") - changeOfflineValue(itemB,value, listBarcodes) + //changeOfflineValue(itemB,value, listBarcodes) + showProgress() customDialogTwo.dismiss() }.setOkButtonTwo("Basura"){ viewModel.itemTrash(itemFk = itemFk,warehouseFk = warehouseFk,user = user,password = password,newValue = value,isTrash = "1") - changeOfflineValue(itemB,value, listBarcodes) + //changeOfflineValue(itemB,value, listBarcodes) + showProgress() customDialogTwo.dismiss() }.setKoButton("Cancelar"){ @@ -463,7 +472,8 @@ class ItemCardFragment( customDialogTwo.dismiss() }.show() }else{ - changeOfflineValue(itemB,value, listBarcodes) + //changeOfflineValue(itemB,value, listBarcodes) + showProgress() viewModel.itemTrash(itemFk = itemFk,warehouseFk = warehouseFk,user = user,password = password,newValue = (value.toInt() * -1).toString(),isTrash = "0") } }catch (e:Exception){ @@ -526,7 +536,8 @@ class ItemCardFragment( } viewModel.barcodesEdit(itemFk = itemFk, user = user, password = password, value = code, delete = delete) barcodeAdapter!!.notifyDataSetChanged() - changeOfflineValue(item,"", listBarcodes) + //changeOfflineValue(item,"", listBarcodes) + showProgress() } private fun showDialogSelectItemTypePacking(){ @@ -538,7 +549,7 @@ class ItemCardFragment( val builder = AlertDialog.Builder(this.context) builder.setTitle(getString(R.string.mensajeseleccionencajado)) .setItems(array - ) { dialog, position -> + ) { _, position -> updateItemPackingType(itemsPackingType[position].code.toString()) } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt index ae33c1e3..e7b62c8c 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt @@ -83,7 +83,7 @@ class BufferFragment( } scan_input.requestFocus() - scan_input.setOnEditorActionListener { v, actionId, event -> + scan_input.setOnEditorActionListener { _, actionId, _ -> if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) { goBack = false if (!scan_input.text.isNullOrEmpty()) { @@ -124,7 +124,7 @@ class BufferFragment( } else { // customDialog.setTitle("Mensaje").setDescription(it.errorMessage) - customDialog.setTitle("Mensaje").setDescription("Operación "+entryPoint.toLowerCase() + " realizada correctamente") + customDialog.setTitle("Mensaje").setDescription("Operación "+entryPoint.lowercase() + " realizada correctamente") .setOkButton("Aceptar") { customDialog.dismiss() backButton.performClick() diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/adapter/ItemBuyersAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/adapter/ItemBuyersAdapter.kt index 5da2a6fc..978883fd 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/adapter/ItemBuyersAdapter.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/adapter/ItemBuyersAdapter.kt @@ -41,7 +41,7 @@ class ItemBuyersAdapter ( fun bind(item: ItemBuyerVO) { binding.apply { this.itemBuyer = item - if (item != null && item.image != "") + if (item.image != "") imgItem.loadUrl("https://verdnatura.es/vn-image-data/catalog/200x200/"+item.image); else imgItem.loadUrl("https://verdnatura.es/vn-image-data/catalog/200x200/"+item.itemFk); @@ -74,7 +74,7 @@ class ItemBuyersAdapter ( onStarSelectedListener.onStarSelected(item.id,"5") } - if (item.stars != null && item.stars != ""){ + if (item.stars != ""){ try { val punt = item.stars.toInt() if (punt == 1){ diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityFragment.kt index 1d9e4c37..9c5eafb6 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityFragment.kt @@ -173,7 +173,7 @@ class QaualityFragment( private fun getCalendarFromDate(date:String): Calendar { val sdf = SimpleDateFormat("yyyy-MM-dd") val cal = Calendar.getInstance() - cal.setTime(sdf.parse(date)) + cal.time = sdf.parse(date) return cal } @@ -182,7 +182,7 @@ class QaualityFragment( var index = 0 var position = 0 listItems.forEach { item -> - if (item.shelvingFk.toUpperCase() == matricula.toUpperCase()){ + if (item.shelvingFk.uppercase() == matricula.uppercase()){ item.showStars = true if (!isSearch){ position = index diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt index b12a7243..4a055449 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt @@ -43,6 +43,7 @@ import es.verdnatura.presentation.view.feature.sacador.model.* import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.fragment_collection.* import kotlinx.android.synthetic.main.toolbar.* +import timber.log.Timber class CollectionFragment( var collection: CollectionVO = CollectionVO(), @@ -52,6 +53,7 @@ class CollectionFragment( private var password = "" private var sectorFk = "" private var warehouseFk = "" + private var SectorDescription = "" private var token = "" private var voz = "" private var sales: List = listOf() @@ -111,16 +113,17 @@ class CollectionFragment( voz = prefs.getString(VOZ, "NO").toString() mperror = MediaPlayer.create((activity as MainActivity), R.raw.error) mpok = MediaPlayer.create((activity as MainActivity), R.raw.ok) + SectorDescription=prefs.getString(SECTORDESCRIP,"Sin Sector").toString() + if ((collection.collectionFk != null) && type.equals(CONTROLADOR)) { //sergio: comprueba si viene de la pantalla de controlador - viewModel.ticket_checkFullyControlled(user, password, collection.collectionFk) + viewModel.ticketOrCollection_checkFullyControlled(user, password, collection.collectionFk) workerFkFromTicket=collection.tickets.get(0).sales.get(0).workerFk } - if (collection.tickets.isEmpty()) { viewModel.collectionTicketGet(user, password, collection.collectionFk, sectorFk, type) } @@ -143,7 +146,7 @@ class CollectionFragment( if (splash_progress != null) splash_progress.visibility = View.VISIBLE //toolbar_title.text = "collectionTicket_get" - requireActivity().main_bottom_navigation.visibility = View.VISIBLE + setEvents() @@ -582,7 +585,7 @@ class CollectionFragment( var shelvingIndex = 0 for (placementVO in saleVO.placements) { // para comprobar si es igual a una matricula - if (placementVO.shelving != null && placementVO.visible != null && txtscan.toUpperCase() == placementVO.shelving.toUpperCase() && placementVO.visible != "(0)") { + if (placementVO.shelving != null && placementVO.visible != null && txtscan.uppercase() == placementVO.shelving.uppercase() && placementVO.visible != "(0)") { if (mpok != null) mpok!!.start() isOk = true //////Log.i("VERDNATURA:","encontrado producto") @@ -618,6 +621,7 @@ class CollectionFragment( parking = txtscan ) } + Timber.i("La coleccion es "+tickets[0]) if (mpok != null) mpok!!.start() "Ticket aparcado".toast(requireContext()) } else { @@ -671,7 +675,7 @@ class CollectionFragment( viewModel.collectionTicketGet(user, password, txtscan, sectorFk, type) if (type.equals(CONTROLADOR)) { - viewModel.ticket_checkFullyControlled(user, password, txtscan) + viewModel.ticketOrCollection_checkFullyControlled(user, password, txtscan) } } else { splash_progress.visibility = View.GONE @@ -700,7 +704,7 @@ class CollectionFragment( //2- Por carro var shelvingIndex = 0 for (placementVO in saleVO.placements) { - if (txtscan.toUpperCase() == placementVO.shelving.toUpperCase()) { + if (txtscan.uppercase() == placementVO.shelving.uppercase()) { if (mpok != null) mpok!!.start() isOk = true showShelving(position, shelvingIndex) @@ -1121,7 +1125,9 @@ class CollectionFragment( collectionFk = collection.collectionFk, sectorFk = sectorFk ) - getString(R.string.Imprimiendo).toast(requireContext()) + + + (getString(R.string.Imprimiendo) + " por "+SectorDescription).toast(requireContext()) } private fun addItem() { @@ -1785,7 +1791,7 @@ class CollectionFragment( val item = sale.itemFk val cantidad = sale.quantity.toInt() - sale.pickedQuantity.toInt() val listtext = sale.longName.split(" ") - var nombre = "" + var nombre: String if (listtext.isNotEmpty()) { nombre = listtext.get(0) + " " + sale.color } else { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt index ff708ade..e17ba780 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt @@ -357,8 +357,8 @@ class CollectionViewModel(context: Context) : BaseViewModel() { }) } - fun ticket_checkFullyControlled(usuario:String,password:String,collectionFk:String){ - getSacadorControladorUserCase.ticket_checkFullyControlled(usuario,password,collectionFk).enqueue(object : + fun ticketOrCollection_checkFullyControlled(usuario:String,password:String,collectionFk:String){ + getSacadorControladorUserCase.ticketOrCollection_checkFullyControlled(usuario,password,collectionFk).enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { _responsecheckfully.value = ResponseItemVO(isError = true, errorMessage = "" + t.message!!) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt index 524efd5e..f5aab8d0 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt @@ -48,7 +48,7 @@ class ControladorFragment : BaseFragment { override fun onFailure(call: Call, t: Throwable) { _responseinsert.value = ResponseItemVO( @@ -66,10 +65,9 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() { fun machineWorker_update( usuario: String, password: String, - PlateNumber: String, - workerFk: String + PlateNumber: String ) { - getVehicleControlTimeUserCase.machineWorker_update(usuario, password, PlateNumber, workerFk) + getVehicleControlTimeUserCase.machineWorker_update(usuario, password, PlateNumber) .enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { _responseinsert.value = ResponseItemVO( @@ -96,40 +94,10 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() { }) } - fun machineWorker_Worker(usuario: String, password: String, userFk: String) { - getVehicleControlTimeUserCase.machineWorker_Worker( - usuario, - password, - userFk - ).enqueue(object : Callback { - override fun onFailure(call: Call, t: Throwable) { - _responsecontrol.value = ResponseItemVO( - isError = true, - errorMessage = "Error al comprobar el control vehículo" - ) - } - - override fun onResponse(call: Call, response: Response) { - if (response.body() == null) { - _responsecontrol.value = ResponseItemVO( - isError = true, - errorMessage = "Error al comprobar control vehículo" - ) - } else { - _responsecontrol.value = - ResponseItemVO(isError = false, response = response.body()!!) - } - - } - - }) - } - - fun workerMachinery_isRegistered(usuario: String, password: String, userFk: String) { + fun workerMachinery_isRegistered(usuario: String, password: String) { getVehicleControlTimeUserCase.workerMachinery_isRegistered( usuario, - password, - userFk + password ).enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { _responsecontrol.value = ResponseItemVO( @@ -156,11 +124,11 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() { - fun deviceProduction_getnameDevice(usuario: String, password: String, userFk: String) { + fun deviceProduction_getnameDevice(usuario: String, password: String, android_id: String) { getVehicleControlTimeUserCase.deviceProduction_getnameDevice( usuario, password, - userFk + android_id ).enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { // Log.i("VERDNATURA::","${t.message}") @@ -228,50 +196,16 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() { }) } - fun deviceProduction_getdeviceNameFromUser(usuario: String, password: String, userFk: String) { - getVehicleControlTimeUserCase.deviceProduction_getdeviceNameFromUser( - usuario, - password, - userFk - ).enqueue(object : Callback { - override fun onFailure(call: Call, t: Throwable) { - _responsemachine.value = ResponseItemMachineControl( - isError = true, - errorMessage = "Error al comprobar el trabajador del dispositivo", - type = "" - ) - } - override fun onResponse(call: Call, response: Response) { - if (response.body() == null) { - _responsemachine.value = ResponseItemMachineControl( - isError = true, - errorMessage = "Error al comprobar el trabajador del dispositivo", - type = "" - ) - } else { - _responsemachine.value = - ResponseItemMachineControl( - isError = false, - response = response.body()!!, - type = "getdeviceNameFromUser" - ) - } - } - - }) - } - - fun machine_getWorkerPlate(usuario: String, password: String, userFk: String) { + fun machine_getWorkerPlate(usuario: String, password: String) { getVehicleControlTimeUserCase.machine_getWorkerPlate( usuario, - password, - userFk + password ).enqueue(object : Callback { override fun onFailure(call: Call, t: Throwable) { - // Log.i("VERDNATURA::","Error ${t.message}") + _responsemachine.value = ResponseItemMachineControl( isError = true, errorMessage = " Error al comprobar el trabajador si ha cogido el vehículo", diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historico/adapter/HistoricoAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historico/adapter/HistoricoAdapter.kt index 6852e06d..7d035107 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historico/adapter/HistoricoAdapter.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historico/adapter/HistoricoAdapter.kt @@ -2,10 +2,12 @@ package es.verdnatura.presentation.view.feature.historico.adapter import android.view.LayoutInflater import android.view.ViewGroup + import androidx.recyclerview.widget.RecyclerView import es.verdnatura.R import es.verdnatura.databinding.ItemHistoricoRowBinding import es.verdnatura.presentation.view.feature.historico.model.ItemHistoricoVO +import androidx.core.content.ContextCompat import java.text.SimpleDateFormat import java.util.* @@ -36,9 +38,10 @@ class HistoricoAdapter ( val sdf = SimpleDateFormat("yyyy-MM-dd") val currentDate = sdf.format(Date()) if (currentDate == item.shipped){ - historicoDate.setBackgroundColor(res.getColor(R.color.verdnatura_pumpkin_orange)) + // historicoDate.setBackgroundColor(res.getColor(R.color.verdnatura_pumpkin_orange)) + historicoDate.setBackgroundColor(ContextCompat.getColor(historicoDate.getContext(),R.color.verdnatura_pumpkin_orange)) }else{ - historicoDate.setBackgroundColor(res.getColor(R.color.verdnatura_black_5)) + historicoDate.setBackgroundColor(ContextCompat.getColor(historicoDate.getContext(),R.color.verdnatura_black_5)) } } } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/adapter/HistoricoVehiculoAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/adapter/HistoricoVehiculoAdapter.kt index 04aaad29..885dc2c3 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/adapter/HistoricoVehiculoAdapter.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/adapter/HistoricoVehiculoAdapter.kt @@ -1,6 +1,7 @@ package es.verdnatura.presentation.view.feature.historicovehiculo.adapter import android.view.LayoutInflater import android.view.ViewGroup +import androidx.core.content.ContextCompat import androidx.recyclerview.widget.RecyclerView import es.verdnatura.R import es.verdnatura.databinding.ItemHistoricovehiculoRowBinding @@ -37,9 +38,9 @@ class HistoricoVehiculoAdapter ( val sdf = SimpleDateFormat("yyyy-MM-dd") val currentDate = sdf.format(Date()) if (currentDate == item.inTimed){ - historicoDate.setBackgroundColor(res.getColor(R.color.verdnatura_pumpkin_orange)) + historicoDate.setBackgroundColor(ContextCompat.getColor(historicoDate.context,R.color.verdnatura_pumpkin_orange)) }else{ - historicoDate.setBackgroundColor(res.getColor(R.color.verdnatura_black_5)) + historicoDate.setBackgroundColor(ContextCompat.getColor(historicoDate.context,R.color.verdnatura_black_5)) } } } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoFragment.kt index 2dd88676..38ff9ece 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoFragment.kt @@ -62,7 +62,7 @@ class HistoricoVehiculoFragment ( ////Log.i("VERDNATURA:","la matricula es $numberPlate") //sergio: revisar entrypoint - viewModel.machineWorker_getHistorical(user,password,numberPlate,userFk) + viewModel.machineWorker_getHistorical(user,password,numberPlate) toolbar_title.text = getString(R.string.vehiclediary) setEvents() super.init() diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt index 50c7ad62..83643a28 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt @@ -26,8 +26,8 @@ class HistoricoVehiculoViewModel (context: Context) : BaseViewModel() { val loadHistoricoVehiculoList = Transformations.map(_historicovehiculoList) { Event(it) } - fun machineWorker_getHistorical(usuario:String,password:String,plateNumber:String,nameWorker:String){ - GetVehicleControlTimeUserCase.machineWorker_getHistorical(usuario,password,plateNumber,nameWorker).enqueue(object : + fun machineWorker_getHistorical(usuario:String,password:String,plateNumber:String){ + GetVehicleControlTimeUserCase.machineWorker_getHistorical(usuario,password,plateNumber).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { val listError:ArrayList = ArrayList() diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt index 24703acc..14145d5b 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/inventario/fragment/InventaryFragment.kt @@ -168,7 +168,7 @@ class InventaryFragment : BaseFragment() { @@ -24,7 +26,17 @@ class LoginActivity : BaseActivity() { ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT))*/ + //goToMain() + addFragment(LoginFragment.newInstance(), R.id.main_frame_layout, LoginFragment.TAG) } + + fun goToMain() { + val intent = Intent(this, MainActivity::class.java) + startActivity(intent) + //splash_progress.visibility=View.GONE + finish() + } + } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt index dd76edbf..babc6f86 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt @@ -54,12 +54,11 @@ class LoginFragment : BaseFragment(LoginVi getANDROIDID() )*/ - - viewModel.device_checkLogin( + viewModel.device_checkLogin( edittext_username.text.toString(), edittext_password.text.toString(), getANDROIDID() - ) + ) }) @@ -154,7 +153,7 @@ class LoginFragment : BaseFragment(LoginVi } if (it.IsVersionCritical == 1) { - customDialog.setDescription("Se requiere actualizar la app para que funcione correctamente.") + customDialog.setDescription(getString(R.string.updatecritical)) } else { customDialog.setKoButton("Cancelar") { customDialog.dismiss() @@ -400,6 +399,7 @@ class LoginFragment : BaseFragment(LoginVi private fun goToMain() { val intent = Intent(activity, MainActivity::class.java) startActivity(intent) + //splash_progress.visibility=View.GONE requireActivity().finish() } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt index 4d5d5764..5b5e4a88 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginViewModel.kt @@ -141,7 +141,7 @@ class LoginViewModel(context: Context) : BaseViewModel() { var loginDevice: LoginDevice? if (response.raw().code() == 555) { - var message = response.raw().message().toString() + // var message = response.raw().message().toString() loginDevice = LoginDevice( isError = true, errorMessage = "Usuario o contraseña incorrectos." diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt index ef30fee1..0435b9fd 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/main/activity/MainActivity.kt @@ -86,6 +86,8 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL Timber.plant(Timber.DebugTree()) } + + } private fun haveSector(): Boolean { @@ -208,7 +210,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL PasilleroFragment.TAG, false ) - true + //true } getString(R.string.Sacadores) -> { fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE) @@ -220,7 +222,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL MAINACTIVITY.TAG, false ) - true + //true } getString(R.string.Controladores) -> { fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE) @@ -232,7 +234,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL false ) - true + // true } getString(R.string.Paletizadores) -> { fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE) @@ -245,7 +247,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL false ) - true + // true } getString(R.string.Ajustes) -> { fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE) @@ -258,7 +260,7 @@ class MainActivity : BaseActivity(), OnPasillerosItemClickL ) } - else -> false + //else -> false } true diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt index 31ab33f4..2cadb287 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletDetailFragment.kt @@ -11,6 +11,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import es.verdnatura.R import es.verdnatura.databinding.FragmentExpeditionPalletDetailBinding import es.verdnatura.domain.notNull +import es.verdnatura.domain.toast import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.common.OnOptionsSelectedListener import es.verdnatura.presentation.common.OnPalletClickListener @@ -39,6 +40,7 @@ class ExpeditionPalletDetailFragment( private var password = "" private var sectorFk = "" private var warehouseFk = "" + private var SectorDescription = "" private var adapter : ExpeditionPalletViewAdapter? = null private lateinit var customDialogList: CustomDialogList private var onPalletClickListener:OnPalletClickListener? = null @@ -64,6 +66,7 @@ class ExpeditionPalletDetailFragment( password = prefs.getString(PASSWORD,"").toString() sectorFk = prefs.getInt(SECTORFK,1).toString() warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString() + SectorDescription=prefs.getString(SECTORDESCRIP,"Sin Sector").toString() super.onCreate(savedInstanceState) @@ -119,7 +122,9 @@ class ExpeditionPalletDetailFragment( }else if(item == iconPrint){ splash_progress.visibility = View.VISIBLE + (getString(R.string.Imprimiendo)+" por " +SectorDescription).toast(requireContext()) viewModel.expeditionPalletPrintSet(user,password,itemPallet!!.Pallet,sectorFk) + } } }) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt index 88e7eb2b..96ca4229 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionPalletFragment.kt @@ -228,7 +228,7 @@ class ExpeditionPalletFragment( if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) { if (!customDialogList.getValue().isNullOrEmpty()){ try{ - val numExpedition = customDialogList.getValue().toDouble() + // val numExpedition = customDialogList.getValue().toDouble() if(customDialogList.getValue().length >= 7){ listExpeditions.add(0,BarcodeVO(code = customDialogList.getValue())) customDialogList.setDescription("Total: "+listExpeditions.size) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateFragment.kt index 37d61a53..894ba32d 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/ExpeditionStateFragment.kt @@ -8,7 +8,7 @@ import android.view.inputmethod.EditorInfo import androidx.lifecycle.Observer import androidx.recyclerview.widget.LinearLayoutManager import es.verdnatura.R -import es.verdnatura.databinding.FragmentExpeditionstateBinding +import es.verdnatura.databinding.FragmentItemexpeditionstateCardBinding import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.common.OnItemExpeditionStateRowClickListener import es.verdnatura.presentation.view.component.CustomDialog @@ -29,8 +29,8 @@ import kotlinx.android.synthetic.main.toolbar.* class ExpeditionStateFragment( var entryPoint: String = "" -) : BaseFragment(ExpeditionStateViewModel::class) { - +// ) : BaseFragment(ExpeditionStateViewModel::class) { + ) : BaseFragment(ExpeditionStateViewModel::class) { private var urlLarge: String = "" private var titleImage: String = "" private var user = "" @@ -98,7 +98,7 @@ class ExpeditionStateFragment( warehouseFk = prefs.getInt(WAREHOUSEFK, 1).toString() // this.itemFk = itemFk splash_progress.visibility = View.VISIBLE - viewModel.expedition_getStateJSON(expeditionFk, user!!, password!!) + viewModel.expedition_getStateJSON(expeditionFk, user, password) } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt index a6502137..47d44c73 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/parking/fragment/ParkingFragment.kt @@ -1,5 +1,6 @@ package es.verdnatura.presentation.view.feature.parking.fragment +import android.annotation.SuppressLint import android.content.SharedPreferences import android.media.MediaPlayer import android.os.Bundle @@ -18,6 +19,7 @@ import es.verdnatura.presentation.view.feature.main.activity.MainActivity import es.verdnatura.presentation.view.feature.parking.adapter.ParkingAdapter import kotlinx.android.synthetic.main.fragment_parking.* import kotlinx.android.synthetic.main.toolbar.* +import timber.log.Timber class ParkingFragment : BaseFragment(ParkingViewModel::class) { @@ -42,7 +44,9 @@ class ParkingFragment : BaseFragment(Pa override fun init() { setEvents() toolbar_title.text = "Parking" - viewModel.hideProgressLoading() + //sergio: después de las últimas actualizaciones se queda activo. Se cambia opción visibilidad. + //viewModel.hideProgressLoading() + splash_progress.visibility=View.GONE setList() customDialog = CustomDialog(requireContext()) super.init() diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorFragment.kt index fefeb5d6..764940dc 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorFragment.kt @@ -44,6 +44,7 @@ class PreSacadorFragment : BaseFragment = ArrayList() @@ -82,6 +83,7 @@ class PreSacadorFragment : BaseFragment resultTagMode = bundle.getString("tagMode") diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingViewModel.kt index a0275501..38902896 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/shelvingparking/fragment/ShelvingParkingViewModel.kt @@ -29,7 +29,7 @@ class ShelvingParkingViewModel(context: Context) : BaseViewModel() { fun shelvingParking_get(usuario:String,password:String,vShelvingFk:String,vWarehouseFk:String,vDayRange:String){ - getShelvingParkingUserCase.shelvingParking_get(usuario,password,vShelvingFk.toUpperCase(),vWarehouseFk,vDayRange).enqueue(object : + getShelvingParkingUserCase.shelvingParking_get(usuario,password,vShelvingFk.uppercase(),vWarehouseFk,vDayRange).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { val listError:ArrayList = ArrayList() diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/register/RegisterSmartTagsFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/register/RegisterSmartTagsFragment.kt index 8f8c5817..e1a6de34 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/register/RegisterSmartTagsFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/register/RegisterSmartTagsFragment.kt @@ -4,14 +4,13 @@ package es.verdnatura.presentation.view.feature.smarttag.register import android.content.Context import android.content.SharedPreferences import android.os.Bundle -import android.util.Log import android.view.View.* import android.view.inputmethod.EditorInfo import androidx.activity.OnBackPressedCallback import androidx.lifecycle.Observer import androidx.recyclerview.widget.LinearLayoutManager import es.verdnatura.R -import es.verdnatura.databinding.FragmentSmarttagRegisterBinding +import es.verdnatura.databinding.FragmentSacadorAssociatesmarttagBinding import es.verdnatura.domain.toast import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.common.* @@ -32,13 +31,12 @@ import kotlinx.android.synthetic.main.fragment_controlador.splash_progress import kotlinx.android.synthetic.main.fragment_expedition_scan.* import kotlinx.android.synthetic.main.fragment_login.* import kotlinx.android.synthetic.main.fragment_sacador.* -import kotlinx.android.synthetic.main.fragment_sacador_associatesmarttag.* -import kotlinx.android.synthetic.main.fragment_smarttag_register.* + import kotlinx.android.synthetic.main.toolbar.* class RegisterSmartTagsFragment( var entryPoint: String = "" -) : BaseFragment( +) : BaseFragment( SmartTagsViewModel::class ) { @@ -49,7 +47,7 @@ class RegisterSmartTagsFragment( private var sectorFk = "" private var warehouseFk = "" private var goBack: Boolean = false - private var onCollectionSelectedListener: OnCollectionSelectedListener? = null + //private var onCollectionSelectedListener: OnCollectionSelectedListener? = null override fun getLayoutId(): Int = R.layout.fragment_sacador_associatesmarttag private lateinit var customDialog: CustomDialog private lateinit var customDialogList: CustomDialogList @@ -204,30 +202,20 @@ class RegisterSmartTagsFragment( customDialog.dismiss() }.show() } else { - if (it.response == null) { + var nameSmartTagwithWagon: String - customDialog.setTitle("Error") - .setDescription("Etiqueta o carro no válido") - .setOkButton("Cerrar") { - customDialog.dismiss() - }.show() + //"Etiqueta/matrícula añadida correctamente".toast(context) + //var sizeSmartTags = listSmartTags.size + 1 - } else { - var nameSmartTagwithWagon = "" - - //"Etiqueta/matrícula añadida correctamente".toast(context) - //var sizeSmartTags = listSmartTags.size + 1 - - nameSmartTagwithWagon = - getTextScaned(listSmartTags.size + 1) + itemScaned - customDialogList.setTitle(getTextToPosition(listSmartTags.size + 1)) + nameSmartTagwithWagon = + getTextScaned(listSmartTags.size + 1) + itemScaned + customDialogList.setTitle(getTextToPosition(listSmartTags.size + 1)) - listSmartTags.add(SmartTag(itemScaned, nameSmartTagwithWagon)) - smartAdapter!!.notifyDataSetChanged() - customDialogList.setValue("") + listSmartTags.add(SmartTag(itemScaned, nameSmartTagwithWagon)) + smartAdapter!!.notifyDataSetChanged() + customDialogList.setValue("") - } } splash_progress.visibility = GONE }) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/sacador/fragment/AssociateSmartTagsFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/sacador/fragment/AssociateSmartTagsFragment.kt index 77724348..831cd64c 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/sacador/fragment/AssociateSmartTagsFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/smarttag/sacador/fragment/AssociateSmartTagsFragment.kt @@ -183,7 +183,7 @@ class AssociateSmartTagsFragment( with(viewModel) { splash_progress.visibility = GONE responseadd.observe(viewLifecycleOwner, Observer { - Log.i("VERDNATURA::", "Revisar llamada de las etiquetas smarttags : ${it.response}") + // Log.i("VERDNATURA::", "Revisar llamada de las etiquetas smarttags : ${it.response}") if (it.isError) { @@ -201,14 +201,13 @@ class AssociateSmartTagsFragment( }.show() } else {*/ - var nameSmartTagwithWagon = "" //"Etiqueta/matrícula añadida correctamente".toast(context) //var sizeSmartTags = listSmartTags.size + 1 - nameSmartTagwithWagon = - getTextScaned(listSmartTags.size + 1) + itemScaned - customDialogList.setTitle(getTextToPosition(listSmartTags.size + 1)) + var nameSmartTagwithWagon = + getTextScaned(0) + itemScaned + customDialogList.setTitle(getTextToPosition(0)) listSmartTags.add(SmartTag(itemScaned, nameSmartTagwithWagon)) smartAdapter!!.notifyDataSetChanged() @@ -236,7 +235,7 @@ class AssociateSmartTagsFragment( }.show() } else { - var nameSmartTagwithWagon = "" + //var nameSmartTagwithWagon = "" /* nameSmartTagwithWagon = getTextScaned(listSmartTags.size + 1) + itemScaned @@ -258,8 +257,8 @@ class AssociateSmartTagsFragment( private fun getTextToPosition(TagsScaned: Int): String { var message = "" - var TagScaned = 0 - when (TagScaned) { + + when (TagsScaned) { 0 -> message = "Escanea etiqueta/s electrónica/s o matrícula/s" 1 -> message = "Escanea etiqueta superior" 2 -> message = "Escanea etiqueta del medio" @@ -272,7 +271,7 @@ class AssociateSmartTagsFragment( private fun getTextScaned(TagScaned: Int): String { var message = "" - var TagScaned = 0 + when (TagScaned) { 0 -> message = "Escaneado:" 1 -> message = "Carro:" @@ -332,7 +331,7 @@ class AssociateSmartTagsFragment( customDialogList.getEditText().requestFocus() (activity as MainActivity).hideKeyboard(customDialogList.getEditText()) - customDialogList.getEditText().setOnEditorActionListener { v, actionId, event -> + customDialogList.getEditText().setOnEditorActionListener { _, actionId, _ -> if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5 || actionId == 6) { if (!customDialogList.getValue().isNullOrEmpty()) { bindShelving_add(customDialogList.getValue()) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapter.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapter.kt index 1590de0f..839a8f74 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapter.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/adapter/UbicadorAdapter.kt @@ -2,6 +2,7 @@ package es.verdnatura.presentation.view.feature.ubicador.adapter import android.view.LayoutInflater import android.view.ViewGroup +import androidx.core.content.ContextCompat import androidx.recyclerview.widget.RecyclerView import es.verdnatura.R import es.verdnatura.databinding.ItemUbicationRowBinding @@ -50,9 +51,10 @@ class UbicadorAdapter ( } if (item.visible == "0"){ - visibleText.setTextColor(res.getColor(R.color.verdnatura_brown_grey)) + visibleText.setTextColor(ContextCompat.getColor(visibleText.context,R.color.verdnatura_brown_grey)) + }else{ - visibleText.setTextColor(res.getColor(R.color.verdnatura_pumpkin_orange)) + visibleText.setTextColor(ContextCompat.getColor(visibleText.context,R.color.verdnatura_pumpkin_orange)) } moreImg.setOnClickListener { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt index ad4df411..89078ea8 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt @@ -163,7 +163,7 @@ class UbicadorFragment( customDialogInput.setTitle("Aparcar carro").setValue("").setOkButton("Aparcar"){ viewModel.shelvingPark(user,password,shelvingFk,customDialogInput.getValue()) parking = customDialogInput.getValue() - toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking + " E: "+etiquetas + toolbar_title.text = shelvingFk.uppercase() + " P: "+parking + " E: "+etiquetas if(mpok != null) mpok!!.start() customDialogInput.dismiss() }.setKoButton("Cancelar"){ @@ -179,7 +179,7 @@ class UbicadorFragment( customDialogInput.dismiss() parking = customDialogInput.getValue() if (toolbar_title != null && shelvingFk != null && parking != null && etiquetas != null){ - toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking+ " E: "+etiquetas + toolbar_title.text = shelvingFk.uppercase() + " P: "+parking+ " E: "+etiquetas }else{ toolbar_title.text = "" } @@ -198,7 +198,7 @@ class UbicadorFragment( customDialogInput.setTitle("Cambiar matrícula").setValue("").setOkButton("Guardar"){ viewModel.shelvingChange(user,password,shelvingFk,customDialogInput.getValue()) shelvingFk = customDialogInput.getValue() - toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking+ " E: "+etiquetas + toolbar_title.text = shelvingFk.uppercase() + " P: "+parking+ " E: "+etiquetas if(mpok != null) mpok!!.start() customDialogInput.dismiss() }.setKoButton("Cancelar"){ @@ -212,7 +212,7 @@ class UbicadorFragment( if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) { viewModel.shelvingChange(user,password,shelvingFk,customDialogInput.getValue()) shelvingFk = customDialogInput.getValue() - toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking+ " E: "+etiquetas + toolbar_title.text = shelvingFk.uppercase() + " P: "+parking+ " E: "+etiquetas if(mpok != null) mpok!!.start() customDialogInput.dismiss() return@setOnEditorActionListener true @@ -254,11 +254,11 @@ class UbicadorFragment( contEtiquetas += item.stickers.toInt() }catch (e: Exception) {} - parking = item.code.toUpperCase() + parking = item.code.uppercase() listItems.add(item) } etiquetas = contEtiquetas.toString() - toolbar_title.text = shelvingFk.toUpperCase() + " P: "+parking+ " E: "+etiquetas + toolbar_title.text = shelvingFk.uppercase() + " P: "+parking+ " E: "+etiquetas if(it.list.size > 0) edit_prioridad.setText(it.list[0].priority) splash_progress.visibility = View.GONE diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt index 32e8f039..f5578524 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt @@ -34,7 +34,7 @@ class UbicadorViewModel(context: Context) : BaseViewModel() { fun itemShelvingList(usuario:String,password:String,vShelvingFk:String){ - getUbicadorUserCase.itemShelvingList(usuario,password,vShelvingFk.toUpperCase()).enqueue(object : + getUbicadorUserCase.itemShelvingList(usuario,password,vShelvingFk.uppercase()).enqueue(object : Callback> { override fun onFailure(call: Call>, t: Throwable) { val listError:ArrayList = ArrayList() diff --git a/app/src/main/res/drawable-v24/ic_logo_large.png b/app/src/main/res/drawable-v24/ic_logo_large.png deleted file mode 100644 index 96c7947b..00000000 Binary files a/app/src/main/res/drawable-v24/ic_logo_large.png and /dev/null differ diff --git a/app/src/main/res/drawable-v24/selector_bottombar_text.xml b/app/src/main/res/drawable-v24/selector_bottombar_text.xml deleted file mode 100644 index b6b2e8a2..00000000 --- a/app/src/main/res/drawable-v24/selector_bottombar_text.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/app/src/main/res/drawable/barcode.xml b/app/src/main/res/drawable/barcode.xml deleted file mode 100644 index c1bdd891..00000000 --- a/app/src/main/res/drawable/barcode.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/buffer_accumulate.xml b/app/src/main/res/drawable/buffer_accumulate.xml deleted file mode 100644 index ce10c38b..00000000 --- a/app/src/main/res/drawable/buffer_accumulate.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/buffer_desactivate.xml b/app/src/main/res/drawable/buffer_desactivate.xml deleted file mode 100644 index 6011c5d5..00000000 --- a/app/src/main/res/drawable/buffer_desactivate.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/buffer_full.xml b/app/src/main/res/drawable/buffer_full.xml deleted file mode 100644 index ef8de3aa..00000000 --- a/app/src/main/res/drawable/buffer_full.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/car_control.xml b/app/src/main/res/drawable/car_control.xml deleted file mode 100644 index 807fb23b..00000000 --- a/app/src/main/res/drawable/car_control.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/circleshape.xml b/app/src/main/res/drawable/circleshape.xml deleted file mode 100644 index ebe8791c..00000000 --- a/app/src/main/res/drawable/circleshape.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - diff --git a/app/src/main/res/drawable/delete.xml b/app/src/main/res/drawable/delete.xml deleted file mode 100644 index 9fd6d874..00000000 --- a/app/src/main/res/drawable/delete.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_local_shipping_black_24dp.xml b/app/src/main/res/drawable/ic_local_shipping_black_24dp.xml deleted file mode 100644 index 0020ffde..00000000 --- a/app/src/main/res/drawable/ic_local_shipping_black_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_local_shipping_black_24dp_selected.xml b/app/src/main/res/drawable/ic_local_shipping_black_24dp_selected.xml deleted file mode 100644 index 3d8c2da0..00000000 --- a/app/src/main/res/drawable/ic_local_shipping_black_24dp_selected.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_swap_horiz_black_24dp.xml b/app/src/main/res/drawable/ic_swap_horiz_black_24dp.xml deleted file mode 100644 index e357d4a9..00000000 --- a/app/src/main/res/drawable/ic_swap_horiz_black_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/walk.xml b/app/src/main/res/drawable/walk.xml deleted file mode 100644 index f8b47566..00000000 --- a/app/src/main/res/drawable/walk.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_expeditionstate.xml b/app/src/main/res/layout/fragment_expeditionstate.xml deleted file mode 100644 index 8ea74836..00000000 --- a/app/src/main/res/layout/fragment_expeditionstate.xml +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_inventary_old.xml b/app/src/main/res/layout/fragment_inventary_old.xml index c0c76376..09118608 100644 --- a/app/src/main/res/layout/fragment_inventary_old.xml +++ b/app/src/main/res/layout/fragment_inventary_old.xml @@ -3,12 +3,6 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -