Commit 01fb822e19dda9141002d3401c35f2156e508934
1 parent
be3b7b8379
Exists in
master
21092020 1800
Showing
20 changed files
with
547 additions
and
446 deletions
Show diff stats
app/src/main/java/com/focasoftware/deboinventariov20/Model/ProductosService.kt
1 | package com.focasoftware.deboinventariov20.Model | 1 | package com.focasoftware.deboinventariov20.Model |
2 | 2 | ||
3 | import com.focasoftware.deboinventariov20.UI.actualizacionMaestros.BASE_URL | 3 | import com.focasoftware.deboinventariov20.UI.actualizacionMaestros.BASE_URL |
4 | import okhttp3.OkHttpClient | ||
5 | import okhttp3.logging.HttpLoggingInterceptor | ||
4 | import retrofit2.Retrofit | 6 | import retrofit2.Retrofit |
5 | import retrofit2.converter.gson.GsonConverterFactory | 7 | import retrofit2.converter.gson.GsonConverterFactory |
8 | import java.net.SocketTimeoutException | ||
9 | import java.util.concurrent.TimeUnit | ||
6 | 10 | ||
7 | object ProductosService { | 11 | object ProductosService { |
12 | private val TIME_OUT: Long | ||
13 | get() { | ||
14 | return 15 | ||
15 | } | ||
16 | private val interceptor = run { | ||
17 | val httpLoggingInterceptor = HttpLoggingInterceptor() | ||
18 | httpLoggingInterceptor.apply { | ||
19 | httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY | ||
20 | } | ||
21 | } | ||
22 | private val okHttpClient = OkHttpClient.Builder() | ||
23 | .addNetworkInterceptor(interceptor) // same for .addInterceptor(...) | ||
24 | .connectTimeout(TIME_OUT, TimeUnit.SECONDS) //Backend is really slow | ||
25 | .writeTimeout(TIME_OUT, TimeUnit.SECONDS) | ||
26 | .readTimeout(TIME_OUT, TimeUnit.SECONDS) | ||
27 | .build() | ||
8 | fun getProductosService(): ProductosApi { | 28 | fun getProductosService(): ProductosApi { |
9 | return Retrofit.Builder() | 29 | return Retrofit.Builder() |
30 | .client(okHttpClient) | ||
10 | .baseUrl(BASE_URL) | 31 | .baseUrl(BASE_URL) |
11 | .addConverterFactory(GsonConverterFactory.create()) | 32 | .addConverterFactory(GsonConverterFactory.create()) |
12 | .build() | 33 | .build() |
13 | .create(ProductosApi::class.java) | 34 | .create(ProductosApi::class.java) |
14 | } | 35 | } |
15 | } | ||
36 | } | ||
37 | //fun prubaConexion(){ | ||
38 | // for (retries in 0..2) { | ||
39 | // try { | ||
40 | // val client: HttpClient = createHttpClientWithDefaultSocketFactory(null, null) | ||
41 | // val response: HttpResponse = client.execute(get) | ||
42 | // val statusCode: Int = response.getStatusLine().getStatusCode() | ||
43 | // return if (statusCode != 200) { | ||
44 | // throw IllegalStateException("GET Request on '" + get.getURI().toString().toString() + "' resulted in " + statusCode) | ||
45 | // } else { | ||
46 | // response.getEntity() | ||
47 | // } | ||
48 | // } catch (e: SocketTimeoutException) { | ||
49 | // // connection timed out...let's try again | ||
50 | // } | ||
51 | // } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/SplashActivity.kt
1 | package com.focasoftware.deboinventariov20.UI | 1 | package com.focasoftware.deboinventariov20.UI |
2 | 2 | ||
3 | import android.app.Activity | 3 | import android.app.Activity |
4 | import android.content.Intent | 4 | import android.content.Intent |
5 | import android.os.Bundle | 5 | import android.os.Bundle |
6 | import com.focasoftware.deboinventariov20.R | 6 | import com.focasoftware.deboinventariov20.R |
7 | 7 | ||
8 | class SplashActivity : Activity() { | 8 | class SplashActivity : Activity() { |
9 | 9 | ||
10 | override fun onCreate(savedInstanceState: Bundle?) { | 10 | override fun onCreate(savedInstanceState: Bundle?) { |
11 | super.onCreate(savedInstanceState) | 11 | super.onCreate(savedInstanceState) |
12 | setContentView(R.layout.activity_splash) | 12 | setContentView(R.layout.activity_splash) |
13 | //window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | 13 | //window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
14 | 14 | ||
15 | val bac = object : Thread(){ | 15 | val bac = object : Thread(){ |
16 | override fun run(){ | 16 | override fun run(){ |
17 | try { | 17 | try { |
18 | Thread.sleep(3000) | 18 | Thread.sleep(3) |
19 | val intent = Intent(baseContext, MainActivity:: class.java) | 19 | val intent = Intent(baseContext, MainActivity:: class.java) |
20 | startActivity(intent) | 20 | startActivity(intent) |
21 | finish() | 21 | finish() |
22 | } catch (e : Exception){ | 22 | } catch (e : Exception){ |
23 | e.printStackTrace() | 23 | e.printStackTrace() |
24 | } | 24 | } |
25 | } | 25 | } |
26 | } | 26 | } |
27 | bac.start() | 27 | bac.start() |
28 | } | 28 | } |
29 | } | 29 | } |
30 | 30 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/ActuaMaestrosFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.actualizacionMaestros | 1 | package com.focasoftware.deboinventariov20.UI.actualizacionMaestros |
2 | 2 | ||
3 | import android.os.Bundle | 3 | import android.os.Bundle |
4 | import android.view.LayoutInflater | 4 | import android.view.LayoutInflater |
5 | import android.view.View | 5 | import android.view.View |
6 | import android.view.ViewGroup | 6 | import android.view.ViewGroup |
7 | import android.widget.Button | 7 | import android.widget.Button |
8 | import androidx.fragment.app.Fragment | 8 | import androidx.fragment.app.Fragment |
9 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 9 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
10 | import com.focasoftware.deboinventariov20.Model.Articles | 10 | import com.focasoftware.deboinventariov20.Model.Articles |
11 | import com.focasoftware.deboinventariov20.Model.ProductosService | 11 | import com.focasoftware.deboinventariov20.Model.ProductosService |
12 | import com.focasoftware.deboinventariov20.Model.ServeInv | 12 | import com.focasoftware.deboinventariov20.Model.ServeInv |
13 | import com.focasoftware.deboinventariov20.R | 13 | import com.focasoftware.deboinventariov20.R |
14 | import com.focasoftware.deboinventariov20.UI.Utils.noServerConf | 14 | import com.focasoftware.deboinventariov20.UI.Utils.noServerConf |
15 | import kotlinx.android.synthetic.main.fragment_actua_maestros.* | 15 | import kotlinx.android.synthetic.main.fragment_actua_maestros.* |
16 | import kotlinx.coroutines.* | 16 | import kotlinx.coroutines.* |
17 | import kotlinx.coroutines.Dispatchers.IO | 17 | import kotlinx.coroutines.Dispatchers.IO |
18 | import kotlinx.coroutines.Dispatchers.Main | 18 | import kotlinx.coroutines.Dispatchers.Main |
19 | import java.util.ArrayList | 19 | import java.net.SocketTimeoutException |
20 | |||
20 | 21 | ||
21 | var BASE_URL = "" | 22 | var BASE_URL = "" |
22 | 23 | ||
23 | class ActuaMaestrosFragment : Fragment() { | 24 | class ActuaMaestrosFragment : Fragment() { |
24 | 25 | ||
25 | override fun onCreate(savedInstanceState: Bundle?) { | 26 | override fun onCreate(savedInstanceState: Bundle?) { |
26 | super.onCreate(savedInstanceState) | 27 | super.onCreate(savedInstanceState) |
27 | 28 | ||
28 | GlobalScope.launch(Main) { | 29 | GlobalScope.launch(Main) { |
29 | val serverPre = fetchServerPreOne() | 30 | val serverPre = fetchServerPreOne() |
30 | if (serverPre!!.direccion.isNullOrEmpty()) { | 31 | if (serverPre!!.direccion.isNullOrEmpty()) { |
31 | val modalDialog = noServerConf() | 32 | val modalDialog = noServerConf() |
32 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 33 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") |
33 | } else { | 34 | } else { |
34 | BASE_URL = serverPre.direccion.toString()+":"+serverPre.puerto.toString()+"/" | 35 | BASE_URL = serverPre.direccion.toString() + ":" + serverPre.puerto.toString() + "/" |
35 | tvServerConectado.text="Conectado al servidor: ${serverPre.descripcion}" | 36 | tvServerConectado.text = "Conectado al servidor: ${serverPre.descripcion}" |
36 | } | 37 | } |
37 | } | 38 | } |
38 | 39 | ||
39 | // mostrarArticulos() | 40 | // mostrarArticulos() |
40 | } | 41 | } |
41 | 42 | ||
42 | private suspend fun fetchServerPreOne(): ServeInv? { | 43 | private suspend fun fetchServerPreOne(): ServeInv? { |
43 | return GlobalScope.async(IO) { | 44 | return GlobalScope.async(IO) { |
44 | return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchServerPreOne() | 45 | return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchServerPreOne() |
45 | }.await() | 46 | }.await() |
46 | } | 47 | } |
47 | 48 | ||
48 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 49 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
49 | // Inflate the layout for this fragment | 50 | // Inflate the layout for this fragment |
50 | val v = inflater.inflate(R.layout.fragment_actua_maestros, container, false) | 51 | val v = inflater.inflate(R.layout.fragment_actua_maestros, container, false) |
51 | val bConfirmarAct = v.findViewById<Button>(R.id.btnConfirmarAct) | 52 | val bConfirmarAct = v.findViewById<Button>(R.id.btnConfirmarAct) |
52 | 53 | ||
53 | bConfirmarAct.setOnClickListener { | 54 | bConfirmarAct.setOnClickListener { |
54 | loading_view.visibility = View.VISIBLE | 55 | loading_view.visibility = View.VISIBLE |
55 | countriesList.text = "Obteniendo artículos del servidor, aguarde por favor." | 56 | countriesList.text = "Obteniendo artículos del servidor, aguarde por favor." |
56 | GlobalScope.launch(Main) { | 57 | GlobalScope.launch(Main) { |
57 | obtenerArticulos() | 58 | obtenerArticulos() |
58 | } | 59 | } |
59 | } | 60 | } |
60 | return v | 61 | return v |
61 | } | 62 | } |
62 | 63 | ||
63 | private suspend fun obtenerArticulos() { | 64 | private suspend fun obtenerArticulos() { |
64 | 65 | ||
65 | val productosService = ProductosService.getProductosService() | 66 | val productosService = ProductosService.getProductosService() |
66 | var index: Long = 1 | 67 | var index: Long = 1 |
67 | withContext(IO) { | 68 | withContext(IO) { |
68 | val job = CoroutineScope(IO).launch { | 69 | val job = CoroutineScope(IO).launch { |
69 | // TODO: BORRO TODO LOS ARTICULOS DE LA BASE PARA CARGARLOS DE NUEVO | 70 | // TODO: BORRO TODO LOS ARTICULOS DE LA BASE PARA CARGARLOS DE NUEVO |
70 | AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.deleteAllArticulos() | 71 | AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.deleteAllArticulos() |
71 | 72 | try { | |
72 | val response = productosService.getProductos() | 73 | val response = productosService.getProductos() |
73 | if (response.isSuccessful) { | 74 | if (response.isSuccessful) { |
74 | 75 | ||
75 | for (pro in response.body()!!) { | 76 | for (pro in response.body()!!) { |
76 | val artiAcargar = Articles(pro.sector, | 77 | val artiAcargar = Articles( |
77 | pro.codigo, | 78 | pro.sector, |
78 | pro.descripcion, | 79 | pro.codigo, |
79 | pro.codBar, | 80 | pro.descripcion, |
80 | pro.codOrigen, | 81 | pro.codBar, |
81 | pro.precio, | 82 | pro.codOrigen, |
82 | pro.costo, | 83 | pro.precio, |
83 | pro.exiVenta, | 84 | pro.costo, |
84 | pro.exiDeposito, | 85 | pro.exiVenta, |
85 | pro.de, | 86 | pro.exiDeposito, |
86 | pro.balanza, | 87 | pro.de, |
87 | pro.depSn, | 88 | pro.balanza, |
88 | pro.imagen) | 89 | pro.depSn, |
89 | index += index | 90 | pro.imagen |
90 | AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.insertArticulos(artiAcargar) | 91 | ) |
91 | } | 92 | index += index |
92 | withContext(Main) { | 93 | AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.insertArticulos(artiAcargar) |
93 | countriesList.visibility = View.VISIBLE | 94 | } |
94 | countriesList.text = "¡Datos Importados Correctamente!" | 95 | withContext(Main) { |
95 | loading_view.visibility = View.GONE | 96 | countriesList.visibility = View.VISIBLE |
97 | countriesList.text = "¡Datos Importados Correctamente!" | ||
98 | loading_view.visibility = View.GONE | ||
99 | } | ||
100 | } else if (!response.isSuccessful) { | ||
101 | withContext(Main) { | ||
102 | countriesList.visibility = View.VISIBLE | ||
103 | countriesList.text = "¡Sin servicio. No se puede conectar a la api o al servidor configurado en el BackEnd!" | ||
104 | loading_view.visibility = View.GONE | ||
105 | } | ||
96 | } | 106 | } |
97 | }else{ | 107 | } catch (e: SocketTimeoutException) { |
98 | withContext(Main) { | 108 | withContext(Main) { |
99 | countriesList.visibility = View.VISIBLE | 109 | countriesList.visibility = View.VISIBLE |
100 | countriesList.text = "¡Error!" | 110 | countriesList.text = "¡Sin conexión al Servidor!" |
101 | loading_view.visibility = View.GONE | 111 | loading_view.visibility = View.GONE |
102 | } | 112 | } |
103 | } | 113 | } |
104 | } | 114 | } |
105 | if (job == null) { | 115 | // if (job == null) { |
106 | withContext(Main) { | 116 | // withContext(Main) { |
107 | countriesList.visibility = View.VISIBLE | 117 | // countriesList.visibility = View.VISIBLE |
108 | countriesList.text = "No se puedo realizar la conexión al Servidor" | 118 | // countriesList.text = "No se puedo realizar la conexión al Servidor" |
109 | loading_view.visibility = View.GONE | 119 | // loading_view.visibility = View.GONE |
110 | } | 120 | // } |
111 | } | 121 | // } |
112 | } | 122 | } |
113 | 123 | ||
114 | 124 | ||
115 | // withContext(Dispatchers.Main) { | 125 | // withContext(Dispatchers.Main) { |
116 | // if (response.isSuccessful) { | 126 | // if (response.isSuccessful) { |
117 | // val call = WebService | 127 | // val call = WebService |
118 | // .instance | 128 | // .instance |
119 | // ?.createService(WebServiceApi::class.java) | 129 | // ?.createService(WebServiceApi::class.java) |
120 | // ?.articulos | 130 | // ?.articulos |
121 | // call?.enqueue(object : Callback<List<productos?>?> { | 131 | // call?.enqueue(object : Callback<List<productos?>?> { |
122 | // override fun onResponse( | 132 | // override fun onResponse( |
123 | // call: Call<List<productos?>?>, | 133 | // call: Call<List<productos?>?>, |
124 | // response: Response<List<productos?>?> | 134 | // response: Response<List<productos?>?> |
125 | // ) { | 135 | // ) { |
126 | // if (response.code() == 200) { | 136 | // if (response.code() == 200) { |
127 | // for (i in response.body()!!.indices) { | 137 | // for (i in response.body()!!.indices) { |
128 | // //AppDb.getAppDb(requireActivity())!!.ArticulosDAO()?.insertArticulos(response.body()!![i]) | 138 | // //AppDb.getAppDb(requireActivity())!!.ArticulosDAO()?.insertArticulos(response.body()!![i]) |
129 | // cargarArticulos(2, 500, "sfas", "66666","2,2", "2,2", false, false, "") | 139 | // cargarArticulos(2, 500, "sfas", "66666","2,2", "2,2", false, false, "") |
130 | //// Log.d( | 140 | //// Log.d( |
131 | //// "TAG1", "Nombre Curso: " + response.body()!![i]?.sector | 141 | //// "TAG1", "Nombre Curso: " + response.body()!![i]?.sector |
132 | //// + "Codigo Profesor: " + response.body()!![i]?.descripcion | 142 | //// + "Codigo Profesor: " + response.body()!![i]?.descripcion |
133 | //// ) | 143 | //// ) |
134 | // mostrarArticulos() | 144 | // mostrarArticulos() |
135 | // } | 145 | // } |
136 | // } else if (response.code() == 404) { | 146 | // } else if (response.code() == 404) { |
137 | // Log.d("TAG1", "No hay cursos") | 147 | // Log.d("TAG1", "No hay cursos") |
138 | // } | 148 | // } |
139 | // | 149 | // |
140 | // } | 150 | // } |
141 | // | 151 | // |
142 | // override fun onFailure(call: Call<List<productos?>?>, t: Throwable) {} | 152 | // override fun onFailure(call: Call<List<productos?>?>, t: Throwable) {} |
143 | // }) | 153 | // }) |
144 | } | 154 | } |
145 | 155 | ||
146 | fun mostrarArticulos() { | 156 | fun mostrarArticulos() { |
147 | val Job = GlobalScope.launch { | 157 | val Job = GlobalScope.launch { |
148 | var listArticulos: List<Articles>? = null | 158 | var listArticulos: List<Articles>? = null |
149 | var temp: String = "" | 159 | var temp: String = "" |
150 | listArticulos = AppDb.getAppDb(requireActivity())?.ArticulosDAO()?.findAllArticulos() | 160 | listArticulos = AppDb.getAppDb(requireActivity())?.ArticulosDAO()?.findAllArticulos() |
151 | if (listArticulos != null) { | 161 | if (listArticulos != null) { |
152 | 162 | ||
153 | for (i in listArticulos.indices) temp += listArticulos[i].codigo.toString() | 163 | for (i in listArticulos.indices) temp += listArticulos[i].codigo.toString() |
154 | } | 164 | } |
155 | withContext(Dispatchers.Main) { | 165 | withContext(Dispatchers.Main) { |
156 | countriesList.visibility = View.VISIBLE | 166 | countriesList.visibility = View.VISIBLE |
157 | loading_view.visibility = View.GONE | 167 | loading_view.visibility = View.GONE |
158 | countriesList?.text = temp | 168 | countriesList?.text = temp |
159 | } | 169 | } |
160 | } | 170 | } |
161 | // for (professor in listArticulos!!) { | 171 | // for (professor in listArticulos!!) { |
162 | // editT.text= professor.id.toString() | 172 | // editT.text= professor.id.toString() |
163 | // } | 173 | // } |
164 | } | 174 | } |
165 | } | 175 | } |
166 | 176 | ||
167 | 177 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/descripCorigenFragment/CodigoOrigenAdapter.kt
1 | package com.focasoftware.deboinventariov20.UI.descripCorigenFragment | 1 | package com.focasoftware.deboinventariov20.UI.descripCorigenFragment |
2 | 2 | ||
3 | import android.content.Context | 3 | import android.content.Context |
4 | import android.view.LayoutInflater | 4 | import android.view.LayoutInflater |
5 | import android.view.View | 5 | import android.view.View |
6 | import android.view.ViewGroup | 6 | import android.view.ViewGroup |
7 | import androidx.recyclerview.widget.RecyclerView | 7 | import androidx.recyclerview.widget.RecyclerView |
8 | import com.focasoftware.deboinventariov20.Model.Articles | 8 | import com.focasoftware.deboinventariov20.Model.Articles |
9 | import com.focasoftware.deboinventariov20.Model.InvHead | ||
10 | import com.focasoftware.deboinventariov20.R | 9 | import com.focasoftware.deboinventariov20.R |
11 | import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder | ||
12 | import com.focasoftware.deboinventariov20.UI.descripcionFragment.DescripcionListAdapter | ||
13 | import kotlinx.android.synthetic.main.item.view.* | ||
14 | import kotlinx.android.synthetic.main.item.view.tvCodigo | ||
15 | import kotlinx.android.synthetic.main.item.view.tvCodigoOrigen | ||
16 | import kotlinx.android.synthetic.main.item.view.tvDescripcion | 10 | import kotlinx.android.synthetic.main.item.view.tvDescripcion |
17 | import kotlinx.android.synthetic.main.item.view.tvSector | ||
18 | import kotlinx.android.synthetic.main.item_codigo_origen.view.* | 11 | import kotlinx.android.synthetic.main.item_codigo_origen.view.* |
19 | 12 | ||
20 | class CodigoOrigenAdapter(private val cnxt: Context, private val corigen: List<Articles>) : | 13 | class CodigoOrigenAdapter(private val cnxt: Context, private val corigen: List<Articles>) : |
21 | RecyclerView.Adapter<CodigoOrigenAdapter.ItemsViewHolder>() { | 14 | RecyclerView.Adapter<CodigoOrigenAdapter.ItemsViewHolder>() { |
22 | internal var items2: List<Articles>? = null | 15 | internal var items2: List<Articles>? = null |
23 | 16 | ||
24 | init { | 17 | init { |
25 | this.items2 = corigen | 18 | this.items2 = corigen |
26 | } | 19 | } |
27 | 20 | ||
28 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder( | 21 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder( |
29 | LayoutInflater.from(cnxt).inflate(R.layout.item_codigo_origen, parent, false)) | 22 | LayoutInflater.from(cnxt).inflate(R.layout.item_codigo_origen, parent, false)) |
30 | 23 | ||
31 | override fun getItemCount() = corigen.size | 24 | override fun getItemCount() = corigen.size |
32 | 25 | ||
33 | override fun onBindViewHolder(holder: ItemsViewHolder, position: Int) { | 26 | override fun onBindViewHolder(holder: ItemsViewHolder, position: Int) { |
34 | when (holder) { | 27 | when (holder) { |
35 | is ItemsViewHolder -> { | 28 | is ItemsViewHolder -> { |
36 | holder.bind(items2!![position]) | 29 | holder.bind(items2!![position]) |
37 | } | 30 | } |
38 | } | 31 | } |
39 | } | 32 | } |
40 | 33 | ||
41 | class ItemsViewHolder constructor(view: View) : RecyclerView.ViewHolder(view) { | 34 | class ItemsViewHolder constructor(view: View) : RecyclerView.ViewHolder(view) { |
42 | 35 | ||
43 | val sector = view.tvSector | 36 | val sector = view.tvSector |
44 | val codigo = view.tvCodigo | 37 | val codigo = view.tvCodigo |
45 | val descripcion = view.tvDescripcion | 38 | val descripcion = view.tvDescripcion |
46 | val CodigoOrigen = view.tvCodigoOrigen | 39 | val CodigoOrigen = view.tvCodigoOrigen |
47 | 40 | ||
48 | fun bind(pro: Articles) { | 41 | fun bind(pro: Articles) { |
49 | sector.text = pro.sector | 42 | sector.text = pro.sector |
50 | codigo.text = pro.codigo | 43 | codigo.text = pro.codigo |
51 | descripcion.text = pro.descripcion | 44 | descripcion.text = pro.descripcion |
52 | CodigoOrigen.text = pro.codOrigen | 45 | CodigoOrigen.text = pro.codOrigen |
53 | } | 46 | } |
54 | } | 47 | } |
55 | } | 48 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/descripcionFragment/DescripcionListAdapter.kt
1 | package com.focasoftware.deboinventariov20.UI.descripcionFragment | 1 | package com.focasoftware.deboinventariov20.UI.descripcionFragment |
2 | 2 | ||
3 | import android.view.LayoutInflater | 3 | import android.view.LayoutInflater |
4 | import android.view.View | 4 | import android.view.View |
5 | import android.view.ViewGroup | 5 | import android.view.ViewGroup |
6 | import androidx.recyclerview.widget.RecyclerView | 6 | import androidx.recyclerview.widget.RecyclerView |
7 | import com.focasoftware.deboinventariov20.Model.Articles | 7 | import com.focasoftware.deboinventariov20.Model.Articles |
8 | import com.focasoftware.deboinventariov20.R | 8 | import com.focasoftware.deboinventariov20.R |
9 | import kotlinx.android.synthetic.main.item.view.* | 9 | import kotlinx.android.synthetic.main.item.view.* |
10 | import kotlinx.android.synthetic.main.item.view.tvDescripcion | ||
11 | import kotlinx.android.synthetic.main.item_descripcion.view.* | ||
10 | 12 | ||
11 | class DescripcionListAdapter(private val productos: List<Articles>?) : | 13 | class DescripcionListAdapter(private val productos: List<Articles>?) : |
12 | RecyclerView.Adapter<DescripcionListAdapter.ItemsViewHolder>() { | 14 | RecyclerView.Adapter<DescripcionListAdapter.ItemsViewHolder>() { |
13 | internal var items2: List<Articles>? = null | 15 | internal var items2: List<Articles>? = null |
14 | 16 | ||
15 | init { | 17 | init { |
16 | this.items2 = productos | 18 | this.items2 = productos |
17 | } | 19 | } |
18 | 20 | ||
19 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder( | 21 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder( |
20 | LayoutInflater.from(parent.context).inflate(R.layout.item_descripcion, parent, false)) | 22 | LayoutInflater.from(parent.context).inflate(R.layout.item_descripcion, parent, false)) |
21 | 23 | ||
22 | override fun getItemCount() = productos!!.size | 24 | override fun getItemCount() = productos!!.size |
23 | 25 | ||
24 | override fun onBindViewHolder(holder: ItemsViewHolder, position: Int) { | 26 | override fun onBindViewHolder(holder: ItemsViewHolder, position: Int) { |
25 | when (holder) { | 27 | when (holder) { |
26 | is ItemsViewHolder -> { | 28 | is ItemsViewHolder -> { |
27 | holder.bind(items2!![position]) | 29 | holder.bind(items2!![position]) |
28 | } | 30 | } |
29 | } | 31 | } |
30 | } | 32 | } |
31 | 33 | ||
32 | class ItemsViewHolder constructor(view: View) : RecyclerView.ViewHolder(view) { | 34 | class ItemsViewHolder constructor(view: View) : RecyclerView.ViewHolder(view) { |
33 | 35 | ||
34 | val sector = view.tvSector | 36 | val sector = view.tvSector |
35 | val codigo = view.tvCodigo | 37 | val codigo = view.tvCodigo |
36 | val descripcion = view.tvDescripcion | 38 | val descripcion = view.tvDescripcion |
37 | val codigoBarras = view.tvCodigoBarras | 39 | val codigoBarras = view.tvCodigoBarras |
38 | 40 | ||
39 | fun bind(pro: Articles) { | 41 | fun bind(pro: Articles) { |
40 | sector.text = pro.sector | 42 | sector.text = pro.sector |
41 | codigo.text = pro.codigo | 43 | codigo.text = pro.codigo |
42 | descripcion.text = pro.descripcion | 44 | descripcion.text = pro.descripcion |
43 | codigoBarras.text = pro.codBar | 45 | codigoBarras.text = pro.codBar |
44 | } | 46 | } |
45 | } | 47 | } |
46 | } | 48 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/InventarioFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.inventario | 1 | package com.focasoftware.deboinventariov20.UI.inventario |
2 | 2 | ||
3 | import android.annotation.SuppressLint | 3 | import android.annotation.SuppressLint |
4 | import android.app.AlertDialog | 4 | import android.app.AlertDialog |
5 | import android.app.Dialog | 5 | import android.app.Dialog |
6 | import android.content.Context | 6 | import android.content.Context |
7 | import android.content.Context.INPUT_METHOD_SERVICE | 7 | import android.content.Context.INPUT_METHOD_SERVICE |
8 | import android.content.DialogInterface | 8 | import android.content.DialogInterface |
9 | import android.content.SharedPreferences | 9 | import android.content.SharedPreferences |
10 | import android.graphics.Canvas | 10 | import android.graphics.Canvas |
11 | import android.graphics.Color | 11 | import android.graphics.Color |
12 | import android.graphics.drawable.Drawable | 12 | import android.graphics.drawable.Drawable |
13 | import android.os.Bundle | 13 | import android.os.Bundle |
14 | import android.text.Editable | 14 | import android.text.Editable |
15 | import android.text.InputType.TYPE_CLASS_NUMBER | 15 | import android.text.InputType.TYPE_CLASS_NUMBER |
16 | import android.text.TextWatcher | 16 | import android.text.TextWatcher |
17 | import android.view.* | 17 | import android.view.* |
18 | import android.view.inputmethod.InputMethodManager | 18 | import android.view.inputmethod.InputMethodManager |
19 | import android.widget.EditText | 19 | import android.widget.EditText |
20 | import android.widget.TextView | 20 | import android.widget.TextView |
21 | import android.widget.Toast | 21 | import android.widget.Toast |
22 | import androidx.core.content.ContextCompat | 22 | import androidx.core.content.ContextCompat |
23 | import androidx.core.os.bundleOf | 23 | import androidx.core.os.bundleOf |
24 | import androidx.fragment.app.Fragment | 24 | import androidx.fragment.app.Fragment |
25 | import androidx.lifecycle.lifecycleScope | 25 | import androidx.lifecycle.lifecycleScope |
26 | import androidx.navigation.NavController | 26 | import androidx.navigation.NavController |
27 | import androidx.navigation.Navigation | 27 | import androidx.navigation.Navigation |
28 | import androidx.recyclerview.widget.ItemTouchHelper | 28 | import androidx.recyclerview.widget.ItemTouchHelper |
29 | import androidx.recyclerview.widget.LinearLayoutManager | 29 | import androidx.recyclerview.widget.LinearLayoutManager |
30 | import androidx.recyclerview.widget.RecyclerView | 30 | import androidx.recyclerview.widget.RecyclerView |
31 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 31 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
32 | import com.focasoftware.deboinventariov20.Model.Articles | 32 | import com.focasoftware.deboinventariov20.Model.Articles |
33 | import com.focasoftware.deboinventariov20.Model.InvBody | 33 | import com.focasoftware.deboinventariov20.Model.InvBody |
34 | import com.focasoftware.deboinventariov20.Model.InvHead | 34 | import com.focasoftware.deboinventariov20.Model.InvHead |
35 | import com.focasoftware.deboinventariov20.R | 35 | import com.focasoftware.deboinventariov20.R |
36 | import com.focasoftware.deboinventariov20.UI.Utils.NoEncontradoSimple | 36 | import com.focasoftware.deboinventariov20.UI.Utils.NoEncontradoSimple |
37 | import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera | 37 | import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera |
38 | import kotlinx.android.synthetic.main.fragment_inventario.* | 38 | import kotlinx.android.synthetic.main.fragment_inventario.* |
39 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.* | 39 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.* |
40 | import kotlinx.android.synthetic.main.login_dialog.view.* | 40 | import kotlinx.android.synthetic.main.login_dialog.view.* |
41 | import kotlinx.android.synthetic.main.login_dialog.view.btnAceptar | 41 | import kotlinx.android.synthetic.main.login_dialog.view.btnAceptar |
42 | import kotlinx.coroutines.* | 42 | import kotlinx.coroutines.* |
43 | import kotlinx.coroutines.Dispatchers.IO | 43 | import kotlinx.coroutines.Dispatchers.IO |
44 | import java.time.LocalDateTime | 44 | import java.time.LocalDateTime |
45 | import java.time.format.DateTimeFormatter | 45 | import java.time.format.DateTimeFormatter |
46 | import java.util.* | 46 | import java.util.* |
47 | 47 | ||
48 | class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickListener { | 48 | class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickListener { |
49 | 49 | ||
50 | private lateinit var sharedPreferences: SharedPreferences | 50 | private lateinit var sharedPreferences: SharedPreferences |
51 | private var iArea: Boolean = false | 51 | private var iArea: Boolean = false |
52 | private lateinit var invHead: InvHead | 52 | private lateinit var invHead: InvHead |
53 | private lateinit var rcInventarios: RecyclerView | 53 | private lateinit var rcInventarios: RecyclerView |
54 | private lateinit var viewAdapter: RecyclerView.Adapter<*> | 54 | private lateinit var viewAdapter: RecyclerView.Adapter<*> |
55 | private lateinit var viewManager: RecyclerView.LayoutManager | 55 | private lateinit var viewManager: RecyclerView.LayoutManager |
56 | private lateinit var sChangeUpper: String | 56 | private lateinit var sChangeUpper: String |
57 | private var listArticulos = ArrayList<ItemsRecycler>() | 57 | private var listArticulos = ArrayList<ItemsRecycler>() |
58 | private lateinit var navController: NavController | 58 | private lateinit var navController: NavController |
59 | var InventarioNuevo: Int = 0 | 59 | var InventarioNuevo: Int = 0 |
60 | private var iEstado = 0 | 60 | private var iEstado = 0 |
61 | private var iBusquedaPor = 0 | 61 | private var iBusquedaPor = 0 |
62 | private var fCant = 0F | 62 | private var fCant = 0F |
63 | private var bFirst = false | 63 | private var bFirst = false |
64 | private lateinit var deleteIcon: Drawable | 64 | private lateinit var deleteIcon: Drawable |
65 | lateinit var mDialogView: View | 65 | lateinit var mDialogView: View |
66 | 66 | ||
67 | @SuppressLint("MissingPermission") | 67 | @SuppressLint("MissingPermission") |
68 | override fun onCreate(savedInstanceState: Bundle?) { | 68 | override fun onCreate(savedInstanceState: Bundle?) { |
69 | super.onCreate(savedInstanceState) | 69 | super.onCreate(savedInstanceState) |
70 | 70 | ||
71 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 71 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
72 | if (sharedPreferences.contains("Inventario")) if (sharedPreferences.getString("Inventario", "").toString() != "-1") { | 72 | if (sharedPreferences.contains("Inventario")) if (sharedPreferences.getString("Inventario", "").toString() != "-1") { |
73 | InventarioNuevo = sharedPreferences.getString("Inventario", "").toString().toInt() | 73 | InventarioNuevo = sharedPreferences.getString("Inventario", "").toString().toInt() |
74 | val editor = sharedPreferences.edit() | 74 | val editor = sharedPreferences.edit() |
75 | editor?.putString("Inventario", "-1") | 75 | editor?.putString("Inventario", "-1") |
76 | editor?.apply() | 76 | editor?.apply() |
77 | editor.commit() | 77 | editor.commit() |
78 | } | 78 | } |
79 | // val c = Calendar.getInstance() | 79 | // val c = Calendar.getInstance() |
80 | // c[2009, 9, 9, 12, 0] = 0 | 80 | // c[2009, 9, 9, 12, 0] = 0 |
81 | // val am: AlarmManager = requireActivity().getSystemService(Context.ALARM_SERVICE) as AlarmManager | 81 | // val am: AlarmManager = requireActivity().getSystemService(Context.ALARM_SERVICE) as AlarmManager |
82 | // am.setTime(c.timeInMillis) | 82 | // am.setTime(c.timeInMillis) |
83 | } | 83 | } |
84 | // private fun setupTimeZone(timeZoneName: String) { | 84 | // private fun setupTimeZone(timeZoneName: String) { |
85 | // val am = requireContext().getSystemService(Context.ALARM_SERVICE) as AlarmManager | 85 | // val am = requireContext().getSystemService(Context.ALARM_SERVICE) as AlarmManager |
86 | // am.setTimeZone("Europe/Madrid") | 86 | // am.setTimeZone("Europe/Madrid") |
87 | // } | 87 | // } |
88 | 88 | ||
89 | 89 | ||
90 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 90 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
91 | val v = inflater.inflate(R.layout.fragment_inventario, container, false) | 91 | val v = inflater.inflate(R.layout.fragment_inventario, container, false) |
92 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 92 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
93 | val tCodigoBarras = v.findViewById<EditText>(R.id.etCodigoBarras) | 93 | val tCodigoBarras = v.findViewById<EditText>(R.id.etCodigoBarras) |
94 | rcInventarios = v.findViewById(R.id.rcInventarios) | 94 | rcInventarios = v.findViewById(R.id.rcInventarios) |
95 | val tvTitulo = v.findViewById<TextView>(R.id.tvTitulo) | 95 | val tvTitulo = v.findViewById<TextView>(R.id.tvTitulo) |
96 | 96 | ||
97 | if (InventarioNuevo == 0) {// TODO: SI INVETNARIO NUEVO | 97 | if (InventarioNuevo == 0) {// TODO: SI INVETNARIO NUEVO |
98 | GlobalScope.launch(Dispatchers.Main) { | 98 | GlobalScope.launch(Dispatchers.Main) { |
99 | //TODO: BUSCO EL ULTIMO INVENTARIO EN LA BD PARA PODER CREAR EL PROXIMO | 99 | //TODO: BUSCO EL ULTIMO INVENTARIO EN LA BD PARA PODER CREAR EL PROXIMO |
100 | InventarioNuevo = AppDb.getAppDb(requireActivity())?.InvHeadDAO()?.findLastInv()?.plus(1) ?: 1 | 100 | InventarioNuevo = AppDb.getAppDb(requireActivity())?.InvHeadDAO()?.findLastInv()?.plus(1) ?: 1 |
101 | //TODO: CREAMOS EL INVENTARIO EN LA CABECERA DEL INVENTARIO | 101 | //TODO: CREAMOS EL INVENTARIO EN LA CABECERA DEL INVENTARIO |
102 | invHead = InvHead(InventarioNuevo, if (!SerchArea()) "Ventas" else "Deposito", 1, ObtenerFechaActual(), ObtenerFechaActual(), 0L, SerchArea(), AjusteProductos(), ProdNoCont()) | 102 | invHead = InvHead(InventarioNuevo, if (!SerchArea()) "Ventas" else "Deposito", 1, ObtenerFechaActual(), ObtenerFechaActual(), 0L, SerchArea(), AjusteProductos(), ProdNoCont()) |
103 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.insertInvHead(invHead) | 103 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.insertInvHead(invHead) |
104 | tvTitulo.text = "Inventario Dinamico" + " N° $InventarioNuevo" | 104 | tvTitulo.text = "Inventario " + " # $InventarioNuevo" |
105 | } | 105 | } |
106 | } else {// TODO (SI VENGO DE FRAGMENT DESCRIPCION) | 106 | } else {// TODO (SI VENGO DE FRAGMENT DESCRIPCION) |
107 | listArticulos.clear() | 107 | listArticulos.clear() |
108 | CargarDeBdInventario(InventarioNuevo) | 108 | CargarDeBdInventario(InventarioNuevo) |
109 | tvTitulo.text = "Inventario Dinamico" + " N° $InventarioNuevo" | 109 | tvTitulo.text = "Inventario " + " # $InventarioNuevo" |
110 | } | 110 | } |
111 | 111 | ||
112 | tCodigoBarras.setOnKeyListener { _, keyCode, keyEvent -> | 112 | tCodigoBarras.setOnKeyListener { _, keyCode, keyEvent -> |
113 | if (keyCode == KeyEvent.KEYCODE_ENTER && keyEvent.action == KeyEvent.ACTION_UP) { | 113 | if (keyCode == KeyEvent.KEYCODE_ENTER && keyEvent.action == KeyEvent.ACTION_UP) { |
114 | sChangeUpper = tCodigoBarras.text.toString() | 114 | sChangeUpper = tCodigoBarras.text.toString() |
115 | var indiceDelArtEncontrado = 0 | 115 | var indiceDelArtEncontrado = 0 |
116 | 116 | ||
117 | if (tCodigoBarras.text.isNullOrBlank() ) { | 117 | if (tCodigoBarras.text.isNullOrBlank() ) { |
118 | tCodigoBarras.error = "No puede estar vacio" | 118 | tCodigoBarras.error = "No puede estar vacio" |
119 | tCodigoBarras.requestFocus() | 119 | tCodigoBarras.requestFocus() |
120 | tCodigoBarras.hint = "No puede estar vacio" | 120 | tCodigoBarras.hint = "No puede estar vacio" |
121 | }else if (tCodigoBarras.text.toString().length<4 && iEstado==2) { | 121 | }else if (tCodigoBarras.text.toString().length<4 && iEstado==2) { |
122 | tCodigoBarras.error = "Minimo 4 caracteres" | 122 | tCodigoBarras.error = "Minimo 4 caracteres" |
123 | tCodigoBarras.requestFocus() | 123 | tCodigoBarras.requestFocus() |
124 | tCodigoBarras.hint = "4 Minimo" | 124 | tCodigoBarras.hint = "4 Minimo" |
125 | 125 | ||
126 | } else { | 126 | } else { |
127 | 127 | ||
128 | //TODO COMIENZA LA BUSQUEDA POR CODIGO DE BARRAS | 128 | //TODO COMIENZA LA BUSQUEDA POR CODIGO DE BARRAS |
129 | when (iBusquedaPor) { | 129 | when (iBusquedaPor) { |
130 | 0 -> { | 130 | 0 -> { |
131 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 131 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
132 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 132 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
133 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 133 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
134 | 134 | ||
135 | GlobalScope.launch(Dispatchers.Main) { | 135 | GlobalScope.launch(Dispatchers.Main) { |
136 | indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 0)//TODO Si encuentra el articulo en el RV devuelve el indice | 136 | indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 0)//TODO Si encuentra el articulo en el RV devuelve el indice |
137 | //TODO (Si no lo encuentra devuelve -1) | 137 | //TODO (Si no lo encuentra devuelve -1) |
138 | if (indiceDelArtEncontrado != -1) { | 138 | if (indiceDelArtEncontrado != -1) { |
139 | if (swSumaUno!!.isChecked) { | 139 | if (swSumaUno!!.isChecked) { |
140 | // fCant = 0F | 140 | // fCant = 0F |
141 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 141 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
142 | // fCant += 1F | 142 | // fCant += 1F |
143 | //TODO ACTUALIZO LA CANTIDAD EN LA BD | 143 | //TODO ACTUALIZO LA CANTIDAD EN LA BD |
144 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), | 144 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), |
145 | listArticulos[indiceDelArtEncontrado].codigo.toString(), | 145 | listArticulos[indiceDelArtEncontrado].codigo.toString(), |
146 | listArticulos[indiceDelArtEncontrado].cantTomada + 1) | 146 | listArticulos[indiceDelArtEncontrado].cantTomada + 1) |
147 | //TODO ACTUALIZO LA CANTIDAD EN EL RV | 147 | //TODO ACTUALIZO LA CANTIDAD EN EL RV |
148 | listArticulos[indiceDelArtEncontrado].cantTomada = listArticulos[indiceDelArtEncontrado].cantTomada + 1 | 148 | listArticulos[indiceDelArtEncontrado].cantTomada = listArticulos[indiceDelArtEncontrado].cantTomada + 1 |
149 | viewAdapter.notifyDataSetChanged() | 149 | viewAdapter.notifyDataSetChanged() |
150 | } else { | 150 | } else { |
151 | dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) | 151 | dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) |
152 | } | 152 | } |
153 | 153 | ||
154 | } else if (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD | 154 | } else if (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD |
155 | //TODO BUSCO EN BASE DE DATOS | 155 | //TODO BUSCO EN BASE DE DATOS |
156 | val artEncontrado = buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | 156 | val artEncontrado = buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
157 | ContinuarCargaCB(artEncontrado)//TODO SE MANDA CERO POR QUE ES UN ARTICULO ESCANEADO NUEVO PARA QUE SEA COMPATIBLE | 157 | ContinuarCargaCB(artEncontrado)//TODO SE MANDA CERO POR QUE ES UN ARTICULO ESCANEADO NUEVO PARA QUE SEA COMPATIBLE |
158 | } | 158 | } |
159 | tCodigoBarras.focusable = View.FOCUSABLE | 159 | tCodigoBarras.focusable = View.FOCUSABLE |
160 | tCodigoBarras.setText("") | 160 | tCodigoBarras.setText("") |
161 | tCodigoBarras.selectAll() | 161 | tCodigoBarras.selectAll() |
162 | } | 162 | } |
163 | return@setOnKeyListener true | 163 | return@setOnKeyListener true |
164 | 164 | ||
165 | 165 | ||
166 | } | 166 | } |
167 | 1 -> {//TODO: BUSQUEDA POR DESCRIPCION************************************************************************** | 167 | 1 -> {//TODO: BUSQUEDA POR DESCRIPCION************************************************************************** |
168 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 168 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
169 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 169 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
170 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 170 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
171 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 1) //TODO :Si encuentra el articulo en el RV devuelve el indice | 171 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 1) //TODO :Si encuentra el articulo en el RV devuelve el indice |
172 | // //TODO Si no lo encuentra devuelve -1 | 172 | // //TODO Si no lo encuentra devuelve -1 |
173 | // if (indiceDelArtEncontrado != -1) { | 173 | // if (indiceDelArtEncontrado != -1) { |
174 | //// if (swSumaUno!!.isChecked) { | 174 | //// if (swSumaUno!!.isChecked) { |
175 | //// fCant = 0F | 175 | //// fCant = 0F |
176 | //// fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 176 | //// fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
177 | //// fCant += 1F | 177 | //// fCant += 1F |
178 | //// listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 178 | //// listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
179 | //// viewAdapter.notifyDataSetChanged() | 179 | //// viewAdapter.notifyDataSetChanged() |
180 | //// } else { | 180 | //// } else { |
181 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 181 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
182 | // MaterialDialog(requireContext()).show { | 182 | // MaterialDialog(requireContext()).show { |
183 | // title(R.string.sTituloNueva) | 183 | // title(R.string.sTituloNueva) |
184 | // message(R.string.sCantidadNueva) | 184 | // message(R.string.sCantidadNueva) |
185 | // input { materialDialog, charSequence -> | 185 | // input { materialDialog, charSequence -> |
186 | // fCant = 0F | 186 | // fCant = 0F |
187 | // fCant = charSequence.toString().toFloat() | 187 | // fCant = charSequence.toString().toFloat() |
188 | // } | 188 | // } |
189 | // positiveButton(R.string.btnOk) { | 189 | // positiveButton(R.string.btnOk) { |
190 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 190 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
191 | // viewAdapter.notifyDataSetChanged() | 191 | // viewAdapter.notifyDataSetChanged() |
192 | // dismiss() | 192 | // dismiss() |
193 | // } | 193 | // } |
194 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 194 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
195 | //// } | 195 | //// } |
196 | // | 196 | // |
197 | // } else if | 197 | // } else if |
198 | // (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD | 198 | // (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD |
199 | GlobalScope.launch(Dispatchers.Main) { | 199 | GlobalScope.launch(Dispatchers.Main) { |
200 | val artEncontrado = buscarDescEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | 200 | val artEncontrado = buscarDescEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
201 | ContinuarCargaDesc(artEncontrado as ArrayList<Articles>) | 201 | ContinuarCargaDesc(artEncontrado as ArrayList<Articles>) |
202 | } | 202 | } |
203 | 203 | ||
204 | iBusquedaPor = 0 | 204 | iBusquedaPor = 0 |
205 | // } | 205 | // } |
206 | 206 | ||
207 | return@setOnKeyListener true | 207 | return@setOnKeyListener true |
208 | } | 208 | } |
209 | 2 -> {//TODO: BUSQUEDA POR CODIGO DE ORIGEN************************************************************************** | 209 | 2 -> {//TODO: BUSQUEDA POR CODIGO DE ORIGEN************************************************************************** |
210 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 210 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
211 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 211 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
212 | 212 | ||
213 | // GlobalScope.launch(Dispatchers.Main) { | 213 | // GlobalScope.launch(Dispatchers.Main) { |
214 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 2)//TODO Si encuentra el articulo en el RV devuelve el indice | 214 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 2)//TODO Si encuentra el articulo en el RV devuelve el indice |
215 | //// //TODO Si no lo encuentra devuelve -1 | 215 | //// //TODO Si no lo encuentra devuelve -1 |
216 | // if (indiceDelArtEncontrado != -1) { | 216 | // if (indiceDelArtEncontrado != -1) { |
217 | // if (swSumaUno!!.isChecked) { | 217 | // if (swSumaUno!!.isChecked) { |
218 | // fCant = 0F | 218 | // fCant = 0F |
219 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 219 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
220 | // fCant += 1F | 220 | // fCant += 1F |
221 | // //TODO ACTUALIZO LA CANTIDAD EN LA BD | 221 | // //TODO ACTUALIZO LA CANTIDAD EN LA BD |
222 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 222 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
223 | // //TODO ACTUALIZO LA CANTIDAD EN EL RV | 223 | // //TODO ACTUALIZO LA CANTIDAD EN EL RV |
224 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 224 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
225 | // viewAdapter.notifyDataSetChanged() | 225 | // viewAdapter.notifyDataSetChanged() |
226 | // } else { | 226 | // } else { |
227 | // dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) | 227 | // dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) |
228 | // } | 228 | // } |
229 | // } else { | 229 | // } else { |
230 | // val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | 230 | // val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) |
231 | // val mBuilder = | 231 | // val mBuilder = |
232 | // AlertDialog.Builder(context).setView(mDialogView).setTitle("Producto '${listArticulos[indiceDelArtEncontrado].descripcion}', se encuentra cargado.") | 232 | // AlertDialog.Builder(context).setView(mDialogView).setTitle("Producto '${listArticulos[indiceDelArtEncontrado].descripcion}', se encuentra cargado.") |
233 | // .setCancelable(false) | 233 | // .setCancelable(false) |
234 | // mDialogView.tvCantInicial.text = listArticulos[indiceDelArtEncontrado].cantTomada.toString() | 234 | // mDialogView.tvCantInicial.text = listArticulos[indiceDelArtEncontrado].cantTomada.toString() |
235 | // val mAlertDialog = mBuilder.show() | 235 | // val mAlertDialog = mBuilder.show() |
236 | // mDialogView.rbSumar.setOnClickListener { | 236 | // mDialogView.rbSumar.setOnClickListener { |
237 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 237 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
238 | // mDialogView.tvgenerico4.text = (mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() | 238 | // mDialogView.tvgenerico4.text = (mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() |
239 | // } | 239 | // } |
240 | // } | 240 | // } |
241 | // mDialogView.rbRestar.setOnClickListener { | 241 | // mDialogView.rbRestar.setOnClickListener { |
242 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 242 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
243 | // if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | 243 | // if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { |
244 | // mDialogView.tvgenerico4.text = | 244 | // mDialogView.tvgenerico4.text = |
245 | // (mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() | 245 | // (mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() |
246 | // } | 246 | // } |
247 | // } | 247 | // } |
248 | // } | 248 | // } |
249 | // mDialogView.rbMdodificar.setOnClickListener { | 249 | // mDialogView.rbMdodificar.setOnClickListener { |
250 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 250 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
251 | // mDialogView.tvgenerico4.text = (mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() | 251 | // mDialogView.tvgenerico4.text = (mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() |
252 | // } | 252 | // } |
253 | // } | 253 | // } |
254 | // mDialogView.btnAceptar.setOnClickListener { | 254 | // mDialogView.btnAceptar.setOnClickListener { |
255 | // mAlertDialog.dismiss() | 255 | // mAlertDialog.dismiss() |
256 | // val name = mDialogView.tvgenerico4.text.toString().toFloat() | 256 | // val name = mDialogView.tvgenerico4.text.toString().toFloat() |
257 | // fCant = 0F | 257 | // fCant = 0F |
258 | // fCant = name | 258 | // fCant = name |
259 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 259 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
260 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 260 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
261 | // viewAdapter.notifyDataSetChanged() | 261 | // viewAdapter.notifyDataSetChanged() |
262 | // } | 262 | // } |
263 | // mDialogView.dialogCancelBtn.setOnClickListener { | 263 | // mDialogView.dialogCancelBtn.setOnClickListener { |
264 | // mAlertDialog.dismiss() | 264 | // mAlertDialog.dismiss() |
265 | // } | 265 | // } |
266 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 266 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
267 | // val type = InputType.TYPE_CLASS_NUMBER | 267 | // val type = InputType.TYPE_CLASS_NUMBER |
268 | // MaterialDialog(requireContext()).show { | 268 | // MaterialDialog(requireContext()).show { |
269 | // | 269 | // |
270 | // title(text = "Producto '$sChangeUpper', se encuentra cargado.") | 270 | // title(text = "Producto '$sChangeUpper', se encuentra cargado.") |
271 | // message(R.string.sCantidadNueva) | 271 | // message(R.string.sCantidadNueva) |
272 | // input(waitForPositiveButton = false, hint = "99.99", inputType = type) { materialDialog, charSequence -> | 272 | // input(waitForPositiveButton = false, hint = "99.99", inputType = type) { materialDialog, charSequence -> |
273 | // fCant = 0F | 273 | // fCant = 0F |
274 | // fCant = charSequence.toString().toFloat() | 274 | // fCant = charSequence.toString().toFloat() |
275 | // } | 275 | // } |
276 | // positiveButton(R.string.btnOk) { | 276 | // positiveButton(R.string.btnOk) { |
277 | // //TODO ACTUALIZO CANTIADAD EN BD | 277 | // //TODO ACTUALIZO CANTIADAD EN BD |
278 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 278 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
279 | // //TODO ACTUALIZO CANTIDAD EN RV | 279 | // //TODO ACTUALIZO CANTIDAD EN RV |
280 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 280 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
281 | // viewAdapter.notifyDataSetChanged() | 281 | // viewAdapter.notifyDataSetChanged() |
282 | // dismiss() | 282 | // dismiss() |
283 | // } | 283 | // } |
284 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 284 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
285 | // } | 285 | // } |
286 | // } else if (indiceDelArtEncontrado == -1) { | 286 | // } else if (indiceDelArtEncontrado == -1) { |
287 | // no lo encontro en el RV, lo va a buscar en al BD | 287 | // no lo encontro en el RV, lo va a buscar en al BD |
288 | 288 | ||
289 | GlobalScope.launch(Dispatchers.Main) { | 289 | GlobalScope.launch(Dispatchers.Main) { |
290 | //TODO BUSCO EN BASE DE DATOS | 290 | //TODO BUSCO EN BASE DE DATOS |
291 | val artEncontrado = buscarCodiogoOriEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | 291 | val artEncontrado = buscarCodiogoOriEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
292 | ContinuarCargaCodigoOri(artEncontrado ) | 292 | ContinuarCargaCodigoOri(artEncontrado ) |
293 | } | 293 | } |
294 | iBusquedaPor = 0 | 294 | iBusquedaPor = 0 |
295 | // } | 295 | // } |
296 | // } | 296 | // } |
297 | return@setOnKeyListener true | 297 | return@setOnKeyListener true |
298 | } | 298 | } |
299 | } | 299 | } |
300 | } | 300 | } |
301 | } | 301 | } |
302 | return@setOnKeyListener false | 302 | return@setOnKeyListener false |
303 | } | 303 | } |
304 | return v | 304 | return v |
305 | } | 305 | } |
306 | 306 | ||
307 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 307 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
308 | super.onViewCreated(view, savedInstanceState) | 308 | super.onViewCreated(view, savedInstanceState) |
309 | navController = Navigation.findNavController(view) | 309 | navController = Navigation.findNavController(view) |
310 | etCodigoBarras.requestFocus() | 310 | etCodigoBarras.requestFocus() |
311 | // val modalDialog = NoEncontradoSimple() | 311 | // val modalDialog = NoEncontradoSimple() |
312 | // modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 312 | // modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") |
313 | 313 | ||
314 | btnBorrarInv.setOnClickListener { | 314 | btnBorrarInv.setOnClickListener { |
315 | AlertDialog.Builder(requireContext()).setTitle("Eliminación de Inventarios").setMessage("¿Confirma que desea eliminar el inventario?") | 315 | AlertDialog.Builder(requireContext()).setTitle("Eliminación de Inventarios").setMessage("¿Confirma que desea eliminar el inventario?") |
316 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> | 316 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> |
317 | BorrarInvActual() | 317 | BorrarInvActual() |
318 | Toast.makeText(requireContext(), "El inventario $InventarioNuevo fue Borrado", Toast.LENGTH_LONG).show() | 318 | Toast.makeText(requireContext(), "El inventario $InventarioNuevo fue Borrado", Toast.LENGTH_LONG).show() |
319 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) | 319 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) |
320 | InventarioNuevo = 0 | 320 | InventarioNuevo = 0 |
321 | 321 | ||
322 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> | 322 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> |
323 | //botón cancel pulsado | 323 | //botón cancel pulsado |
324 | }).show() | 324 | }).show() |
325 | } | 325 | } |
326 | 326 | ||
327 | btnExportarInv.setOnClickListener { | 327 | btnExportarInv.setOnClickListener { |
328 | AlertDialog.Builder(requireContext()).setTitle(R.string.sTituloExportar).setMessage(R.string.sMensajeExportar) | 328 | AlertDialog.Builder(requireContext()).setTitle(R.string.sTituloExportar).setMessage(R.string.sMensajeExportar) |
329 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> | 329 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> |
330 | BorrarInvActual() | 330 | BorrarInvActual() |
331 | Toast.makeText(requireContext(), "El inventario $InventarioNuevo fue Exportado al Servidor", Toast.LENGTH_LONG).show() | 331 | Toast.makeText(requireContext(), "El inventario $InventarioNuevo fue Exportado al Servidor", Toast.LENGTH_LONG).show() |
332 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) | 332 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) |
333 | InventarioNuevo = 0 | 333 | InventarioNuevo = 0 |
334 | 334 | ||
335 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> }).show() | 335 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> }).show() |
336 | } | 336 | } |
337 | ivCamara.setOnClickListener { | 337 | ivCamara.setOnClickListener { |
338 | if (!bFirst) { | 338 | if (!bFirst) { |
339 | iEstado = 1 | 339 | iEstado = 1 |
340 | bFirst = true | 340 | bFirst = true |
341 | } | 341 | } |
342 | 342 | ||
343 | when (iEstado) { | 343 | when (iEstado) { |
344 | 0 -> { | 344 | 0 -> { |
345 | ivCamara.setImageResource(R.drawable.codbar) | 345 | ivCamara.setImageResource(R.drawable.codbar) |
346 | etCodigoBarras.hint = "Busqueda por C. Barras" | 346 | etCodigoBarras.hint = "Busqueda por C. Barras" |
347 | swSumaUno.visibility = View.VISIBLE | 347 | swSumaUno.visibility = View.VISIBLE |
348 | iBusquedaPor = 0 | 348 | iBusquedaPor = 0 |
349 | iEstado = 1 | 349 | iEstado = 1 |
350 | } | 350 | } |
351 | 1 -> { | 351 | 1 -> { |
352 | ivCamara.setImageResource(R.drawable.desc) | 352 | ivCamara.setImageResource(R.drawable.desc) |
353 | etCodigoBarras.hint = "Busqueda por Descripción" | 353 | etCodigoBarras.hint = "Busqueda por Descripción" |
354 | swSumaUno.visibility = View.GONE | 354 | swSumaUno.visibility = View.GONE |
355 | iBusquedaPor = 1 | 355 | iBusquedaPor = 1 |
356 | iEstado = 2 | 356 | iEstado = 2 |
357 | } | 357 | } |
358 | 2 -> { | 358 | 2 -> { |
359 | ivCamara.setImageResource(R.drawable.cod_origen) | 359 | ivCamara.setImageResource(R.drawable.cod_origen) |
360 | etCodigoBarras.hint = "Busqueda por C. Origen" | 360 | etCodigoBarras.hint = "Busqueda por C. Origen" |
361 | swSumaUno.visibility = View.GONE | 361 | swSumaUno.visibility = View.GONE |
362 | iBusquedaPor = 2 | 362 | iBusquedaPor = 2 |
363 | iEstado = 0 | 363 | iEstado = 0 |
364 | } | 364 | } |
365 | } | 365 | } |
366 | } | 366 | } |
367 | } | 367 | } |
368 | 368 | ||
369 | private fun BorrarInvActual() { | 369 | private fun BorrarInvActual() { |
370 | lifecycleScope.launch { | 370 | lifecycleScope.launch { |
371 | withContext(Dispatchers.IO) { | 371 | withContext(Dispatchers.IO) { |
372 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.deleteinvHead(InventarioNuevo.toLong()) | 372 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.deleteinvHead(InventarioNuevo.toLong()) |
373 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.deleteInvBody(InventarioNuevo.toLong()) | 373 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.deleteInvBody(InventarioNuevo.toLong()) |
374 | } | 374 | } |
375 | } | 375 | } |
376 | } | 376 | } |
377 | 377 | ||
378 | private fun CargarDeBdInventario(ultimoInv: Int) { | 378 | private fun CargarDeBdInventario(ultimoInv: Int) { |
379 | GlobalScope.launch(Dispatchers.Main) { | 379 | GlobalScope.launch(Dispatchers.Main) { |
380 | val invbody = cargarInventario(ultimoInv) | 380 | val invbody = cargarInventario(ultimoInv) |
381 | for ((i, _) in invbody!!.withIndex()) { | 381 | for ((i, _) in invbody!!.withIndex()) { |
382 | val art = Articles(invbody[i].sector, | 382 | val art = Articles(invbody[i].sector, |
383 | invbody[i].codigo, | 383 | invbody[i].codigo, |
384 | invbody[i].descripcion, | 384 | invbody[i].descripcion, |
385 | invbody[i].codBar, | 385 | invbody[i].codBar, |
386 | invbody[i].codOrigen, | 386 | invbody[i].codOrigen, |
387 | invbody[i].precio, | 387 | invbody[i].precio, |
388 | invbody[i].costo, | 388 | invbody[i].costo, |
389 | "", | 389 | "", |
390 | "", | 390 | "", |
391 | "", | 391 | "", |
392 | invbody[i].balanza, | 392 | invbody[i].balanza, |
393 | invbody[i].depSn, | 393 | invbody[i].depSn, |
394 | invbody[i].costo) | 394 | invbody[i].costo) |
395 | cargarRecicler(art, invbody[i].cantTomada!!.toFloat()) | 395 | cargarRecicler(art, invbody[i].cantTomada!!.toFloat()) |
396 | } | 396 | } |
397 | } | 397 | } |
398 | } | 398 | } |
399 | 399 | ||
400 | private fun ContinuarCargaCodigoOri(artAcargar:List<Articles>) { | 400 | private fun ContinuarCargaCodigoOri(artAcargar:List<Articles>) { |
401 | 401 | ||
402 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD | 402 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD |
403 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 403 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
404 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 404 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
405 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 405 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
406 | 406 | ||
407 | var bundle = Bundle() | 407 | var bundle = Bundle() |
408 | bundle = bundleOf("ArrayDesc" to artAcargar) | 408 | bundle = bundleOf("ArrayDesc" to artAcargar) |
409 | bundle.putInt("numeroInv", InventarioNuevo) | 409 | bundle.putInt("numeroInv", InventarioNuevo) |
410 | navController.navigate(R.id.action_inventarioFragment_to_codigoOriFragment, bundle) | 410 | navController.navigate(R.id.action_inventarioFragment_to_codigoOriFragment, bundle) |
411 | 411 | ||
412 | } else {//TODO si no lo encuentra en la BD | 412 | } else {//TODO si no lo encuentra en la BD |
413 | val modalDialog = NoEncontradoSimple() | 413 | val modalDialog = NoEncontradoSimple() |
414 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 414 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") |
415 | } | 415 | } |
416 | etCodigoBarras.focusable = View.FOCUSABLE | 416 | etCodigoBarras.focusable = View.FOCUSABLE |
417 | etCodigoBarras.setText("") | 417 | etCodigoBarras.setText("") |
418 | etCodigoBarras.selectAll() | 418 | etCodigoBarras.selectAll() |
419 | } | 419 | } |
420 | 420 | ||
421 | private fun ContinuarCargaDesc(artAcargar: ArrayList<Articles>) { | 421 | private fun ContinuarCargaDesc(artAcargar: ArrayList<Articles>) { |
422 | //TODO DESPUES DE INGRESAR LA DESCRIPCION Y DE BUSCAR LOS CAINCIDENCIAS EN LA BASE SE VA A MOSTRAR LAS MISMAS | 422 | //TODO DESPUES DE INGRESAR LA DESCRIPCION Y DE BUSCAR LOS CAINCIDENCIAS EN LA BASE SE VA A MOSTRAR LAS MISMAS |
423 | //TODO SI LA CANTIDAD ENCONTRADA ES UNO, LO CARGO DIRECTAMENTE EN EL RV | 423 | //TODO SI LA CANTIDAD ENCONTRADA ES UNO, LO CARGO DIRECTAMENTE EN EL RV |
424 | 424 | ||
425 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD | 425 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD |
426 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV | 426 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV |
427 | // fCant = 0F | 427 | // fCant = 0F |
428 | // fCant += 1F | 428 | // fCant += 1F |
429 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV | 429 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV |
430 | // val acargarPorDesc = Articles(artAcargar[0].sector, | 430 | // val acargarPorDesc = Articles(artAcargar[0].sector, |
431 | // artAcargar[0].codigo, | 431 | // artAcargar[0].codigo, |
432 | // artAcargar[0].descripcion, | 432 | // artAcargar[0].descripcion, |
433 | // artAcargar[0].codBar, | 433 | // artAcargar[0].codBar, |
434 | // artAcargar[0].codOrigen, | 434 | // artAcargar[0].codOrigen, |
435 | // artAcargar[0].precio, | 435 | // artAcargar[0].precio, |
436 | // artAcargar[0].costo, | 436 | // artAcargar[0].costo, |
437 | // "", | 437 | // "", |
438 | // "", | 438 | // "", |
439 | // "", | 439 | // "", |
440 | // artAcargar[0].balanza, | 440 | // artAcargar[0].balanza, |
441 | // artAcargar[0].depSn, | 441 | // artAcargar[0].depSn, |
442 | // "") | 442 | // "") |
443 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD | 443 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD |
444 | // cargarArtEnBd(acargarPorDesc, fCant) | 444 | // cargarArtEnBd(acargarPorDesc, fCant) |
445 | // cargarRecicler(acargarPorDesc, fCant) | 445 | // cargarRecicler(acargarPorDesc, fCant) |
446 | // } else { | 446 | // } else { |
447 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 447 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
448 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 448 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
449 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 449 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
450 | var bundle = Bundle() | 450 | var bundle = Bundle() |
451 | bundle = bundleOf("ArrayDesc" to artAcargar) | 451 | bundle = bundleOf("ArrayDesc" to artAcargar) |
452 | bundle.putInt("numeroInv", InventarioNuevo) | 452 | bundle.putInt("numeroInv", InventarioNuevo) |
453 | navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) | 453 | navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) |
454 | //navController.backStack.removeLast() | 454 | //navController.backStack.removeLast() |
455 | // } | 455 | // } |
456 | // } else {//SI NO ESTA +1 | 456 | // } else {//SI NO ESTA +1 |
457 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV | 457 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV |
458 | // fCant = listArticulos[0].cantTomada | 458 | // fCant = listArticulos[0].cantTomada |
459 | // MaterialDialog(requireContext()).show { | 459 | // MaterialDialog(requireContext()).show { |
460 | // title(R.string.sTituloNueva) | 460 | // title(R.string.sTituloNueva) |
461 | // message(R.string.sCantidadNueva) | 461 | // message(R.string.sCantidadNueva) |
462 | // input { materialDialog, charSequence -> | 462 | // input { materialDialog, charSequence -> |
463 | // fCant = 0F | 463 | // fCant = 0F |
464 | // fCant = charSequence.toString().toFloat() | 464 | // fCant = charSequence.toString().toFloat() |
465 | // } | 465 | // } |
466 | // positiveButton(R.string.btnOk) { | 466 | // positiveButton(R.string.btnOk) { |
467 | // listArticulos[0].cantTomada = fCant | 467 | // listArticulos[0].cantTomada = fCant |
468 | // viewAdapter.notifyDataSetChanged() | 468 | // viewAdapter.notifyDataSetChanged() |
469 | // dismiss() | 469 | // dismiss() |
470 | // } | 470 | // } |
471 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 471 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
472 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV | 472 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV |
473 | // val acargarPorDesc = Articles(artAcargar[0].sector, | 473 | // val acargarPorDesc = Articles(artAcargar[0].sector, |
474 | // artAcargar[0].codigo, | 474 | // artAcargar[0].codigo, |
475 | // artAcargar[0].descripcion, | 475 | // artAcargar[0].descripcion, |
476 | // artAcargar[0].codBar, | 476 | // artAcargar[0].codBar, |
477 | // artAcargar[0].cod_origen, | 477 | // artAcargar[0].cod_origen, |
478 | // artAcargar[0].precio, | 478 | // artAcargar[0].precio, |
479 | // artAcargar[0].costo, | 479 | // artAcargar[0].costo, |
480 | // artAcargar[0].balanza, | 480 | // artAcargar[0].balanza, |
481 | // artAcargar[0].depSn, | 481 | // artAcargar[0].depSn, |
482 | // "") | 482 | // "") |
483 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD | 483 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD |
484 | // cargarArtEnBd(acargarPorDesc, fCant) | 484 | // cargarArtEnBd(acargarPorDesc, fCant) |
485 | // cargarRecicler(acargarPorDesc, fCant) | 485 | // cargarRecicler(acargarPorDesc, fCant) |
486 | // } else { | 486 | // } else { |
487 | // var bundle = Bundle() | 487 | // var bundle = Bundle() |
488 | // bundle = bundleOf("ArrayDesc" to artAcargar) | 488 | // bundle = bundleOf("ArrayDesc" to artAcargar) |
489 | // bundle.putInt("numeroInv", InventarioNuevo) | 489 | // bundle.putInt("numeroInv", InventarioNuevo) |
490 | // navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) | 490 | // navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) |
491 | // } | 491 | // } |
492 | // } | 492 | // } |
493 | } else {//TODO si no lo encuentra en la BD | 493 | } else {//TODO si no lo encuentra en la BD |
494 | val modalDialog = NoEncontradoSimple() | 494 | val modalDialog = NoEncontradoSimple() |
495 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 495 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") |
496 | } | 496 | } |
497 | etCodigoBarras.focusable = View.FOCUSABLE | 497 | etCodigoBarras.focusable = View.FOCUSABLE |
498 | etCodigoBarras.setText("") | 498 | etCodigoBarras.setText("") |
499 | etCodigoBarras.selectAll() | 499 | etCodigoBarras.selectAll() |
500 | } | 500 | } |
501 | 501 | ||
502 | private fun ContinuarCargaCB(artAcargar: Articles?) { | 502 | private fun ContinuarCargaCB(artAcargar: Articles?) { |
503 | 503 | ||
504 | if (artAcargar != null) {// TODO: Si lo encuentra en la BD | 504 | if (artAcargar != null) {// TODO: Si lo encuentra en la BD |
505 | if (swSumaUno!!.isChecked) {//TODO: SI ESTA +1, PONE CANTIDAD 1 | 505 | if (swSumaUno!!.isChecked) {//TODO: SI ESTA +1, PONE CANTIDAD 1 |
506 | fCant = 0F | 506 | fCant = 0F |
507 | fCant += 1F | 507 | fCant += 1F |
508 | cargarArtEnBd(artAcargar, String.format("%.3f", fCant)) | 508 | cargarArtEnBd(artAcargar, String.format("%.3f", fCant)) |
509 | cargarRecicler(artAcargar, fCant) | 509 | cargarRecicler(artAcargar, fCant) |
510 | } else {//TODO: SI NO ESTA +1 PREGUNTA CANTIDAD | 510 | } else {//TODO: SI NO ESTA +1 PREGUNTA CANTIDAD |
511 | 511 | ||
512 | DialogingresarCantidad(requireContext(), artAcargar) | 512 | DialogingresarCantidad(requireContext(), artAcargar) |
513 | 513 | ||
514 | } | 514 | } |
515 | } else {// TODO si no lo encuentra en la BD | 515 | } else {// TODO si no lo encuentra en la BD |
516 | val modalDialog = NoEncontradoSimple() | 516 | val modalDialog = NoEncontradoSimple() |
517 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 517 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") |
518 | } | 518 | } |
519 | etCodigoBarras.focusable = View.FOCUSABLE | 519 | etCodigoBarras.focusable = View.FOCUSABLE |
520 | etCodigoBarras.setText("") | 520 | etCodigoBarras.setText("") |
521 | etCodigoBarras.selectAll() | 521 | etCodigoBarras.selectAll() |
522 | } | 522 | } |
523 | 523 | ||
524 | fun DialogingresarCantidad(cnxt: Context, artAcargar: Articles?): Float { | 524 | fun DialogingresarCantidad(cnxt: Context, artAcargar: Articles?): Float { |
525 | var cantidad = 0F | 525 | var cantidad = 0F |
526 | val mDialogView = LayoutInflater.from(cnxt).inflate(R.layout.ingresar_cantidad, null) | 526 | val mDialogView = LayoutInflater.from(cnxt).inflate(R.layout.ingresar_cantidad, null) |
527 | val mBuilder = AlertDialog.Builder(cnxt).setView(mDialogView).setCancelable(false) | 527 | val mBuilder = AlertDialog.Builder(cnxt).setView(mDialogView).setCancelable(false) |
528 | if (artAcargar!!.balanza!!.toInt() == 1 || artAcargar.balanza!!.toInt() == 3 || artAcargar.balanza!!.toInt() == 7) mDialogView.etCantidad.inputType = TYPE_CLASS_NUMBER | 528 | if (artAcargar!!.balanza!!.toInt() == 1 || artAcargar.balanza!!.toInt() == 3 || artAcargar.balanza!!.toInt() == 7) mDialogView.etCantidad.inputType = TYPE_CLASS_NUMBER |
529 | mDialogView.tvTitulo.text = artAcargar.descripcion.toString() | 529 | mDialogView.tvTitulo.text = artAcargar.descripcion.toString() |
530 | val mAlertDialog = mBuilder.show() | 530 | val mAlertDialog = mBuilder.show() |
531 | 531 | ||
532 | mDialogView.etCantidad.requestFocus() | 532 | mDialogView.etCantidad.requestFocus() |
533 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 533 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
534 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 534 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
535 | 535 | ||
536 | mDialogView.btnAceptar.setOnClickListener { | 536 | mDialogView.btnAceptar.setOnClickListener { |
537 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { | 537 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { |
538 | mDialogView.etCantidad.error = "No vacio" | 538 | mDialogView.etCantidad.error = "No vacio" |
539 | mDialogView.etCantidad.requestFocus() | 539 | mDialogView.etCantidad.requestFocus() |
540 | mDialogView.etCantidad.hint = "Ingrese un valor" | 540 | mDialogView.etCantidad.hint = "Ingrese un valor" |
541 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { | 541 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { |
542 | mAlertDialog.dismiss() | 542 | mAlertDialog.dismiss() |
543 | cantidad = mDialogView.etCantidad.text.toString().toFloat() | 543 | cantidad = mDialogView.etCantidad.text.toString().toFloat() |
544 | cargarArtEnBd(artAcargar, String.format("%.2f", cantidad)) | 544 | cargarArtEnBd(artAcargar, String.format("%.2f", cantidad)) |
545 | cargarRecicler(artAcargar, cantidad) | 545 | cargarRecicler(artAcargar, cantidad) |
546 | modificarCantidadEnCabecera(InventarioNuevo, true, requireContext()) | 546 | modificarCantidadEnCabecera(InventarioNuevo, true, requireContext()) |
547 | } | 547 | } |
548 | } | 548 | } |
549 | return cantidad | 549 | return cantidad |
550 | } | 550 | } |
551 | 551 | ||
552 | fun dialogoSumaResta(context: Context, indiceDelArtEncontrado: Int, univta: String, cancelable: Boolean) { | 552 | fun dialogoSumaResta(context: Context, indiceDelArtEncontrado: Int, univta: String, cancelable: Boolean) { |
553 | 553 | ||
554 | mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | 554 | mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) |
555 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(cancelable) | 555 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(cancelable) |
556 | // TODO: SI PERMITE QUE INGRESE DECIMALES | 556 | // TODO: SI PERMITE QUE INGRESE DECIMALES |
557 | if (univta.contains("1") || univta.contains("3") || univta.contains("7")) mDialogView.tvNuevaCantidad.inputType = TYPE_CLASS_NUMBER | 557 | if (univta.contains("1") || univta.contains("3") || univta.contains("7")) mDialogView.tvNuevaCantidad.inputType = TYPE_CLASS_NUMBER |
558 | mDialogView.tvTitulo2.text="${listArticulos[indiceDelArtEncontrado].descripcion}" | 558 | mDialogView.tvTitulo2.text="${listArticulos[indiceDelArtEncontrado].descripcion}" |
559 | mDialogView.tvCantInicial.text = String.format("%.2f", listArticulos[indiceDelArtEncontrado].cantTomada) | 559 | mDialogView.tvCantInicial.text = String.format("%.2f", listArticulos[indiceDelArtEncontrado].cantTomada) |
560 | val mAlertDialog = mBuilder.show() | 560 | val mAlertDialog = mBuilder.show() |
561 | mDialogView.tvNuevaCantidad.requestFocus() | 561 | mDialogView.tvNuevaCantidad.requestFocus() |
562 | 562 | ||
563 | 563 | ||
564 | 564 | ||
565 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 565 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
566 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 566 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
567 | 567 | ||
568 | mDialogView.tvNuevaCantidad.addTextChangedListener(textWatcher) | 568 | mDialogView.tvNuevaCantidad.addTextChangedListener(textWatcher) |
569 | 569 | ||
570 | mDialogView.rbSumar.setOnClickListener { | 570 | mDialogView.rbSumar.setOnClickListener { |
571 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 571 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
572 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()) | 572 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()) |
573 | // mDialogView.tvNuevaCantidad.isEnabled = false | 573 | // mDialogView.tvNuevaCantidad.isEnabled = false |
574 | } | 574 | } |
575 | } | 575 | } |
576 | mDialogView.rbRestar.setOnClickListener { | 576 | mDialogView.rbRestar.setOnClickListener { |
577 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 577 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
578 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | 578 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { |
579 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()) | 579 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()) |
580 | // mDialogView.tvNuevaCantidad.isEnabled = false | 580 | // mDialogView.tvNuevaCantidad.isEnabled = false |
581 | } else { | 581 | } else { |
582 | mDialogView.tvResultado.text = "" | 582 | mDialogView.tvResultado.text = "" |
583 | mDialogView.tvResultado.error = "Operación No Valida" | 583 | mDialogView.tvResultado.error = "Operación No Valida" |
584 | mDialogView.tvResultado.requestFocus() | 584 | mDialogView.tvResultado.requestFocus() |
585 | mDialogView.tvResultado.hint = "Error" | 585 | mDialogView.tvResultado.hint = "Error" |
586 | } | 586 | } |
587 | } | 587 | } |
588 | } | 588 | } |
589 | mDialogView.rbMdodificar.setOnClickListener { | 589 | mDialogView.rbMdodificar.setOnClickListener { |
590 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 590 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
591 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat()) | 591 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat()) |
592 | // mDialogView.tvNuevaCantidad.isEnabled = false | 592 | // mDialogView.tvNuevaCantidad.isEnabled = false |
593 | } | 593 | } |
594 | } | 594 | } |
595 | mDialogView.btnAceptar.setOnClickListener { | 595 | mDialogView.btnAceptar.setOnClickListener { |
596 | if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || !mDialogView.tvNuevaCantidad.text.isBlank()) { | 596 | if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || !mDialogView.tvNuevaCantidad.text.isBlank()) { |
597 | if (mDialogView.tvResultado.text.isNotEmpty() || !mDialogView.tvResultado.text.isBlank()) { | 597 | if (mDialogView.tvResultado.text.isNotEmpty() || !mDialogView.tvResultado.text.isBlank()) { |
598 | mAlertDialog.dismiss() | 598 | mAlertDialog.dismiss() |
599 | listArticulos[indiceDelArtEncontrado].cantTomada = String.format("%.2f", mDialogView.tvResultado.text.toString().toFloat()).toFloat() | 599 | listArticulos[indiceDelArtEncontrado].cantTomada = String.format("%.2f", mDialogView.tvResultado.text.toString().toFloat()).toFloat() |
600 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), | 600 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), |
601 | listArticulos[indiceDelArtEncontrado].codigo.toString(), | 601 | listArticulos[indiceDelArtEncontrado].codigo.toString(), |
602 | String.format("%.2f", mDialogView.tvResultado.text.toString().toFloat()).toFloat()) | 602 | String.format("%.2f", mDialogView.tvResultado.text.toString().toFloat()).toFloat()) |
603 | 603 | ||
604 | viewAdapter.notifyDataSetChanged() | 604 | viewAdapter.notifyDataSetChanged() |
605 | } else if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { | 605 | } else if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { |
606 | mDialogView.tvResultado.error = "Operación Requerida" | 606 | mDialogView.tvResultado.error = "Operación Requerida" |
607 | mDialogView.tvResultado.requestFocus() | 607 | mDialogView.tvResultado.requestFocus() |
608 | mDialogView.tvResultado.hint = "Seleccione Operación" | 608 | mDialogView.tvResultado.hint = "Seleccione Operación" |
609 | } | 609 | } |
610 | } else if (mDialogView.tvNuevaCantidad.text.isEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { | 610 | } else if (mDialogView.tvNuevaCantidad.text.isEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { |
611 | mDialogView.tvNuevaCantidad.error = "Completar" | 611 | mDialogView.tvNuevaCantidad.error = "Completar" |
612 | mDialogView.tvNuevaCantidad.requestFocus() | 612 | mDialogView.tvNuevaCantidad.requestFocus() |
613 | mDialogView.tvNuevaCantidad.hint = "Ingrese un valor" | 613 | mDialogView.tvNuevaCantidad.hint = "Ingrese un valor" |
614 | } | 614 | } |
615 | } | 615 | } |
616 | mDialogView.dialogCancelBtn.setOnClickListener { | 616 | mDialogView.dialogCancelBtn.setOnClickListener { |
617 | mAlertDialog.dismiss() | 617 | mAlertDialog.dismiss() |
618 | } | 618 | } |
619 | } | 619 | } |
620 | 620 | ||
621 | suspend fun buscarCodiogoOriEnBD(CodOri: String): List<Articles> { | 621 | suspend fun buscarCodiogoOriEnBD(CodOri: String): List<Articles> { |
622 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 622 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
623 | var busqueda: List<Articles> | 623 | var busqueda: List<Articles> |
624 | return GlobalScope.async(Dispatchers.IO) { | 624 | return GlobalScope.async(Dispatchers.IO) { |
625 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodOri(CodOri, SerchAreaInventario()) | 625 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodOri(CodOri, SerchAreaInventario()) |
626 | return@async busqueda | 626 | return@async busqueda |
627 | }.await() | 627 | }.await() |
628 | } | 628 | } |
629 | 629 | ||
630 | suspend fun buscarCBEnBD(CodigoBarras: String): Articles? { | 630 | suspend fun buscarCBEnBD(CodigoBarras: String): Articles? { |
631 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 631 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
632 | var busqueda: Articles? = null | 632 | var busqueda: Articles? = null |
633 | return GlobalScope.async(IO) { | 633 | return GlobalScope.async(IO) { |
634 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, SerchAreaInventario()) | 634 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, SerchAreaInventario()) |
635 | return@async busqueda | 635 | return@async busqueda |
636 | }.await() | 636 | }.await() |
637 | } | 637 | } |
638 | 638 | ||
639 | suspend fun buscarDescEnBD(descripcion: String): List<Articles>? { | 639 | suspend fun buscarDescEnBD(descripcion: String): List<Articles>? { |
640 | //TODO BUSQUEDA POR DESCRIPCION | 640 | //TODO BUSQUEDA POR DESCRIPCION |
641 | var busqueda: List<Articles>? = null | 641 | var busqueda: List<Articles>? = null |
642 | return GlobalScope.async(Dispatchers.IO) { | 642 | return GlobalScope.async(Dispatchers.IO) { |
643 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, SerchAreaInventario()) | 643 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, SerchAreaInventario()) |
644 | return@async busqueda | 644 | return@async busqueda |
645 | }.await() | 645 | }.await() |
646 | } | 646 | } |
647 | 647 | ||
648 | suspend fun borrarArticulo(sector: String, codigo: String, inventario: String): Int? { | 648 | suspend fun borrarArticulo(sector: String, codigo: String, inventario: String): Int? { |
649 | //TODO BUSQUEDA POR DESCRIPCION | 649 | //TODO BUSQUEDA POR DESCRIPCION |
650 | var result: Int | 650 | var result: Int |
651 | return GlobalScope.async(IO) { | 651 | return GlobalScope.async(IO) { |
652 | result = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.deleteItemFromInvBody(sector.toLong(), codigo.toLong(), inventario.toLong()) | 652 | result = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.deleteItemFromInvBody(sector.toLong(), codigo.toLong(), inventario.toLong()) |
653 | return@async result | 653 | return@async result |
654 | }.await() | 654 | }.await() |
655 | } | 655 | } |
656 | 656 | ||
657 | private suspend fun buscoArtEnRv(codigoBarras: String, sTipoBusqueda: Int): Int { | 657 | private suspend fun buscoArtEnRv(codigoBarras: String, sTipoBusqueda: Int): Int { |
658 | return GlobalScope.async(IO) { | 658 | return GlobalScope.async(IO) { |
659 | var indice = 0 | 659 | var indice = 0 |
660 | var bEncontrado = false | 660 | var bEncontrado = false |
661 | if (sTipoBusqueda == 0) {//TODO BUSQUEDA POR CODIGO DE BARRAS | 661 | if (sTipoBusqueda == 0) {//TODO BUSQUEDA POR CODIGO DE BARRAS |
662 | // TODO CAMBIO DE CB A CODIGO DEBO | 662 | // TODO CAMBIO DE CB A CODIGO DEBO |
663 | val any = cambioCBporCodigoDebo(codigoBarras) | 663 | val any = cambioCBporCodigoDebo(codigoBarras) |
664 | if (any != null) { | 664 | if (any != null) { |
665 | for (item in listArticulos) { | 665 | for (item in listArticulos) { |
666 | if (item.sector!!.toInt() == any.sector!!.toInt() && item.codigo!!.toInt() == any.codigo!!.toInt()) { | 666 | if (item.sector!!.toInt() == any.sector!!.toInt() && item.codigo!!.toInt() == any.codigo!!.toInt()) { |
667 | bEncontrado = true | 667 | bEncontrado = true |
668 | break | 668 | break |
669 | } | 669 | } |
670 | indice += 1 | 670 | indice += 1 |
671 | } | 671 | } |
672 | } | 672 | } |
673 | 673 | ||
674 | } else if (sTipoBusqueda == 1) {//TODO BUSQUEDA POR DESCRIPCION | 674 | } else if (sTipoBusqueda == 1) {//TODO BUSQUEDA POR DESCRIPCION |
675 | for (item in listArticulos) { | 675 | for (item in listArticulos) { |
676 | if (item.descripcion!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { | 676 | if (item.descripcion!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { |
677 | bEncontrado = true | 677 | bEncontrado = true |
678 | break | 678 | break |
679 | } | 679 | } |
680 | indice += 1 | 680 | indice += 1 |
681 | } | 681 | } |
682 | } else if (sTipoBusqueda == 2) {//TODO BUSQUEDA POR CODIGO DE ORIGEN | 682 | } else if (sTipoBusqueda == 2) {//TODO BUSQUEDA POR CODIGO DE ORIGEN |
683 | for (item in listArticulos) { | 683 | for (item in listArticulos) { |
684 | if (item.codigoOrigen!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { | 684 | if (item.codigoOrigen!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { |
685 | bEncontrado = true | 685 | bEncontrado = true |
686 | break | 686 | break |
687 | } | 687 | } |
688 | indice += 1 | 688 | indice += 1 |
689 | } | 689 | } |
690 | } | 690 | } |
691 | return@async if (bEncontrado) indice else -1 | 691 | return@async if (bEncontrado) indice else -1 |
692 | }.await() | 692 | }.await() |
693 | } | 693 | } |
694 | 694 | ||
695 | suspend fun cambioCBporCodigoDebo(codigoBarras: String): Articles? { | 695 | suspend fun cambioCBporCodigoDebo(codigoBarras: String): Articles? { |
696 | //TODO BUSQUEDA POR DESCRIPCION | 696 | //TODO BUSQUEDA POR DESCRIPCION |
697 | var busqueda: Articles? = null | 697 | var busqueda: Articles? = null |
698 | return GlobalScope.async(IO) { | 698 | return GlobalScope.async(IO) { |
699 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(codigoBarras, SerchAreaInventario()) | 699 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(codigoBarras, SerchAreaInventario()) |
700 | return@async busqueda | 700 | return@async busqueda |
701 | }.await() | 701 | }.await() |
702 | } | 702 | } |
703 | 703 | ||
704 | private fun cargarArtEnBd(articulos: Articles, cant: String) { | 704 | private fun cargarArtEnBd(articulos: Articles, cant: String) { |
705 | val body = InvBody(InventarioNuevo,// TODO PREPARO PARA MANDAR A CARGAR EN LA BD | 705 | val body = InvBody(InventarioNuevo,// TODO PREPARO PARA MANDAR A CARGAR EN LA BD |
706 | articulos.sector, | 706 | articulos.sector, |
707 | articulos.codigo, | 707 | articulos.codigo, |
708 | articulos.descripcion, | 708 | articulos.descripcion, |
709 | cant, | 709 | cant, |
710 | articulos.codBar, | 710 | articulos.codBar, |
711 | articulos.codOrigen, | 711 | articulos.codOrigen, |
712 | articulos.precio, | 712 | articulos.precio, |
713 | articulos.precio, | 713 | articulos.precio, |
714 | articulos.balanza, | 714 | articulos.balanza, |
715 | articulos.depSn, | 715 | articulos.depSn, |
716 | ObtenerFechaActual(), | 716 | ObtenerFechaActual(), |
717 | ObtenerFechaActual()) | 717 | ObtenerFechaActual()) |
718 | InsertarArtEnDB(body)// TODO MANDO A CARGAR A LA BASE DE DATOS | 718 | InsertarArtEnDB(body)// TODO MANDO A CARGAR A LA BASE DE DATOS |
719 | } | 719 | } |
720 | 720 | ||
721 | fun cargarRecicler(articulos: Articles, cant: Float) { | 721 | fun cargarRecicler(articulos: Articles, cant: Float) { |
722 | //TODO CARGO EN LE RV | 722 | //TODO CARGO EN LE RV |
723 | val item = ItemsRecycler(if (articulos.sector.toString().toInt()<9) "0${articulos.sector.toString()}" else articulos.sector.toString() | 723 | val item = ItemsRecycler(if (articulos.sector.toString().toInt()<9) "0${articulos.sector.toString()}" else articulos.sector.toString() |
724 | , articulos.codigo, articulos.descripcion, cant, articulos.codBar, articulos.codOrigen, articulos.balanza.toString(), articulos.de.toString()) | 724 | , articulos.codigo, articulos.descripcion, cant, articulos.codBar, articulos.codOrigen, articulos.balanza.toString(), articulos.de.toString()) |
725 | listArticulos.add(item) | 725 | listArticulos.add(item) |
726 | 726 | ||
727 | viewAdapter = ProductosListAdapter(requireContext(), listArticulos, this) | 727 | viewAdapter = ProductosListAdapter(requireContext(), listArticulos, this) |
728 | viewManager = LinearLayoutManager(requireContext()) | 728 | viewManager = LinearLayoutManager(requireContext()) |
729 | deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! | 729 | deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! |
730 | rcInventarios.apply { | 730 | rcInventarios.apply { |
731 | adapter = viewAdapter | 731 | adapter = viewAdapter |
732 | layoutManager = viewManager | 732 | layoutManager = viewManager |
733 | } | 733 | } |
734 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { | 734 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { |
735 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { | 735 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { |
736 | return false | 736 | return false |
737 | } | 737 | } |
738 | 738 | ||
739 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { | 739 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { |
740 | 740 | ||
741 | GlobalScope.launch(Dispatchers.Main) { | 741 | GlobalScope.launch(Dispatchers.Main) { |
742 | borrarArticulo(listArticulos[viewHolder.adapterPosition].sector.toString(), listArticulos[viewHolder.adapterPosition].codigo.toString(), InventarioNuevo.toString()) | 742 | borrarArticulo(listArticulos[viewHolder.adapterPosition].sector.toString(), listArticulos[viewHolder.adapterPosition].codigo.toString(), InventarioNuevo.toString()) |
743 | (viewAdapter as ProductosListAdapter).removeItem(viewHolder) | 743 | (viewAdapter as ProductosListAdapter).removeItem(viewHolder) |
744 | viewAdapter.notifyDataSetChanged() | 744 | viewAdapter.notifyDataSetChanged() |
745 | modificarCantidadEnCabecera(InventarioNuevo, false, requireContext()) | 745 | modificarCantidadEnCabecera(InventarioNuevo, false, requireContext()) |
746 | } | 746 | } |
747 | } | 747 | } |
748 | 748 | ||
749 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { | 749 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { |
750 | val itemView = viewHolder.itemView | 750 | val itemView = viewHolder.itemView |
751 | val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2 | 751 | val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2 |
752 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) | 752 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) |
753 | 753 | ||
754 | if (dX > 0) { | 754 | if (dX > 0) { |
755 | 755 | ||
756 | if (dX < c.width / 2) c.drawColor(Color.GREEN) | 756 | if (dX < c.width / 2) c.drawColor(Color.GREEN) |
757 | else c.drawColor(Color.RED) | 757 | else c.drawColor(Color.RED) |
758 | deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom - iconMargin) | 758 | deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom - iconMargin) |
759 | } else { | 759 | } else { |
760 | } | 760 | } |
761 | 761 | ||
762 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | 762 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) |
763 | deleteIcon.draw(c) | 763 | deleteIcon.draw(c) |
764 | } | 764 | } |
765 | } | 765 | } |
766 | 766 | ||
767 | val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback) | 767 | val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback) |
768 | itemTouchHelper.attachToRecyclerView(rcInventarios) | 768 | itemTouchHelper.attachToRecyclerView(rcInventarios) |
769 | } | 769 | } |
770 | 770 | ||
771 | private fun ProdNoCont(): Int? { | 771 | private fun ProdNoCont(): Int? { |
772 | var mostrarStock = 0 | 772 | var mostrarStock = 0 |
773 | if (sharedPreferences.contains("cbMostrarStock")) if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") mostrarStock = 1 | 773 | if (sharedPreferences.contains("cbMostrarStock")) if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") mostrarStock = 1 |
774 | return mostrarStock | 774 | return mostrarStock |
775 | } | 775 | } |
776 | 776 | ||
777 | private fun AjusteProductos(): Int? { | 777 | private fun AjusteProductos(): Int? { |
778 | var prodInclu = 0 | 778 | var prodInclu = 0 |
779 | if (sharedPreferences.contains("rbProInclu")) if (sharedPreferences.getString("rbProInclu", "").toString() == "1") prodInclu = 1 | 779 | if (sharedPreferences.contains("rbProInclu")) if (sharedPreferences.getString("rbProInclu", "").toString() == "1") prodInclu = 1 |
780 | 780 | ||
781 | if (sharedPreferences.contains("rbProNoInclu")) if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") prodInclu = 0 | 781 | if (sharedPreferences.contains("rbProNoInclu")) if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") prodInclu = 0 |
782 | return prodInclu | 782 | return prodInclu |
783 | } | 783 | } |
784 | 784 | ||
785 | private fun SerchArea(): Boolean { | 785 | private fun SerchArea(): Boolean { |
786 | if (sharedPreferences.contains("rbVentas")) if (sharedPreferences.getString("rbVentas", "").toString() == "1") iArea =false | 786 | if (sharedPreferences.contains("rbVentas")) if (sharedPreferences.getString("rbVentas", "").toString() == "1") iArea =false |
787 | if (sharedPreferences.contains("rbDeposito")) if (sharedPreferences.getString("rbDeposito", "").toString() == "1") iArea = true | 787 | if (sharedPreferences.contains("rbDeposito")) if (sharedPreferences.getString("rbDeposito", "").toString() == "1") iArea = true |
788 | return iArea | 788 | return iArea |
789 | } | 789 | } |
790 | 790 | ||
791 | suspend fun SerchAreaInventario(): Boolean { | 791 | suspend fun SerchAreaInventario(): Boolean { |
792 | return GlobalScope.async(IO) { | 792 | return GlobalScope.async(IO) { |
793 | return@async AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.fetchAreaInvH(InventarioNuevo.toLong()) | 793 | return@async AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.fetchAreaInvH(InventarioNuevo.toLong()) |
794 | }.await() | 794 | }.await() |
795 | 795 | ||
796 | } | 796 | } |
797 | 797 | ||
798 | fun ObtenerFechaActual(): String? { | 798 | fun ObtenerFechaActual(): String? { |
799 | //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD | 799 | //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD |
800 | val current = LocalDateTime.now() | 800 | val current = LocalDateTime.now() |
801 | val formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy hh:mm:ss") | 801 | val formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy hh:mm:ss") |
802 | val dFechaHora = current.format(formatter) | 802 | val dFechaHora = current.format(formatter) |
803 | return dFechaHora.toString() | 803 | return dFechaHora.toString() |
804 | } | 804 | } |
805 | 805 | ||
806 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { | 806 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { |
807 | lifecycleScope.launch { | 807 | lifecycleScope.launch { |
808 | withContext(Dispatchers.IO) { | 808 | withContext(Dispatchers.IO) { |
809 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) | 809 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) |
810 | } | 810 | } |
811 | } | 811 | } |
812 | } | 812 | } |
813 | 813 | ||
814 | fun updateCantidad(sector: String, codigo: String, cantidad: Float) { | 814 | fun updateCantidad(sector: String, codigo: String, cantidad: Float) { |
815 | lifecycleScope.launch { | 815 | lifecycleScope.launch { |
816 | withContext(Dispatchers.IO) { | 816 | withContext(Dispatchers.IO) { |
817 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.UpdateInvBody(cantidad, sector.toLong(), codigo.toLong()) | 817 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.UpdateInvBody(cantidad, sector.toLong(), codigo.toLong()) |
818 | } | 818 | } |
819 | } | 819 | } |
820 | } | 820 | } |
821 | 821 | ||
822 | suspend fun cargarInventario(inventario: Int): List<InvBody>? { | 822 | suspend fun cargarInventario(inventario: Int): List<InvBody>? { |
823 | return GlobalScope.async(Dispatchers.IO) { | 823 | return GlobalScope.async(Dispatchers.IO) { |
824 | return@async AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.fetchAllInvBody(inventario) | 824 | return@async AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.fetchAllInvBody(inventario) |
825 | }.await() | 825 | }.await() |
826 | } | 826 | } |
827 | 827 | ||
828 | override fun onImageDotsClick(sector: String?, codigo: String?) { | 828 | override fun onImageDotsClick(sector: String?, codigo: String?) { |
829 | val bundle = Bundle() | 829 | val bundle = Bundle() |
830 | bundle.putString("sector", sector!!.toInt().toString()) | 830 | bundle.putString("sector", sector!!.toInt().toString()) |
831 | bundle.putString("codigo", codigo) | 831 | bundle.putString("codigo", codigo) |
832 | bundle.putInt("numeroInv", InventarioNuevo) | 832 | bundle.putInt("numeroInv", InventarioNuevo) |
833 | navController.navigate(R.id.action_inventarioFragment_to_detalleArtFragment, bundle) | 833 | navController.navigate(R.id.action_inventarioFragment_to_detalleArtFragment, bundle) |
834 | } | 834 | } |
835 | 835 | ||
836 | override fun onImagePenClick(sector: String?, codigo: String?, cantidad: String?, position: String) { | 836 | override fun onImagePenClick(sector: String?, codigo: String?, cantidad: String?, position: String) { |
837 | dialogoSumaResta(requireContext(), position.toInt(), listArticulos[position.toInt()].univta, true) | 837 | dialogoSumaResta(requireContext(), position.toInt(), listArticulos[position.toInt()].univta, true) |
838 | } | 838 | } |
839 | 839 | ||
840 | private val textWatcher = object : TextWatcher { | 840 | private val textWatcher = object : TextWatcher { |
841 | override fun afterTextChanged(s: Editable?) { | 841 | override fun afterTextChanged(s: Editable?) { |
842 | } | 842 | } |
843 | 843 | ||
844 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { | 844 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { |
845 | } | 845 | } |
846 | 846 | ||
847 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { | 847 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
848 | if(mDialogView.rbSumar.isChecked){ | 848 | if(mDialogView.rbSumar.isChecked){ |
849 | // mDialogView.tvNuevaCantidad.isEnabled=false | 849 | // mDialogView.tvNuevaCantidad.isEnabled=false |
850 | mDialogView.tvResultado.text=String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat()+ mDialogView.tvCantInicial.text.toString().toFloat()) | 850 | mDialogView.tvResultado.text=String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat()+ mDialogView.tvCantInicial.text.toString().toFloat()) |
851 | } | 851 | } |
852 | if(mDialogView.rbRestar.isChecked) { | 852 | if(mDialogView.rbRestar.isChecked) { |
853 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 853 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
854 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | 854 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { |
855 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()) | 855 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()) |
856 | // mDialogView.tvNuevaCantidad.isEnabled = false | 856 | // mDialogView.tvNuevaCantidad.isEnabled = false |
857 | } else { | 857 | } else { |
858 | mDialogView.tvResultado.text = "" | 858 | mDialogView.tvResultado.text = "" |
859 | mDialogView.tvResultado.error = "Operación No Valida" | 859 | mDialogView.tvResultado.error = "Operación No Valida" |
860 | mDialogView.tvResultado.requestFocus() | 860 | mDialogView.tvResultado.requestFocus() |
861 | mDialogView.tvResultado.hint = "Error" | 861 | mDialogView.tvResultado.hint = "Error" |
862 | } | 862 | } |
863 | } | 863 | } |
864 | } | 864 | } |
865 | if(mDialogView.rbMdodificar.isChecked) { | 865 | if(mDialogView.rbMdodificar.isChecked) { |
866 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 866 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
867 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat()) | 867 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat()) |
868 | // mDialogView.tvNuevaCantidad.isEnabled = false | 868 | // mDialogView.tvNuevaCantidad.isEnabled = false |
869 | } | 869 | } |
870 | } | 870 | } |
871 | 871 | ||
872 | } | 872 | } |
873 | } | 873 | } |
874 | } | 874 | } |
875 | 875 | ||
876 | 876 | ||
877 | 877 | ||
878 | 878 | ||
879 | 879 | ||
880 | 880 | ||
881 | 881 | ||
882 | 882 | ||
883 | 883 | ||
884 | 884 | ||
885 | 885 | ||
886 | 886 | ||
887 | 887 | ||
888 | 888 | ||
889 | 889 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/ProductosListAdapter.kt
1 | package com.focasoftware.deboinventariov20.UI.inventario | 1 | package com.focasoftware.deboinventariov20.UI.inventario |
2 | 2 | ||
3 | import android.content.Context | 3 | import android.content.Context |
4 | import android.view.LayoutInflater | 4 | import android.view.LayoutInflater |
5 | import android.view.View | 5 | import android.view.View |
6 | import android.view.ViewGroup | 6 | import android.view.ViewGroup |
7 | import androidx.recyclerview.widget.RecyclerView | 7 | import androidx.recyclerview.widget.RecyclerView |
8 | import com.focasoftware.deboinventariov20.R | 8 | import com.focasoftware.deboinventariov20.R |
9 | import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder | 9 | import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder |
10 | import kotlinx.android.synthetic.main.item.view.* | 10 | import kotlinx.android.synthetic.main.item.view.* |
11 | import java.io.IOException | 11 | import java.io.IOException |
12 | import java.net.UnknownHostException | 12 | import java.net.UnknownHostException |
13 | 13 | ||
14 | 14 | ||
15 | class ProductosListAdapter(private val context: Context,private val productos: ArrayList<ItemsRecycler>, private val itemImageClickListener: OnImageDotsClickListener) : | 15 | class ProductosListAdapter(private val context: Context,private val productos: ArrayList<ItemsRecycler>, private val itemImageClickListener: OnImageDotsClickListener) : |
16 | RecyclerView.Adapter<BaseViewHolder<*>>() { | 16 | RecyclerView.Adapter<BaseViewHolder<*>>() { |
17 | 17 | ||
18 | private var removePosition: Int = 0 | 18 | private var removePosition: Int = 0 |
19 | private var removedItem: ItemsRecycler? = null | 19 | private var removedItem: ItemsRecycler? = null |
20 | 20 | ||
21 | interface OnImageDotsClickListener { | 21 | interface OnImageDotsClickListener { |
22 | fun onImageDotsClick(sector: String?,codigo: String?) | 22 | fun onImageDotsClick(sector: String?,codigo: String?) |
23 | fun onImagePenClick(sector: String?, codigo: String?, cantidad: String?, position: String) | 23 | fun onImagePenClick(sector: String?, codigo: String?, cantidad: String?, position: String) |
24 | } | 24 | } |
25 | 25 | ||
26 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item, parent, false)) | 26 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item, parent, false)) |
27 | 27 | ||
28 | override fun getItemCount() = productos.size | 28 | override fun getItemCount() = productos.size |
29 | 29 | ||
30 | override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) { | 30 | override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) { |
31 | when (holder) { | 31 | when (holder) { |
32 | is ItemsViewHolder -> { holder.bind(productos[position], position) } | 32 | is ItemsViewHolder -> { holder.bind(productos[position], position) } |
33 | 33 | ||
34 | } | 34 | } |
35 | } | 35 | } |
36 | inner class ItemsViewHolder (itemView: View) : BaseViewHolder<ItemsRecycler>(itemView) { | 36 | inner class ItemsViewHolder (itemView: View) : BaseViewHolder<ItemsRecycler>(itemView) { |
37 | override fun bind(item: ItemsRecycler, position: Int) { | 37 | override fun bind(item: ItemsRecycler, position: Int) { |
38 | itemView.ivDots.setOnClickListener {itemImageClickListener.onImageDotsClick(item.sector,item.codigo) } | 38 | itemView.ivDots.setOnClickListener {itemImageClickListener.onImageDotsClick(item.sector,item.codigo) } |
39 | itemView.ivPen.setOnClickListener {itemImageClickListener.onImagePenClick(item.sector,item.codigo,item.cantTomada.toString(),adapterPosition.toString()) } | 39 | itemView.ivPen.setOnClickListener {itemImageClickListener.onImagePenClick(item.sector,item.codigo,item.cantTomada.toString(),adapterPosition.toString()) } |
40 | 40 | ||
41 | itemView.tvSector.text=item.sector | 41 | // itemView.tvSector.text=item.sector |
42 | itemView.tvCodigo.text=item.codigo | 42 | // itemView.tvCodigo.text=item.codigo |
43 | itemView.tvDescripcion.text=item.descripcion | 43 | itemView.tvDescripcion.text=item.descripcion |
44 | itemView.tvCantidad.text=item.cantTomada.toString() | 44 | itemView.tvCantidad.text=item.cantTomada.toString() |
45 | itemView.tvCodigoBarras.text=item.sector | 45 | // itemView.tvCodigoBarras.text=item.sector |
46 | itemView.tvCodigoOrigen.text=item.sector | 46 | // itemView.tvCodigoOrigen.text=item.sector |
47 | itemView.ivPen.setImageResource(R.drawable.pen) | 47 | itemView.ivPen.setImageResource(R.drawable.pen) |
48 | itemView.ivDots.setImageResource(R.drawable.more) | 48 | itemView.ivDots.setImageResource(R.drawable.more) |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | fun removeItem(viewHolder: RecyclerView.ViewHolder) { | 52 | fun removeItem(viewHolder: RecyclerView.ViewHolder) { |
53 | removePosition = viewHolder.adapterPosition | 53 | removePosition = viewHolder.adapterPosition |
54 | removedItem = productos[viewHolder.adapterPosition] | 54 | removedItem = productos[viewHolder.adapterPosition] |
55 | 55 | ||
56 | productos.removeAt(viewHolder.adapterPosition) | 56 | productos.removeAt(viewHolder.adapterPosition) |
57 | notifyItemRemoved(viewHolder.adapterPosition) | 57 | notifyItemRemoved(viewHolder.adapterPosition) |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | 61 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/main/InventarioListAdapter.kt
1 | package com.focasoftware.deboinventariov20.UI.main | 1 | package com.focasoftware.deboinventariov20.UI.main |
2 | 2 | ||
3 | import android.content.Context | 3 | import android.content.Context |
4 | import android.view.LayoutInflater | 4 | import android.view.LayoutInflater |
5 | import android.view.View | 5 | import android.view.View |
6 | import android.view.ViewGroup | 6 | import android.view.ViewGroup |
7 | import android.widget.Filter | 7 | import android.widget.Filter |
8 | import android.widget.Filterable | 8 | import android.widget.Filterable |
9 | import androidx.recyclerview.widget.RecyclerView | 9 | import androidx.recyclerview.widget.RecyclerView |
10 | import com.focasoftware.deboinventariov20.Model.InvHead | 10 | import com.focasoftware.deboinventariov20.Model.InvHead |
11 | import com.focasoftware.deboinventariov20.R | 11 | import com.focasoftware.deboinventariov20.R |
12 | import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder | 12 | import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder |
13 | import kotlinx.android.synthetic.main.item_principal.view.* | 13 | import kotlinx.android.synthetic.main.item_principal.view.* |
14 | import java.util.* | 14 | import java.util.* |
15 | import kotlin.collections.ArrayList | 15 | import kotlin.collections.ArrayList |
16 | 16 | ||
17 | class InventarioListAdapter(private val context: Context, private val inv: List<InvHead>, private val itemClickListener: OnInventarioClickListener) : | 17 | class InventarioListAdapter(private val context: Context, private val inv: List<InvHead>, private val itemClickListener: OnInventarioClickListener) : |
18 | RecyclerView.Adapter<BaseViewHolder<*>>() { | 18 | RecyclerView.Adapter<BaseViewHolder<*>>() { |
19 | 19 | ||
20 | interface OnInventarioClickListener { | 20 | interface OnInventarioClickListener { |
21 | fun onItemClick(inventario: String?) | 21 | fun onItemClick(inventario: String?) |
22 | } | 22 | } |
23 | 23 | ||
24 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item_principal, parent, false)) | 24 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item_principal, parent, false)) |
25 | 25 | ||
26 | override fun getItemCount() = inv.size | 26 | override fun getItemCount() = inv.size |
27 | 27 | ||
28 | 28 | ||
29 | inner class ItemsViewHolder(itemView: View) : BaseViewHolder<InvHead>(itemView) { | 29 | inner class ItemsViewHolder(itemView: View) : BaseViewHolder<InvHead>(itemView) { |
30 | override fun bind(item: InvHead, position: Int) { | 30 | override fun bind(item: InvHead, position: Int) { |
31 | itemView.setOnClickListener {itemClickListener.onItemClick(item.invNum.toString())} | 31 | itemView.setOnClickListener {itemClickListener.onItemClick(item.invNum.toString())} |
32 | itemView.tvPrincipalinventario.text = if ( item.invNum < 10) "0${ item.invNum.toString()}" else item.invNum.toString() | 32 | itemView.tvPrincipalinventario.text = if ( item.invNum < 10) "#0${ item.invNum.toString()}" else "#"+item.invNum.toString() |
33 | 33 | ||
34 | itemView.tvDescription.text=item.descripcion.toString() | 34 | itemView.tvDescription.text=item.descripcion.toString() |
35 | itemView.tvFecha.text=item.fechaInicio.toString() | 35 | itemView.tvFecha.text=item.fechaInicio.toString() |
36 | itemView.tvCantContada.text=item.prodContados.toString() | 36 | itemView.tvCantContada.text=item.prodContados.toString() |
37 | } | 37 | } |
38 | } | 38 | } |
39 | 39 | ||
40 | override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) { | 40 | override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) { |
41 | when (holder) { | 41 | when (holder) { |
42 | is ItemsViewHolder -> holder.bind(inv[position], position) | 42 | is ItemsViewHolder -> holder.bind(inv[position], position) |
43 | else -> IllegalArgumentException("No se pudo pasar el ViewHolder") | 43 | else -> IllegalArgumentException("No se pudo pasar el ViewHolder") |
44 | } | 44 | } |
45 | } | 45 | } |
46 | } | 46 | } |
app/src/main/res/drawable/gradient_bt.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | |||
4 | <gradient | ||
5 | android:angle="90" | ||
6 | android:endColor="@android:color/darker_gray" | ||
7 | android:startColor="@color/colorPrimaryDark" | ||
8 | android:type="linear"> | ||
9 | |||
10 | </gradient> | ||
11 | |||
12 | <corners | ||
13 | android:radius="20dp"/> | ||
14 | |||
15 | </shape> |
app/src/main/res/drawable/ic_izq.xml
File was created | 1 | <vector xmlns:android="http://schemas.android.com/apk/res/android" | |
2 | android:width="24dp" | ||
3 | android:height="24dp" | ||
4 | android:viewportWidth="24" | ||
5 | android:viewportHeight="24" | ||
6 | android:tint="@color/colorPrimaryDark"> | ||
7 | <path | ||
8 | android:fillColor="@color/colorPrimaryDark" | ||
9 | android:pathData="M21,11H6.83l3.58,-3.59L9,6l-6,6 6,6 1.41,-1.41L6.83,13H21z"/> | ||
10 | </vector> | ||
11 |
app/src/main/res/layout/fragment_codigo_ori.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | ||
3 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 3 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
4 | xmlns:app="http://schemas.android.com/apk/res-auto" | 4 | xmlns:app="http://schemas.android.com/apk/res-auto" |
5 | xmlns:tools="http://schemas.android.com/tools" | 5 | xmlns:tools="http://schemas.android.com/tools" |
6 | android:layout_width="match_parent" | 6 | android:layout_width="match_parent" |
7 | android:layout_height="match_parent" | 7 | android:layout_height="match_parent" |
8 | android:background="@android:color/darker_gray" | ||
8 | tools:context=".UI.descripcionFragment.DescripcionFragment"> | 9 | tools:context=".UI.descripcionFragment.DescripcionFragment"> |
9 | 10 | ||
11 | <ImageView | ||
12 | android:id="@+id/ivHolder" | ||
13 | android:layout_width="40dp" | ||
14 | android:layout_height="40dp" | ||
15 | android:src="@drawable/ic_izq" | ||
16 | android:visibility="visible" | ||
17 | app:layout_constraintBottom_toTopOf="@id/guideline4" | ||
18 | app:layout_constraintStart_toStartOf="parent" /> | ||
19 | |||
20 | |||
21 | <TextView | ||
22 | android:id="@+id/tvCodigo" | ||
23 | android:layout_width="0dp" | ||
24 | android:layout_height="wrap_content" | ||
25 | android:layout_marginStart="2dp" | ||
26 | android:gravity="center_horizontal" | ||
27 | android:orientation="vertical" | ||
28 | android:text="Deslizar a la izquierda para seleccionar" | ||
29 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
30 | android:textColor="@color/colorPrimaryDark" | ||
31 | android:textSize="16dp" | ||
32 | android:textStyle="bold" | ||
33 | |||
34 | app:layout_constraintBottom_toTopOf="@id/guideline4" | ||
35 | app:layout_constraintHorizontal_chainStyle="packed" | ||
36 | app:layout_constraintStart_toEndOf="@id/ivHolder" | ||
37 | app:layout_constraintTop_toTopOf="parent" /> | ||
38 | |||
10 | <androidx.recyclerview.widget.RecyclerView | 39 | <androidx.recyclerview.widget.RecyclerView |
11 | android:id="@+id/rcCodigoOri" | 40 | android:id="@+id/rcCodigoOri" |
12 | android:layout_width="match_parent" | 41 | android:layout_width="match_parent" |
13 | android:layout_height="0dp" | 42 | android:layout_height="0dp" |
14 | android:background="@android:color/darker_gray" | 43 | android:background="@android:color/darker_gray" |
15 | android:scrollbars="vertical" | 44 | android:scrollbars="vertical" |
16 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | 45 | app:layout_constraintBottom_toTopOf="@+id/guideline6" |
17 | app:layout_constraintEnd_toEndOf="parent" | 46 | app:layout_constraintEnd_toEndOf="parent" |
18 | app:layout_constraintStart_toStartOf="parent" | 47 | app:layout_constraintStart_toStartOf="parent" |
19 | app:layout_constraintTop_toBottomOf="@id/guideline4" | 48 | app:layout_constraintTop_toBottomOf="@id/guideline4" |
20 | tools:listitem="@layout/item_codigo_origen" /> | 49 | tools:listitem="@layout/item_codigo_origen" /> |
21 | 50 | ||
22 | <!-- <Button--> | 51 | <!-- <Button--> |
23 | <!-- android:id="@+id/btnSalir"--> | 52 | <!-- android:id="@+id/btnSalir"--> |
24 | <!-- android:layout_width="0dp"--> | 53 | <!-- android:layout_width="0dp"--> |
25 | <!-- android:layout_height="wrap_content"--> | 54 | <!-- android:layout_height="wrap_content"--> |
26 | <!-- android:text="@string/btnCancelar"--> | 55 | <!-- android:text="@string/btnCancelar"--> |
27 | <!-- android:textColor="@android:color/white"--> | 56 | <!-- android:textColor="@android:color/white"--> |
28 | <!-- android:padding="10dp"--> | 57 | <!-- android:padding="10dp"--> |
29 | <!-- android:background="@drawable/boton_borde_redondeado"--> | 58 | <!-- android:background="@drawable/boton_borde_redondeado"--> |
30 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> | 59 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> |
31 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | 60 | <!-- app:layout_constraintEnd_toEndOf="parent"--> |
32 | <!-- app:layout_constraintHorizontal_chainStyle="spread"--> | 61 | <!-- app:layout_constraintHorizontal_chainStyle="spread"--> |
33 | <!-- app:layout_constraintStart_toStartOf="parent"--> | 62 | <!-- app:layout_constraintStart_toStartOf="parent"--> |
34 | <!-- app:layout_constraintTop_toBottomOf="@+id/rcInventarios" />--> | 63 | <!-- app:layout_constraintTop_toBottomOf="@+id/rcInventarios" />--> |
35 | 64 | ||
36 | <androidx.constraintlayout.widget.Guideline | 65 | <androidx.constraintlayout.widget.Guideline |
37 | android:id="@+id/guideline4" | 66 | android:id="@+id/guideline4" |
38 | android:layout_width="wrap_content" | 67 | android:layout_width="wrap_content" |
39 | android:layout_height="wrap_content" | 68 | android:layout_height="wrap_content" |
40 | android:orientation="horizontal" | 69 | android:orientation="horizontal" |
41 | app:layout_constraintGuide_percent="0.06" /> | 70 | app:layout_constraintGuide_percent="0.06" /> |
42 | 71 | ||
43 | <androidx.constraintlayout.widget.Guideline | 72 | <androidx.constraintlayout.widget.Guideline |
44 | android:id="@+id/guideline5" | 73 | android:id="@+id/guideline5" |
45 | android:layout_width="wrap_content" | 74 | android:layout_width="wrap_content" |
46 | android:layout_height="wrap_content" | 75 | android:layout_height="wrap_content" |
47 | android:orientation="horizontal" | 76 | android:orientation="horizontal" |
48 | app:layout_constraintGuide_percent="0.88" /> | 77 | app:layout_constraintGuide_percent="0.88" /> |
49 | 78 | ||
50 | <androidx.constraintlayout.widget.Guideline | 79 | <androidx.constraintlayout.widget.Guideline |
51 | android:id="@+id/guideline6" | 80 | android:id="@+id/guideline6" |
52 | android:layout_width="wrap_content" | 81 | android:layout_width="wrap_content" |
53 | android:layout_height="wrap_content" | 82 | android:layout_height="wrap_content" |
54 | android:orientation="horizontal" | 83 | android:orientation="horizontal" |
55 | app:layout_constraintGuide_percent="0.97" /> | 84 | app:layout_constraintGuide_percent="0.97" /> |
56 | </androidx.constraintlayout.widget.ConstraintLayout> | 85 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/fragment_descripcion.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | ||
3 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 3 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
4 | xmlns:app="http://schemas.android.com/apk/res-auto" | 4 | xmlns:app="http://schemas.android.com/apk/res-auto" |
5 | xmlns:tools="http://schemas.android.com/tools" | 5 | xmlns:tools="http://schemas.android.com/tools" |
6 | android:layout_width="match_parent" | 6 | android:layout_width="match_parent" |
7 | android:layout_height="match_parent" | 7 | android:layout_height="match_parent" |
8 | android:background="@android:color/darker_gray" | ||
8 | tools:context=".UI.descripcionFragment.DescripcionFragment"> | 9 | tools:context=".UI.descripcionFragment.DescripcionFragment"> |
9 | 10 | ||
11 | |||
12 | <ImageView | ||
13 | android:id="@+id/ivHolder" | ||
14 | android:layout_width="40dp" | ||
15 | android:layout_height="40dp" | ||
16 | android:src="@drawable/ic_izq" | ||
17 | android:visibility="visible" | ||
18 | app:layout_constraintBottom_toTopOf="@id/guideline4" | ||
19 | app:layout_constraintStart_toStartOf="parent" /> | ||
20 | |||
21 | |||
22 | <TextView | ||
23 | android:id="@+id/tvCodigo" | ||
24 | android:layout_width="0dp" | ||
25 | android:layout_height="wrap_content" | ||
26 | android:layout_marginStart="2dp" | ||
27 | android:gravity="center_horizontal" | ||
28 | android:orientation="vertical" | ||
29 | android:text="Deslizar a la izquierda para seleccionar" | ||
30 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
31 | android:textColor="@color/colorPrimaryDark" | ||
32 | android:textSize="16dp" | ||
33 | android:textStyle="bold" | ||
34 | |||
35 | app:layout_constraintBottom_toTopOf="@id/guideline4" | ||
36 | app:layout_constraintHorizontal_chainStyle="packed" | ||
37 | app:layout_constraintStart_toEndOf="@id/ivHolder" | ||
38 | app:layout_constraintTop_toTopOf="parent" /> | ||
39 | |||
10 | <androidx.recyclerview.widget.RecyclerView | 40 | <androidx.recyclerview.widget.RecyclerView |
11 | android:id="@+id/rcDescripcion" | 41 | android:id="@+id/rcDescripcion" |
12 | android:layout_width="match_parent" | 42 | android:layout_width="match_parent" |
13 | android:layout_height="0dp" | 43 | android:layout_height="0dp" |
14 | android:background="@android:color/darker_gray" | 44 | android:background="@android:color/darker_gray" |
15 | android:scrollbars="vertical" | 45 | android:scrollbars="vertical" |
16 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | 46 | app:layout_constraintBottom_toTopOf="@+id/guideline6" |
17 | app:layout_constraintEnd_toEndOf="parent" | 47 | app:layout_constraintEnd_toEndOf="parent" |
18 | app:layout_constraintStart_toStartOf="parent" | 48 | app:layout_constraintStart_toStartOf="parent" |
19 | app:layout_constraintTop_toBottomOf="@id/guideline4" | 49 | app:layout_constraintTop_toBottomOf="@id/guideline4" |
20 | tools:listitem="@layout/item" /> | 50 | tools:listitem="@layout/item" /> |
21 | 51 | ||
22 | <!-- <Button--> | 52 | <!-- <Button--> |
23 | <!-- android:id="@+id/btnSalir"--> | 53 | <!-- android:id="@+id/btnSalir"--> |
24 | <!-- android:layout_width="0dp"--> | 54 | <!-- android:layout_width="0dp"--> |
25 | <!-- android:layout_height="wrap_content"--> | 55 | <!-- android:layout_height="wrap_content"--> |
26 | <!-- android:text="@string/btnCancelar"--> | 56 | <!-- android:text="@string/btnCancelar"--> |
27 | <!-- android:textColor="@android:color/white"--> | 57 | <!-- android:textColor="@android:color/white"--> |
28 | <!-- android:padding="10dp"--> | 58 | <!-- android:padding="10dp"--> |
29 | <!-- android:background="@drawable/boton_borde_redondeado"--> | 59 | <!-- android:background="@drawable/boton_borde_redondeado"--> |
30 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> | 60 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> |
31 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | 61 | <!-- app:layout_constraintEnd_toEndOf="parent"--> |
32 | <!-- app:layout_constraintHorizontal_chainStyle="spread"--> | 62 | <!-- app:layout_constraintHorizontal_chainStyle="spread"--> |
33 | <!-- app:layout_constraintStart_toStartOf="parent"--> | 63 | <!-- app:layout_constraintStart_toStartOf="parent"--> |
34 | <!-- app:layout_constraintTop_toBottomOf="@+id/rcInventarios" />--> | 64 | <!-- app:layout_constraintTop_toBottomOf="@+id/rcInventarios" />--> |
35 | 65 | ||
36 | <androidx.constraintlayout.widget.Guideline | 66 | <androidx.constraintlayout.widget.Guideline |
37 | android:id="@+id/guideline4" | 67 | android:id="@+id/guideline4" |
38 | android:layout_width="wrap_content" | 68 | android:layout_width="wrap_content" |
39 | android:layout_height="wrap_content" | 69 | android:layout_height="wrap_content" |
40 | android:orientation="horizontal" | 70 | android:orientation="horizontal" |
41 | app:layout_constraintGuide_percent="0.06" /> | 71 | app:layout_constraintGuide_percent="0.06" /> |
42 | 72 | ||
43 | <androidx.constraintlayout.widget.Guideline | 73 | <androidx.constraintlayout.widget.Guideline |
44 | android:id="@+id/guideline5" | 74 | android:id="@+id/guideline5" |
45 | android:layout_width="wrap_content" | 75 | android:layout_width="wrap_content" |
46 | android:layout_height="wrap_content" | 76 | android:layout_height="wrap_content" |
47 | android:orientation="horizontal" | 77 | android:orientation="horizontal" |
48 | app:layout_constraintGuide_percent="0.88" /> | 78 | app:layout_constraintGuide_percent="0.88" /> |
49 | 79 | ||
50 | <androidx.constraintlayout.widget.Guideline | 80 | <androidx.constraintlayout.widget.Guideline |
51 | android:id="@+id/guideline6" | 81 | android:id="@+id/guideline6" |
52 | android:layout_width="wrap_content" | 82 | android:layout_width="wrap_content" |
53 | android:layout_height="wrap_content" | 83 | android:layout_height="wrap_content" |
54 | android:orientation="horizontal" | 84 | android:orientation="horizontal" |
55 | app:layout_constraintGuide_percent="0.97" /> | 85 | app:layout_constraintGuide_percent="0.97" /> |
56 | </androidx.constraintlayout.widget.ConstraintLayout> | 86 | </androidx.constraintlayout.widget.ConstraintLayout> |
57 | 87 |
app/src/main/res/layout/fragment_detalle_art.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | android:id="@+id/nsPedidosDatos" | 4 | android:id="@+id/nsPedidosDatos" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent"> | 6 | android:layout_height="match_parent"> |
7 | 7 | ||
8 | <androidx.cardview.widget.CardView | 8 | <androidx.cardview.widget.CardView |
9 | android:id="@+id/cvItem1" | 9 | android:id="@+id/cvItem1" |
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
11 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
12 | android:layout_marginStart="5dp" | 12 | android:layout_marginStart="5dp" |
13 | android:layout_marginTop="5dp" | 13 | android:layout_marginTop="5dp" |
14 | android:layout_marginEnd="5dp" | 14 | android:layout_marginEnd="5dp" |
15 | app:cardBackgroundColor="@android:color/darker_gray" | 15 | app:cardBackgroundColor="@android:color/darker_gray" |
16 | app:cardCornerRadius="25dp" | 16 | app:cardCornerRadius="25dp" |
17 | app:cardElevation="10dp" | 17 | app:cardElevation="10dp" |
18 | app:layout_constraintEnd_toEndOf="parent" | 18 | app:layout_constraintEnd_toEndOf="parent" |
19 | app:layout_constraintStart_toStartOf="parent" | 19 | app:layout_constraintStart_toStartOf="parent" |
20 | app:layout_constraintTop_toTopOf="parent"> | 20 | app:layout_constraintTop_toTopOf="parent"> |
21 | 21 | ||
22 | <androidx.constraintlayout.widget.ConstraintLayout | 22 | <androidx.constraintlayout.widget.ConstraintLayout |
23 | android:id="@+id/clayout" | 23 | android:id="@+id/clayout" |
24 | android:layout_width="match_parent" | 24 | android:layout_width="match_parent" |
25 | android:layout_height="match_parent"> | 25 | android:layout_height="match_parent"> |
26 | 26 | ||
27 | <!-- <TextView--> | ||
28 | <!-- android:id="@+id/tvTime"--> | ||
29 | <!-- android:layout_width="0dp"--> | ||
30 | <!-- android:layout_height="wrap_content"--> | ||
31 | <!-- android:layout_marginTop="15dp"--> | ||
32 | <!-- android:gravity="center_horizontal"--> | ||
33 | <!-- android:orientation="horizontal"--> | ||
34 | <!-- android:text="Detalle del artículo"--> | ||
35 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
36 | <!-- android:textSize="@dimen/Titulos"--> | ||
37 | <!-- android:textStyle="bold"--> | ||
38 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
39 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
40 | <!-- app:layout_constraintTop_toTopOf="parent" />--> | ||
41 | |||
27 | <TextView | 42 | <TextView |
28 | android:id="@+id/tvTime" | 43 | android:id="@+id/tvDescripcion" |
29 | android:layout_width="0dp" | 44 | android:layout_width="wrap_content" |
30 | android:layout_height="wrap_content" | 45 | android:layout_height="0dp" |
31 | android:layout_marginTop="15dp" | 46 | android:layout_marginTop="10dp" |
32 | android:gravity="center_horizontal" | 47 | android:gravity="center_horizontal" |
33 | android:orientation="horizontal" | 48 | |
34 | android:text="Detalle del artículo" | 49 | android:text="coaca" |
35 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 50 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
36 | android:textSize="@dimen/Titulos" | 51 | android:textSize="30sp" |
37 | android:textStyle="bold" | 52 | android:textStyle="bold" |
38 | app:layout_constraintEnd_toEndOf="parent" | 53 | app:layout_constraintEnd_toEndOf="parent" |
39 | app:layout_constraintStart_toStartOf="parent" | 54 | app:layout_constraintStart_toStartOf="parent" |
40 | app:layout_constraintTop_toTopOf="parent" /> | 55 | app:layout_constraintTop_toTopOf="parent" /> |
41 | 56 | ||
57 | |||
42 | <TextView | 58 | <TextView |
43 | android:id="@+id/textView6" | 59 | android:id="@+id/textView18" |
44 | android:layout_width="wrap_content" | 60 | android:layout_width="wrap_content" |
45 | android:layout_height="wrap_content" | 61 | android:layout_height="wrap_content" |
46 | android:layout_marginStart="5dp" | ||
47 | android:layout_marginTop="10dp" | 62 | android:layout_marginTop="10dp" |
48 | android:text="Descripción:" | 63 | android:text="Códigos:" |
49 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 64 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
50 | android:textSize="14sp" | 65 | android:textSize="15sp" |
51 | app:layout_constraintEnd_toStartOf="@id/tvDescripcion" | ||
52 | app:layout_constraintStart_toStartOf="parent" | 66 | app:layout_constraintStart_toStartOf="parent" |
53 | app:layout_constraintTop_toBottomOf="@+id/tvTime" /> | 67 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
54 | |||
55 | <TextView | ||
56 | android:id="@+id/tvDescripcion" | ||
57 | android:layout_width="0dp" | ||
58 | android:layout_height="wrap_content" | ||
59 | android:layout_marginStart="5dp" | ||
60 | android:layout_marginTop="10dp" | ||
61 | android:lines="2" | ||
62 | android:text="" | ||
63 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
64 | android:textSize="18sp" | ||
65 | android:textStyle="bold" | ||
66 | app:layout_constraintBaseline_toBaselineOf="@+id/textView6" | ||
67 | app:layout_constraintEnd_toEndOf="parent" | ||
68 | app:layout_constraintStart_toEndOf="@+id/textView6" /> | ||
69 | |||
70 | 68 | ||
71 | <TextView | 69 | <TextView |
72 | android:id="@+id/textView18" | 70 | android:id="@+id/textView19" |
73 | android:layout_width="wrap_content" | 71 | android:layout_width="wrap_content" |
74 | android:layout_height="wrap_content" | 72 | android:layout_height="wrap_content" |
75 | android:layout_marginStart="5dp" | 73 | android:layout_marginStart="5dp" |
76 | android:layout_marginTop="10dp" | 74 | android:text="DEBO:" |
77 | android:text="Código:" | ||
78 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 75 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
79 | android:textSize="15sp" | 76 | android:textSize="15sp" |
80 | app:layout_constraintStart_toStartOf="parent" | 77 | app:layout_constraintBaseline_toBaselineOf="@+id/textView18" |
81 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | 78 | app:layout_constraintStart_toEndOf="@+id/textView18" /> |
82 | 79 | ||
83 | <TextView | 80 | <TextView |
84 | android:id="@+id/tvSector" | 81 | android:id="@+id/tvSector" |
85 | android:layout_width="0dp" | 82 | android:layout_width="0dp" |
86 | android:layout_height="wrap_content" | 83 | android:layout_height="wrap_content" |
87 | android:layout_marginStart="5dp" | 84 | android:layout_marginStart="5dp" |
88 | android:layout_marginTop="10dp" | ||
89 | android:text="99" | 85 | android:text="99" |
90 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 86 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
91 | android:textSize="18sp" | 87 | android:textSize="18sp" |
92 | android:textStyle="bold" | 88 | android:textStyle="bold" |
93 | app:layout_constraintBaseline_toBaselineOf="@+id/textView18" | 89 | app:layout_constraintBaseline_toBaselineOf="@+id/textView19" |
94 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | 90 | app:layout_constraintStart_toEndOf="@+id/textView19" /> |
95 | 91 | ||
96 | <TextView | 92 | <TextView |
97 | android:id="@+id/tvCodigo" | 93 | android:id="@+id/tvCodigo" |
98 | android:layout_width="0dp" | 94 | android:layout_width="0dp" |
99 | android:layout_height="wrap_content" | 95 | android:layout_height="wrap_content" |
100 | android:layout_marginStart="5dp" | 96 | android:layout_marginStart="3dp" |
101 | android:layout_marginTop="10dp" | 97 | android:layout_marginTop="10dp" |
102 | android:text="99999" | 98 | android:text="999999" |
103 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 99 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
104 | android:textSize="18sp" | 100 | android:textSize="18sp" |
105 | android:textStyle="bold" | 101 | android:textStyle="bold" |
106 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | 102 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" |
107 | app:layout_constraintStart_toEndOf="@id/tvSector" /> | 103 | app:layout_constraintStart_toEndOf="@id/tvSector" /> |
108 | 104 | ||
109 | 105 | ||
110 | <TextView | 106 | <TextView |
111 | android:id="@+id/textView1" | 107 | android:id="@+id/textView1" |
112 | android:layout_width="0dp" | 108 | android:layout_width="0dp" |
113 | android:layout_height="wrap_content" | 109 | android:layout_height="wrap_content" |
114 | android:layout_marginStart="5dp" | 110 | android:layout_marginStart="5dp" |
115 | android:layout_marginTop="10dp" | 111 | android:layout_marginTop="10dp" |
116 | android:text="Código barras:" | 112 | android:text="barras:" |
117 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 113 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
118 | android:textSize="15sp" | 114 | android:textSize="15sp" |
119 | app:layout_constraintBaseline_toBaselineOf="@+id/tvCodigo" | 115 | app:layout_constraintBaseline_toBaselineOf="@+id/tvCodigo" |
120 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | 116 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> |
121 | 117 | ||
122 | <TextView | 118 | <TextView |
123 | android:id="@+id/tvCodigoBarras" | 119 | android:id="@+id/tvCodigoBarras" |
124 | android:layout_width="wrap_content" | 120 | android:layout_width="wrap_content" |
125 | android:layout_height="wrap_content" | 121 | android:layout_height="wrap_content" |
126 | android:layout_marginStart="5dp" | 122 | android:layout_marginStart="5dp" |
127 | android:text="1234567890123" | 123 | android:text="12346579012345" |
128 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 124 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
129 | android:textSize="18sp" | 125 | android:textSize="18sp" |
130 | android:textStyle="bold" | 126 | android:textStyle="bold" |
131 | app:layout_constraintBaseline_toBaselineOf="@+id/textView1" | 127 | app:layout_constraintBaseline_toBaselineOf="@+id/textView1" |
132 | app:layout_constraintStart_toEndOf="@id/textView1" /> | 128 | app:layout_constraintStart_toEndOf="@id/textView1" /> |
133 | 129 | ||
134 | <TextView | 130 | <TextView |
135 | android:id="@+id/textView2" | 131 | android:id="@+id/textView2" |
136 | android:layout_width="wrap_content" | 132 | android:layout_width="wrap_content" |
137 | android:layout_height="wrap_content" | 133 | android:layout_height="wrap_content" |
138 | android:layout_marginStart="5dp" | 134 | android:layout_marginStart="5dp" |
139 | android:layout_marginTop="10dp" | 135 | android:layout_marginTop="10dp" |
140 | android:text="Código origen:" | 136 | android:text="origen:" |
141 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 137 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
142 | android:textSize="15sp" | 138 | android:textSize="15sp" |
143 | app:layout_constraintStart_toStartOf="parent" | 139 | app:layout_constraintStart_toEndOf="@+id/textView18" |
144 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> | 140 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> |
145 | 141 | ||
146 | 142 | ||
147 | <TextView | 143 | <TextView |
148 | android:id="@+id/tvCodigoOrigen" | 144 | android:id="@+id/tvCodigoOrigen" |
149 | android:layout_width="wrap_content" | 145 | android:layout_width="wrap_content" |
150 | android:layout_height="wrap_content" | 146 | android:layout_height="wrap_content" |
151 | android:layout_marginStart="5dp" | 147 | android:layout_marginStart="5dp" |
152 | android:layout_marginTop="10dp" | 148 | android:layout_marginTop="10dp" |
153 | android:text="9999999999" | 149 | android:text="1234567890123" |
154 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 150 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
155 | android:textSize="18sp" | 151 | android:textSize="18sp" |
156 | android:textStyle="bold" | 152 | android:textStyle="bold" |
157 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | 153 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" |
158 | app:layout_constraintStart_toEndOf="@+id/textView2" | 154 | app:layout_constraintStart_toEndOf="@+id/textView2" |
159 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> | 155 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> |
160 | 156 | ||
161 | <TextView | 157 | <TextView |
162 | android:id="@+id/textView3" | 158 | android:id="@+id/textView9" |
159 | android:layout_width="wrap_content" | ||
160 | android:layout_height="wrap_content" | ||
161 | android:layout_marginTop="10dp" | ||
162 | android:text="Precio:" | ||
163 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
164 | android:textSize="15sp" | ||
165 | app:layout_constraintStart_toStartOf="parent" | ||
166 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | ||
167 | |||
168 | <TextView | ||
169 | android:id="@+id/textView12" | ||
163 | android:layout_width="wrap_content" | 170 | android:layout_width="wrap_content" |
164 | android:layout_height="wrap_content" | 171 | android:layout_height="wrap_content" |
165 | android:layout_marginStart="5dp" | 172 | android:layout_marginStart="5dp" |
166 | android:layout_marginTop="10dp" | 173 | android:layout_marginTop="10dp" |
167 | android:text="Depósito:" | 174 | android:text="venta:" |
168 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 175 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
169 | android:textSize="15sp" | 176 | android:textSize="15sp" |
170 | app:layout_constraintStart_toEndOf="@+id/tvCodigoOrigen" | 177 | app:layout_constraintBaseline_toBaselineOf="@+id/textView9" |
171 | app:layout_constraintTop_toBottomOf="@+id/textView1" /> | 178 | app:layout_constraintStart_toEndOf="@+id/textView18" /> |
172 | 179 | ||
173 | <TextView | 180 | <TextView |
174 | android:id="@+id/tvDeposito" | 181 | android:id="@+id/tvPrecio" |
175 | android:layout_width="wrap_content" | 182 | android:layout_width="wrap_content" |
176 | android:layout_height="wrap_content" | 183 | android:layout_height="wrap_content" |
177 | android:layout_marginStart="5dp" | 184 | android:layout_marginStart="5dp" |
178 | android:text="SI" | 185 | android:layout_marginTop="10dp" |
186 | android:text="99999.99" | ||
179 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 187 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
180 | android:textSize="18sp" | 188 | android:textSize="18sp" |
181 | android:textStyle="bold" | 189 | android:textStyle="bold" |
182 | app:layout_constraintBaseline_toBaselineOf="@+id/textView3" | 190 | app:layout_constraintBaseline_toBaselineOf="@+id/textView12" |
183 | app:layout_constraintStart_toEndOf="@+id/textView3" /> | 191 | app:layout_constraintStart_toEndOf="@+id/textView12" /> |
184 | 192 | ||
185 | <TextView | 193 | <TextView |
186 | android:id="@+id/textView9" | 194 | android:id="@+id/textView8" |
187 | android:layout_width="wrap_content" | 195 | android:layout_width="wrap_content" |
188 | android:layout_height="wrap_content" | 196 | android:layout_height="wrap_content" |
189 | android:layout_marginStart="5dp" | 197 | android:layout_marginStart="5dp" |
190 | android:layout_marginTop="10dp" | 198 | android:layout_marginTop="10dp" |
191 | android:text="Precio:" | 199 | android:text="Costo:" |
192 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 200 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
193 | android:textSize="15sp" | 201 | android:textSize="15sp" |
194 | app:layout_constraintStart_toStartOf="parent" | 202 | app:layout_constraintBaseline_toBaselineOf="@+id/tvPrecio" |
195 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | 203 | app:layout_constraintStart_toEndOf="@+id/tvPrecio" /> |
196 | 204 | ||
197 | <TextView | 205 | <TextView |
198 | android:id="@+id/tvPrecio" | 206 | android:id="@+id/tvCosto" |
199 | android:layout_width="wrap_content" | 207 | android:layout_width="wrap_content" |
200 | android:layout_height="wrap_content" | 208 | android:layout_height="wrap_content" |
201 | android:layout_marginStart="5dp" | 209 | android:layout_marginStart="5dp" |
202 | android:layout_marginTop="10dp" | 210 | android:layout_marginTop="10dp" |
203 | android:text="100.99" | 211 | android:text="9999.99" |
204 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 212 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
205 | android:textSize="18sp" | 213 | android:textSize="18sp" |
206 | android:textStyle="bold" | 214 | android:textStyle="bold" |
207 | app:layout_constraintBaseline_toBaselineOf="@+id/textView9" | 215 | app:layout_constraintBaseline_toBaselineOf="@+id/textView8" |
208 | app:layout_constraintStart_toEndOf="@+id/textView9" /> | 216 | app:layout_constraintStart_toEndOf="@+id/textView8" /> |
209 | 217 | ||
210 | <TextView | 218 | <TextView |
211 | android:id="@+id/textView8" | 219 | android:id="@+id/textView3" |
212 | android:layout_width="wrap_content" | 220 | android:layout_width="wrap_content" |
213 | android:layout_height="wrap_content" | 221 | android:layout_height="wrap_content" |
214 | android:layout_marginStart="5dp" | ||
215 | android:layout_marginTop="10dp" | 222 | android:layout_marginTop="10dp" |
216 | android:text="Costo:" | 223 | android:text="Depósito:" |
217 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 224 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
218 | android:textSize="15sp" | 225 | android:textSize="15sp" |
219 | app:layout_constraintStart_toEndOf="@+id/tvPrecio" | 226 | app:layout_constraintStart_toStartOf="parent" |
220 | app:layout_constraintTop_toBottomOf="@+id/tvCodigoOrigen" /> | 227 | app:layout_constraintTop_toBottomOf="@+id/textView9" /> |
221 | 228 | ||
222 | <TextView | 229 | <TextView |
223 | android:id="@+id/tvCosto" | 230 | android:id="@+id/tvDeposito" |
224 | android:layout_width="wrap_content" | 231 | android:layout_width="wrap_content" |
225 | android:layout_height="wrap_content" | 232 | android:layout_height="wrap_content" |
226 | android:layout_marginStart="5dp" | 233 | android:layout_marginStart="5dp" |
227 | android:layout_marginTop="10dp" | 234 | android:text="Si" |
228 | android:text="22.99" | ||
229 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 235 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
230 | android:textSize="18sp" | 236 | android:textSize="18sp" |
231 | android:textStyle="bold" | 237 | android:textStyle="bold" |
232 | app:layout_constraintBaseline_toBaselineOf="@+id/textView8" | 238 | app:layout_constraintBaseline_toBaselineOf="@+id/textView3" |
233 | app:layout_constraintStart_toEndOf="@+id/textView8" | 239 | app:layout_constraintStart_toEndOf="@+id/textView3" /> |
234 | app:layout_constraintTop_toBottomOf="@+id/tvDeposito" /> | ||
235 | 240 | ||
236 | <TextView | 241 | <TextView |
237 | android:id="@+id/textView5" | 242 | android:id="@+id/textView5" |
238 | android:layout_width="wrap_content" | 243 | android:layout_width="wrap_content" |
239 | android:layout_height="wrap_content" | 244 | android:layout_height="wrap_content" |
240 | android:layout_marginStart="5dp" | ||
241 | android:layout_marginTop="10dp" | 245 | android:layout_marginTop="10dp" |
242 | android:text="Existencia en venta:" | 246 | android:text="Stock:" |
243 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 247 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
244 | android:textSize="15sp" | 248 | android:textSize="15sp" |
245 | app:layout_constraintStart_toStartOf="parent" | 249 | app:layout_constraintStart_toStartOf="parent" |
246 | app:layout_constraintTop_toBottomOf="@+id/textView9" /> | 250 | app:layout_constraintTop_toBottomOf="@+id/textView3" /> |
251 | |||
252 | |||
253 | <TextView | ||
254 | android:id="@+id/textView15" | ||
255 | android:layout_width="wrap_content" | ||
256 | android:layout_height="wrap_content" | ||
257 | android:layout_marginStart="5dp" | ||
258 | android:layout_marginTop="10dp" | ||
259 | android:text="venta:" | ||
260 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
261 | android:textSize="15sp" | ||
262 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" | ||
263 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | ||
247 | 264 | ||
248 | <TextView | 265 | <TextView |
249 | android:id="@+id/tvExiVenta" | 266 | android:id="@+id/tvExiVenta" |
250 | android:layout_width="wrap_content" | 267 | android:layout_width="wrap_content" |
251 | android:layout_height="wrap_content" | 268 | android:layout_height="wrap_content" |
252 | android:layout_marginStart="5dp" | 269 | android:layout_marginStart="5dp" |
253 | android:layout_marginTop="10dp" | 270 | android:layout_marginTop="10dp" |
254 | android:text="100" | 271 | android:text="99999.99" |
255 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 272 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
256 | android:textSize="18sp" | 273 | android:textSize="18sp" |
257 | android:textStyle="bold" | 274 | android:textStyle="bold" |
258 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" | 275 | app:layout_constraintBaseline_toBaselineOf="@+id/textView15" |
259 | app:layout_constraintStart_toEndOf="@+id/textView5" /> | 276 | app:layout_constraintStart_toEndOf="@+id/textView15" /> |
260 | 277 | ||
261 | <TextView | 278 | <TextView |
262 | android:id="@+id/textView7" | 279 | android:id="@+id/textView7" |
263 | android:layout_width="wrap_content" | 280 | android:layout_width="wrap_content" |
264 | android:layout_height="wrap_content" | 281 | android:layout_height="wrap_content" |
265 | android:layout_marginStart="5dp" | 282 | android:layout_marginStart="5dp" |
266 | android:layout_marginTop="10dp" | 283 | android:text="deposito:" |
267 | android:text="Existencia en deposito:" | ||
268 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 284 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
269 | android:textSize="15sp" | 285 | android:textSize="15sp" |
270 | app:layout_constraintStart_toEndOf="@+id/tvExiVenta" | 286 | app:layout_constraintBaseline_toBaselineOf="@+id/tvExiVenta" |
271 | app:layout_constraintTop_toBottomOf="@+id/textView8" /> | 287 | app:layout_constraintStart_toEndOf="@+id/tvExiVenta" /> |
272 | 288 | ||
273 | <TextView | 289 | <TextView |
274 | android:id="@+id/tvExiDeposito" | 290 | android:id="@+id/tvExiDeposito" |
275 | android:layout_width="wrap_content" | 291 | android:layout_width="wrap_content" |
276 | android:layout_height="wrap_content" | 292 | android:layout_height="wrap_content" |
277 | android:layout_marginStart="5dp" | 293 | android:layout_marginStart="5dp" |
278 | android:layout_marginTop="10dp" | 294 | android:layout_marginTop="10dp" |
279 | android:text="777" | 295 | android:text="99999.99" |
280 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 296 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
281 | android:textSize="18sp" | 297 | android:textSize="18sp" |
282 | android:textStyle="bold" | 298 | android:textStyle="bold" |
283 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" | 299 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" |
284 | app:layout_constraintStart_toEndOf="@+id/textView7" | 300 | app:layout_constraintStart_toEndOf="@+id/textView7" |
285 | app:layout_constraintTop_toBottomOf="@+id/tvCosto" /> | 301 | app:layout_constraintTop_toBottomOf="@+id/tvCosto" /> |
286 | 302 | ||
287 | 303 | ||
288 | <TextView | 304 | <TextView |
289 | android:id="@+id/textView10" | 305 | android:id="@+id/textView10" |
290 | android:layout_width="wrap_content" | 306 | android:layout_width="wrap_content" |
291 | android:layout_height="wrap_content" | 307 | android:layout_height="wrap_content" |
292 | android:layout_marginStart="5dp" | 308 | android:layout_marginStart="5dp" |
293 | android:layout_marginTop="10dp" | 309 | android:layout_marginTop="10dp" |
294 | android:text="Unidad de venta:" | 310 | android:text="Unidad de venta:" |
295 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 311 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
296 | android:textSize="15sp" | 312 | android:textSize="15sp" |
297 | app:layout_constraintStart_toStartOf="parent" | 313 | app:layout_constraintBaseline_toBaselineOf="@+id/tvDeposito" |
298 | app:layout_constraintTop_toBottomOf="@+id/tvExiVenta" /> | 314 | app:layout_constraintStart_toEndOf="@+id/tvPrecio" /> |
299 | 315 | ||
300 | <TextView | 316 | <TextView |
301 | android:id="@+id/tvBal" | 317 | android:id="@+id/tvBal" |
302 | android:layout_width="wrap_content" | 318 | android:layout_width="wrap_content" |
303 | android:layout_height="wrap_content" | 319 | android:layout_height="wrap_content" |
304 | android:layout_marginStart="3dp" | 320 | android:layout_marginStart="5dp" |
305 | android:text="CENT. CUBICOS" | 321 | android:text="Unidades" |
306 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 322 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
307 | android:textSize="18sp" | 323 | android:textSize="15sp" |
308 | app:layout_constraintBaseline_toBaselineOf="@+id/textView10" | 324 | app:layout_constraintBaseline_toBaselineOf="@+id/textView10" |
309 | app:layout_constraintStart_toEndOf="@+id/textView10" /> | 325 | app:layout_constraintStart_toEndOf="@+id/textView10" /> |
310 | 326 | ||
311 | 327 | ||
312 | <TextView | 328 | <TextView |
313 | android:id="@+id/textView11" | 329 | android:id="@+id/textView11" |
app/src/main/res/layout/fragment_inventario.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:id="@+id/frameLayout" | 5 | android:id="@+id/frameLayout" |
6 | android:layout_width="match_parent" | 6 | android:layout_width="match_parent" |
7 | android:layout_height="match_parent" | 7 | android:layout_height="match_parent" |
8 | tools:context=".UI.inventario.InventarioFragment"> | 8 | tools:context=".UI.inventario.InventarioFragment"> |
9 | 9 | ||
10 | 10 | ||
11 | <androidx.appcompat.widget.AppCompatTextView | 11 | <androidx.appcompat.widget.AppCompatTextView |
12 | android:id="@+id/tvTitulo" | 12 | android:id="@+id/tvTitulo" |
13 | android:layout_width="match_parent" | 13 | android:layout_width="match_parent" |
14 | android:layout_height="90dp" | 14 | android:layout_height="50dp" |
15 | android:layout_marginStart="8dp" | 15 | android:layout_marginStart="8dp" |
16 | android:layout_marginEnd="8dp" | 16 | android:layout_marginEnd="8dp" |
17 | android:autoSizeMaxTextSize="100sp" | 17 | android:autoSizeMaxTextSize="100sp" |
18 | android:autoSizeMinTextSize="20sp" | 18 | android:autoSizeMinTextSize="20sp" |
19 | android:autoSizeStepGranularity="5sp" | 19 | android:autoSizeStepGranularity="5sp" |
20 | android:autoSizeTextType="uniform" | 20 | android:autoSizeTextType="uniform" |
21 | android:gravity="center" | 21 | android:gravity="center" |
22 | android:lines="1" | 22 | android:lines="1" |
23 | android:text="@string/invTitulo" | 23 | android:text="@string/invTitulo" |
24 | android:textColor="@color/colorAccent" | 24 | android:textColor="@color/colorAccent" |
25 | app:fontFamily="sans-serif-condensed" | 25 | app:fontFamily="sans-serif-condensed" |
26 | app:layout_constraintBottom_toTopOf="@id/guideline2" | 26 | app:layout_constraintBottom_toTopOf="@id/guideline2" |
27 | app:layout_constraintEnd_toEndOf="parent" | 27 | app:layout_constraintEnd_toEndOf="parent" |
28 | app:layout_constraintStart_toStartOf="parent" | 28 | app:layout_constraintStart_toStartOf="parent" |
29 | app:layout_constraintTop_toTopOf="@id/guideline" /> | 29 | app:layout_constraintTop_toTopOf="@id/guideline" /> |
30 | 30 | ||
31 | 31 | ||
32 | <ImageButton | 32 | <ImageButton |
33 | android:id="@+id/ivCamara" | 33 | android:id="@+id/ivCamara" |
34 | android:layout_width="80dp" | 34 | android:layout_width="80dp" |
35 | android:layout_height="80dp" | 35 | android:layout_height="80dp" |
36 | android:layout_marginTop="15dp" | 36 | android:layout_marginTop="15dp" |
37 | android:clickable="true" | 37 | android:clickable="true" |
38 | android:contentDescription="@string/ibBusCB" | 38 | android:contentDescription="@string/ibBusCB" |
39 | android:elevation="5dp" | 39 | android:elevation="5dp" |
40 | android:background="@drawable/boton_redondo" | 40 | android:background="@drawable/boton_redondo" |
41 | android:layout_margin="10dp" | 41 | android:layout_margin="10dp" |
42 | android:focusable="false" | 42 | android:focusable="false" |
43 | android:scaleType="fitEnd" | 43 | android:scaleType="fitEnd" |
44 | app:layout_constraintCircleRadius="40dp" | 44 | app:layout_constraintCircleRadius="40dp" |
45 | android:src="@drawable/codbar" | 45 | android:src="@drawable/codbar" |
46 | app:layout_constraintBottom_toTopOf="@id/guideline3" | 46 | app:layout_constraintBottom_toTopOf="@id/guideline3" |
47 | app:layout_constraintEnd_toStartOf="@+id/etCodigoBarras" | 47 | app:layout_constraintEnd_toStartOf="@+id/etCodigoBarras" |
48 | app:layout_constraintHorizontal_bias="0.0" | 48 | app:layout_constraintHorizontal_bias="0.0" |
49 | app:layout_constraintStart_toStartOf="parent" | 49 | app:layout_constraintStart_toStartOf="parent" |
50 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | 50 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> |
51 | 51 | ||
52 | <EditText | 52 | <EditText |
53 | android:id="@+id/etCodigoBarras" | 53 | android:id="@+id/etCodigoBarras" |
54 | android:layout_width="0dp" | 54 | android:layout_width="0dp" |
55 | android:layout_height="wrap_content" | 55 | android:layout_height="wrap_content" |
56 | android:autofillHints="" | 56 | android:autofillHints="" |
57 | android:clickable="true" | 57 | android:clickable="true" |
58 | android:ems="10" | 58 | android:ems="10" |
59 | android:focusable="true" | 59 | android:focusable="true" |
60 | android:hint="@string/ibBusCB" | 60 | android:hint="@string/ibBusCB" |
61 | android:inputType="textPersonName" | 61 | android:inputType="textPersonName" |
62 | android:lines="1" | 62 | android:lines="1" |
63 | android:textAllCaps="true" | 63 | android:textAllCaps="true" |
64 | android:textSize="20sp" | 64 | android:textSize="20sp" |
65 | app:layout_constraintBottom_toTopOf="@+id/guideline3" | 65 | app:layout_constraintBottom_toTopOf="@+id/guideline3" |
66 | app:layout_constraintEnd_toStartOf="@+id/swSumaUno" | 66 | app:layout_constraintEnd_toStartOf="@+id/swSumaUno" |
67 | app:layout_constraintHorizontal_bias="0.49" | 67 | app:layout_constraintHorizontal_bias="0.49" |
68 | app:layout_constraintHorizontal_chainStyle="packed" | 68 | app:layout_constraintHorizontal_chainStyle="packed" |
69 | app:layout_constraintStart_toEndOf="@+id/ivCamara" | 69 | app:layout_constraintStart_toEndOf="@+id/ivCamara" |
70 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | 70 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> |
71 | 71 | ||
72 | 72 | ||
73 | <Switch | 73 | <Switch |
74 | android:id="@+id/swSumaUno" | 74 | android:id="@+id/swSumaUno" |
75 | android:layout_width="wrap_content" | 75 | android:layout_width="wrap_content" |
76 | android:layout_height="wrap_content" | 76 | android:layout_height="wrap_content" |
77 | android:text="@string/switch_1" | 77 | android:text="@string/switch_1" |
78 | app:layout_constraintBaseline_toBaselineOf="@+id/etCodigoBarras" | 78 | app:layout_constraintBaseline_toBaselineOf="@+id/etCodigoBarras" |
79 | app:layout_constraintEnd_toEndOf="parent" | 79 | app:layout_constraintEnd_toEndOf="parent" |
80 | app:layout_constraintStart_toEndOf="@id/etCodigoBarras" | 80 | app:layout_constraintStart_toEndOf="@id/etCodigoBarras" |
81 | tools:ignore="UseSwitchCompatOrMaterialXml" /> | 81 | tools:ignore="UseSwitchCompatOrMaterialXml" /> |
82 | 82 | ||
83 | <androidx.recyclerview.widget.RecyclerView | 83 | <androidx.recyclerview.widget.RecyclerView |
84 | android:id="@+id/rcInventarios" | 84 | android:id="@+id/rcInventarios" |
85 | android:layout_width="match_parent" | 85 | android:layout_width="match_parent" |
86 | android:layout_height="0dp" | 86 | android:layout_height="0dp" |
87 | android:background="@android:color/darker_gray" | 87 | android:background="@android:color/darker_gray" |
88 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" | 88 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" |
89 | app:layout_constraintEnd_toEndOf="parent" | 89 | app:layout_constraintEnd_toEndOf="parent" |
90 | app:layout_constraintStart_toStartOf="parent" | 90 | app:layout_constraintStart_toStartOf="parent" |
91 | app:layout_constraintTop_toBottomOf="@+id/guideline4" | 91 | app:layout_constraintTop_toBottomOf="@+id/guideline4" |
92 | tools:listitem="@layout/item" /> | 92 | tools:listitem="@layout/item" /> |
93 | 93 | ||
94 | 94 | ||
95 | <Button | 95 | <Button |
96 | android:id="@+id/btnExportarInv" | 96 | android:id="@+id/btnExportarInv" |
97 | android:layout_width="wrap_content" | 97 | android:layout_width="wrap_content" |
98 | android:layout_height="wrap_content" | 98 | android:layout_height="wrap_content" |
99 | android:text="@string/btnExportarInv" | 99 | android:text="@string/btnExportarInv" |
100 | android:textColor="@android:color/white" | 100 | android:textColor="@android:color/white" |
101 | android:padding="10dp" | 101 | android:padding="10dp" |
102 | android:background="@drawable/boton_borde_redondeado" | 102 | android:background="@drawable/boton_borde_redondeado" |
103 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | 103 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" |
104 | app:layout_constraintEnd_toEndOf="parent" | 104 | app:layout_constraintEnd_toEndOf="parent" |
105 | app:layout_constraintHorizontal_chainStyle="spread" | 105 | app:layout_constraintHorizontal_chainStyle="spread" |
106 | app:layout_constraintStart_toEndOf="@+id/btnBorrarInv" | 106 | app:layout_constraintStart_toEndOf="@+id/btnBorrarInv" |
107 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | 107 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> |
108 | 108 | ||
109 | <Button | 109 | <Button |
110 | android:id="@+id/btnBorrarInv" | 110 | android:id="@+id/btnBorrarInv" |
111 | android:layout_width="wrap_content" | 111 | android:layout_width="wrap_content" |
112 | android:layout_height="wrap_content" | 112 | android:layout_height="wrap_content" |
113 | android:text="@string/btnBorrarInv" | 113 | android:text="@string/btnBorrarInv" |
114 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | 114 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" |
115 | app:layout_constraintEnd_toStartOf="@id/btnExportarInv" | 115 | app:layout_constraintEnd_toStartOf="@id/btnExportarInv" |
116 | app:layout_constraintHorizontal_chainStyle="spread" | 116 | app:layout_constraintHorizontal_chainStyle="spread" |
117 | app:layout_constraintStart_toStartOf="parent" | 117 | app:layout_constraintStart_toStartOf="parent" |
118 | android:textColor="@android:color/white" | 118 | android:textColor="@android:color/white" |
119 | android:padding="10dp" | 119 | android:padding="10dp" |
120 | android:background="@drawable/boton_borde_redondeado" | 120 | android:background="@drawable/boton_borde_redondeado" |
121 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | 121 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> |
122 | 122 | ||
123 | <androidx.constraintlayout.widget.Guideline | 123 | <androidx.constraintlayout.widget.Guideline |
124 | android:id="@+id/guideline" | 124 | android:id="@+id/guideline" |
125 | android:layout_width="wrap_content" | 125 | android:layout_width="wrap_content" |
126 | android:layout_height="wrap_content" | 126 | android:layout_height="wrap_content" |
127 | android:orientation="horizontal" | 127 | android:orientation="horizontal" |
128 | app:layout_constraintGuide_percent="0.02" /> | 128 | app:layout_constraintGuide_percent="0.02" /> |
129 | 129 | ||
130 | <androidx.constraintlayout.widget.Guideline | 130 | <androidx.constraintlayout.widget.Guideline |
131 | android:id="@+id/guideline2" | 131 | android:id="@+id/guideline2" |
132 | android:layout_width="wrap_content" | 132 | android:layout_width="wrap_content" |
133 | android:layout_height="wrap_content" | 133 | android:layout_height="wrap_content" |
134 | android:orientation="horizontal" | 134 | android:orientation="horizontal" |
135 | app:layout_constraintGuide_percent="0.12" /> | 135 | app:layout_constraintGuide_percent="0.12029161" /> |
136 | 136 | ||
137 | <androidx.constraintlayout.widget.Guideline | 137 | <androidx.constraintlayout.widget.Guideline |
138 | android:id="@+id/guideline3" | 138 | android:id="@+id/guideline3" |
139 | android:layout_width="wrap_content" | 139 | android:layout_width="wrap_content" |
140 | android:layout_height="wrap_content" | 140 | android:layout_height="wrap_content" |
141 | android:orientation="horizontal" | 141 | android:orientation="horizontal" |
142 | app:layout_constraintGuide_percent="0.29" /> | 142 | app:layout_constraintGuide_percent="0.27" /> |
143 | 143 | ||
144 | <androidx.constraintlayout.widget.Guideline | 144 | <androidx.constraintlayout.widget.Guideline |
145 | android:id="@+id/guideline4" | 145 | android:id="@+id/guideline4" |
146 | android:layout_width="wrap_content" | 146 | android:layout_width="wrap_content" |
147 | android:layout_height="wrap_content" | 147 | android:layout_height="wrap_content" |
148 | android:orientation="horizontal" | 148 | android:orientation="horizontal" |
149 | app:layout_constraintGuide_percent="0.35" /> | 149 | app:layout_constraintGuide_percent="0.32" /> |
150 | 150 | ||
151 | <androidx.constraintlayout.widget.Guideline | 151 | <androidx.constraintlayout.widget.Guideline |
152 | android:id="@+id/guideline5" | 152 | android:id="@+id/guideline5" |
153 | android:layout_width="wrap_content" | 153 | android:layout_width="wrap_content" |
154 | android:layout_height="wrap_content" | 154 | android:layout_height="wrap_content" |
155 | android:orientation="horizontal" | 155 | android:orientation="horizontal" |
156 | app:layout_constraintGuide_percent="0.88" /> | 156 | app:layout_constraintGuide_percent="0.88" /> |
157 | 157 | ||
158 | <androidx.constraintlayout.widget.Guideline | 158 | <androidx.constraintlayout.widget.Guideline |
159 | android:id="@+id/guideline6" | 159 | android:id="@+id/guideline6" |
160 | android:layout_width="wrap_content" | 160 | android:layout_width="wrap_content" |
161 | android:layout_height="wrap_content" | 161 | android:layout_height="wrap_content" |
162 | android:orientation="horizontal" | 162 | android:orientation="horizontal" |
163 | app:layout_constraintGuide_percent="0.97" /> | 163 | app:layout_constraintGuide_percent="0.97" /> |
164 | 164 | ||
165 | 165 | ||
166 | </androidx.constraintlayout.widget.ConstraintLayout> | 166 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/item.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="wrap_content" | 6 | android:layout_height="wrap_content" |
7 | android:layout_margin="5dp" | 7 | android:layout_margin="5dp" |
8 | app:cardCornerRadius="2dp" | 8 | app:cardCornerRadius="15dp" |
9 | app:cardElevation="10dp" | 9 | app:cardElevation="10dp" |
10 | app:contentPadding="5dp" | 10 | app:contentPadding="5dp" |
11 | app:cardPreventCornerOverlap="false"> | 11 | app:cardPreventCornerOverlap="false"> |
12 | 12 | ||
13 | <androidx.constraintlayout.widget.ConstraintLayout | 13 | <androidx.constraintlayout.widget.ConstraintLayout |
14 | android:layout_width="match_parent" | 14 | android:layout_width="match_parent" |
15 | android:layout_height="wrap_content"> | 15 | android:layout_height="wrap_content"> |
16 | 16 | ||
17 | <TextView | 17 | <TextView |
18 | android:id="@+id/textView2" | 18 | android:id="@+id/tvDescripcion" |
19 | android:layout_width="wrap_content" | 19 | android:layout_width="0dp" |
20 | android:layout_height="wrap_content" | 20 | android:layout_height="wrap_content" |
21 | android:layout_marginStart="5dp" | 21 | android:layout_marginStart="3dp" |
22 | android:text="Código:" | 22 | android:maxLines="2" |
23 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 23 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" |
24 | android:textSize="14sp" | 24 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
25 | app:layout_constraintEnd_toStartOf="@+id/tvSector" | 25 | android:textSize="16sp" |
26 | app:layout_constraintHorizontal_bias="0.01" | 26 | android:textStyle="bold" |
27 | app:layout_constraintHorizontal_chainStyle="packed" | ||
28 | app:layout_constraintStart_toStartOf="parent" | 27 | app:layout_constraintStart_toStartOf="parent" |
29 | app:layout_constraintTop_toTopOf="parent" /> | 28 | app:layout_constraintTop_toTopOf="parent" /> |
30 | 29 | ||
30 | <!-- <TextView--> | ||
31 | <!-- android:id="@+id/textView2"--> | ||
32 | <!-- android:layout_width="wrap_content"--> | ||
33 | <!-- android:layout_height="wrap_content"--> | ||
34 | <!-- android:layout_marginStart="5dp"--> | ||
35 | <!-- android:text="Código:"--> | ||
36 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> | ||
37 | <!-- android:textSize="14sp"--> | ||
38 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvSector"--> | ||
39 | <!-- app:layout_constraintHorizontal_bias="0.01"--> | ||
40 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
41 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
42 | <!-- app:layout_constraintTop_toTopOf="parent" />--> | ||
31 | 43 | ||
32 | <TextView | ||
33 | android:id="@+id/tvSector" | ||
34 | android:layout_width="wrap_content" | ||
35 | android:layout_height="match_parent" | ||
36 | android:layout_marginStart="8dp" | ||
37 | android:text="9999" | ||
38 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
39 | android:textColorHint="@android:color/black" | ||
40 | android:textSize="18sp" | ||
41 | android:textStyle="bold" | ||
42 | app:layout_constraintHorizontal_chainStyle="packed" | ||
43 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | ||
44 | app:layout_constraintEnd_toStartOf="@+id/tvCodigo" | ||
45 | app:layout_constraintStart_toEndOf="@+id/textView2" /> | ||
46 | 44 | ||
45 | <!-- <TextView--> | ||
46 | <!-- android:id="@+id/tvSector"--> | ||
47 | <!-- android:layout_width="wrap_content"--> | ||
48 | <!-- android:layout_height="match_parent"--> | ||
49 | <!-- android:layout_marginStart="8dp"--> | ||
50 | <!-- android:text="9999"--> | ||
51 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
52 | <!-- android:textColorHint="@android:color/black"--> | ||
53 | <!-- android:textSize="18sp"--> | ||
54 | <!-- android:textStyle="bold"--> | ||
55 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
56 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView2"--> | ||
57 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvCodigo"--> | ||
58 | <!-- app:layout_constraintStart_toEndOf="@+id/textView2" />--> | ||
47 | 59 | ||
48 | <TextView | 60 | |
49 | android:id="@+id/tvCodigo" | 61 | <!-- <TextView--> |
50 | android:layout_width="wrap_content" | 62 | <!-- android:id="@+id/tvCodigo"--> |
51 | android:layout_height="match_parent" | 63 | <!-- android:layout_width="wrap_content"--> |
52 | android:text="99999999" | 64 | <!-- android:layout_height="match_parent"--> |
53 | android:layout_marginStart="8dp" | 65 | <!-- android:text="99999999"--> |
54 | app:layout_constraintHorizontal_chainStyle="packed" | 66 | <!-- android:layout_marginStart="8dp"--> |
55 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 67 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> |
56 | android:textColorHint="@android:color/black" | 68 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> |
57 | android:textSize="18sp" | 69 | <!-- android:textColorHint="@android:color/black"--> |
58 | android:textStyle="bold" | 70 | <!-- android:textSize="18sp"--> |
59 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | 71 | <!-- android:textStyle="bold"--> |
60 | app:layout_constraintEnd_toStartOf="@+id/textView5" | 72 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/tvSector"--> |
61 | app:layout_constraintStart_toEndOf="@+id/tvSector" /> | 73 | <!-- app:layout_constraintEnd_toStartOf="@+id/textView5"--> |
74 | <!-- app:layout_constraintStart_toEndOf="@+id/tvSector" />--> | ||
62 | 75 | ||
63 | <TextView | 76 | <TextView |
64 | android:id="@+id/textView5" | 77 | android:id="@+id/textView5" |
65 | android:layout_width="wrap_content" | 78 | android:layout_width="wrap_content" |
66 | android:layout_height="wrap_content" | 79 | android:layout_height="wrap_content" |
67 | android:layout_marginStart="12dp" | ||
68 | android:text="Cantidad:" | 80 | android:text="Cantidad:" |
69 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 81 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
70 | android:textSize="18sp" | 82 | android:textSize="14sp" |
71 | app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras" | 83 | android:layout_marginStart="5dp" |
72 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" | 84 | android:layout_marginTop="5dp" |
73 | app:layout_constraintTop_toTopOf="parent" /> | 85 | app:layout_constraintStart_toStartOf="parent" |
86 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
74 | 87 | ||
75 | <TextView | 88 | <TextView |
76 | android:id="@+id/tvCantidad" | 89 | android:id="@+id/tvCantidad" |
77 | android:layout_width="wrap_content" | 90 | android:layout_width="wrap_content" |
78 | android:layout_height="match_parent" | 91 | android:layout_height="match_parent" |
79 | android:layout_margin="5dp" | 92 | android:layout_marginTop="5dp" |
80 | android:text="12345.12" | 93 | android:text="12345.12" |
81 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 94 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
82 | android:textSize="18sp" | 95 | android:textSize="18sp" |
83 | android:textStyle="bold" | 96 | android:textStyle="bold" |
84 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" | 97 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" |
85 | app:layout_constraintEnd_toEndOf="parent" | 98 | |
86 | app:layout_constraintHorizontal_bias="0.0" | 99 | app:layout_constraintStart_toEndOf="@id/textView5" /> |
87 | app:layout_constraintStart_toEndOf="@id/textView5" | ||
88 | app:layout_constraintTop_toTopOf="parent" /> | ||
89 | 100 | ||
90 | <ImageView | 101 | <ImageView |
91 | android:id="@+id/ivPen" | 102 | android:id="@+id/ivPen" |
92 | android:layout_width="30dp" | 103 | android:layout_width="30dp" |
93 | android:layout_height="30dp" | 104 | android:layout_height="30dp" |
105 | android:layout_marginStart="3dp" | ||
94 | android:src="@drawable/pen" | 106 | android:src="@drawable/pen" |
95 | android:visibility="visible" | 107 | android:visibility="visible" |
96 | app:layout_constraintBottom_toTopOf="@+id/tvDescripcion" | ||
97 | app:layout_constraintStart_toEndOf="@+id/tvCantidad" | 108 | app:layout_constraintStart_toEndOf="@+id/tvCantidad" |
98 | app:layout_constraintTop_toTopOf="parent" | 109 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
99 | app:layout_constraintVertical_bias="0.0" /> | ||
100 | 110 | ||
101 | <ImageView | 111 | <ImageView |
102 | android:id="@+id/ivDots" | 112 | android:id="@+id/ivDots" |
103 | android:layout_width="30dp" | 113 | android:layout_width="30dp" |
104 | android:layout_height="30dp" | 114 | android:layout_height="30dp" |
115 | android:layout_marginEnd="3dp" | ||
105 | android:src="@drawable/more" | 116 | android:src="@drawable/more" |
106 | android:visibility="visible" | 117 | android:visibility="visible" |
107 | app:layout_constraintBottom_toTopOf="@+id/tvDescripcion" | ||
108 | app:layout_constraintEnd_toEndOf="parent" | 118 | app:layout_constraintEnd_toEndOf="parent" |
109 | app:layout_constraintTop_toTopOf="parent" | 119 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
110 | app:layout_constraintVertical_bias="0.0" /> | ||
111 | 120 | ||
112 | <TextView | 121 | <!-- <TextView--> |
113 | android:id="@+id/textView85" | 122 | <!-- android:id="@+id/textView85"--> |
114 | android:layout_width="wrap_content" | 123 | <!-- android:layout_width="wrap_content"--> |
115 | android:layout_height="wrap_content" | 124 | <!-- android:layout_height="wrap_content"--> |
116 | android:layout_marginStart="5dp" | 125 | <!-- android:layout_marginStart="5dp"--> |
117 | android:layout_marginTop="8dp" | 126 | <!-- android:layout_marginTop="8dp"--> |
118 | android:text="Desc:" | 127 | <!-- android:text="Desc:"--> |
119 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 128 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> |
120 | android:textSize="14sp" | 129 | <!-- android:textSize="14sp"--> |
121 | app:layout_constraintEnd_toStartOf="@+id/tvDescripcion" | 130 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvDescripcion"--> |
122 | app:layout_constraintHorizontal_bias="0.0" | 131 | <!-- app:layout_constraintHorizontal_bias="0.0"--> |
123 | app:layout_constraintHorizontal_chainStyle="packed" | 132 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> |
124 | app:layout_constraintStart_toStartOf="parent" | 133 | <!-- app:layout_constraintStart_toStartOf="parent"--> |
125 | app:layout_constraintTop_toBottomOf="@id/tvCodigo" /> | 134 | <!-- app:layout_constraintTop_toBottomOf="@id/tvCodigo" />--> |
126 | 135 | ||
127 | <TextView | ||
128 | android:id="@+id/tvDescripcion" | ||
129 | android:layout_width="0dp" | ||
130 | android:layout_height="wrap_content" | ||
131 | android:layout_marginStart="3dp" | ||
132 | android:layout_marginTop="8dp" | ||
133 | android:maxLines="2" | ||
134 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" | ||
135 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
136 | android:textSize="18sp" | ||
137 | android:textStyle="bold" | ||
138 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" | ||
139 | app:layout_constraintEnd_toEndOf="parent" | ||
140 | app:layout_constraintStart_toEndOf="@+id/textView85" | ||
141 | app:layout_constraintTop_toBottomOf="@+id/tvCodigo" /> | ||
142 | 136 | ||
143 | <TextView | 137 | <!-- <TextView--> |
144 | android:id="@+id/tvCodigoBarras" | 138 | <!-- android:id="@+id/tvCodigoBarras"--> |
145 | android:layout_width="match_parent" | 139 | <!-- android:layout_width="match_parent"--> |
146 | android:layout_height="wrap_content" | 140 | <!-- android:layout_height="wrap_content"--> |
app/src/main/res/layout/item_codigo_origen.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
5 | android:layout_height="wrap_content" | 5 | android:layout_height="wrap_content" |
6 | android:layout_margin="5dp" | 6 | android:layout_margin="5dp" |
7 | app:cardCornerRadius="2dp" | 7 | app:cardCornerRadius="15dp" |
8 | app:cardElevation="10dp" | 8 | app:cardElevation="10dp" |
9 | app:contentPadding="5dp" | 9 | app:cardPreventCornerOverlap="false" |
10 | app:cardPreventCornerOverlap="false"> | 10 | app:contentPadding="5dp"> |
11 | 11 | ||
12 | <androidx.constraintlayout.widget.ConstraintLayout | 12 | <androidx.constraintlayout.widget.ConstraintLayout |
13 | android:layout_width="match_parent" | 13 | android:layout_width="match_parent" |
14 | android:layout_height="wrap_content"> | 14 | android:layout_height="wrap_content"> |
15 | 15 | ||
16 | <TextView | 16 | <TextView |
17 | android:id="@+id/textView2" | 17 | android:id="@+id/tvDescripcion" |
18 | android:layout_width="wrap_content" | 18 | android:layout_width="0dp" |
19 | android:layout_height="wrap_content" | 19 | android:layout_height="wrap_content" |
20 | android:layout_marginStart="5dp" | 20 | android:layout_marginStart="5dp" |
21 | android:text="Código:" | 21 | android:maxLines="2" |
22 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 22 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" |
23 | android:textSize="14sp" | 23 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
24 | app:layout_constraintEnd_toStartOf="@+id/tvSector" | 24 | android:textSize="16sp" |
25 | app:layout_constraintHorizontal_bias="0.01" | 25 | android:textStyle="bold" |
26 | app:layout_constraintHorizontal_chainStyle="packed" | 26 | app:layout_constraintEnd_toEndOf="parent" |
27 | app:layout_constraintStart_toStartOf="parent" | 27 | app:layout_constraintStart_toStartOf="parent" |
28 | app:layout_constraintTop_toTopOf="parent" /> | 28 | app:layout_constraintTop_toTopOf="parent" /> |
29 | 29 | ||
30 | 30 | ||
31 | <TextView | 31 | <TextView |
32 | android:id="@+id/tvSector" | 32 | android:id="@+id/tvCantidad" |
33 | android:layout_width="wrap_content" | 33 | android:layout_width="wrap_content" |
34 | android:layout_height="match_parent" | 34 | android:layout_height="match_parent" |
35 | android:layout_marginStart="8dp" | 35 | android:layout_marginStart="5dp" |
36 | android:text="9999" | 36 | android:text="Código Origen:" |
37 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 37 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
38 | android:textColorHint="@android:color/black" | ||
39 | android:textSize="14sp" | 38 | android:textSize="14sp" |
40 | android:textStyle="bold" | 39 | app:layout_constraintStart_toStartOf="parent" |
41 | app:layout_constraintHorizontal_chainStyle="packed" | 40 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
42 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | 41 | |
43 | app:layout_constraintEnd_toStartOf="@+id/tvCodigo" | ||
44 | app:layout_constraintStart_toEndOf="@+id/textView2" /> | ||
45 | <TextView | 42 | <TextView |
46 | android:id="@+id/tvCodigo" | 43 | android:id="@+id/tvCodigoOrigen" |
47 | android:layout_width="wrap_content" | 44 | android:layout_width="wrap_content" |
48 | android:layout_height="match_parent" | 45 | android:layout_height="match_parent" |
49 | android:layout_marginStart="8dp" | 46 | android:maxLines="2" |
50 | android:text="99999999" | 47 | android:text="987654" |
51 | app:layout_constraintHorizontal_chainStyle="packed" | ||
52 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 48 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
53 | android:textColorHint="@android:color/black" | ||
54 | android:textSize="14sp" | 49 | android:textSize="14sp" |
55 | android:textStyle="bold" | 50 | android:textStyle="bold" |
56 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | 51 | android:visibility="visible" |
57 | app:layout_constraintEnd_toStartOf="@+id/textView5" | 52 | app:layout_constraintStart_toEndOf="@+id/tvCantidad" |
58 | app:layout_constraintStart_toEndOf="@+id/tvSector" /> | 53 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
54 | |||
59 | 55 | ||
60 | <TextView | 56 | <TextView |
61 | android:id="@+id/textView5" | 57 | android:id="@+id/textView2" |
62 | android:layout_width="wrap_content" | 58 | android:layout_width="wrap_content" |
63 | android:layout_height="wrap_content" | 59 | android:layout_height="wrap_content" |
64 | android:layout_marginStart="8dp" | 60 | android:layout_marginStart="5dp" |
65 | android:text="Cantidad:" | 61 | android:text="Código DEBO:" |
66 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 62 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
67 | android:textSize="14sp" | 63 | android:textSize="14sp" |
68 | android:visibility="gone" | 64 | app:layout_constraintStart_toEndOf="@+id/tvCodigoOrigen" |
69 | app:layout_constraintTop_toTopOf="parent" | 65 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
70 | app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras" | 66 | |
71 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | ||
72 | 67 | ||
73 | <TextView | 68 | <TextView |
74 | android:id="@+id/tvCantidad" | 69 | android:id="@+id/tvSector" |
75 | android:layout_width="wrap_content" | 70 | android:layout_width="wrap_content" |
76 | android:layout_height="match_parent" | 71 | android:layout_height="match_parent" |
77 | android:layout_marginStart="8dp" | 72 | android:text="9999" |
78 | android:text="Código Origen:" | ||
79 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 73 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
74 | android:textColorHint="@android:color/black" | ||
80 | android:textSize="14sp" | 75 | android:textSize="14sp" |
81 | android:textStyle="bold" | 76 | android:textStyle="bold" |
82 | android:visibility="visible" | 77 | app:layout_constraintStart_toEndOf="@+id/textView2" |
83 | app:layout_constraintEnd_toStartOf="@id/tvCodigoOrigen" | 78 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
84 | app:layout_constraintStart_toEndOf="@id/textView5" | ||
85 | app:layout_constraintTop_toTopOf="parent" /> | ||
86 | 79 | ||
87 | <TextView | 80 | <TextView |
88 | android:id="@+id/tvCodigoOrigen" | 81 | android:id="@+id/tvCodigo" |
89 | android:layout_width="0dp" | 82 | android:layout_width="wrap_content" |
90 | android:layout_height="wrap_content" | 83 | android:layout_height="match_parent" |
91 | android:layout_marginStart="3dp" | 84 | android:layout_marginStart="2dp" |
92 | android:maxLines="2" | 85 | android:text="99999999" |
93 | android:text="" | ||
94 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 86 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
87 | android:textColorHint="@android:color/black" | ||
95 | android:textSize="14sp" | 88 | android:textSize="14sp" |
96 | android:visibility="visible" | ||
97 | android:textStyle="bold" | 89 | android:textStyle="bold" |
98 | app:layout_constraintEnd_toEndOf="parent" | ||
99 | app:layout_constraintStart_toEndOf="@+id/tvCantidad" | ||
100 | app:layout_constraintTop_toTopOf="parent"/> | ||
101 | |||
102 | <ImageView | ||
103 | android:id="@+id/ivHolder" | ||
104 | android:layout_width="30dp" | ||
105 | android:layout_height="30dp" | ||
106 | android:visibility="gone" | ||
107 | android:src="@drawable/more" | ||
108 | app:layout_constraintBottom_toTopOf="@+id/tvDescripcion" | ||
109 | app:layout_constraintEnd_toEndOf="parent" | ||
110 | app:layout_constraintHorizontal_bias="0.968" | ||
111 | app:layout_constraintStart_toEndOf="@+id/tvCodigoBarras" | ||
112 | app:layout_constraintTop_toTopOf="parent" | ||
113 | app:layout_constraintVertical_bias="0.0" /> | ||
114 | |||
115 | <TextView | ||
116 | android:id="@+id/textView85" | ||
117 | android:layout_width="wrap_content" | ||
118 | android:layout_height="wrap_content" | ||
119 | android:layout_marginStart="5dp" | ||
120 | android:layout_marginTop="8dp" | ||
121 | android:text="Desc:" | ||
122 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | ||
123 | android:textSize="14sp" | ||
124 | app:layout_constraintEnd_toStartOf="@+id/tvDescripcion" | ||
125 | app:layout_constraintHorizontal_bias="0.0" | ||
126 | app:layout_constraintHorizontal_chainStyle="packed" | 90 | app:layout_constraintHorizontal_chainStyle="packed" |
127 | app:layout_constraintStart_toStartOf="parent" | 91 | app:layout_constraintStart_toEndOf="@+id/tvSector" |
128 | app:layout_constraintTop_toBottomOf="@id/tvCodigo" /> | 92 | app:layout_constraintTop_toTopOf="@+id/textView2" /> |
129 | 93 | ||
130 | <TextView | 94 | <!-- <TextView--> |
131 | android:id="@+id/tvDescripcion" | 95 | <!-- android:id="@+id/textView5"--> |
132 | android:layout_width="0dp" | 96 | <!-- android:layout_width="wrap_content"--> |
133 | android:layout_height="wrap_content" | 97 | <!-- android:layout_height="wrap_content"--> |
134 | android:layout_marginStart="3dp" | 98 | <!-- android:layout_marginStart="8dp"--> |
135 | android:layout_marginTop="8dp" | 99 | <!-- android:text="Cantidad:"--> |
136 | android:maxLines="2" | 100 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> |
137 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" | 101 | <!-- android:textSize="14sp"--> |
138 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 102 | <!-- android:visibility="gone"--> |
139 | android:textSize="14sp" | 103 | <!-- app:layout_constraintTop_toTopOf="parent"--> |
140 | android:textStyle="bold" | 104 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras"--> |
141 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" | 105 | <!-- app:layout_constraintStart_toEndOf="@+id/tvCodigo" />--> |
142 | app:layout_constraintEnd_toEndOf="parent" | 106 | |
143 | app:layout_constraintStart_toEndOf="@+id/textView85" | 107 | <!-- <ImageView--> |
144 | app:layout_constraintTop_toBottomOf="@+id/tvCodigo" /> | 108 | <!-- android:id="@+id/ivHolder"--> |
109 | <!-- android:layout_width="30dp"--> | ||
110 | <!-- android:layout_height="30dp"--> |
app/src/main/res/layout/item_descripcion.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
5 | android:layout_height="wrap_content" | 5 | android:layout_height="wrap_content" |
6 | android:layout_margin="5dp" | 6 | android:layout_margin="5dp" |
7 | app:cardCornerRadius="2dp" | 7 | app:cardCornerRadius="15dp" |
8 | app:cardElevation="10dp" | 8 | app:cardElevation="10dp" |
9 | app:contentPadding="5dp" | 9 | app:cardPreventCornerOverlap="false" |
10 | app:cardPreventCornerOverlap="false"> | 10 | app:contentPadding="5dp"> |
11 | 11 | ||
12 | <androidx.constraintlayout.widget.ConstraintLayout | 12 | <androidx.constraintlayout.widget.ConstraintLayout |
13 | android:layout_width="match_parent" | 13 | android:layout_width="match_parent" |
14 | android:layout_height="wrap_content"> | 14 | android:layout_height="wrap_content"> |
15 | 15 | ||
16 | <TextView | 16 | <TextView |
17 | android:id="@+id/tvDescripcion" | ||
18 | android:layout_width="0dp" | ||
19 | android:layout_height="wrap_content" | ||
20 | android:layout_marginStart="5dp" | ||
21 | android:maxLines="2" | ||
22 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" | ||
23 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
24 | android:textSize="16sp" | ||
25 | android:textStyle="bold" | ||
26 | app:layout_constraintEnd_toEndOf="parent" | ||
27 | app:layout_constraintStart_toStartOf="parent" | ||
28 | app:layout_constraintTop_toTopOf="parent" /> | ||
29 | |||
30 | <TextView | ||
17 | android:id="@+id/textView2" | 31 | android:id="@+id/textView2" |
18 | android:layout_width="wrap_content" | 32 | android:layout_width="wrap_content" |
19 | android:layout_height="wrap_content" | 33 | android:layout_height="wrap_content" |
20 | android:layout_marginStart="5dp" | 34 | android:layout_marginStart="5dp" |
21 | android:text="Código:" | 35 | android:text="Código DEBO:" |
22 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 36 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
23 | android:textSize="14sp" | 37 | android:textSize="14sp" |
24 | app:layout_constraintEnd_toStartOf="@+id/tvSector" | ||
25 | app:layout_constraintHorizontal_bias="0.01" | ||
26 | app:layout_constraintHorizontal_chainStyle="packed" | 38 | app:layout_constraintHorizontal_chainStyle="packed" |
27 | app:layout_constraintStart_toStartOf="parent" | 39 | app:layout_constraintStart_toStartOf="parent" |
28 | app:layout_constraintTop_toTopOf="parent" /> | 40 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
29 | 41 | ||
30 | 42 | ||
31 | <TextView | 43 | <TextView |
32 | android:id="@+id/tvSector" | 44 | android:id="@+id/tvSector" |
33 | android:layout_width="wrap_content" | 45 | android:layout_width="wrap_content" |
34 | android:layout_height="match_parent" | 46 | android:layout_height="match_parent" |
35 | android:layout_marginStart="8dp" | ||
36 | android:text="9999" | 47 | android:text="9999" |
37 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 48 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
38 | android:textColorHint="@android:color/black" | 49 | android:textColorHint="@android:color/black" |
39 | android:textSize="14sp" | 50 | android:textSize="14sp" |
40 | android:textStyle="bold" | 51 | android:textStyle="bold" |
41 | app:layout_constraintHorizontal_chainStyle="packed" | ||
42 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | 52 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" |
43 | app:layout_constraintEnd_toStartOf="@+id/tvCodigo" | 53 | app:layout_constraintHorizontal_chainStyle="packed" |
44 | app:layout_constraintStart_toEndOf="@+id/textView2" /> | 54 | app:layout_constraintStart_toEndOf="@+id/textView2" |
55 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
56 | |||
45 | <TextView | 57 | <TextView |
46 | android:id="@+id/tvCodigo" | 58 | android:id="@+id/tvCodigo" |
47 | android:layout_width="wrap_content" | 59 | android:layout_width="wrap_content" |
48 | android:layout_height="match_parent" | 60 | android:layout_height="match_parent" |
49 | android:layout_marginStart="8dp" | 61 | android:layout_marginStart="2dp" |
50 | android:text="99999999" | 62 | android:text="99999999" |
51 | app:layout_constraintHorizontal_chainStyle="packed" | ||
52 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 63 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
53 | android:textColorHint="@android:color/black" | 64 | android:textColorHint="@android:color/black" |
54 | android:textSize="14sp" | 65 | android:textSize="14sp" |
55 | android:textStyle="bold" | 66 | android:textStyle="bold" |
56 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | 67 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" |
57 | app:layout_constraintEnd_toStartOf="@+id/textView5" | 68 | app:layout_constraintHorizontal_chainStyle="packed" |
58 | app:layout_constraintStart_toEndOf="@+id/tvSector" /> | 69 | app:layout_constraintStart_toEndOf="@+id/tvSector" |
70 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
59 | 71 | ||
60 | <TextView | 72 | <TextView |
61 | android:id="@+id/textView5" | 73 | android:id="@+id/textView3" |
62 | android:layout_width="wrap_content" | 74 | android:layout_width="wrap_content" |
63 | android:layout_height="wrap_content" | 75 | android:layout_height="wrap_content" |
64 | android:layout_marginStart="8dp" | 76 | android:layout_marginStart="5dp" |
65 | android:text="Cantidad:" | 77 | android:text="Código barras:" |
66 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 78 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
67 | android:textSize="14sp" | 79 | android:textSize="14sp" |
68 | android:visibility="gone" | 80 | app:layout_constraintHorizontal_chainStyle="packed" |
69 | app:layout_constraintTop_toTopOf="parent" | 81 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" |
70 | app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras" | 82 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
71 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | ||
72 | |||
73 | <TextView | ||
74 | android:id="@+id/tvCantidad" | ||
75 | android:layout_width="wrap_content" | ||
76 | android:layout_height="match_parent" | ||
77 | android:layout_marginStart="8dp" | ||
78 | android:text="Código Barras:" | ||
79 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
80 | android:textSize="14sp" | ||
81 | android:textStyle="bold" | ||
82 | android:visibility="visible" | ||
83 | app:layout_constraintEnd_toStartOf="@id/tvCodigoBarras" | ||
84 | app:layout_constraintStart_toEndOf="@id/textView5" | ||
85 | app:layout_constraintTop_toTopOf="parent" /> | ||
86 | 83 | ||
87 | <TextView | 84 | <TextView |
88 | android:id="@+id/tvCodigoBarras" | 85 | android:id="@+id/tvCodigoBarras" |
89 | android:layout_width="0dp" | 86 | android:layout_width="wrap_content" |
90 | android:layout_height="wrap_content" | 87 | android:layout_height="wrap_content" |
91 | android:layout_marginStart="3dp" | 88 | android:layout_marginStart="3dp" |
92 | android:maxLines="2" | 89 | android:maxLines="2" |
93 | android:text="" | 90 | android:text="1234567890123456" |
94 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 91 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
95 | android:textSize="14sp" | 92 | android:textSize="14sp" |
96 | android:visibility="visible" | ||
97 | android:textStyle="bold" | 93 | android:textStyle="bold" |
98 | app:layout_constraintEnd_toEndOf="parent" | 94 | android:visibility="visible" |
99 | app:layout_constraintStart_toEndOf="@+id/tvCantidad" | 95 | app:layout_constraintBaseline_toBaselineOf="@+id/textView3" |
100 | app:layout_constraintTop_toTopOf="parent"/> | 96 | app:layout_constraintStart_toEndOf="@+id/textView3" |
97 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
98 | <!-- <TextView--> | ||
99 | <!-- android:id="@+id/textView5"--> | ||
100 | <!-- android:layout_width="wrap_content"--> | ||
101 | <!-- android:layout_height="wrap_content"--> | ||
102 | <!-- android:layout_marginStart="8dp"--> | ||
103 | <!-- android:text="Cantidad:"--> | ||
104 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> | ||
105 | <!-- android:textSize="14sp"--> | ||
106 | <!-- android:visibility="gone"--> | ||
107 | <!-- app:layout_constraintTop_toTopOf="parent"--> | ||
108 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras"--> | ||
109 | <!-- app:layout_constraintStart_toEndOf="@+id/tvCodigo" />--> | ||
101 | 110 | ||
102 | <ImageView | 111 | <!-- <TextView--> |
103 | android:id="@+id/ivHolder" | 112 | <!-- android:id="@+id/tvCantidad"--> |
104 | android:layout_width="30dp" | 113 | <!-- android:layout_width="wrap_content"--> |
105 | android:layout_height="30dp" | 114 | <!-- android:layout_height="match_parent"--> |
106 | android:visibility="gone" | 115 | <!-- android:layout_marginStart="8dp"--> |
107 | android:src="@drawable/more" | 116 | <!-- android:text="Código Barras:"--> |
108 | app:layout_constraintBottom_toTopOf="@+id/tvDescripcion" | 117 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> |
109 | app:layout_constraintEnd_toEndOf="parent" | 118 | <!-- android:textSize="14sp"--> |
110 | app:layout_constraintHorizontal_bias="0.968" | 119 | <!-- android:textStyle="bold"--> |
111 | app:layout_constraintStart_toEndOf="@+id/tvCodigoBarras" | 120 | <!-- android:visibility="visible"--> |
112 | app:layout_constraintTop_toTopOf="parent" | 121 | <!-- app:layout_constraintEnd_toStartOf="@id/tvCodigoBarras"--> |
113 | app:layout_constraintVertical_bias="0.0" /> | 122 | <!-- app:layout_constraintStart_toEndOf="@id/textView5"--> |
123 | <!-- app:layout_constraintTop_toTopOf="parent" />--> | ||
114 | 124 | ||
115 | <TextView | ||
116 | android:id="@+id/textView85" | ||
117 | android:layout_width="wrap_content" | ||
118 | android:layout_height="wrap_content" |
app/src/main/res/layout/item_principal.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="wrap_content" | 6 | android:layout_height="wrap_content" |
7 | android:layout_margin="5dp" | 7 | android:layout_margin="5dp" |
8 | app:cardCornerRadius="5dp" | 8 | app:cardCornerRadius="15dp" |
9 | app:cardElevation="10dp" | 9 | app:cardElevation="10dp" |
10 | app:cardPreventCornerOverlap="false"> | 10 | app:cardPreventCornerOverlap="false"> |
11 | 11 | ||
12 | <androidx.constraintlayout.widget.ConstraintLayout | 12 | <androidx.constraintlayout.widget.ConstraintLayout |
13 | android:layout_width="match_parent" | 13 | android:layout_width="match_parent" |
14 | android:layout_height="wrap_content" | 14 | android:layout_height="wrap_content" |
15 | android:layout_gravity="center_horizontal|center_vertical" | 15 | android:layout_gravity="center_horizontal|center_vertical" |
16 | android:orientation="vertical"> | 16 | android:orientation="vertical"> |
17 | 17 | ||
18 | <TextView | 18 | <TextView |
19 | android:id="@+id/tvPrincipalinventario" | 19 | android:id="@+id/tvPrincipalinventario" |
20 | android:layout_width="50dp" | 20 | android:layout_width="50dp" |
21 | android:layout_height="50dp" | 21 | android:layout_height="50dp" |
22 | android:layout_margin="10dp" | 22 | android:layout_margin="10dp" |
23 | android:background="@drawable/boton_redondo2" | 23 | android:background="@drawable/boton_redondo2" |
24 | android:gravity="center" | 24 | android:gravity="center" |
25 | android:lines="2" | 25 | android:lines="2" |
26 | android:textColor="@android:color/black" | 26 | android:textColor="@android:color/black" |
27 | android:textSize="@dimen/TitulosMedios" | 27 | android:textSize="@dimen/TitulosMedios" |
28 | android:textStyle="bold" | 28 | android:textStyle="bold" |
29 | app:layout_constraintBottom_toTopOf="@+id/ivFondo" | 29 | app:layout_constraintBottom_toTopOf="@+id/ivFondo" |
30 | app:layout_constraintStart_toStartOf="parent" | 30 | app:layout_constraintStart_toStartOf="parent" |
31 | app:layout_constraintTop_toTopOf="parent" | 31 | app:layout_constraintTop_toTopOf="parent" |
32 | tools:text="99" /> | 32 | tools:text="99" /> |
33 | 33 | ||
34 | <TextView | 34 | <TextView |
35 | android:id="@+id/textView6" | 35 | android:id="@+id/textView6" |
36 | android:layout_width="wrap_content" | 36 | android:layout_width="wrap_content" |
37 | android:layout_height="wrap_content" | 37 | android:layout_height="wrap_content" |
38 | android:layout_marginTop="5dp" | 38 | android:layout_marginTop="5dp" |
39 | android:text="Fecha Inicio" | 39 | android:text="Fecha Inicio" |
40 | android:textSize="15sp" | 40 | android:textSize="15sp" |
41 | android:textStyle="bold" | 41 | android:textStyle="bold" |
42 | app:layout_constraintEnd_toEndOf="parent" | 42 | app:layout_constraintEnd_toEndOf="parent" |
43 | app:layout_constraintHorizontal_bias="0.217" | 43 | app:layout_constraintHorizontal_bias="0.217" |
44 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" | 44 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" |
45 | app:layout_constraintTop_toTopOf="parent" /> | 45 | app:layout_constraintTop_toTopOf="parent" /> |
46 | 46 | ||
47 | <TextView | 47 | <TextView |
48 | android:id="@+id/tvFecha" | 48 | android:id="@+id/tvFecha" |
49 | android:layout_width="wrap_content" | 49 | android:layout_width="wrap_content" |
50 | android:layout_height="wrap_content" | 50 | android:layout_height="wrap_content" |
51 | android:layout_marginStart="5dp" | 51 | android:layout_marginStart="5dp" |
52 | android:text="01/01/2020 12:20:20" | 52 | android:text="01/01/2020 12:20:20" |
53 | android:textSize="15sp" | 53 | android:textSize="15sp" |
54 | android:textStyle="bold" | 54 | android:textStyle="bold" |
55 | app:layout_constraintBaseline_toBaselineOf="@+id/textView6" | 55 | app:layout_constraintBaseline_toBaselineOf="@+id/textView6" |
56 | app:layout_constraintEnd_toEndOf="parent" | 56 | app:layout_constraintEnd_toEndOf="parent" |
57 | app:layout_constraintHorizontal_bias="0.0" | 57 | app:layout_constraintHorizontal_bias="0.0" |
58 | app:layout_constraintStart_toEndOf="@id/textView6" /> | 58 | app:layout_constraintStart_toEndOf="@id/textView6" /> |
59 | 59 | ||
60 | <TextView | 60 | <TextView |
61 | android:id="@+id/textView7" | 61 | android:id="@+id/textView7" |
62 | android:layout_width="wrap_content" | 62 | android:layout_width="wrap_content" |
63 | android:layout_height="wrap_content" | 63 | android:layout_height="wrap_content" |
64 | android:layout_marginTop="4dp" | 64 | android:layout_marginTop="4dp" |
65 | android:text="Art. Contados" | 65 | android:text="Art. Contados" |
66 | android:textSize="15sp" | 66 | android:textSize="15sp" |
67 | android:textStyle="bold" | 67 | android:textStyle="bold" |
68 | app:layout_constraintEnd_toEndOf="parent" | 68 | app:layout_constraintEnd_toEndOf="parent" |
69 | app:layout_constraintHorizontal_bias="0.23" | 69 | app:layout_constraintHorizontal_bias="0.23" |
70 | app:layout_constraintStart_toEndOf="@+id/tvPrincipalinventario" | 70 | app:layout_constraintStart_toEndOf="@+id/tvPrincipalinventario" |
71 | app:layout_constraintTop_toBottomOf="@id/textView6" /> | 71 | app:layout_constraintTop_toBottomOf="@id/textView6" /> |
72 | 72 | ||
73 | <TextView | 73 | <TextView |
74 | android:id="@+id/tvCantContada" | 74 | android:id="@+id/tvCantContada" |
75 | android:layout_width="wrap_content" | 75 | android:layout_width="wrap_content" |
76 | android:layout_height="wrap_content" | 76 | android:layout_height="wrap_content" |
77 | android:layout_marginTop="4dp" | 77 | android:layout_marginTop="4dp" |
78 | android:layout_marginStart="5dp" | 78 | android:layout_marginStart="5dp" |
79 | android:text="002" | 79 | android:text="002" |
80 | android:textSize="15sp" | 80 | android:textSize="15sp" |
81 | android:textStyle="bold" | 81 | android:textStyle="bold" |
82 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" | 82 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" |
83 | app:layout_constraintStart_toEndOf="@+id/textView7" | 83 | app:layout_constraintStart_toEndOf="@+id/textView7" |
84 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" /> | 84 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" /> |
85 | 85 | ||
86 | <TextView | 86 | <TextView |
87 | android:id="@+id/tvDescription" | 87 | android:id="@+id/tvDescription" |
88 | android:layout_width="wrap_content" | 88 | android:layout_width="wrap_content" |
89 | android:layout_height="wrap_content" | 89 | android:layout_height="wrap_content" |
90 | android:text="prueba" | 90 | android:text="prueba" |
91 | app:layout_constraintBottom_toTopOf="@id/ivFondo" | 91 | app:layout_constraintBottom_toTopOf="@id/ivFondo" |
92 | app:layout_constraintEnd_toEndOf="parent" | 92 | app:layout_constraintEnd_toEndOf="parent" |
93 | app:layout_constraintHorizontal_bias="0.489" | 93 | app:layout_constraintHorizontal_bias="0.489" |
94 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" | 94 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" |
95 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" | 95 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" |
96 | app:layout_constraintVertical_bias="1.0" /> | 96 | app:layout_constraintVertical_bias="1.0" /> |
97 | 97 | ||
98 | 98 | ||
99 | <androidx.appcompat.widget.AppCompatImageView | 99 | <androidx.appcompat.widget.AppCompatImageView |
100 | android:id="@+id/ivFondo" | 100 | android:id="@+id/ivFondo" |
101 | android:layout_width="0dp" | 101 | android:layout_width="0dp" |
102 | android:layout_height="10dp" | 102 | android:layout_height="10dp" |
103 | android:background="@android:drawable/progress_horizontal" | 103 | android:background="@android:drawable/progress_horizontal" |
104 | android:elevation="10dp" | 104 | android:elevation="10dp" |
105 | app:layout_constraintBottom_toBottomOf="parent" | 105 | app:layout_constraintBottom_toBottomOf="parent" |
106 | app:layout_constraintCircleRadius="5dp" | 106 | app:layout_constraintCircleRadius="5dp" |
107 | app:layout_constraintEnd_toEndOf="parent" | 107 | app:layout_constraintEnd_toEndOf="parent" |
108 | app:layout_constraintStart_toStartOf="parent" | 108 | app:layout_constraintStart_toStartOf="parent" |
109 | tools:srcCompat="@android:drawable/progress_horizontal" /> | 109 | tools:srcCompat="@android:drawable/progress_horizontal" /> |
110 | </androidx.constraintlayout.widget.ConstraintLayout> | 110 | </androidx.constraintlayout.widget.ConstraintLayout> |
111 | </androidx.cardview.widget.CardView> | 111 | </androidx.cardview.widget.CardView> |
112 | 112 |
app/src/main/res/layout/item_servidores.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="wrap_content" | 6 | android:layout_height="wrap_content" |
7 | android:layout_margin="5dp" | 7 | android:layout_margin="5dp" |
8 | app:cardCornerRadius="2dp" | 8 | app:cardCornerRadius="15dp" |
9 | app:cardElevation="10dp" | 9 | app:cardElevation="10dp" |
10 | app:contentPadding="5dp" | 10 | app:contentPadding="5dp" |
11 | app:cardPreventCornerOverlap="false"> | 11 | app:cardPreventCornerOverlap="false"> |
12 | 12 | ||
13 | <androidx.constraintlayout.widget.ConstraintLayout | 13 | <androidx.constraintlayout.widget.ConstraintLayout |
14 | android:layout_width="match_parent" | 14 | android:layout_width="match_parent" |
15 | android:layout_height="wrap_content"> | 15 | android:layout_height="wrap_content"> |
16 | 16 | ||
17 | <TextView | 17 | <TextView |
18 | android:id="@+id/textView2" | 18 | android:id="@+id/textView2" |
19 | android:layout_width="wrap_content" | 19 | android:layout_width="wrap_content" |
20 | android:layout_height="wrap_content" | 20 | android:layout_height="wrap_content" |
21 | android:layout_marginStart="5dp" | 21 | android:layout_marginStart="5dp" |
22 | android:text="Descripción:" | 22 | android:text="Descripción:" |
23 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 23 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
24 | android:textSize="14sp" | 24 | android:textSize="14sp" |
25 | app:layout_constraintEnd_toStartOf="@+id/tvCodigo" | 25 | app:layout_constraintEnd_toStartOf="@+id/tvCodigo" |
26 | app:layout_constraintHorizontal_bias="0.01" | 26 | app:layout_constraintHorizontal_bias="0.01" |
27 | app:layout_constraintHorizontal_chainStyle="packed" | 27 | app:layout_constraintHorizontal_chainStyle="packed" |
28 | app:layout_constraintStart_toStartOf="parent" | 28 | app:layout_constraintStart_toStartOf="parent" |
29 | app:layout_constraintTop_toTopOf="parent" /> | 29 | app:layout_constraintTop_toTopOf="parent" /> |
30 | 30 | ||
31 | <TextView | 31 | <TextView |
32 | android:id="@+id/tvDescServidor" | 32 | android:id="@+id/tvDescServidor" |
33 | android:layout_width="0dp" | 33 | android:layout_width="0dp" |
34 | android:layout_height="match_parent" | 34 | android:layout_height="match_parent" |
35 | android:layout_marginStart="8dp" | 35 | android:layout_marginStart="8dp" |
36 | android:text="Laboratorio Foca 1" | 36 | android:text="Laboratorio Foca 1" |
37 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 37 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
38 | android:textColorHint="@android:color/black" | 38 | android:textColorHint="@android:color/black" |
39 | android:textSize="14sp" | 39 | android:textSize="14sp" |
40 | android:textStyle="bold" | 40 | android:textStyle="bold" |
41 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | 41 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" |
42 | app:layout_constraintEnd_toEndOf="parent" | 42 | app:layout_constraintEnd_toEndOf="parent" |
43 | app:layout_constraintStart_toEndOf="@+id/textView2" /> | 43 | app:layout_constraintStart_toEndOf="@+id/textView2" /> |
44 | 44 | ||
45 | <TextView | 45 | <TextView |
46 | android:id="@+id/textView85" | 46 | android:id="@+id/textView85" |
47 | android:layout_width="wrap_content" | 47 | android:layout_width="wrap_content" |
48 | android:layout_height="wrap_content" | 48 | android:layout_height="wrap_content" |
49 | android:layout_marginStart="5dp" | 49 | android:layout_marginStart="5dp" |
50 | android:layout_marginTop="8dp" | 50 | android:layout_marginTop="8dp" |
51 | android:text="Dirección:" | 51 | android:text="Dirección:" |
52 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 52 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
53 | android:textSize="14sp" | 53 | android:textSize="14sp" |
54 | app:layout_constraintStart_toStartOf="parent" | 54 | app:layout_constraintStart_toStartOf="parent" |
55 | app:layout_constraintTop_toBottomOf="@id/tvDescServidor" /> | 55 | app:layout_constraintTop_toBottomOf="@id/tvDescServidor" /> |
56 | 56 | ||
57 | <TextView | 57 | <TextView |
58 | android:id="@+id/tvDireccionServidor" | 58 | android:id="@+id/tvDireccionServidor" |
59 | android:layout_width="wrap_content" | 59 | android:layout_width="wrap_content" |
60 | android:layout_height="wrap_content" | 60 | android:layout_height="wrap_content" |
61 | android:layout_marginStart="5dp" | 61 | android:layout_marginStart="5dp" |
62 | android:text="http://192.168.0.205" | 62 | android:text="http://192.168.0.205" |
63 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 63 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
64 | android:textColorHint="@android:color/black" | 64 | android:textColorHint="@android:color/black" |
65 | android:textSize="14sp" | 65 | android:textSize="14sp" |
66 | android:textStyle="bold" | 66 | android:textStyle="bold" |
67 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" | 67 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" |
68 | app:layout_constraintStart_toEndOf="@+id/textView85" /> | 68 | app:layout_constraintStart_toEndOf="@+id/textView85" /> |
69 | 69 | ||
70 | <TextView | 70 | <TextView |
71 | android:id="@+id/textView86" | 71 | android:id="@+id/textView86" |
72 | android:layout_width="wrap_content" | 72 | android:layout_width="wrap_content" |
73 | android:layout_height="wrap_content" | 73 | android:layout_height="wrap_content" |
74 | android:layout_marginTop="8dp" | 74 | android:layout_marginTop="8dp" |
75 | android:layout_marginStart="10dp" | 75 | android:layout_marginStart="10dp" |
76 | android:text="Puerto:" | 76 | android:text="Puerto:" |
77 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 77 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
78 | android:textSize="14sp" | 78 | android:textSize="14sp" |
79 | app:layout_constraintHorizontal_chainStyle="packed" | 79 | app:layout_constraintHorizontal_chainStyle="packed" |
80 | app:layout_constraintStart_toEndOf="@+id/tvDireccionServidor" | 80 | app:layout_constraintStart_toEndOf="@+id/tvDireccionServidor" |
81 | app:layout_constraintTop_toBottomOf="@id/tvDescServidor" /> | 81 | app:layout_constraintTop_toBottomOf="@id/tvDescServidor" /> |
82 | 82 | ||
83 | <TextView | 83 | <TextView |
84 | android:id="@+id/tvPuertoServidor" | 84 | android:id="@+id/tvPuertoServidor" |
85 | android:layout_width="wrap_content" | 85 | android:layout_width="wrap_content" |
86 | android:layout_height="wrap_content" | 86 | android:layout_height="wrap_content" |
87 | android:layout_marginTop="8dp" | 87 | android:layout_marginTop="8dp" |
88 | android:layout_marginStart="5dp" | 88 | android:layout_marginStart="5dp" |
89 | android:text="" | 89 | android:text="" |
90 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 90 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
91 | android:textColorHint="@android:color/black" | 91 | android:textColorHint="@android:color/black" |
92 | android:textSize="14sp" | 92 | android:textSize="14sp" |
93 | android:textStyle="bold" | 93 | android:textStyle="bold" |
94 | app:layout_constraintStart_toEndOf="@+id/textView86" | 94 | app:layout_constraintStart_toEndOf="@+id/textView86" |
95 | app:layout_constraintTop_toBottomOf="@+id/tvDescServidor" /> | 95 | app:layout_constraintTop_toBottomOf="@+id/tvDescServidor" /> |
96 | </androidx.constraintlayout.widget.ConstraintLayout> | 96 | </androidx.constraintlayout.widget.ConstraintLayout> |
97 | 97 | ||
98 | </androidx.cardview.widget.CardView> | 98 | </androidx.cardview.widget.CardView> |
app/src/main/res/navigation/mobile_navigation.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <navigation xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <navigation xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:id="@+id/mobile_navigation" | 5 | android:id="@+id/mobile_navigation" |
6 | app:startDestination="@id/mainFragment2"> | 6 | app:startDestination="@id/mainFragment2"> |
7 | 7 | ||
8 | <activity | 8 | <activity |
9 | android:id="@+id/mainActivity" | 9 | android:id="@+id/mainActivity" |
10 | android:name="com.focasoftware.deboinventariov20.UI.MainActivity" | 10 | android:name="com.focasoftware.deboinventariov20.UI.MainActivity" |
11 | android:label="app_bar_main" | 11 | android:label="app_bar_main" |
12 | tools:layout="@layout/app_bar_main" /> | 12 | tools:layout="@layout/app_bar_main" /> |
13 | 13 | ||
14 | <fragment | 14 | <fragment |
15 | android:id="@+id/mainFragment2" | 15 | android:id="@+id/mainFragment2" |
16 | android:name="com.focasoftware.deboinventariov20.UI.main.MainFragment" | 16 | android:name="com.focasoftware.deboinventariov20.UI.main.MainFragment" |
17 | android:label="Principal" | 17 | android:label="Principal" |
18 | tools:layout="@layout/fragment_main" > | 18 | tools:layout="@layout/fragment_main" > |
19 | <action | 19 | <action |
20 | android:id="@+id/action_mainFragment2_to_configuracionFragment" | 20 | android:id="@+id/action_mainFragment2_to_configuracionFragment" |
21 | app:destination="@id/configuracionFragment" | 21 | app:destination="@id/configuracionFragment" |
22 | app:popEnterAnim="@anim/slide_in_left" | 22 | app:popEnterAnim="@anim/slide_in_left" |
23 | app:popExitAnim="@anim/slide_out_right" | 23 | app:popExitAnim="@anim/slide_out_right" |
24 | app:enterAnim="@anim/slide_in_right" | 24 | app:enterAnim="@anim/slide_in_right" |
25 | app:exitAnim="@anim/slide_out_left" /> | 25 | app:exitAnim="@anim/slide_out_left" /> |
26 | <action | 26 | <action |
27 | android:id="@+id/action_mainFragment2_to_actuaMaestrosFragment" | 27 | android:id="@+id/action_mainFragment2_to_actuaMaestrosFragment" |
28 | app:destination="@id/actuaMaestrosFragment" | 28 | app:destination="@id/actuaMaestrosFragment" |
29 | app:popEnterAnim="@anim/slide_in_left" | 29 | app:popEnterAnim="@anim/slide_in_left" |
30 | app:popExitAnim="@anim/slide_out_right" | 30 | app:popExitAnim="@anim/slide_out_right" |
31 | app:enterAnim="@anim/slide_in_right" | 31 | app:enterAnim="@anim/slide_in_right" |
32 | app:exitAnim="@anim/slide_out_left" /> | 32 | app:exitAnim="@anim/slide_out_left" /> |
33 | <action | 33 | <action |
34 | android:id="@+id/action_mainFragment2_to_inventarioFragment" | 34 | android:id="@+id/action_mainFragment2_to_inventarioFragment" |
35 | app:destination="@id/inventarioFragment" | 35 | app:destination="@id/inventarioFragment" |
36 | app:popEnterAnim="@anim/slide_in_left" | 36 | app:popEnterAnim="@anim/slide_in_left" |
37 | app:popExitAnim="@anim/slide_out_right" | 37 | app:popExitAnim="@anim/slide_out_right" |
38 | app:enterAnim="@anim/slide_in_right" | 38 | app:enterAnim="@anim/slide_in_right" |
39 | app:exitAnim="@anim/slide_out_left" /> | 39 | app:exitAnim="@anim/slide_out_left" /> |
40 | </fragment> | 40 | </fragment> |
41 | 41 | ||
42 | <fragment | 42 | <fragment |
43 | android:id="@+id/actuaMaestrosFragment" | 43 | android:id="@+id/actuaMaestrosFragment" |
44 | android:name="com.focasoftware.deboinventariov20.UI.actualizacionMaestros.ActuaMaestrosFragment" | 44 | android:name="com.focasoftware.deboinventariov20.UI.actualizacionMaestros.ActuaMaestrosFragment" |
45 | android:label="Importaciones Varias" | 45 | android:label="Importaciones Varias" |
46 | tools:layout="@layout/fragment_actua_maestros" /> | 46 | tools:layout="@layout/fragment_actua_maestros" /> |
47 | 47 | ||
48 | 48 | ||
49 | <fragment | 49 | <fragment |
50 | android:id="@+id/inventarioFragment" | 50 | android:id="@+id/inventarioFragment" |
51 | android:name="com.focasoftware.deboinventariov20.UI.inventario.InventarioFragment" | 51 | android:name="com.focasoftware.deboinventariov20.UI.inventario.InventarioFragment" |
52 | android:label="Inventario Dinamico" | 52 | android:label="Inventario Dinamico" |
53 | tools:layout="@layout/fragment_inventario" > | 53 | tools:layout="@layout/fragment_inventario" > |
54 | <action | 54 | <action |
55 | android:id="@+id/action_inventarioFragment_to_descripcionFragment" | 55 | android:id="@+id/action_inventarioFragment_to_descripcionFragment" |
56 | app:destination="@id/descripcionFragment" | 56 | app:destination="@id/descripcionFragment" |
57 | app:popEnterAnim="@anim/slide_in_left" | 57 | app:popEnterAnim="@anim/slide_in_left" |
58 | app:popExitAnim="@anim/slide_out_right" | 58 | app:popExitAnim="@anim/slide_out_right" |
59 | app:enterAnim="@anim/slide_in_right" | 59 | app:enterAnim="@anim/slide_in_right" |
60 | app:exitAnim="@anim/slide_out_left" | 60 | app:exitAnim="@anim/slide_out_left" |
61 | /> | 61 | /> |
62 | <action | 62 | <action |
63 | android:id="@+id/action_inventarioFragment_to_mainFragment2" | 63 | android:id="@+id/action_inventarioFragment_to_mainFragment2" |
64 | app:destination="@id/mainFragment2" | 64 | app:destination="@id/mainFragment2" |
65 | app:popEnterAnim="@anim/slide_in_left" | 65 | app:popEnterAnim="@anim/slide_in_left" |
66 | app:popExitAnim="@anim/slide_out_right" | 66 | app:popExitAnim="@anim/slide_out_right" |
67 | app:enterAnim="@anim/slide_in_right" | 67 | app:enterAnim="@anim/slide_in_right" |
68 | app:exitAnim="@anim/slide_out_left"/> | 68 | app:exitAnim="@anim/slide_out_left"/> |
69 | <action | 69 | <action |
70 | android:id="@+id/action_inventarioFragment_to_detalleArtFragment" | 70 | android:id="@+id/action_inventarioFragment_to_detalleArtFragment" |
71 | app:destination="@id/detalleArtFragment" /> | 71 | app:destination="@id/detalleArtFragment" /> |
72 | <action | 72 | <action |
73 | android:id="@+id/action_inventarioFragment_to_codigoOriFragment" | 73 | android:id="@+id/action_inventarioFragment_to_codigoOriFragment" |
74 | app:destination="@id/codigoOriFragment" /> | 74 | app:destination="@id/codigoOriFragment" /> |
75 | </fragment> | 75 | </fragment> |
76 | 76 | ||
77 | <fragment | 77 | <fragment |
78 | android:id="@+id/descripcionFragment" | 78 | android:id="@+id/descripcionFragment" |
79 | android:name="com.focasoftware.deboinventariov20.UI.descripcionFragment.DescripcionFragment" | 79 | android:name="com.focasoftware.deboinventariov20.UI.descripcionFragment.DescripcionFragment" |
80 | android:label="Busqueda por Descripción"> | 80 | android:label="Busqueda por Descripción"> |
81 | <action | 81 | <action |
82 | android:id="@+id/action_descripcionFragment_to_inventarioFragment" | 82 | android:id="@+id/action_descripcionFragment_to_inventarioFragment" |
83 | app:destination="@id/inventarioFragment" | 83 | app:destination="@id/inventarioFragment" |
84 | app:enterAnim="@anim/slide_in_right" | 84 | app:enterAnim="@anim/slide_in_right" |
85 | app:exitAnim="@anim/slide_out_left" | 85 | app:exitAnim="@anim/slide_out_left" |
86 | app:popEnterAnim="@anim/slide_in_left" | 86 | app:popEnterAnim="@anim/slide_in_left" |
87 | app:popExitAnim="@anim/slide_out_right" /> | 87 | app:popExitAnim="@anim/slide_out_right" /> |
88 | </fragment> | 88 | </fragment> |
89 | 89 | ||
90 | <fragment | 90 | <fragment |
91 | android:id="@+id/detalleArtFragment" | 91 | android:id="@+id/detalleArtFragment" |
92 | android:name="com.focasoftware.deboinventariov20.UI.detalleProducto.DetalleArtFragment" | 92 | android:name="com.focasoftware.deboinventariov20.UI.detalleProducto.DetalleArtFragment" |
93 | android:label="Detalle Articulo" | 93 | android:label="Información Artículo" |
94 | tools:layout="@layout/fragment_detalle_art"> | 94 | tools:layout="@layout/fragment_detalle_art"> |
95 | <action | 95 | <action |
96 | android:id="@+id/action_detalleArtFragment_to_inventarioFragment" | 96 | android:id="@+id/action_detalleArtFragment_to_inventarioFragment" |
97 | app:destination="@id/inventarioFragment" /> | 97 | app:destination="@id/inventarioFragment" /> |
98 | </fragment> | 98 | </fragment> |
99 | <fragment | 99 | <fragment |
100 | android:id="@+id/configuracionFragment" | 100 | android:id="@+id/configuracionFragment" |
101 | android:name="com.focasoftware.deboinventariov20.UI.configuracion.ConfiguracionFragment" | 101 | android:name="com.focasoftware.deboinventariov20.UI.configuracion.ConfiguracionFragment" |
102 | android:label="Configuraciones" | 102 | android:label="Configuraciones" |
103 | tools:layout="@layout/fragment_configuracion" > | 103 | tools:layout="@layout/fragment_configuracion" > |
104 | <action | 104 | <action |
105 | android:id="@+id/action_configuracionFragment_to_servidoresFragment" | 105 | android:id="@+id/action_configuracionFragment_to_servidoresFragment" |
106 | app:destination="@id/servidoresFragment" | 106 | app:destination="@id/servidoresFragment" |
107 | app:popEnterAnim="@anim/slide_in_left" | 107 | app:popEnterAnim="@anim/slide_in_left" |
108 | app:popExitAnim="@anim/slide_out_right" | 108 | app:popExitAnim="@anim/slide_out_right" |
109 | app:enterAnim="@anim/slide_in_right" | 109 | app:enterAnim="@anim/slide_in_right" |
110 | app:exitAnim="@anim/slide_out_left" /> | 110 | app:exitAnim="@anim/slide_out_left" /> |
111 | <action | 111 | <action |
112 | android:id="@+id/action_configuracionFragment_to_mainFragment2" | 112 | android:id="@+id/action_configuracionFragment_to_mainFragment2" |
113 | app:destination="@id/mainFragment2" | 113 | app:destination="@id/mainFragment2" |
114 | app:popUpTo="@id/configuracionFragment" | 114 | app:popUpTo="@id/configuracionFragment" |
115 | app:popUpToInclusive="false" /> | 115 | app:popUpToInclusive="false" /> |
116 | </fragment> | 116 | </fragment> |
117 | 117 | ||
118 | <fragment | 118 | <fragment |
119 | android:id="@+id/servidoresFragment" | 119 | android:id="@+id/servidoresFragment" |
120 | android:name="com.focasoftware.deboinventariov20.UI.servidores.ServidoresFragment" | 120 | android:name="com.focasoftware.deboinventariov20.UI.servidores.ServidoresFragment" |
121 | android:label="Alta Servidores" | 121 | android:label="Alta Servidores" |
122 | tools:layout="@layout/fragment_servidores"> | 122 | tools:layout="@layout/fragment_servidores"> |
123 | <action | 123 | <action |
124 | android:id="@+id/action_servidoresFragment_to_configuracionFragment" | 124 | android:id="@+id/action_servidoresFragment_to_configuracionFragment" |
125 | app:destination="@id/configuracionFragment" | 125 | app:destination="@id/configuracionFragment" |
126 | app:popUpTo="@id/servidoresFragment" | 126 | app:popUpTo="@id/servidoresFragment" |
127 | app:popUpToInclusive="false" /> | 127 | app:popUpToInclusive="false" /> |
128 | </fragment> | 128 | </fragment> |
129 | <fragment | 129 | <fragment |
130 | android:id="@+id/codigoOriFragment" | 130 | android:id="@+id/codigoOriFragment" |
131 | android:name="com.focasoftware.deboinventariov20.UI.descripCorigenFragment.CodigoOriFragment" | 131 | android:name="com.focasoftware.deboinventariov20.UI.descripCorigenFragment.CodigoOriFragment" |
132 | android:label="Busqueda por Código de Origen"> | 132 | android:label="Busqueda por Código de Origen"> |
133 | <action | 133 | <action |
134 | android:id="@+id/action_codigoOriFragment_to_inventarioFragment" | 134 | android:id="@+id/action_codigoOriFragment_to_inventarioFragment" |
135 | app:destination="@id/inventarioFragment" /> | 135 | app:destination="@id/inventarioFragment" /> |
136 | </fragment> | 136 | </fragment> |
137 | </navigation> | 137 | </navigation> |
138 | 138 |