From cb80d580063d7e6bf8f435d9fb28597183ea4c82 Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Tue, 27 Feb 2024 09:44:17 +0100 Subject: [PATCH] refs #6284 feat:update and review xml --- .../java/es/verdnatura/MobileApplication.kt | 17 +++++++-------- app/src/main/res/layout/fragment_ajustes.xml | 3 ++- .../res/layout/fragment_inventory_parking.xml | 3 ++- .../main/res/layout/fragment_item_card.xml | 2 +- app/src/main/res/layout/fragment_login.xml | 4 ++-- .../res/layout/fragment_paletizador_menu.xml | 2 +- .../main/res/layout/fragment_pasillero.xml | 4 ++-- .../main/res/layout/fragment_pre_sacador.xml | 21 ++++++++----------- 8 files changed, 27 insertions(+), 29 deletions(-) diff --git a/app/src/main/java/es/verdnatura/MobileApplication.kt b/app/src/main/java/es/verdnatura/MobileApplication.kt index d26c330f..d24ee516 100644 --- a/app/src/main/java/es/verdnatura/MobileApplication.kt +++ b/app/src/main/java/es/verdnatura/MobileApplication.kt @@ -7,6 +7,7 @@ import android.os.Handler import android.os.Looper import es.verdnatura.dataStore.DataStoreLocal import es.verdnatura.di.viewModelModule +import es.verdnatura.domain.ConstAndValues import es.verdnatura.domain.RestClient import es.verdnatura.domain.SalixService import es.verdnatura.domain.VerdnaturaService @@ -16,6 +17,7 @@ import es.verdnatura.presentation.common.LoginListener import es.verdnatura.presentation.common.MainActivityListener import es.verdnatura.presentation.common.SignListener import es.verdnatura.presentation.view.component.CustomDialogMainActivity +import kotlinx.coroutines.runBlocking import org.koin.android.ext.koin.androidContext import org.koin.core.context.loadKoinModules import org.koin.core.context.startKoin @@ -65,9 +67,12 @@ class MobileApplication : Application(), InteceptorListener { loadKoinModules(moduleList) } - var restClient = RestClient(this, this) - silex = restClient.restClient + + runBlocking { dataStoreApp.editDataStoreKey(ConstAndValues.BASEURLSALIX,ConstAndValues.BASE_URL_SALIX) } + val restClient = RestClient(this, this) salix = restClient.salixClient + silex = restClient.restClient + } @@ -77,7 +82,6 @@ class MobileApplication : Application(), InteceptorListener { fun messageToast(isError: Boolean, message: String) { val playSound = when (isError) { - null -> null false -> mpok true -> mperror } @@ -111,11 +115,6 @@ class MobileApplication : Application(), InteceptorListener { fun getLanguage(): String { val settings = this.resources.configuration - return if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) { - settings.locales.get(0).language - } else { - @Suppress("DEPRECATION") - settings.locale.language - } + return settings.locales.get(0).language } } \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_ajustes.xml b/app/src/main/res/layout/fragment_ajustes.xml index 002f8808..aee64b8d 100644 --- a/app/src/main/res/layout/fragment_ajustes.xml +++ b/app/src/main/res/layout/fragment_ajustes.xml @@ -34,6 +34,7 @@ app:layout_constraintTop_toBottomOf="@id/divider" android:layout_marginLeft="@dimen/pasilleros_margin_main_menu" android:padding="@dimen/navigation_row_min_padding" + android:visibility="gone" > @@ -179,7 +180,7 @@ app:layout_constraintTop_toTopOf="parent" /> + android:visibility="gone"> + - > + diff --git a/app/src/main/res/layout/fragment_login.xml b/app/src/main/res/layout/fragment_login.xml index 37648086..34097ab6 100644 --- a/app/src/main/res/layout/fragment_login.xml +++ b/app/src/main/res/layout/fragment_login.xml @@ -39,7 +39,8 @@ android:layout_marginTop="0dp" android:textColorHint="@android:color/darker_gray" app:layout_constraintStart_toStartOf="@id/textview_welcome" - app:layout_constraintTop_toBottomOf="@id/textview_welcome"> + app:layout_constraintTop_toBottomOf="@id/textview_welcome" + android:visibility="gone"> diff --git a/app/src/main/res/layout/fragment_paletizador_menu.xml b/app/src/main/res/layout/fragment_paletizador_menu.xml index a9c92d1d..010444f6 100644 --- a/app/src/main/res/layout/fragment_paletizador_menu.xml +++ b/app/src/main/res/layout/fragment_paletizador_menu.xml @@ -23,7 +23,7 @@ tool:listitem="@layout/item_pasilleros_main_menu" android:paddingTop="@dimen/toolbar_height"/> - ' + tool:listitem="@layout/item_pasilleros_main_menu"/> + - + - - + app:layout_constraintTop_toTopOf="@+id/main_toolbar" /> - - ' + app:layout_constraintTop_toTopOf="parent">