diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingCountFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingCountFragment.kt index 68eaa4d9..d666df35 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingCountFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/PackagingCountFragment.kt @@ -41,9 +41,9 @@ class PackagingCountFragment( override fun onCreate(savedInstanceState: Bundle?) { - viewModel.supplier_getItemsSalix( + /* viewModel.supplier_getItemsSalix( 2, 1 - ) + )*/ super.onCreate(savedInstanceState) } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/SupplierFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/SupplierFragment.kt index b18c981a..6135d7cf 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/SupplierFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/packaging/fragment/SupplierFragment.kt @@ -1,6 +1,8 @@ package es.verdnatura.presentation.view.feature.packaging.fragment +import android.content.ContentResolver import android.content.Context +import android.net.Uri import android.os.Bundle import android.view.View import androidx.recyclerview.widget.LinearLayoutManager @@ -10,7 +12,6 @@ import es.verdnatura.presentation.base.BaseFragment import es.verdnatura.presentation.common.OnPasillerosItemClickListener import es.verdnatura.presentation.view.feature.inventario.fragment.SearchSupplierModel import es.verdnatura.presentation.view.feature.packaging.fragment.PackagingViewModel.PackagingViewModel -import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix import es.verdnatura.presentation.view.feature.packaging.model.Supplier import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO import ir.mirrajabi.searchdialog.SimpleSearchDialogCompat @@ -47,13 +48,28 @@ class SupplierFragment( override fun onCreate(savedInstanceState: Bundle?) { - viewModel.getSuppliers( + /* viewModel.getSuppliers( + )*/ + + val drawableId: Int = + R.drawable.background_test // Reemplaza "mi_drawable" con el nombre de tu recurso Drawable + + + /* val uri: Uri = Uri.parse( + ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + context!!.resources.getResourcePackageName(drawableId) + '/' + + context!!.resources.getResourceTypeName(drawableId) + '/' + + context!!.resources.getResourceEntryName(drawableId) ) - /*val file = File(data.getSign()) + val rutaAbsoluta: String = uri.toString()*/ + + + + val file = File("/storage/emulated/0/Android/data/es.verdnatura.sfusion/files/Pictures/test.png") val filePart = MultipartBody.Part.createFormData( "file", - file.getName(), + file.name, RequestBody.create(MediaType.parse("image/png"), file) ) viewModel.entry_uploadPhotoSalix( @@ -65,7 +81,7 @@ class SupplierFragment( "Example description", false, file = filePart - )*/ + ) // viewModel.entry_addFromBuy(8,1,100) super.onCreate(savedInstanceState) } @@ -128,7 +144,8 @@ class SupplierFragment( } if (!onBack) { binding.splashProgress.visibility=View.VISIBLE - viewModel.addFromPackaging(getDataInt("SUPPLIERID"), getData("ENTRYTYPE")=="Rec") + + //viewModel.addFromPackaging(getDataInt("SUPPLIERID"), getData("ENTRYTYPE")=="Rec") } onBack = false