Commit 880347544ec163fb7af7b6afb0025f6bcabb1dd5
1 parent
864e76ea40
Exists in
master
22102020 0600
Showing
22 changed files
with
353 additions
and
288 deletions
Show diff stats
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.Context | 4 | import android.content.Context |
5 | import android.content.Intent | 5 | import android.content.Intent |
6 | import android.content.SharedPreferences | 6 | import android.content.SharedPreferences |
7 | import android.os.Bundle | 7 | import android.os.Bundle |
8 | import com.focasoftware.deboinventariov20.R | 8 | import com.focasoftware.deboinventariov20.R |
9 | 9 | ||
10 | private lateinit var sharedPreferences: SharedPreferences | 10 | private lateinit var sharedPreferences: SharedPreferences |
11 | 11 | ||
12 | class SplashActivity : Activity() { | 12 | class SplashActivity : Activity() { |
13 | 13 | ||
14 | override fun onCreate(savedInstanceState: Bundle?) { | 14 | override fun onCreate(savedInstanceState: Bundle?) { |
15 | super.onCreate(savedInstanceState) | 15 | super.onCreate(savedInstanceState) |
16 | setContentView(R.layout.activity_splash) | 16 | setContentView(R.layout.activity_splash) |
17 | 17 | ||
18 | sharedPreferences = baseContext.getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 18 | sharedPreferences = baseContext.getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
19 | val editor = sharedPreferences.edit() | 19 | val editor = sharedPreferences.edit() |
20 | editor?.putString("inicio", "inicio") | 20 | editor?.putString("inicio", "inicio") |
21 | editor?.apply() | 21 | editor?.apply() |
22 | editor.commit() | 22 | editor.commit() |
23 | val bac = object : Thread() { | 23 | val bac = object : Thread() { |
24 | override fun run() { | 24 | override fun run() { |
25 | try { | 25 | try { |
26 | sleep(3000) | ||
27 | val intent = Intent(baseContext, MainActivity::class.java) | 26 | val intent = Intent(baseContext, MainActivity::class.java) |
28 | startActivity(intent) | 27 | startActivity(intent) |
29 | finish() | 28 | finish() |
30 | } catch (e: Exception) { | 29 | } catch (e: Exception) { |
31 | e.printStackTrace() | 30 | e.printStackTrace() |
32 | } | 31 | } |
33 | } | 32 | } |
34 | } | 33 | } |
35 | bac.start() | 34 | bac.start() |
36 | 35 | ||
37 | } | 36 | } |
38 | } | 37 | } |
39 | 38 |
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.os.SystemClock | ||
4 | import android.view.LayoutInflater | 5 | import android.view.LayoutInflater |
5 | import android.view.View | 6 | import android.view.View |
6 | import android.view.ViewGroup | 7 | import android.view.ViewGroup |
7 | import android.widget.Button | 8 | import android.widget.* |
8 | import android.widget.RadioButton | ||
9 | import android.widget.Toast | ||
10 | import androidx.fragment.app.Fragment | 9 | import androidx.fragment.app.Fragment |
11 | import androidx.navigation.NavController | 10 | import androidx.navigation.NavController |
12 | import androidx.navigation.Navigation | 11 | import androidx.navigation.Navigation |
13 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 12 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
14 | import com.focasoftware.deboinventariov20.Model.* | 13 | import com.focasoftware.deboinventariov20.Model.* |
15 | import com.focasoftware.deboinventariov20.R | 14 | import com.focasoftware.deboinventariov20.R |
16 | import com.focasoftware.deboinventariov20.UI.MainActivity | 15 | import com.focasoftware.deboinventariov20.UI.MainActivity |
17 | import com.focasoftware.deboinventariov20.UI.Utils.NoServerConf | 16 | import com.focasoftware.deboinventariov20.UI.Utils.NoServerConf |
18 | import com.focasoftware.deboinventariov20.UI.Utils.ServerNoConf | 17 | import com.focasoftware.deboinventariov20.UI.Utils.ServerNoConf |
19 | import com.focasoftware.deboinventariov20.UI.Utils.fetchServerPreOne | 18 | import com.focasoftware.deboinventariov20.UI.Utils.fetchServerPreOne |
20 | import kotlinx.android.synthetic.main.fragment_actua_maestros.* | 19 | import kotlinx.android.synthetic.main.fragment_actua_maestros.* |
21 | import kotlinx.coroutines.* | 20 | import kotlinx.coroutines.* |
22 | import kotlinx.coroutines.Dispatchers.IO | 21 | import kotlinx.coroutines.Dispatchers.IO |
23 | import kotlinx.coroutines.Dispatchers.Main | 22 | import kotlinx.coroutines.Dispatchers.Main |
24 | import retrofit2.Call | 23 | import retrofit2.Call |
25 | import retrofit2.Callback | 24 | import retrofit2.Callback |
26 | import retrofit2.Response | 25 | import retrofit2.Response |
27 | import java.net.SocketTimeoutException | 26 | import java.net.SocketTimeoutException |
28 | 27 | ||
29 | 28 | ||
30 | private var serverPre: ServeInv? = null | 29 | private var serverPre: ServeInv? = null |
31 | private lateinit var navController: NavController | 30 | private lateinit var navController: NavController |
32 | |||
33 | |||
34 | class ActuaMaestrosFragment : Fragment() { | 31 | class ActuaMaestrosFragment : Fragment() { |
35 | private val job: Job = Job() | 32 | private val job: Job = Job() |
36 | private val fragmentScopeAM = CoroutineScope(IO + job) | 33 | private val fragmentScopeAM = CoroutineScope(IO + job) |
34 | private lateinit var countriesList:TextView | ||
35 | private lateinit var loading_view:ProgressBar | ||
37 | 36 | ||
38 | override fun onCreate(savedInstanceState: Bundle?) { | 37 | override fun onCreate(savedInstanceState: Bundle?) { |
39 | super.onCreate(savedInstanceState) | 38 | super.onCreate(savedInstanceState) |
40 | |||
41 | // val servidor = urlBajada((activity as MainActivity)) | ||
42 | // if (servidor != "") { | ||
43 | // tvServerConectado.text = "Conectado al servidor: $servidor" | ||
44 | // } | ||
45 | } | 39 | } |
46 | 40 | ||
47 | override fun onDestroy() { | 41 | override fun onDestroy() { |
48 | super.onDestroy() | 42 | super.onDestroy() |
49 | fragmentScopeAM.cancel() | 43 | fragmentScopeAM.cancel() |
50 | } | 44 | } |
51 | 45 | ||
52 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 46 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
53 | val v = inflater.inflate(R.layout.fragment_actua_maestros, container, false) | 47 | val v = inflater.inflate(R.layout.fragment_actua_maestros, container, false) |
54 | val bConfirmarAct = v.findViewById<Button>(R.id.btnConfirmarAct) | 48 | val bConfirmarAct = v.findViewById<Button>(R.id.btnConfirmarAct) |
55 | val obPorWifi = v.findViewById<RadioButton>(R.id.obPorWifi) | 49 | val obPorWifi = v.findViewById<RadioButton>(R.id.obPorWifi) |
56 | val obImpInventarios = v.findViewById<RadioButton>(R.id.obImpInventarios) | 50 | val obImpInventarios = v.findViewById<RadioButton>(R.id.obImpInventarios) |
57 | 51 | countriesList = v.findViewById<TextView>(R.id.countriesList) | |
52 | loading_view= v.findViewById<ProgressBar>(R.id.loading_view) | ||
58 | obPorWifi.setOnClickListener { | 53 | obPorWifi.setOnClickListener { |
59 | bConfirmarAct.text = ("Confirmar Importación") | 54 | bConfirmarAct.text = ("Confirmar Importación") |
60 | } | 55 | } |
61 | obImpInventarios.setOnClickListener { | 56 | obImpInventarios.setOnClickListener { |
62 | bConfirmarAct.text = ("Buscar Inventarios sectorizados en servidor") | 57 | bConfirmarAct.text = ("Buscar Inventarios sectorizados") |
63 | } | 58 | } |
64 | 59 | ||
65 | bConfirmarAct.setOnClickListener { | 60 | bConfirmarAct.setOnClickListener { |
66 | if (obPorWifi.isChecked) { | 61 | if (obPorWifi.isChecked) { |
67 | loading_view.visibility = View.VISIBLE | 62 | loading_view.visibility = View.VISIBLE |
68 | countriesList.text = ("Obteniendo artículos del servidor, aguarde por favor.") | 63 | countriesList.text = ("Obteniendo artículos del servidor, aguarde por favor.") |
69 | obtenerArticulos() | 64 | obtenerArticulos() |
70 | } | 65 | } |
71 | if (obImpInventarios.isChecked) { | 66 | if (obImpInventarios.isChecked) { |
72 | navController = Navigation.findNavController(v) | 67 | navController = Navigation.findNavController(v) |
73 | navController.navigate(R.id.action_actuaMaestrosFragment_to_invSecImpFragment) | 68 | navController.navigate(R.id.action_actuaMaestrosFragment_to_invSecImpFragment) |
74 | } | 69 | } |
75 | } | 70 | } |
76 | return v | 71 | return v |
77 | } | 72 | } |
78 | 73 | ||
79 | private fun obtenerArticulos() { | 74 | private fun obtenerArticulos() { |
80 | fragmentScopeAM.launch(Main) { | 75 | fragmentScopeAM.launch(Main) { |
81 | try { | 76 | try { |
82 | serverPre = fetchServerPreOne((activity as MainActivity)) | 77 | serverPre = fetchServerPreOne((activity as MainActivity)) |
83 | 78 | ||
84 | } catch (e: RuntimeException) { | 79 | } catch (e: RuntimeException) { |
85 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | 80 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() |
86 | } | 81 | } |
87 | if (serverPre != null) { | 82 | if (serverPre != null) { |
88 | if (serverPre!!.direccion.isNullOrEmpty()) { | 83 | if (serverPre!!.direccion.isNullOrEmpty()) { |
89 | val modalDialog = NoServerConf() | 84 | val modalDialog = NoServerConf() |
90 | if (activity != null) { | 85 | if (activity != null) { |
91 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 86 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
92 | } | 87 | } |
93 | } else { | 88 | } else { |
94 | BASE_URL = serverPre!!.direccion.toString() + ":" + serverPre!!.puertoBajada.toString() + "/" | 89 | BASE_URL = serverPre!!.direccion.toString() + ":" + serverPre!!.puertoBajada.toString() + "/" |
95 | } | 90 | } |
96 | } else { | 91 | } else { |
97 | if (activity != null) { | 92 | if (activity != null) { |
98 | val modalDialog = ServerNoConf() | 93 | val modalDialog = ServerNoConf() |
99 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 94 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
100 | } | 95 | } |
101 | } | 96 | } |
102 | 97 | ||
103 | 98 | ||
104 | try { | 99 | try { |
105 | val call: Call<List<Productos?>?>? = WebService.instance | 100 | val call: Call<List<Productos?>?>? = WebService.instance |
106 | ?.createService(WebServiceApi::class.java) | 101 | ?.createService(WebServiceApi::class.java) |
107 | ?.getProductos() | 102 | ?.getProductos() |
108 | var index: Long = 1 | 103 | var index: Long = 1 |
109 | call!!.enqueue(object : Callback<List<Productos?>?> { | 104 | call!!.enqueue(object : Callback<List<Productos?>?> { |
110 | override fun onResponse(call: Call<List<Productos?>?>?, response: Response<List<Productos?>?>) { | 105 | override fun onResponse(call: Call<List<Productos?>?>?, response: Response<List<Productos?>?>) { |
111 | if (response.code() == 200) { | 106 | if (response.code() == 200) { |
112 | try { | 107 | try { |
113 | for (pro in response.body()!!) { | 108 | for (pro in response.body()!!) { |
114 | val artiAcargar = Articles( | 109 | val artiAcargar = Articles( |
115 | pro?.sector, | 110 | pro?.sector, |
116 | pro?.codigo, | 111 | pro?.codigo, |
117 | pro?.descripcion, | 112 | pro?.descripcion, |
118 | pro?.codBar, | 113 | pro?.codBar, |
119 | pro?.codOrigen, | 114 | pro?.codOrigen, |
120 | pro?.precio, | 115 | pro?.precio, |
121 | pro?.costo, | 116 | pro?.costo, |
122 | pro?.exiVenta, | 117 | pro?.exiVenta, |
123 | pro?.exiDeposito, | 118 | pro?.exiDeposito, |
124 | pro?.de, | 119 | pro?.de, |
125 | pro?.balanza, | 120 | pro?.balanza, |
126 | pro?.depSn, | 121 | pro?.depSn, |
127 | pro?.imagen | 122 | pro?.imagen |
128 | ) | 123 | ) |
129 | index += index | 124 | index += index |
130 | insertarProducto(artiAcargar) | 125 | insertarProducto(artiAcargar) |
131 | } | 126 | } |
132 | countriesList.visibility = View.VISIBLE | 127 | countriesList.visibility = View.VISIBLE |
133 | countriesList.text = "¡Datos Importados Correctamente!" | 128 | countriesList.text = "¡Datos Importados Correctamente!" |
134 | loading_view.visibility = View.GONE | 129 | loading_view.visibility = View.GONE |
135 | } catch (e: SocketTimeoutException) { | 130 | } catch (e: SocketTimeoutException) { |
136 | countriesList.visibility = View.VISIBLE | 131 | countriesList.visibility = View.VISIBLE |
137 | countriesList.text = "¡Sin conexión al Servidor!" | 132 | countriesList.text = "¡Sin conexión al Servidor!" |
138 | loading_view.visibility = View.GONE | 133 | loading_view.visibility = View.GONE |
139 | } | 134 | } |
140 | } else if (response.code() == 404) { | 135 | } else if (response.code() == 404) { |
141 | countriesList.visibility = View.VISIBLE | 136 | countriesList.visibility = View.VISIBLE |
142 | countriesList.text = "¡Sin conexión al Servidor!" | 137 | countriesList.text = "¡Sin conexión al Servidor!" |
143 | loading_view.visibility = View.GONE | 138 | loading_view.visibility = View.GONE |
144 | } | 139 | } |
145 | } | 140 | } |
146 | 141 | ||
147 | override fun onFailure(call: Call<List<Productos?>?>?, t: Throwable?) { countriesList.visibility = View.VISIBLE | 142 | override fun onFailure(call: Call<List<Productos?>?>?, t: Throwable?) { countriesList.visibility = View.VISIBLE |
148 | countriesList.visibility = View.VISIBLE | 143 | countriesList.visibility = View.VISIBLE |
149 | countriesList.text = "¡Sin conexión al Servidor!" | 144 | countriesList.text = "¡Sin conexión al Servidor!" |
150 | loading_view.visibility = View.GONE | 145 | loading_view.visibility = View.GONE |
151 | } | 146 | } |
152 | }) | 147 | }) |
153 | } catch (e: RuntimeException) { | 148 | } catch (e: RuntimeException) { |
154 | countriesList.visibility = View.VISIBLE | 149 | countriesList.visibility = View.VISIBLE |
155 | countriesList.text = "Error ${e.message}" | 150 | countriesList.text = "Error ${e.message}" |
156 | loading_view.visibility = View.GONE | 151 | loading_view.visibility = View.GONE |
157 | } | 152 | } |
158 | } | 153 | } |
154 | SystemClock.sleep(2000); | ||
155 | //activity?.onBackPressed() | ||
159 | // val call = getInstance() | 156 | // val call = getInstance() |
160 | // ?.createService(WebServiceApi::class.java) | 157 | // ?.createService(WebServiceApi::class.java) |
161 | // ?.getProductos() | 158 | // ?.getProductos() |
162 | // val api: WebService? = getInstance()!!.createService() | 159 | // val api: WebService? = getInstance()!!.createService() |
163 | // val call: Call<List<Productos>> = api!!.getProductos() | 160 | // val call: Call<List<Productos>> = api!!.getProductos() |
164 | 161 | ||
165 | // var index: Long = 1 | 162 | // var index: Long = 1 |
166 | // call!!.enqueue(object : Callback<List<Productos>> { | 163 | // call!!.enqueue(object : Callback<List<Productos>> { |
167 | // override fun onResponse(call: Call<List<Productos>>, response: Response<List<Productos>>) { | 164 | // override fun onResponse(call: Call<List<Productos>>, response: Response<List<Productos>>) { |
168 | // if (response.code() == 200) { | 165 | // if (response.code() == 200) { |
169 | // try { | 166 | // try { |
170 | // for (pro in response.body()!!) { | 167 | // for (pro in response.body()!!) { |
171 | // val artiAcargar = Articles( | 168 | // val artiAcargar = Articles( |
172 | // pro.sector, | 169 | // pro.sector, |
173 | // pro.codigo, | 170 | // pro.codigo, |
174 | // pro.descripcion, | 171 | // pro.descripcion, |
175 | // pro.codBar, | 172 | // pro.codBar, |
176 | // pro.codOrigen, | 173 | // pro.codOrigen, |
177 | // pro.precio, | 174 | // pro.precio, |
178 | // pro.costo, | 175 | // pro.costo, |
179 | // pro.exiVenta, | 176 | // pro.exiVenta, |
180 | // pro.exiDeposito, | 177 | // pro.exiDeposito, |
181 | // pro.de, | 178 | // pro.de, |
182 | // pro.balanza, | 179 | // pro.balanza, |
183 | // pro.depSn, | 180 | // pro.depSn, |
184 | // pro.imagen | 181 | // pro.imagen |
185 | // ) | 182 | // ) |
186 | // index += index | 183 | // index += index |
187 | // insertarProducto(artiAcargar) | 184 | // insertarProducto(artiAcargar) |
188 | // } | 185 | // } |
189 | // countriesList.visibility = View.VISIBLE | 186 | // countriesList.visibility = View.VISIBLE |
190 | // countriesList.text = "¡Datos Importados Correctamente!" | 187 | // countriesList.text = "¡Datos Importados Correctamente!" |
191 | // loading_view.visibility = View.GONE | 188 | // loading_view.visibility = View.GONE |
192 | // } catch (e: SocketTimeoutException) { | 189 | // } catch (e: SocketTimeoutException) { |
193 | // countriesList.visibility = View.VISIBLE | 190 | // countriesList.visibility = View.VISIBLE |
194 | // countriesList.text = "¡Sin conexión al Servidor!" | 191 | // countriesList.text = "¡Sin conexión al Servidor!" |
195 | // loading_view.visibility = View.GONE | 192 | // loading_view.visibility = View.GONE |
196 | // } | 193 | // } |
197 | // } | 194 | // } |
198 | // } | 195 | // } |
199 | // | 196 | // |
200 | // override fun onFailure(call: Call<List<Productos>>, t: Throwable) { | 197 | // override fun onFailure(call: Call<List<Productos>>, t: Throwable) { |
201 | // countriesList.visibility = View.VISIBLE | 198 | // countriesList.visibility = View.VISIBLE |
202 | // countriesList.text = (t.message + "." + t.cause) | 199 | // countriesList.text = (t.message + "." + t.cause) |
203 | // loading_view.visibility = View.GONE | 200 | // loading_view.visibility = View.GONE |
204 | // } | 201 | // } |
205 | // }) | 202 | // }) |
206 | 203 | ||
207 | //Este es el que andaba | 204 | //Este es el que andaba |
208 | // var index: Long = 1 | 205 | // var index: Long = 1 |
209 | // withContext(IO) { | 206 | // withContext(IO) { |
210 | // val job = CoroutineScope(IO).launch { | 207 | // val job = CoroutineScope(IO).launch { |
211 | // // TODO: BORRO TODO LOS ARTICULOS DE LA BASE PARA CARGARLOS DE NUEVO | 208 | // // TODO: BORRO TODO LOS ARTICULOS DE LA BASE PARA CARGARLOS DE NUEVO |
212 | // AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.deleteAllArticulos() | 209 | // AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.deleteAllArticulos() |
213 | // try { | 210 | // try { |
214 | // val response = WebServiceApi. | 211 | // val response = WebServiceApi. |
215 | // if (response.isSuccessful) { | 212 | // if (response.isSuccessful) { |
216 | // | 213 | // |
217 | // for (pro in response.body()!!) { | 214 | // for (pro in response.body()!!) { |
218 | // val artiAcargar = Articles( | 215 | // val artiAcargar = Articles( |
219 | // pro.sector, | 216 | // pro.sector, |
220 | // pro.codigo, | 217 | // pro.codigo, |
221 | // pro.descripcion, | 218 | // pro.descripcion, |
222 | // pro.codBar, | 219 | // pro.codBar, |
223 | // pro.codOrigen, | 220 | // pro.codOrigen, |
224 | // pro.precio, | 221 | // pro.precio, |
225 | // pro.costo, | 222 | // pro.costo, |
226 | // pro.exiVenta, | 223 | // pro.exiVenta, |
227 | // pro.exiDeposito, | 224 | // pro.exiDeposito, |
228 | // pro.de, | 225 | // pro.de, |
229 | // pro.balanza, | 226 | // pro.balanza, |
230 | // pro.depSn, | 227 | // pro.depSn, |
231 | // pro.imagen | 228 | // pro.imagen |
232 | // ) | 229 | // ) |
233 | // index += index | 230 | // index += index |
234 | // AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.insertArticulos(artiAcargar) | 231 | // AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.insertArticulos(artiAcargar) |
235 | // } | 232 | // } |
236 | // withContext(Main) { | 233 | // withContext(Main) { |
237 | // countriesList.visibility = View.VISIBLE | 234 | // countriesList.visibility = View.VISIBLE |
238 | // countriesList.text = "¡Datos Importados Correctamente!" | 235 | // countriesList.text = "¡Datos Importados Correctamente!" |
239 | // loading_view.visibility = View.GONE | 236 | // loading_view.visibility = View.GONE |
240 | // } | 237 | // } |
241 | // } else if (!response.isSuccessful) { | 238 | // } else if (!response.isSuccessful) { |
242 | // withContext(Main) { | 239 | // withContext(Main) { |
243 | // countriesList.visibility = View.VISIBLE | 240 | // countriesList.visibility = View.VISIBLE |
244 | // countriesList.text = "¡Sin servicio. No se puede conectar a la api o al servidor configurado en el BackEnd!" | 241 | // countriesList.text = "¡Sin servicio. No se puede conectar a la api o al servidor configurado en el BackEnd!" |
245 | // loading_view.visibility = View.GONE | 242 | // loading_view.visibility = View.GONE |
246 | // } | 243 | // } |
247 | // } | 244 | // } |
248 | // } catch (e: SocketTimeoutException) { | 245 | // } catch (e: SocketTimeoutException) { |
249 | // withContext(Main) { | 246 | // withContext(Main) { |
250 | // countriesList.visibility = View.VISIBLE | 247 | // countriesList.visibility = View.VISIBLE |
251 | // countriesList.text = "¡Sin conexión al Servidor!" | 248 | // countriesList.text = "¡Sin conexión al Servidor!" |
252 | // loading_view.visibility = View.GONE | 249 | // loading_view.visibility = View.GONE |
253 | // } | 250 | // } |
254 | // } | 251 | // } |
255 | // } | 252 | // } |
256 | // } | 253 | // } |
257 | // withContext(Dispatchers.Main) { | 254 | // withContext(Dispatchers.Main) { |
258 | // if (response.isSuccessful) { | 255 | // if (response.isSuccessful) { |
259 | // val call = WebService | 256 | // val call = WebService |
260 | // .instance | 257 | // .instance |
261 | // ?.createService(WebServiceApi::class.java) | 258 | // ?.createService(WebServiceApi::class.java) |
262 | // ?.articulos | 259 | // ?.articulos |
263 | // call?.enqueue(object : Callback<List<productos?>?> { | 260 | // call?.enqueue(object : Callback<List<productos?>?> { |
264 | // override fun onResponse( | 261 | // override fun onResponse( |
265 | // call: Call<List<productos?>?>, | 262 | // call: Call<List<productos?>?>, |
266 | // response: Response<List<productos?>?> | 263 | // response: Response<List<productos?>?> |
267 | // ) { | 264 | // ) { |
268 | // if (response.code() == 200) { | 265 | // if (response.code() == 200) { |
269 | // for (i in response.body()!!.indices) { | 266 | // for (i in response.body()!!.indices) { |
270 | // //AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()?.insertArticulos(response.body()!![i]) | 267 | // //AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()?.insertArticulos(response.body()!![i]) |
271 | // cargarArticulos(2, 500, "sfas", "66666","2,2", "2,2", false, false, "") | 268 | // cargarArticulos(2, 500, "sfas", "66666","2,2", "2,2", false, false, "") |
272 | //// Log.d( | 269 | //// Log.d( |
273 | //// "TAG1", "Nombre Curso: " + response.body()!![i]?.sector | 270 | //// "TAG1", "Nombre Curso: " + response.body()!![i]?.sector |
274 | //// + "Codigo Profesor: " + response.body()!![i]?.descripcion | 271 | //// + "Codigo Profesor: " + response.body()!![i]?.descripcion |
275 | //// ) | 272 | //// ) |
276 | // mostrarArticulos() | 273 | // mostrarArticulos() |
277 | // } | 274 | // } |
278 | // } else if (response.code() == 404) { | 275 | // } else if (response.code() == 404) { |
279 | // Log.d("TAG1", "No hay cursos") | 276 | // Log.d("TAG1", "No hay cursos") |
280 | // } | 277 | // } |
281 | // | 278 | // |
282 | // } | 279 | // } |
283 | // | 280 | // |
284 | // override fun onFailure(call: Call<List<productos?>?>, t: Throwable) {} | 281 | // override fun onFailure(call: Call<List<productos?>?>, t: Throwable) {} |
285 | // }) | 282 | // }) |
286 | } | 283 | } |
287 | 284 | ||
288 | fun insertarProducto(aCargar: Articles) { | 285 | fun insertarProducto(aCargar: Articles) { |
289 | fragmentScopeAM.launch { | 286 | fragmentScopeAM.launch { |
290 | withContext(IO) { | 287 | withContext(IO) { |
291 | AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.insertArticulos(aCargar) | 288 | AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.insertArticulos(aCargar) |
292 | } | 289 | } |
293 | } | 290 | } |
294 | } | 291 | } |
295 | 292 | ||
296 | fun mostrarArticulos() { | 293 | fun mostrarArticulos() { |
297 | fragmentScopeAM.launch { | 294 | fragmentScopeAM.launch { |
298 | var listArticulos: List<Articles>? = null | 295 | var listArticulos: List<Articles>? = null |
299 | var temp: String = "" | 296 | var temp: String = "" |
300 | listArticulos = AppDb.getAppDb((activity as MainActivity))?.ArticulosDAO()?.findAllArticulos() | 297 | listArticulos = AppDb.getAppDb((activity as MainActivity))?.ArticulosDAO()?.findAllArticulos() |
301 | if (listArticulos != null) { | 298 | if (listArticulos != null) { |
302 | 299 | ||
303 | for (i in listArticulos.indices) temp += listArticulos[i].codigo.toString() | 300 | for (i in listArticulos.indices) temp += listArticulos[i].codigo.toString() |
304 | } | 301 | } |
305 | withContext(Main) { | 302 | withContext(Main) { |
306 | countriesList.visibility = View.VISIBLE | 303 | countriesList.visibility = View.VISIBLE |
307 | loading_view.visibility = View.GONE | 304 | loading_view.visibility = View.GONE |
308 | countriesList?.text = temp | 305 | countriesList?.text = temp |
309 | } | 306 | } |
310 | } | 307 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/InvSecImpFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.actualizacionMaestros | 1 | package com.focasoftware.deboinventariov20.UI.actualizacionMaestros |
2 | 2 | ||
3 | import android.app.AlertDialog | 3 | import android.app.AlertDialog |
4 | import android.content.DialogInterface | 4 | import android.content.DialogInterface |
5 | import android.os.Bundle | 5 | import android.os.Bundle |
6 | import android.view.LayoutInflater | 6 | import android.view.LayoutInflater |
7 | import android.view.View | 7 | import android.view.View |
8 | import android.view.ViewGroup | 8 | import android.view.ViewGroup |
9 | import android.widget.Button | 9 | import android.widget.Button |
10 | import android.widget.ProgressBar | 10 | import android.widget.ProgressBar |
11 | import android.widget.TextView | 11 | import android.widget.TextView |
12 | import android.widget.Toast | 12 | import android.widget.Toast |
13 | import androidx.fragment.app.Fragment | 13 | import androidx.fragment.app.Fragment |
14 | import androidx.navigation.NavController | 14 | import androidx.navigation.NavController |
15 | import androidx.navigation.Navigation | 15 | import androidx.navigation.Navigation |
16 | import androidx.recyclerview.widget.LinearLayoutManager | 16 | import androidx.recyclerview.widget.LinearLayoutManager |
17 | import androidx.recyclerview.widget.RecyclerView | 17 | import androidx.recyclerview.widget.RecyclerView |
18 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 18 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
19 | import com.focasoftware.deboinventariov20.Model.* | 19 | import com.focasoftware.deboinventariov20.Model.* |
20 | import com.focasoftware.deboinventariov20.R | 20 | import com.focasoftware.deboinventariov20.R |
21 | import com.focasoftware.deboinventariov20.UI.MainActivity | 21 | import com.focasoftware.deboinventariov20.UI.MainActivity |
22 | import com.focasoftware.deboinventariov20.UI.Utils.* | 22 | import com.focasoftware.deboinventariov20.UI.Utils.* |
23 | |||
23 | import kotlinx.android.synthetic.main.fragment_inv_importados.* | 24 | import kotlinx.android.synthetic.main.fragment_inv_importados.* |
24 | import kotlinx.coroutines.* | 25 | import kotlinx.coroutines.* |
25 | import kotlinx.coroutines.Dispatchers.IO | 26 | import kotlinx.coroutines.Dispatchers.IO |
26 | import kotlinx.coroutines.Dispatchers.Main | 27 | import kotlinx.coroutines.Dispatchers.Main |
27 | import retrofit2.Call | 28 | import retrofit2.Call |
28 | import retrofit2.Callback | 29 | import retrofit2.Callback |
29 | import retrofit2.Response | 30 | import retrofit2.Response |
30 | import java.lang.Thread.sleep | 31 | import java.lang.Thread.sleep |
31 | import java.net.SocketTimeoutException | 32 | import java.net.SocketTimeoutException |
32 | 33 | ||
33 | private lateinit var viewAdapter: RecyclerView.Adapter<*> | 34 | private lateinit var viewAdapter: RecyclerView.Adapter<*> |
34 | private lateinit var viewManager: RecyclerView.LayoutManager | 35 | private lateinit var viewManager: RecyclerView.LayoutManager |
35 | private lateinit var recicler: RecyclerView | 36 | private lateinit var recicler: RecyclerView |
36 | private var listInv = ArrayList<ItemsInvSecHead>() | 37 | private var listInv = ArrayList<ItemsInvSecHead>() |
37 | private var serverPre: ServeInv? = null | 38 | private var serverPre: ServeInv? = null |
38 | var invSeleccionados = mutableListOf<String>() | 39 | var invSeleccionados = mutableListOf<String>() |
39 | private lateinit var navController: NavController | 40 | private lateinit var navController: NavController |
40 | 41 | ||
41 | class InvSecImpFragment : Fragment(), InvSecHeadListAdapter.OnCheckListener { | 42 | class InvSecImpFragment : Fragment(), InvSecHeadListAdapter.OnCheckListener { |
42 | private val job: Job = Job() | 43 | private val job: Job = Job() |
43 | private val fragmentScopeInvSec = CoroutineScope(Dispatchers.IO + job) | 44 | private val fragmentScopeInvSec = CoroutineScope(Dispatchers.IO + job) |
44 | 45 | ||
45 | override fun onCreate(savedInstanceState: Bundle?) { | 46 | override fun onCreate(savedInstanceState: Bundle?) { |
46 | super.onCreate(savedInstanceState) | 47 | super.onCreate(savedInstanceState) |
47 | invSeleccionados.clear() | 48 | invSeleccionados.clear() |
48 | } | 49 | } |
49 | override fun onDestroy() { | 50 | override fun onDestroy() { |
50 | super.onDestroy() | 51 | super.onDestroy() |
51 | fragmentScopeInvSec.cancel() | 52 | fragmentScopeInvSec.cancel() |
52 | } | 53 | } |
53 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 54 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
54 | super.onViewCreated(view, savedInstanceState) | 55 | super.onViewCreated(view, savedInstanceState) |
55 | val navController = Navigation.findNavController(view) | 56 | val navController = Navigation.findNavController(view) |
56 | val btnConfirmarAct = view.findViewById<Button>(R.id.btnConfirmarAct) | 57 | val btnConfirmarAct = view.findViewById<Button>(R.id.btnConfirmarAct) |
57 | val pbInvSec = view.findViewById<ProgressBar>(R.id.pbInvSec) | 58 | val pbInvSec = view.findViewById<ProgressBar>(R.id.pbInvSec) |
58 | val tvMensaje = view.findViewById<TextView>(R.id.tvMensaje) | 59 | val tvMensaje = view.findViewById<TextView>(R.id.tvMensaje) |
60 | |||
59 | recicler = view.findViewById(R.id.rcDescripcion) | 61 | recicler = view.findViewById(R.id.rcDescripcion) |
60 | 62 | ||
61 | fragmentScopeInvSec.launch(Main) { | 63 | fragmentScopeInvSec.launch(Main) { |
62 | invSeleccionados.clear() | 64 | invSeleccionados.clear() |
63 | pbInvSec.visibility = View.VISIBLE | 65 | pbInvSec.visibility = View.VISIBLE |
64 | recicler.visibility = View.GONE | 66 | recicler.visibility = View.GONE |
65 | try { | 67 | try { |
66 | serverPre = fetchServerPreOne(requireActivity()) | 68 | serverPre = fetchServerPreOne(requireActivity()) |
67 | } catch (e: RuntimeException) { | 69 | } catch (e: RuntimeException) { |
68 | 70 | ||
69 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | 71 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() |
70 | } | 72 | } |
71 | if (serverPre != null) { | 73 | if (serverPre != null) { |
72 | if (serverPre!!.direccion.isNullOrEmpty()) { | 74 | if (serverPre!!.direccion.isNullOrEmpty()) { |
73 | val modalDialog = NoServerConf() | 75 | val modalDialog = NoServerConf() |
74 | if (activity != null) { | 76 | if (activity != null) { |
75 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 77 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
76 | } | 78 | } |
77 | } else { | 79 | } else { |
78 | BASE_URL = serverPre!!.direccion.toString() + ":" + serverPre!!.puertoSubida.toString() + "/" | 80 | BASE_URL = serverPre!!.direccion.toString() + ":" + serverPre!!.puertoSubida.toString() + "/" |
79 | listInv.clear() | 81 | listInv.clear() |
80 | try { | 82 | try { |
81 | // val call: Call<List<InvHeadSecR?>?>? = WebService.instance | 83 | // val call: Call<List<InvHeadSecR?>?>? = WebService.instance |
82 | // ?.createService(WebServiceApi::class.java) | 84 | // ?.createService(WebServiceApi::class.java) |
83 | // ?.getHeadInvSec() | 85 | // ?.getHeadInvSec() |
84 | ItomInv.request.getHeadInvSec() | 86 | ItomInv.request.getHeadInvSec() |
85 | ?.enqueue(object : Callback<List<InvHeadSecR?>?> { | 87 | ?.enqueue(object : Callback<List<InvHeadSecR?>?> { |
86 | // call!!.enqueue(object : Callback<List<InvHeadSecR?>?> { | 88 | // call!!.enqueue(object : Callback<List<InvHeadSecR?>?> { |
87 | override fun onResponse(call: Call<List<InvHeadSecR?>?>?, response: Response<List<InvHeadSecR?>?>) { | 89 | override fun onResponse(call: Call<List<InvHeadSecR?>?>?, response: Response<List<InvHeadSecR?>?>) { |
88 | if (response.code() == 200) { | 90 | if (response.code() == 200) { |
89 | try { | 91 | try { |
90 | for (inv in response.body()!!) { | 92 | for (inv in response.body()!!) { |
91 | cargarRecicler(inv?.invNum, inv!!.detalle, inv.fechaInicio, inv.depsn) | 93 | cargarRecicler(inv?.invNum, inv!!.detalle, inv.fechaInicio, inv.depsn) |
92 | } | 94 | } |
93 | } catch (e: SocketTimeoutException) { | 95 | } catch (e: SocketTimeoutException) { |
94 | } | 96 | } |
95 | } else if (response.code() == 404) { | 97 | } else if (response.code() == 404) { |
96 | tvSeleccionInventario.visibility = View.VISIBLE | 98 | tvSeleccionInventario.visibility = View.VISIBLE |
97 | tvMensaje.visibility = View.VISIBLE | 99 | tvMensaje.visibility = View.VISIBLE |
98 | tvMensaje.text = "No hay inventarios disponibles." | 100 | tvMensaje.text = "No hay inventarios disponibles." |
99 | pbInvSec.visibility = View.GONE | 101 | pbInvSec.visibility = View.GONE |
100 | } | 102 | } |
101 | } | 103 | } |
102 | 104 | ||
103 | override fun onFailure(call: Call<List<InvHeadSecR?>?>?, t: Throwable?) {} | 105 | override fun onFailure(call: Call<List<InvHeadSecR?>?>?, t: Throwable?) {} |
104 | }) | 106 | }) |
105 | } catch (e: RuntimeException) { | 107 | } catch (e: RuntimeException) { |
106 | tvSeleccionInventario.visibility = View.VISIBLE | 108 | tvSeleccionInventario.visibility = View.VISIBLE |
107 | tvMensaje.visibility = View.VISIBLE | 109 | tvMensaje.visibility = View.VISIBLE |
108 | tvMensaje.text = "Error ${e.message}" | 110 | tvMensaje.text = "Error ${e.message}" |
109 | pbInvSec.visibility = View.GONE | 111 | pbInvSec.visibility = View.GONE |
110 | tvMensaje.visibility = View.GONE | 112 | tvMensaje.visibility = View.GONE |
111 | } | 113 | } |
112 | // obtenerInvSectorizados() | 114 | // obtenerInvSectorizados() |
113 | } | 115 | } |
114 | } else { | 116 | } else { |
115 | if (activity != null) { | 117 | if (activity != null) { |
116 | val modalDialog = ServerNoConf() | 118 | val modalDialog = ServerNoConf() |
117 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 119 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
118 | } | 120 | } |
119 | } | 121 | } |
120 | pbInvSec.visibility = View.GONE | 122 | pbInvSec.visibility = View.GONE |
121 | recicler.visibility = View.VISIBLE | 123 | recicler.visibility = View.VISIBLE |
122 | 124 | ||
123 | } | 125 | } |
124 | 126 | ||
125 | 127 | ||
126 | btnConfirmarAct.setOnClickListener { | 128 | btnConfirmarAct.setOnClickListener { |
127 | var entroAlFor=false | 129 | var finalizo=false |
130 | var contador=0 | ||
131 | |||
128 | for (inv in invSeleccionados) { | 132 | for (inv in invSeleccionados) { |
129 | entroAlFor=true | 133 | |
130 | GlobalScope.launch(Main) { | 134 | GlobalScope.launch(Main) { |
131 | deleteAllInvHeadSec(inv.toInt()) | 135 | deleteAllInvHeadSec(inv.toInt()) |
132 | deleteAllInvBodySec(inv.toInt()) | 136 | deleteAllInvBodySec(inv.toInt()) |
133 | } | 137 | } |
134 | val aEnviar: NumInvSec = NumInvSec(inv) | 138 | val aEnviar: NumInvSec = NumInvSec(inv) |
135 | // val call: Call<List<InvBodySecR?>?>? = WebService.instance | 139 | // val call: Call<List<InvBodySecR?>?>? = WebService.instance |
136 | // ?.createService(WebServiceApi::class.java) | 140 | // ?.createService(WebServiceApi::class.java) |
137 | // ?.getBodyInvSec(aEnviar) | 141 | // ?.getBodyInvSec(aEnviar) |
138 | // call!!.enqueue(object : Callback<List<InvBodySecR?>?> { | 142 | // call!!.enqueue(object : Callback<List<InvBodySecR?>?> { |
139 | ItomInv.request.getBodyInvSec(aEnviar) | 143 | ItomInv.request.getBodyInvSec(aEnviar) |
140 | ?.enqueue(object : Callback<List<InvBodySecR?>?> { | 144 | ?.enqueue(object : Callback<List<InvBodySecR?>?> { |
141 | override fun onResponse(call: Call<List<InvBodySecR?>?>?, response: Response<List<InvBodySecR?>?>) { | 145 | override fun onResponse(call: Call<List<InvBodySecR?>?>?, response: Response<List<InvBodySecR?>?>) { |
142 | 146 | ||
143 | if (response.code() == 200) { | 147 | if (response.code() == 200) { |
144 | try { | 148 | try { |
145 | preparaParaInsertar(response.body(), inv) | 149 | if(preparaParaInsertar(response.body(), inv)) finalizo=true |
150 | // fragmentScopeInvSec.launch(Main) { | ||
151 | // if (response.body() != null) { | ||
152 | // for (head in listInv) { | ||
153 | // if (inv.toInt() == head.invnum) { | ||
154 | // val invHeadTemp = InvHeadSec(head.invnum, head.detalle, head.fecha, head.deposito == 1, "", head.fecha, 0) | ||
155 | // insertInvHeadSec(invHeadTemp) | ||
156 | // break | ||
157 | // } | ||
158 | // } | ||
159 | // for (body in response.body()!!) { | ||
160 | // val invBodyTemp = InvBodySec( | ||
161 | // body!!.INV.toInt(), body.SEC, body.ART, body.DET, body.PRE, | ||
162 | // body.uniVta, | ||
163 | // body.COS, "", body.DEPSN!!.toInt() != 0, body.EXIVTA, body.EXIDEP, body.CODBAR, "", "" | ||
164 | // ) | ||
165 | // insertInvBodySec(invBodyTemp) | ||
166 | // } | ||
167 | // } | ||
168 | // contador+=1 | ||
169 | // sleep(500) | ||
170 | // buscarCantArtInvSecHead(inv) | ||
171 | // sleep(500) | ||
172 | // if(contador==invSeleccionados.size){ | ||
173 | // recicler.visibility = View.GONE | ||
174 | // btnConfirmarAct.isEnabled = false | ||
175 | // val modalDialog = InvSecImp() | ||
176 | // modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | ||
177 | // | ||
178 | // activity?.onBackPressed() | ||
179 | // } | ||
180 | // } | ||
181 | |||
146 | } catch (e: SocketTimeoutException) { | 182 | } catch (e: SocketTimeoutException) { |
147 | } | 183 | } |
148 | } else if (response.code() == 404) { | 184 | } else if (response.code() == 404) { } |
149 | } | ||
150 | } | 185 | } |
151 | |||
152 | override fun onFailure(call: Call<List<InvBodySecR?>?>?, t: Throwable?) {} | 186 | override fun onFailure(call: Call<List<InvBodySecR?>?>?, t: Throwable?) {} |
153 | }) | 187 | }) |
188 | finalizo=true | ||
154 | } | 189 | } |
155 | if (entroAlFor) { | 190 | if (finalizo) { |
156 | recicler.visibility = View.GONE | 191 | recicler.visibility = View.GONE |
157 | btnConfirmarAct.isEnabled = false | 192 | btnConfirmarAct.isEnabled = false |
158 | val modalDialog = InvSecImp() | 193 | val modalDialog = InvSecImp() |
159 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 194 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") |
195 | |||
196 | // activity?.onBackPressed() | ||
197 | |||
160 | } | 198 | } |
161 | // navController.navigate(R.id.action_invSecImpFragment_to_mainFragment2) | 199 | // navController.navigate(R.id.action_invSecImpFragment_to_mainFragment2) |
162 | } | 200 | } |
163 | } | 201 | } |
164 | 202 | ||
165 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 203 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
166 | val v = inflater.inflate(R.layout.fragment_inv_importados, container, false) | 204 | val v = inflater.inflate(R.layout.fragment_inv_importados, container, false) |
167 | return v | 205 | return v |
168 | } | 206 | } |
169 | 207 | ||
170 | private fun preparaParaInsertar(list: List<InvBodySecR?>?, inv: String) { | 208 | private fun preparaParaInsertar(list: List<InvBodySecR?>?, inv: String):Boolean { |
171 | 209 | ||
172 | fragmentScopeInvSec.launch(Main) { | 210 | fragmentScopeInvSec.launch(Main) { |
173 | if (list != null) { | 211 | if (list != null) { |
174 | for (head in listInv) { | 212 | for (head in listInv) { |
175 | if (inv.toInt() == head.invnum) { | 213 | if (inv.toInt() == head.invnum) { |
176 | val invHeadTemp = InvHeadSec(head.invnum, head.detalle, head.fecha, head.deposito == 1, "", head.fecha, 0) | 214 | val invHeadTemp = InvHeadSec(head.invnum, head.detalle, head.fecha, head.deposito == 1, "", head.fecha, 0) |
177 | insertInvHeadSec(invHeadTemp) | 215 | insertInvHeadSec(invHeadTemp) |
178 | break | 216 | break |
179 | } | 217 | } |
180 | } | 218 | } |
181 | for (body in list) { | 219 | for (body in list) { |
182 | val invBodyTemp = InvBodySec( | 220 | val invBodyTemp = InvBodySec( |
183 | body!!.INV.toInt(), body.SEC, body.ART, body.DET, body.PRE, | 221 | body!!.INV.toInt(), body.SEC, body.ART, body.DET, body.PRE, |
184 | body.uniVta, | 222 | body.uniVta, |
185 | body.COS, "", body.DEPSN!!.toInt() != 0, body.EXIVTA, body.EXIDEP, body.CODBAR, "", "" | 223 | body.COS, "", body.DEPSN!!.toInt() != 0, body.EXIVTA, body.EXIDEP, body.CODBAR, "", "" |
186 | ) | 224 | ) |
187 | insertInvBodySec(invBodyTemp) | 225 | insertInvBodySec(invBodyTemp) |
188 | } | 226 | } |
189 | } | 227 | } |
190 | sleep(500) | 228 | sleep(500) |
191 | buscarCantArtInvSecHead(inv) | 229 | buscarCantArtInvSecHead(inv) |
192 | sleep(500) | 230 | sleep(500) |
193 | } | 231 | } |
232 | return true | ||
194 | } | 233 | } |
195 | 234 | ||
196 | fun cargarRecicler(invNum: Int?, detalle: String?, fechaInicio: String?, deposito: Int?) { | 235 | fun cargarRecicler(invNum: Int?, detalle: String?, fechaInicio: String?, deposito: Int?) { |
197 | //TODO CARGO EN LE RV | 236 | //TODO CARGO EN LE RV |
198 | val item = ItemsInvSecHead(invNum, detalle, fechaInicio, deposito) | 237 | val item = ItemsInvSecHead(invNum, detalle, fechaInicio, deposito) |
199 | listInv.add(item) | 238 | listInv.add(item) |
200 | 239 | ||
201 | viewAdapter = InvSecHeadListAdapter(requireContext(), listInv, this) | 240 | viewAdapter = InvSecHeadListAdapter(requireContext(), listInv, this) |
202 | viewManager = LinearLayoutManager(requireContext()) | 241 | viewManager = LinearLayoutManager(requireContext()) |
203 | // deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! | 242 | // deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! |
204 | recicler.apply { | 243 | recicler.apply { |
205 | adapter = viewAdapter | 244 | adapter = viewAdapter |
206 | layoutManager = viewManager | 245 | layoutManager = viewManager |
207 | } | 246 | } |
208 | } | 247 | } |
209 | 248 | ||
210 | override fun onItemCheck(inventario: String?) { | 249 | override fun onItemCheck(inventario: String?) { |
211 | if (inventario in invSeleccionados) { | 250 | if (inventario in invSeleccionados) { |
212 | invSeleccionados.removeIf { it == inventario } | 251 | invSeleccionados.removeIf { it == inventario } |
213 | } else { | 252 | } else { |
214 | fragmentScopeInvSec.launch(Main) { | 253 | fragmentScopeInvSec.launch(Main) { |
215 | var invBodySec: List<InvBodySec>? = null | 254 | var invBodySec: List<InvBodySec>? = null |
216 | invBodySec = verificoExisteInvSec(inventario!!.toInt()) | 255 | invBodySec = verificoExisteInvSec(inventario!!.toInt()) |
217 | if (!invBodySec.isNullOrEmpty()) { | 256 | if (!invBodySec.isNullOrEmpty()) { |
218 | AlertDialog.Builder(requireContext()).setTitle("El inventario $inventario ya se encuentra cargado.").setMessage(" Si continúa se perderan los datos ingresados.") | 257 | AlertDialog.Builder(requireContext()).setTitle("El inventario $inventario ya se encuentra cargado.").setMessage(" Si continúa se perderan los datos ingresados.") |
219 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> | 258 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> |
220 | invSeleccionados.add(inventario) | 259 | invSeleccionados.add(inventario) |
221 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> | 260 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> |
222 | 261 | ||
223 | }).show() | 262 | }).show() |
224 | } else invSeleccionados.add(inventario) | 263 | } else invSeleccionados.add(inventario) |
225 | } | 264 | } |
226 | } | 265 | } |
227 | } | 266 | } |
228 | 267 | ||
229 | private suspend fun insertInvBodySec(inventario: InvBodySec) { | 268 | private suspend fun insertInvBodySec(inventario: InvBodySec) { |
230 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { | 269 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { |
231 | AppDb.getAppDb(requireActivity())!!.InvBodySecDAO()!!.insertInvBodySec(inventario) | 270 | AppDb.getAppDb(requireActivity())!!.InvBodySecDAO()!!.insertInvBodySec(inventario) |
232 | } | 271 | } |
233 | } | 272 | } |
234 | 273 | ||
235 | private suspend fun insertInvHeadSec(inventario: InvHeadSec) { | 274 | private suspend fun insertInvHeadSec(inventario: InvHeadSec) { |
236 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { | 275 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { |
237 | AppDb.getAppDb(requireActivity())!!.InvHeadSecDAO()!!.insertInvHeadSec(inventario) | 276 | AppDb.getAppDb(requireActivity())!!.InvHeadSecDAO()!!.insertInvHeadSec(inventario) |
238 | } | 277 | } |
239 | } | 278 | } |
240 | 279 | ||
241 | private suspend fun deleteAllInvHeadSec(invNum: Int) { | 280 | private suspend fun deleteAllInvHeadSec(invNum: Int) { |
242 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { | 281 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { |
243 | AppDb.getAppDb(requireContext())!!.InvHeadSecDAO()!!.deleteAllInvHeadSec(invNum) | 282 | AppDb.getAppDb(requireContext())!!.InvHeadSecDAO()!!.deleteAllInvHeadSec(invNum) |
244 | } | 283 | } |
245 | } | 284 | } |
246 | 285 | ||
247 | private suspend fun deleteAllInvBodySec(invNum: Int) { | 286 | private suspend fun deleteAllInvBodySec(invNum: Int) { |
248 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { | 287 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { |
249 | AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.deleteAllInvBodySec(invNum) | 288 | AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.deleteAllInvBodySec(invNum) |
250 | } | 289 | } |
251 | } | 290 | } |
252 | 291 | ||
253 | private suspend fun buscarCantArtInvSecHead(invNum: String) { | 292 | private suspend fun buscarCantArtInvSecHead(invNum: String) { |
254 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { | 293 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { |
255 | val arti = mutableListOf<String>() | 294 | val arti = mutableListOf<String>() |
256 | val invBodySec: List<InvBodySec> = fetchInvSecBodyGroup(invNum) | 295 | val invBodySec: List<InvBodySec> = fetchInvSecBodyGroup(invNum) |
257 | // var cant = 0 | 296 | // var cant = 0 |
258 | // var encontrado: Boolean | 297 | // var encontrado: Boolean |
259 | // var first = false | 298 | // var first = false |
260 | // for (inv in invBodySec) { | 299 | // for (inv in invBodySec) { |
261 | // if (!first) { | 300 | // if (!first) { |
262 | // arti.add(inv.sector.toString() + inv.codigo.toString()) | 301 | // arti.add(inv.sector.toString() + inv.codigo.toString()) |
263 | // first = true | 302 | // first = true |
264 | // cant += 1 | 303 | // cant += 1 |
265 | // } else { | 304 | // } else { |
266 | // encontrado = false | 305 | // encontrado = false |
267 | // for (ar in arti) { | 306 | // for (ar in arti) { |
268 | // | 307 | // |
269 | // + | 308 | // + |
270 | // if (ar == inv.sector.toString() + inv.codigo.toString()) { | 309 | // if (ar == inv.sector.toString() + inv.codigo.toString()) { |
271 | // encontrado = true | 310 | // encontrado = true |
272 | // break | 311 | // break |
273 | // } | 312 | // } |
274 | // } | 313 | // } |
275 | // if (!encontrado) { | 314 | // if (!encontrado) { |
276 | // cant += 1 | 315 | // cant += 1 |
277 | // arti.add(inv.sector.toString() + inv.codigo.toString()) | 316 | // arti.add(inv.sector.toString() + inv.codigo.toString()) |
278 | // } | 317 | // } |
279 | // } | 318 | // } |
280 | // } | 319 | // } |
281 | AppDb.getAppDb(requireActivity())!!.InvHeadSecDAO()!!.updateCantArtInvSecHead(invNum.toInt(), invBodySec.count()) | 320 | AppDb.getAppDb(requireActivity())!!.InvHeadSecDAO()!!.updateCantArtInvSecHead(invNum.toInt(), invBodySec.count()) |
282 | } | 321 | } |
283 | } | 322 | } |
284 | 323 | ||
285 | private suspend fun verificoExisteInvSec(invNum: Int): List<InvBodySec> { | 324 | private suspend fun verificoExisteInvSec(invNum: Int): List<InvBodySec> { |
286 | var busqueda: List<InvBodySec> | 325 | var busqueda: List<InvBodySec> |
287 | return fragmentScopeInvSec.async(IO) { | 326 | return fragmentScopeInvSec.async(IO) { |
288 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.verificoExisteInvSec(invNum) | 327 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.verificoExisteInvSec(invNum) |
289 | return@async busqueda | 328 | return@async busqueda |
290 | }.await() | 329 | }.await() |
291 | } | 330 | } |
292 | 331 | ||
293 | private suspend fun fetchInvSecBodyGroup(invNum: String): List<InvBodySec> { | 332 | private suspend fun fetchInvSecBodyGroup(invNum: String): List<InvBodySec> { |
294 | var busqueda: List<InvBodySec> | 333 | var busqueda: List<InvBodySec> |
295 | return fragmentScopeInvSec.async(IO) { | 334 | return fragmentScopeInvSec.async(IO) { |
296 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.fetchInvSecBodyGroup(invNum) | 335 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.fetchInvSecBodyGroup(invNum) |
297 | return@async busqueda | 336 | return@async busqueda |
298 | }.await() | 337 | }.await() |
app/src/main/java/com/focasoftware/deboinventariov20/UI/configuracion/ConfiguracionFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.configuracion | 1 | package com.focasoftware.deboinventariov20.UI.configuracion |
2 | 2 | ||
3 | import android.content.Context | 3 | import android.content.Context |
4 | import android.content.SharedPreferences | 4 | import android.content.SharedPreferences |
5 | import android.os.Bundle | 5 | import android.os.Bundle |
6 | import android.view.LayoutInflater | 6 | import android.view.LayoutInflater |
7 | import android.view.View | 7 | import android.view.View |
8 | import android.view.ViewGroup | 8 | import android.view.ViewGroup |
9 | import android.widget.* | 9 | import android.widget.* |
10 | import androidx.fragment.app.Fragment | 10 | import androidx.fragment.app.Fragment |
11 | import androidx.lifecycle.lifecycleScope | 11 | import androidx.lifecycle.lifecycleScope |
12 | import androidx.navigation.NavController | 12 | import androidx.navigation.NavController |
13 | import androidx.navigation.Navigation | 13 | import androidx.navigation.Navigation |
14 | import androidx.navigation.fragment.findNavController | 14 | import androidx.navigation.fragment.findNavController |
15 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 15 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
16 | import com.focasoftware.deboinventariov20.Model.* | 16 | import com.focasoftware.deboinventariov20.Model.* |
17 | import com.focasoftware.deboinventariov20.R | 17 | import com.focasoftware.deboinventariov20.R |
18 | import com.focasoftware.deboinventariov20.UI.MainActivity | 18 | import com.focasoftware.deboinventariov20.UI.MainActivity |
19 | import com.focasoftware.deboinventariov20.UI.Utils.* | 19 | import com.focasoftware.deboinventariov20.UI.Utils.* |
20 | import kotlinx.android.synthetic.main.fragment_configuracion.* | 20 | import kotlinx.android.synthetic.main.fragment_configuracion.* |
21 | import kotlinx.coroutines.* | 21 | import kotlinx.coroutines.* |
22 | import kotlinx.coroutines.Dispatchers.Main | 22 | import kotlinx.coroutines.Dispatchers.Main |
23 | import retrofit2.Call | 23 | import retrofit2.Call |
24 | import retrofit2.Callback | 24 | import retrofit2.Callback |
25 | import retrofit2.Response | 25 | import retrofit2.Response |
26 | import java.net.SocketTimeoutException | 26 | import java.net.SocketTimeoutException |
27 | import kotlin.math.absoluteValue | 27 | import kotlin.math.absoluteValue |
28 | 28 | ||
29 | 29 | ||
30 | class ConfiguracionFragment : Fragment() { | 30 | class ConfiguracionFragment : Fragment() { |
31 | 31 | ||
32 | lateinit var sharedPreferences: SharedPreferences | 32 | lateinit var sharedPreferences: SharedPreferences |
33 | private lateinit var navController: NavController | 33 | private lateinit var navController: NavController |
34 | var itemSelect: Int = 0 | 34 | var itemSelect: Int = 0 |
35 | var indexSelect: Int = 0 | 35 | var indexSelect: Int = 0 |
36 | 36 | ||
37 | override fun onCreate(savedInstanceState: Bundle?) { | 37 | override fun onCreate(savedInstanceState: Bundle?) { |
38 | super.onCreate(savedInstanceState) | 38 | super.onCreate(savedInstanceState) |
39 | sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 39 | sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
40 | } | 40 | } |
41 | 41 | ||
42 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 42 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
43 | super.onViewCreated(view, savedInstanceState) | 43 | super.onViewCreated(view, savedInstanceState) |
44 | navController = Navigation.findNavController(view) | 44 | navController = Navigation.findNavController(view) |
45 | 45 | ||
46 | GlobalScope.launch(Main) { | 46 | GlobalScope.launch(Main) { |
47 | val listServer = mutableListOf<String>() | 47 | val listServer = mutableListOf<String>() |
48 | for (server in getDescServers()) { | 48 | for (server in getDescServers()) { |
49 | listServer.add((if (server.servNum < 9) "0" + server.servNum.toString() else server.servNum.toString()) + " - " + server.descripcion.toString()) | 49 | listServer.add((if (server.servNum < 9) "0" + server.servNum.toString() else server.servNum.toString()) + " - " + server.descripcion.toString()) |
50 | } | 50 | } |
51 | val adapterSpServer = ArrayAdapter( | 51 | val adapterSpServer = ArrayAdapter( |
52 | requireContext(), | 52 | requireContext(), |
53 | R.layout.support_simple_spinner_dropdown_item, | 53 | R.layout.support_simple_spinner_dropdown_item, |
54 | listServer | 54 | listServer |
55 | ) | 55 | ) |
56 | spServidor.adapter = adapterSpServer | 56 | spServidor.adapter = adapterSpServer |
57 | if (sharedPreferences.contains("ServerPredeterminado")) { | 57 | if (sharedPreferences.contains("ServerPredeterminado")) { |
58 | spServidor.setSelection( | 58 | spServidor.setSelection( |
59 | sharedPreferences.getString("ServerPredeterminado", "").toString().toInt() | 59 | sharedPreferences.getString("ServerPredeterminado", "").toString().toInt() |
60 | ) | 60 | ) |
61 | } else (spServidor.setSelection(0)) | 61 | } else (spServidor.setSelection(0)) |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 65 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
66 | 66 | ||
67 | val v = inflater.inflate(R.layout.fragment_configuracion, container, false) | 67 | val v = inflater.inflate(R.layout.fragment_configuracion, container, false) |
68 | val btnGuardar = v.findViewById<Button>(R.id.btnGuardar) | 68 | val btnGuardar = v.findViewById<Button>(R.id.btnGuardar) |
69 | val rbProInclu = v.findViewById<RadioButton>(R.id.rbProInclu) | 69 | val rbProInclu = v.findViewById<RadioButton>(R.id.rbProInclu) |
70 | val rbProNoInclu = v.findViewById<RadioButton>(R.id.rbProNoInclu) | 70 | val rbProNoInclu = v.findViewById<RadioButton>(R.id.rbProNoInclu) |
71 | val cbHabiLectura = v.findViewById<CheckBox>(R.id.cbHabiLectura) | 71 | val cbHabiLectura = v.findViewById<CheckBox>(R.id.cbHabiLectura) |
72 | val cbMostrarStock = v.findViewById<CheckBox>(R.id.cbMostrarStock) | 72 | val cbMostrarStock = v.findViewById<CheckBox>(R.id.cbMostrarStock) |
73 | // val rbCodigoBarras = v.findViewById<RadioButton>(R.id.rbCodigoBarras) | 73 | // val rbCodigoBarras = v.findViewById<RadioButton>(R.id.rbCodigoBarras) |
74 | // val rbCodigoDebo = v.findViewById<RadioButton>(R.id.rbCodigoDebo) | 74 | // val rbCodigoDebo = v.findViewById<RadioButton>(R.id.rbCodigoDebo) |
75 | // val rbCodigoOrigen = v.findViewById<RadioButton>(R.id.rbCodigoOrigen) | 75 | // val rbCodigoOrigen = v.findViewById<RadioButton>(R.id.rbCodigoOrigen) |
76 | val rbDeposito = v.findViewById<RadioButton>(R.id.rbDeposito) | 76 | val rbDeposito = v.findViewById<RadioButton>(R.id.rbDeposito) |
77 | val rbVentas = v.findViewById<RadioButton>(R.id.rbVentas) | 77 | val rbVentas = v.findViewById<RadioButton>(R.id.rbVentas) |
78 | val btnAgregarServidor = v.findViewById<Button>(R.id.btnAgregarServidor) | 78 | val btnAgregarServidor = v.findViewById<Button>(R.id.btnAgregarServidor) |
79 | val spServidor = v.findViewById<Spinner>(R.id.spServidor) | 79 | val spServidor = v.findViewById<Spinner>(R.id.spServidor) |
80 | val btnValidarServidor = v.findViewById<Button>(R.id.btnValidarServidor) | 80 | val btnValidarServidor = v.findViewById<Button>(R.id.btnValidarServidor) |
81 | val cbAskTimeServerToStart = v.findViewById<CheckBox>(R.id.cbAskTimeServerToStart) | 81 | val cbAskTimeServerToStart = v.findViewById<CheckBox>(R.id.cbAskTimeServerToStart) |
82 | 82 | ||
83 | if (sharedPreferences.contains("etRuta")) if (sharedPreferences.contains("rbProInclu")) { | 83 | if (sharedPreferences.contains("etRuta")) if (sharedPreferences.contains("rbProInclu")) { |
84 | if (sharedPreferences.getString("rbProInclu", "").toString() == "0") { | 84 | if (sharedPreferences.getString("rbProInclu", "").toString() == "0") { |
85 | rbProInclu.isChecked = false | 85 | rbProInclu.isChecked = false |
86 | rbProNoInclu.isChecked = true | 86 | rbProNoInclu.isChecked = true |
87 | } else if (sharedPreferences.getString("rbProInclu", "").toString() == "1") { | 87 | } else if (sharedPreferences.getString("rbProInclu", "").toString() == "1") { |
88 | rbProInclu.isChecked = true | 88 | rbProInclu.isChecked = true |
89 | rbProNoInclu.isChecked = false | 89 | rbProNoInclu.isChecked = false |
90 | } | 90 | } |
91 | } else (sharedPreferences.getString("rbProInclu", "").toString() == "") | 91 | } else (sharedPreferences.getString("rbProInclu", "").toString() == "") |
92 | 92 | ||
93 | if (sharedPreferences.contains("rbProNoInclu")) { | 93 | if (sharedPreferences.contains("rbProNoInclu")) { |
94 | if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") { | 94 | if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") { |
95 | rbProNoInclu.isChecked = false | 95 | rbProNoInclu.isChecked = false |
96 | rbProInclu.isChecked = true | 96 | rbProInclu.isChecked = true |
97 | } else if (sharedPreferences.getString("rbProNoInclu", "").toString() == "1") { | 97 | } else if (sharedPreferences.getString("rbProNoInclu", "").toString() == "1") { |
98 | rbProNoInclu.isChecked = true | 98 | rbProNoInclu.isChecked = true |
99 | rbProInclu.isChecked = false | 99 | rbProInclu.isChecked = false |
100 | } | 100 | } |
101 | } else (sharedPreferences.getString("rbProNoInclu", "").toString() == "") | 101 | } else (sharedPreferences.getString("rbProNoInclu", "").toString() == "") |
102 | 102 | ||
103 | if (sharedPreferences.contains("cbHabiLectura")) { | 103 | if (sharedPreferences.contains("cbHabiLectura")) { |
104 | if (sharedPreferences.getString("cbHabiLectura", "").toString() == "0") { | 104 | if (sharedPreferences.getString("cbHabiLectura", "").toString() == "0") { |
105 | cbHabiLectura.isChecked = false | 105 | cbHabiLectura.isChecked = false |
106 | } else if (sharedPreferences.getString("cbHabiLectura", "").toString() == "1") { | 106 | } else if (sharedPreferences.getString("cbHabiLectura", "").toString() == "1") { |
107 | cbHabiLectura.isChecked = true | 107 | cbHabiLectura.isChecked = true |
108 | } | 108 | } |
109 | } else (sharedPreferences.getString("cbHabiLectura", "").toString() == "") | 109 | } else (sharedPreferences.getString("cbHabiLectura", "").toString() == "") |
110 | 110 | ||
111 | if (sharedPreferences.contains("cbMostrarStock")) { | 111 | if (sharedPreferences.contains("cbMostrarStock")) { |
112 | if (sharedPreferences.getString("cbMostrarStock", "").toString() == "0") { | 112 | if (sharedPreferences.getString("cbMostrarStock", "").toString() == "0") { |
113 | cbMostrarStock.isChecked = false | 113 | cbMostrarStock.isChecked = false |
114 | } else if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") { | 114 | } else if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") { |
115 | cbMostrarStock.isChecked = true | 115 | cbMostrarStock.isChecked = true |
116 | } | 116 | } |
117 | } else (sharedPreferences.getString("cbMostrarStock", "").toString() == "") | 117 | } else (sharedPreferences.getString("cbMostrarStock", "").toString() == "") |
118 | 118 | ||
119 | if (sharedPreferences.contains("rbVentas")) { | 119 | if (sharedPreferences.contains("rbVentas")) { |
120 | if (sharedPreferences.getString("rbVentas", "").toString() == "0") { | 120 | if (sharedPreferences.getString("rbVentas", "").toString() == "0") { |
121 | rbVentas.isChecked = false | 121 | rbVentas.isChecked = false |
122 | rbDeposito.isChecked = true | 122 | rbDeposito.isChecked = true |
123 | } else if (sharedPreferences.getString("rbVentas", "").toString() == "1") { | 123 | } else if (sharedPreferences.getString("rbVentas", "").toString() == "1") { |
124 | rbVentas.isChecked = true | 124 | rbVentas.isChecked = true |
125 | rbDeposito.isChecked = false | 125 | rbDeposito.isChecked = false |
126 | } | 126 | } |
127 | } else (sharedPreferences.getString("rbVentas", "").toString() == "") | 127 | } else (sharedPreferences.getString("rbVentas", "").toString() == "") |
128 | 128 | ||
129 | if (sharedPreferences.contains("rbDeposito")) { | 129 | if (sharedPreferences.contains("rbDeposito")) { |
130 | if (sharedPreferences.getString("rbDeposito", "").toString() == "0") { | 130 | if (sharedPreferences.getString("rbDeposito", "").toString() == "0") { |
131 | rbDeposito.isChecked = false | 131 | rbDeposito.isChecked = false |
132 | rbVentas.isChecked = true | 132 | rbVentas.isChecked = true |
133 | } else if (sharedPreferences.getString("rbDeposito", "").toString() == "1") { | 133 | } else if (sharedPreferences.getString("rbDeposito", "").toString() == "1") { |
134 | rbDeposito.isChecked = true | 134 | rbDeposito.isChecked = true |
135 | rbVentas.isChecked = false | 135 | rbVentas.isChecked = false |
136 | } | 136 | } |
137 | } else (sharedPreferences.getString("rbDeposito", "").toString() == "") | 137 | } else (sharedPreferences.getString("rbDeposito", "").toString() == "") |
138 | 138 | ||
139 | // if (sharedPreferences.contains("rbCodigoDebo")) { | 139 | // if (sharedPreferences.contains("rbCodigoDebo")) { |
140 | // if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "0") { | 140 | // if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "0") { |
141 | // rbCodigoDebo.isChecked = false | 141 | // rbCodigoDebo.isChecked = false |
142 | // rbCodigoOrigen.isChecked = false | 142 | // rbCodigoOrigen.isChecked = false |
143 | // rbCodigoBarras.isChecked = false | 143 | // rbCodigoBarras.isChecked = false |
144 | // } else if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "1") { | 144 | // } else if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "1") { |
145 | // rbCodigoDebo.isChecked = true | 145 | // rbCodigoDebo.isChecked = true |
146 | // rbCodigoOrigen.isChecked = false | 146 | // rbCodigoOrigen.isChecked = false |
147 | // rbCodigoBarras.isChecked = false | 147 | // rbCodigoBarras.isChecked = false |
148 | // } | 148 | // } |
149 | // } else (sharedPreferences.getString("rbCodigoDebo", "").toString() == "") | 149 | // } else (sharedPreferences.getString("rbCodigoDebo", "").toString() == "") |
150 | // | 150 | // |
151 | // if (sharedPreferences.contains("rbCodigoOrigen")) { | 151 | // if (sharedPreferences.contains("rbCodigoOrigen")) { |
152 | // if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "0") { | 152 | // if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "0") { |
153 | // rbCodigoOrigen.isChecked = false | 153 | // rbCodigoOrigen.isChecked = false |
154 | // } else if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "1") { | 154 | // } else if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "1") { |
155 | // rbCodigoOrigen.isChecked = true | 155 | // rbCodigoOrigen.isChecked = true |
156 | // } | 156 | // } |
157 | // } else (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "") | 157 | // } else (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "") |
158 | 158 | ||
159 | // if (sharedPreferences.contains("rbCodigoBarras")) { | 159 | // if (sharedPreferences.contains("rbCodigoBarras")) { |
160 | // if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "0") { | 160 | // if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "0") { |
161 | // rbCodigoBarras.isChecked = false | 161 | // rbCodigoBarras.isChecked = false |
162 | // } else if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "1") { | 162 | // } else if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "1") { |
163 | // rbCodigoBarras.isChecked = true | 163 | // rbCodigoBarras.isChecked = true |
164 | // } | 164 | // } |
165 | // } else (sharedPreferences.getString("rbCodigoBarras", "").toString() == "") | 165 | // } else (sharedPreferences.getString("rbCodigoBarras", "").toString() == "") |
166 | 166 | ||
167 | if (sharedPreferences.contains("cbAskTimeServerToStart")) { | 167 | if (sharedPreferences.contains("cbAskTimeServerToStart")) { |
168 | if (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "0") { | 168 | if (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "0") { |
169 | cbAskTimeServerToStart.isChecked = false | 169 | cbAskTimeServerToStart.isChecked = false |
170 | } else if (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "1") { | 170 | } else if (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "1") { |
171 | cbAskTimeServerToStart.isChecked = true | 171 | cbAskTimeServerToStart.isChecked = true |
172 | } | 172 | } |
173 | } else (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "") | 173 | } else (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "") |
174 | 174 | ||
175 | 175 | ||
176 | btnGuardar.setOnClickListener { | 176 | btnGuardar.setOnClickListener { |
177 | guardarPreferencias() | 177 | guardarPreferencias() |
178 | GlobalScope.launch(Main) { | 178 | GlobalScope.launch(Main) { |
179 | 179 | ||
180 | val serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne() | 180 | val serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne() |
181 | if (serverBajada != null) { | 181 | if (serverBajada != null) { |
182 | if (serverBajada.direccion.isNullOrEmpty()) { | 182 | if (serverBajada.direccion.isNullOrEmpty()) { |
183 | val modalDialog = NoServerConf() | 183 | val modalDialog = NoServerConf() |
184 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 184 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
185 | } else { | 185 | } else { |
186 | BASE_URL = serverBajada.direccion.toString() + ":" + serverBajada.puertoBajada.toString() + "/" | 186 | BASE_URL = serverBajada.direccion.toString() + ":" + serverBajada.puertoBajada.toString() + "/" |
187 | val call: Call<List<Time?>?>? = WebService.instance | 187 | val call: Call<List<Time?>?>? = WebService.instance |
188 | ?.createService(WebServiceApi::class.java) | 188 | ?.createService(WebServiceApi::class.java) |
189 | ?.getTime() | 189 | ?.getTime() |
190 | call!!.enqueue(object : Callback<List<Time?>?> { | 190 | call!!.enqueue(object : Callback<List<Time?>?> { |
191 | override fun onResponse(call: Call<List<Time?>?>?, response: Response<List<Time?>?>) { | 191 | override fun onResponse(call: Call<List<Time?>?>?, response: Response<List<Time?>?>) { |
192 | if (response.code() == 200) { | 192 | if (response.code() == 200) { |
193 | try { | 193 | try { |
194 | val timeServer = | 194 | val timeServer = |
195 | response.body()?.get(0)?.dia + "/" + | 195 | response.body()?.get(0)?.dia + "/" + |
196 | response.body()?.get(0)?.mes + "/" + | 196 | response.body()?.get(0)?.mes + "/" + |
197 | response.body()?.get(0)?.ano + " " + | 197 | response.body()?.get(0)?.ano + " " + |
198 | response.body()?.get(0)?.hora + ":" + | 198 | response.body()?.get(0)?.hora + ":" + |
199 | response.body()?.get(0)?.minutos + ":" + | 199 | response.body()?.get(0)?.minutos + ":" + |
200 | response.body()?.get(0)?.segundos | 200 | response.body()?.get(0)?.segundos |
201 | val horaServer = response.body()?.get(0)?.hora + "" + | 201 | val horaServer = response.body()?.get(0)?.hora + "" + |
202 | response.body()?.get(0)?.minutos + "" + | 202 | response.body()?.get(0)?.minutos + "" + |
203 | response.body()?.get(0)?.segundos | 203 | response.body()?.get(0)?.segundos |
204 | val fechaServer = response.body()?.get(0)?.dia + "" + | 204 | val fechaServer = response.body()?.get(0)?.dia + "" + |
205 | response.body()?.get(0)?.mes + "" + | 205 | response.body()?.get(0)?.mes + "" + |
206 | response.body()?.get(0)?.ano | 206 | response.body()?.get(0)?.ano |
207 | if (!askTimeServer(timeServer, horaServer, fechaServer)) { | 207 | if (!askTimeServer(timeServer, horaServer, fechaServer)) { |
208 | // Toast.makeText(v.context, "Los Datos se guardaron correctamente", Toast.LENGTH_SHORT).show() | 208 | // Toast.makeText(v.context, "Los Datos se guardaron correctamente", Toast.LENGTH_SHORT).show() |
209 | // navController.navigate(R.id.action_configuracionFragment_to_mainFragment2) | 209 | // navController.navigate(R.id.action_configuracionFragment_to_mainFragment2) |
210 | } | 210 | } |
211 | } catch (e: SocketTimeoutException) { | 211 | } catch (e: SocketTimeoutException) { |
212 | 212 | ||
213 | } | 213 | } |
214 | } else if (response.code() == 400) { | 214 | } else if (response.code() == 400) { |
215 | } | 215 | } |
216 | } | 216 | } |
217 | 217 | ||
218 | override fun onFailure(call: Call<List<Time?>?>?, t: Throwable?) {} | 218 | override fun onFailure(call: Call<List<Time?>?>?, t: Throwable?) {} |
219 | }) | 219 | }) |
220 | 220 | ||
221 | Toast.makeText(v.context, "Los Datos se guardaron correctamente", Toast.LENGTH_SHORT).show() | 221 | Toast.makeText(v.context, "Los Datos se guardaron correctamente", Toast.LENGTH_SHORT).show() |
222 | navController.navigate(R.id.action_configuracionFragment_to_mainFragment2) | 222 | navController.navigate(R.id.action_configuracionFragment_to_mainFragment2) |
223 | |||
224 | } | 223 | } |
225 | } | 224 | } |
226 | } | 225 | } |
227 | } | 226 | } |
228 | btnAgregarServidor.setOnClickListener { findNavController().navigate(R.id.servidoresFragment) } | 227 | btnAgregarServidor.setOnClickListener { findNavController().navigate(R.id.servidoresFragment) } |
229 | 228 | ||
230 | spServidor.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { | 229 | spServidor.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { |
231 | override fun onNothingSelected(parent: AdapterView<*>?) {} | 230 | override fun onNothingSelected(parent: AdapterView<*>?) {} |
232 | override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { | 231 | override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { |
233 | itemSelect = parent!!.getItemAtPosition(position).toString().substring(0, 2).toInt() | 232 | itemSelect = parent!!.getItemAtPosition(position).toString().substring(0, 2).toInt() |
234 | indexSelect = position | 233 | indexSelect = position |
235 | } | 234 | } |
236 | } | 235 | } |
237 | 236 | ||
238 | btnValidarServidor.setOnClickListener { | 237 | btnValidarServidor.setOnClickListener { |
239 | GlobalScope.launch(Main) { | 238 | GlobalScope.launch(Main) { |
240 | val serverPre = fetchServer() | 239 | val serverPre = fetchServer() |
241 | if (serverPre != null) { | 240 | if (serverPre != null) { |
242 | if (isConnectedToThisServer(serverPre.direccion.toString().substring(7, serverPre.direccion.toString().length))) { | 241 | if (isConnectedToThisServer(serverPre.direccion.toString().substring(7, serverPre.direccion.toString().length))) { |
243 | val modalDialog = ServerValido() | 242 | val modalDialog = ServerValido() |
244 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 243 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
245 | } else { | 244 | } else { |
246 | val modalDialog = ServerNoValido() | 245 | val modalDialog = ServerNoValido() |
247 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 246 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
248 | } | 247 | } |
249 | } | 248 | } |
250 | } | 249 | } |
251 | } | 250 | } |
252 | 251 | ||
253 | rbVentas.setOnClickListener { | 252 | rbVentas.setOnClickListener { |
254 | val modalDialog = SelAreaInventarioVentas() | 253 | val modalDialog = SelAreaInventarioVentas() |
255 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 254 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
256 | } | 255 | } |
257 | 256 | ||
258 | rbDeposito.setOnClickListener { | 257 | rbDeposito.setOnClickListener { |
259 | val modalDialog = SelAreaInventarioDeposito() | 258 | val modalDialog = SelAreaInventarioDeposito() |
260 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 259 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
261 | } | 260 | } |
262 | return v | 261 | return v |
263 | } | 262 | } |
264 | 263 | ||
265 | private suspend fun fetchServer(): ServeInv? { | 264 | private suspend fun fetchServer(): ServeInv? { |
266 | return GlobalScope.async(Dispatchers.IO) { | 265 | return GlobalScope.async(Dispatchers.IO) { |
267 | return@async AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServer(itemSelect) | 266 | return@async AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServer(itemSelect) |
268 | }.await() | 267 | }.await() |
269 | } | 268 | } |
270 | 269 | ||
271 | private suspend fun getDescServers(): List<ServeInv> { | 270 | private suspend fun getDescServers(): List<ServeInv> { |
272 | return GlobalScope.async(Dispatchers.IO) { | 271 | return GlobalScope.async(Dispatchers.IO) { |
273 | return@async AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchAllServers() | 272 | return@async AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchAllServers() |
274 | }.await() | 273 | }.await() |
275 | } | 274 | } |
276 | 275 | ||
277 | fun guardarPreferencias() { | 276 | fun guardarPreferencias() { |
278 | try { | 277 | try { |
279 | val editor = sharedPreferences.edit() | 278 | val editor = sharedPreferences.edit() |
280 | 279 | ||
281 | if (etRuta.text.isNotEmpty()) editor?.putString("etRuta", etRuta.text.toString()) | 280 | if (etRuta.text.isNotEmpty()) editor?.putString("etRuta", etRuta.text.toString()) |
282 | 281 | ||
283 | if (rbProInclu.isChecked) editor?.putString("rbProInclu", "1") else editor?.putString("rbProInclu", "0") | 282 | if (rbProInclu.isChecked) editor?.putString("rbProInclu", "1") else editor?.putString("rbProInclu", "0") |
284 | if (rbProNoInclu.isChecked) editor?.putString("rbProNoInclu", "1") else editor?.putString("rbProNoInclu", "0") | 283 | if (rbProNoInclu.isChecked) editor?.putString("rbProNoInclu", "1") else editor?.putString("rbProNoInclu", "0") |
285 | if (cbHabiLectura.isChecked) editor?.putString("cbHabiLectura", "1") else editor?.putString("cbHabiLectura", "0") | 284 | if (cbHabiLectura.isChecked) editor?.putString("cbHabiLectura", "1") else editor?.putString("cbHabiLectura", "0") |
286 | if (cbMostrarStock.isChecked) editor?.putString("cbMostrarStock", "1") else editor?.putString("cbMostrarStock", "0") | 285 | if (cbMostrarStock.isChecked) editor?.putString("cbMostrarStock", "1") else editor?.putString("cbMostrarStock", "0") |
287 | if (rbVentas.isChecked) editor?.putString("rbVentas", "1") else editor?.putString("rbVentas", "0") | 286 | if (rbVentas.isChecked) editor?.putString("rbVentas", "1") else editor?.putString("rbVentas", "0") |
288 | if (rbDeposito.isChecked) editor?.putString("rbDeposito", "1") else editor?.putString("rbDeposito", "0") | 287 | if (rbDeposito.isChecked) editor?.putString("rbDeposito", "1") else editor?.putString("rbDeposito", "0") |
289 | if (cbAskTimeServerToStart.isChecked) editor?.putString("cbAskTimeServerToStart", "1") else editor?.putString("cbAskTimeServerToStart", "0") | 288 | if (cbAskTimeServerToStart.isChecked) editor?.putString("cbAskTimeServerToStart", "1") else editor?.putString("cbAskTimeServerToStart", "0") |
290 | editor?.putString("ServerPredeterminado", indexSelect.toString()) | 289 | editor?.putString("ServerPredeterminado", indexSelect.toString()) |
291 | updateServerPreInZero() | 290 | updateServerPreInZero() |
292 | updateServerPre(itemSelect) | 291 | updateServerPre(itemSelect) |
293 | 292 | ||
294 | editor?.apply() | 293 | editor?.apply() |
295 | editor.commit() | 294 | editor.commit() |
296 | 295 | ||
297 | } catch (e: Exception) { | 296 | } catch (e: Exception) { |
298 | Toast.makeText(requireContext(), "Error ", Toast.LENGTH_LONG).show() | 297 | Toast.makeText(requireContext(), "Error ", Toast.LENGTH_LONG).show() |
299 | e.printStackTrace() | 298 | e.printStackTrace() |
300 | } | 299 | } |
301 | } | 300 | } |
302 | 301 | ||
303 | private fun askTimeServer(timeServer: String, horaServer: String, fechaServer: String): Boolean { | 302 | private fun askTimeServer(timeServer: String, horaServer: String, fechaServer: String): Boolean { |
304 | 303 | ||
305 | var existeDiferencias = false | 304 | var existeDiferencias = false |
306 | val horaAct = obtenerHoraActual().toDouble() | 305 | val horaAct = obtenerHoraActual().toDouble() |
307 | val fechaAct = obtenerDiaActual().toDouble() | 306 | val fechaAct = obtenerDiaActual().toDouble() |
308 | val difFecha = fechaAct - fechaServer.toDouble() | 307 | val difFecha = fechaAct - fechaServer.toDouble() |
309 | val difHora = horaAct - horaServer.toDouble() | 308 | val difHora = horaAct - horaServer.toDouble() |
310 | if (difFecha.absoluteValue > 0) existeDiferencias = true | 309 | if (difFecha.absoluteValue > 0) existeDiferencias = true |
311 | if (difHora.absoluteValue > 130) existeDiferencias = true | 310 | if (difHora.absoluteValue > 130) existeDiferencias = true |
312 | 311 | ||
313 | if (existeDiferencias) { | 312 | if (existeDiferencias) { |
314 | dialogoHoraServer((activity as MainActivity), requireContext(), obtenerFechaActual(), timeServer) | 313 | dialogoHoraServer((activity as MainActivity), requireContext(), obtenerFechaActual(), timeServer) |
315 | } | 314 | } |
316 | return existeDiferencias | 315 | return existeDiferencias |
317 | } | 316 | } |
318 | 317 | ||
319 | private fun updateServerPreInZero() { | 318 | private fun updateServerPreInZero() { |
320 | lifecycleScope.launch { | 319 | lifecycleScope.launch { |
321 | withContext(Dispatchers.IO) { | 320 | withContext(Dispatchers.IO) { |
322 | // val activity: FragmentActivity? = activity | 321 | // val activity: FragmentActivity? = activity |
323 | // if (activity != null && isAdded) { | 322 | // if (activity != null && isAdded) { |
324 | AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.UpdateServerPreInZero() | 323 | AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.UpdateServerPreInZero() |
325 | // } | 324 | // } |
326 | } | 325 | } |
327 | } | 326 | } |
328 | } | 327 | } |
329 | 328 | ||
330 | private fun updateServerPre(server: Int) { | 329 | private fun updateServerPre(server: Int) { |
331 | lifecycleScope.launch { | 330 | lifecycleScope.launch { |
332 | withContext(Dispatchers.IO) { | 331 | withContext(Dispatchers.IO) { |
333 | // val activity: FragmentActivity? = activity | 332 | // val activity: FragmentActivity? = activity |
334 | // if (activity != null) { | 333 | // if (activity != null) { |
335 | AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.UpdateServerPre(server) | 334 | AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.UpdateServerPre(server) |
336 | // } | 335 | // } |
337 | } | 336 | } |
338 | } | 337 | } |
339 | } | 338 | } |
340 | } | 339 | } |
341 | 340 | ||
342 | 341 | ||
343 | 342 | ||
344 | 343 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/detalleProducto/DetalleArtFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.detalleProducto | 1 | package com.focasoftware.deboinventariov20.UI.detalleProducto |
2 | 2 | ||
3 | import android.content.Context | 3 | import android.content.Context |
4 | import android.content.SharedPreferences | 4 | import android.content.SharedPreferences |
5 | import android.os.Bundle | 5 | import android.os.Bundle |
6 | import android.view.LayoutInflater | 6 | import android.view.LayoutInflater |
7 | import android.view.View | 7 | import android.view.View |
8 | import android.view.ViewGroup | 8 | import android.view.ViewGroup |
9 | import android.view.inputmethod.InputMethodManager | 9 | import android.view.inputmethod.InputMethodManager |
10 | import androidx.fragment.app.Fragment | 10 | import androidx.fragment.app.Fragment |
11 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 11 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
12 | import com.focasoftware.deboinventariov20.Model.Articles | 12 | import com.focasoftware.deboinventariov20.Model.Articles |
13 | import com.focasoftware.deboinventariov20.R | 13 | import com.focasoftware.deboinventariov20.R |
14 | import kotlinx.android.synthetic.main.fragment_detalle_art.* | 14 | import kotlinx.android.synthetic.main.fragment_detalle_art.* |
15 | import kotlinx.coroutines.Dispatchers | 15 | import kotlinx.coroutines.Dispatchers |
16 | import kotlinx.coroutines.Dispatchers.Main | 16 | import kotlinx.coroutines.Dispatchers.Main |
17 | import kotlinx.coroutines.GlobalScope | 17 | import kotlinx.coroutines.GlobalScope |
18 | import kotlinx.coroutines.async | 18 | import kotlinx.coroutines.async |
19 | import kotlinx.coroutines.launch | 19 | import kotlinx.coroutines.launch |
20 | 20 | ||
21 | class DetalleArtFragment : Fragment() { | 21 | class DetalleArtFragment : Fragment() { |
22 | 22 | ||
23 | private var Inventario: Int = 0 | 23 | private var Inventario: Int = 0 |
24 | private var sector: String? = null | 24 | private var sector: String? = null |
25 | private var codigo: String? = null | 25 | private var codigo: String? = null |
26 | private var artSerch: Articles? = null | 26 | private var artSerch: Articles? = null |
27 | lateinit var sharedPreferences: SharedPreferences | 27 | lateinit var sharedPreferences: SharedPreferences |
28 | 28 | ||
29 | override fun onCreate(savedInstanceState: Bundle?) { | 29 | override fun onCreate(savedInstanceState: Bundle?) { |
30 | super.onCreate(savedInstanceState) | 30 | super.onCreate(savedInstanceState) |
31 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 31 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
32 | arguments?.let { | 32 | arguments?.let { |
33 | sector = it.getString("sector") | 33 | sector = it.getString("sector") |
34 | codigo = it.getString("codigo") | 34 | codigo = it.getString("codigo") |
35 | Inventario= it.getInt("numeroInv") | 35 | Inventario= it.getInt("numeroInv") |
36 | } | 36 | } |
37 | val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager? | 37 | val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager? |
38 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 38 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
39 | 39 | ||
40 | marcarInventario() | 40 | marcarInventario() |
41 | GlobalScope.launch(Main) { | 41 | GlobalScope.launch(Main) { |
42 | artSerch = buscarCodigoDeboEnBD(sector, codigo) | 42 | artSerch = buscarCodigoDeboEnBD(sector, codigo) |
43 | if (artSerch == null) { | 43 | if (artSerch == null) { |
44 | 44 | ||
45 | // val type = InputType.TYPE_CLASS_NUMBER | 45 | // val type = InputType.TYPE_CLASS_NUMBER |
46 | // MaterialDialog(requireContext()).show { | 46 | // MaterialDialog(requireContext()).show { |
47 | // | 47 | // |
48 | // title(text = "Producto '$sChangeUpper', se encuentra cargado.") | 48 | // title(text = "Producto '$sChangeUpper', se encuentra cargado.") |
49 | // message(R.string.sCantidadNueva) | 49 | // message(R.string.sCantidadNueva) |
50 | // input(waitForPositiveButton = false, hint = "99.99", inputType = type) { materialDialog, charSequence -> | 50 | // input(waitForPositiveButton = false, hint = "99.99", inputType = type) { materialDialog, charSequence -> |
51 | // fCant = 0F | 51 | // fCant = 0F |
52 | // fCant = charSequence.toString().toFloat() | 52 | // fCant = charSequence.toString().toFloat() |
53 | // } | 53 | // } |
54 | // positiveButton(R.string.btnOk) { | 54 | // positiveButton(R.string.btnOk) { |
55 | // //TODO ACTUALIZO CANTIADAD EN BD | 55 | // //TODO ACTUALIZO CANTIADAD EN BD |
56 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 56 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
57 | // //TODO ACTUALIZO CANTIDAD EN RV | 57 | // //TODO ACTUALIZO CANTIDAD EN RV |
58 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 58 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
59 | // viewAdapter.notifyDataSetChanged() | 59 | // viewAdapter.notifyDataSetChanged() |
60 | // dismiss() | 60 | // dismiss() |
61 | // } | 61 | // } |
62 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 62 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
63 | } else if (artSerch != null) { | 63 | } else if (artSerch != null) { |
64 | tvSector.text=sector | 64 | tvSector.text=sector |
65 | tvCodigo.text=codigo | 65 | tvCodigo.text=codigo |
66 | tvDeposito.text=if(!artSerch!!.depSn!!)"No" else "Si" | 66 | tvDeposito.text=if(!artSerch!!.depSn!!)"No" else "Si" |
67 | tvDescripcion.text=artSerch!!.descripcion.toString() | 67 | tvDescripcion.text=artSerch!!.descripcion.toString() |
68 | tvCodigoBarras.text=if (artSerch!!.codBar.toString()=="null")"" else artSerch!!.codBar.toString() | 68 | tvCodigoBarras.text=if (artSerch!!.codBar.toString()=="null")"" else artSerch!!.codBar.toString() |
69 | tvCodigoOrigen.text=if (artSerch!!.codOrigen.toString()=="null")"" else artSerch!!.codOrigen.toString() | 69 | tvCodigoOrigen.text=if (artSerch!!.codOrigen.toString()=="null")"" else artSerch!!.codOrigen.toString() |
70 | tvExiVenta.text=artSerch!!.exiVenta.toString() | 70 | tvExiVenta.text=artSerch!!.exiVenta.toString() |
71 | tvExiDeposito.text=artSerch!!.exiDeposito.toString() | 71 | tvExiDeposito.text=artSerch!!.exiDeposito.toString() |
72 | 72 | ||
73 | when ( artSerch!!.balanza.toString().toInt()) { | 73 | when ( artSerch!!.balanza.toString().toInt()) { |
74 | 1 ->tvBal.text="Unidades" | 74 | 1 ->tvBal.text="Unidades" |
75 | 2 ->tvBal.text="Litros" | 75 | 2 ->tvBal.text="Litros" |
76 | 3 ->tvBal.text="Cajas" | 76 | 3 ->tvBal.text="Cajas" |
77 | 4 ->tvBal.text="M3" | 77 | 4 ->tvBal.text="M3" |
78 | 5 ->tvBal.text="Metros" | 78 | 5 ->tvBal.text="Metros" |
79 | 6 ->tvBal.text="Fracción" | 79 | 6 ->tvBal.text="Fracción" |
80 | 7 ->tvBal.text="Bultos" | 80 | 7 ->tvBal.text="Bultos" |
81 | 8 ->tvBal.text="Gramos" | 81 | 8 ->tvBal.text="Gramos" |
82 | 9 ->tvBal.text="Cent. cúbicos" | 82 | 9 ->tvBal.text="Cent. cúbicos" |
83 | 10 ->tvBal.text="Kgs" | 83 | 10 ->tvBal.text="Kgs" |
84 | else -> { tvBal.text="Otros" | 84 | else -> { tvBal.text="Otros" |
85 | } | 85 | } |
86 | } | 86 | } |
87 | if(!artSerch!!.costo.toString().isNullOrEmpty()){} | 87 | if(artSerch!!.costo!=null) |
88 | tvCosto.text= | 88 | tvCosto.text= (Math.round(artSerch!!.costo.toString().toFloat() * 100.0) / 100.0).toString() |
89 | (Math.round(artSerch!!.costo.toString().toFloat() * 100.0) / 100.0).toString() | 89 | else tvCosto.text="0" |
90 | tvPrecio.text= (Math.round( artSerch!!.precio.toString().toFloat() * 100.0) / 100.0).toString() | 90 | |
91 | if(artSerch!!.precio!=null ) | ||
92 | tvPrecio.text= (Math.round( artSerch!!.precio.toString().toFloat() * 100.0) / 100.0).toString() | ||
93 | else tvPrecio.text="0" | ||
91 | } | 94 | } |
92 | } | 95 | } |
93 | } | 96 | } |
94 | 97 | ||
95 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 98 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
96 | 99 | ||
97 | return inflater.inflate(R.layout.fragment_detalle_art, container, false) | 100 | return inflater.inflate(R.layout.fragment_detalle_art, container, false) |
98 | } | 101 | } |
99 | 102 | ||
100 | suspend fun buscarCodigoDeboEnBD(sector: String?, codigo: String?): Articles? { | 103 | suspend fun buscarCodigoDeboEnBD(sector: String?, codigo: String?): Articles? { |
101 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 104 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
102 | var busqueda: Articles? | 105 | var busqueda: Articles? |
103 | return GlobalScope.async(Dispatchers.IO) { | 106 | return GlobalScope.async(Dispatchers.IO) { |
104 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.fetchArticuloByCodSec(sector, codigo) | 107 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.fetchArticuloByCodSec(sector, codigo) |
105 | return@async busqueda | 108 | return@async busqueda |
106 | }.await() | 109 | }.await() |
107 | } | 110 | } |
108 | fun marcarInventario() { | 111 | fun marcarInventario() { |
109 | 112 | ||
110 | val editor = sharedPreferences.edit() | 113 | val editor = sharedPreferences.edit() |
111 | editor?.putString("Inventario", Inventario.toString()) | 114 | editor?.putString("Inventario", Inventario.toString()) |
112 | editor?.apply() | 115 | editor?.apply() |
113 | editor.commit() | 116 | editor.commit() |
114 | // navController.navigate(R.id.action_descripcionFragment_to_inventarioFragment) | 117 | // navController.navigate(R.id.action_descripcionFragment_to_inventarioFragment) |
115 | } | 118 | } |
116 | } | 119 | } |
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.app.AlertDialog | 3 | import android.app.AlertDialog |
4 | import android.content.Context | 4 | import android.content.Context |
5 | import android.content.Context.INPUT_METHOD_SERVICE | 5 | import android.content.Context.INPUT_METHOD_SERVICE |
6 | import android.content.DialogInterface | 6 | import android.content.DialogInterface |
7 | import android.content.SharedPreferences | 7 | import android.content.SharedPreferences |
8 | import android.graphics.Canvas | 8 | import android.graphics.Canvas |
9 | import android.graphics.Color | 9 | import android.graphics.Color |
10 | import android.graphics.drawable.Drawable | 10 | import android.graphics.drawable.Drawable |
11 | import android.os.Bundle | 11 | import android.os.Bundle |
12 | import android.system.ErrnoException | 12 | import android.system.ErrnoException |
13 | import android.text.Editable | 13 | import android.text.Editable |
14 | import android.text.InputType.TYPE_CLASS_NUMBER | 14 | import android.text.InputType.TYPE_CLASS_NUMBER |
15 | import android.text.TextWatcher | 15 | import android.text.TextWatcher |
16 | import android.view.* | 16 | import android.view.* |
17 | import android.view.inputmethod.InputMethodManager | 17 | import android.view.inputmethod.InputMethodManager |
18 | import android.widget.EditText | 18 | import android.widget.EditText |
19 | import android.widget.TextView | 19 | import android.widget.TextView |
20 | import android.widget.Toast | 20 | import android.widget.Toast |
21 | import androidx.core.content.ContextCompat | 21 | import androidx.core.content.ContextCompat |
22 | import androidx.core.os.bundleOf | 22 | import androidx.core.os.bundleOf |
23 | import androidx.fragment.app.Fragment | 23 | import androidx.fragment.app.Fragment |
24 | import androidx.lifecycle.ViewModel | 24 | import androidx.lifecycle.ViewModel |
25 | import androidx.lifecycle.ViewModelProviders | 25 | import androidx.lifecycle.ViewModelProviders |
26 | import androidx.lifecycle.lifecycleScope | 26 | import androidx.lifecycle.lifecycleScope |
27 | import androidx.navigation.NavController | 27 | import androidx.navigation.NavController |
28 | import androidx.navigation.Navigation | 28 | import androidx.navigation.Navigation |
29 | import androidx.recyclerview.widget.ItemTouchHelper | 29 | import androidx.recyclerview.widget.ItemTouchHelper |
30 | import androidx.recyclerview.widget.LinearLayoutManager | 30 | import androidx.recyclerview.widget.LinearLayoutManager |
31 | import androidx.recyclerview.widget.RecyclerView | 31 | import androidx.recyclerview.widget.RecyclerView |
32 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 32 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
33 | import com.focasoftware.deboinventariov20.Model.* | 33 | import com.focasoftware.deboinventariov20.Model.* |
34 | import com.focasoftware.deboinventariov20.R | 34 | import com.focasoftware.deboinventariov20.R |
35 | import com.focasoftware.deboinventariov20.UI.MainActivity | 35 | import com.focasoftware.deboinventariov20.UI.MainActivity |
36 | import com.focasoftware.deboinventariov20.UI.Utils.* | 36 | import com.focasoftware.deboinventariov20.UI.Utils.* |
37 | import com.focasoftware.deboinventariov20.UI.inventario.viewModel.InventarioViewModel | 37 | import com.focasoftware.deboinventariov20.UI.inventario.viewModel.InventarioViewModel |
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 kotlinx.coroutines.Dispatchers.Main | 44 | import kotlinx.coroutines.Dispatchers.Main |
45 | import okhttp3.internal.http2.ErrorCode | ||
45 | import retrofit2.Call | 46 | import retrofit2.Call |
46 | import retrofit2.Callback | 47 | import retrofit2.Callback |
47 | import retrofit2.Response | 48 | import retrofit2.Response |
48 | import java.io.IOException | 49 | import java.io.IOException |
49 | import java.net.SocketTimeoutException | 50 | import java.net.SocketTimeoutException |
50 | import java.util.* | 51 | import java.util.* |
51 | import kotlin.collections.ArrayList | 52 | import kotlin.collections.ArrayList |
52 | 53 | ||
53 | private lateinit var sharedPreferences: SharedPreferences | 54 | private lateinit var sharedPreferences: SharedPreferences |
54 | private var iArea: Boolean = false | 55 | private var iArea: Boolean = false |
55 | private lateinit var invHead: InvHead | 56 | private lateinit var invHead: InvHead |
56 | private lateinit var viewAdapter: RecyclerView.Adapter<*> | 57 | private lateinit var viewAdapter: RecyclerView.Adapter<*> |
57 | private lateinit var viewManager: RecyclerView.LayoutManager | 58 | private lateinit var viewManager: RecyclerView.LayoutManager |
58 | private lateinit var sChangeUpper: String | 59 | private lateinit var sChangeUpper: String |
59 | private var listArticulos = ArrayList<ItemsRecycler>() | 60 | private var listArticulos = ArrayList<ItemsRecycler>() |
60 | private lateinit var navController: NavController | 61 | private lateinit var navController: NavController |
61 | private var iEstado = 0 | 62 | private var iEstado = 0 |
62 | private var iBusquedaPor = 0 | 63 | private var iBusquedaPor = 0 |
63 | private var fCant = 0F | 64 | private var fCant = 0F |
64 | private var bFirst = false | 65 | private var bFirst = false |
65 | private lateinit var deleteIcon: Drawable | 66 | private lateinit var deleteIcon: Drawable |
66 | lateinit var inventarioViewModel: ViewModel | 67 | lateinit var inventarioViewModel: ViewModel |
67 | private var sectorBalanza = 0 | 68 | private var codBarBalanza = "" |
68 | private var codigoBalanza = 0 | ||
69 | private var cantEnteraBalanza = 0 | 69 | private var cantEnteraBalanza = 0 |
70 | private var cantDecimalBalanza = 0 | 70 | private var cantDecimalBalanza = 0 |
71 | private var EsBalanza = false | 71 | private var EsBalanza = false |
72 | 72 | ||
73 | class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickListener { | 73 | class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickListener { |
74 | lateinit var mDialogView: View | 74 | lateinit var mDialogView: View |
75 | private lateinit var rcInventarios: RecyclerView | 75 | private lateinit var rcInventarios: RecyclerView |
76 | private val job: Job = Job() | 76 | private val job: Job = Job() |
77 | private val fragmentScopeInvFrag = CoroutineScope(IO + job) | 77 | private val fragmentScopeInvFrag = CoroutineScope(IO + job) |
78 | private var serverBajada: ServeInv? = null | 78 | private var serverBajada: ServeInv? = null |
79 | 79 | ||
80 | override fun onDestroy() { | 80 | override fun onDestroy() { |
81 | super.onDestroy() | 81 | super.onDestroy() |
82 | fragmentScopeInvFrag.cancel() | 82 | fragmentScopeInvFrag.cancel() |
83 | } | 83 | } |
84 | 84 | ||
85 | override fun onCreate(savedInstanceState: Bundle?) { | 85 | override fun onCreate(savedInstanceState: Bundle?) { |
86 | super.onCreate(savedInstanceState) | 86 | super.onCreate(savedInstanceState) |
87 | listArticulos.clear() | ||
87 | inventarioViewModel = ViewModelProviders.of(this).get(InventarioViewModel::class.java) | 88 | inventarioViewModel = ViewModelProviders.of(this).get(InventarioViewModel::class.java) |
88 | 89 | ||
89 | sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 90 | sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
90 | if (sharedPreferences.contains("Inventario")) if (sharedPreferences.getString("Inventario", "").toString() != "-1") { | 91 | if (sharedPreferences.contains("Inventario")) if (sharedPreferences.getString("Inventario", "").toString() != "-1") { |
91 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = sharedPreferences.getString("Inventario", "").toString().toInt() | 92 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = sharedPreferences.getString("Inventario", "").toString().toInt() |
92 | val editor = sharedPreferences.edit() | 93 | val editor = sharedPreferences.edit() |
93 | editor?.putString("Inventario", "-1") | 94 | editor?.putString("Inventario", "-1") |
94 | editor?.apply() | 95 | editor?.apply() |
95 | editor.commit() | 96 | editor.commit() |
96 | } | 97 | } |
97 | } | 98 | } |
98 | 99 | ||
99 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 100 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
100 | val v = inflater.inflate(R.layout.fragment_inventario, container, false) | 101 | val v = inflater.inflate(R.layout.fragment_inventario, container, false) |
101 | 102 | ||
102 | 103 | ||
103 | val tCodigoBarras = v.findViewById<EditText>(R.id.etCodigoBarras) | 104 | val tCodigoBarras = v.findViewById<EditText>(R.id.etCodigoBarras) |
104 | rcInventarios = v.findViewById(R.id.rcInventarios) | 105 | rcInventarios = v.findViewById(R.id.rcInventarios) |
105 | val tvTitulo = v.findViewById<TextView>(R.id.tvTitulo) | 106 | val tvTitulo = v.findViewById<TextView>(R.id.tvTitulo) |
106 | val descArea: String = if (!SerchArea()) "Ventas" else "Deposito" | 107 | val descArea: String = if (!SerchArea()) "Ventas" else "Deposito" |
107 | 108 | ||
108 | if ((inventarioViewModel as InventarioViewModel).InventarioNuevo == 0) {// TODO: SI INVETNARIO NUEVO | 109 | if ((inventarioViewModel as InventarioViewModel).InventarioNuevo == 0) {// TODO: SI INVETNARIO NUEVO |
109 | GlobalScope.launch(Dispatchers.Main) { | 110 | GlobalScope.launch(Dispatchers.Main) { |
110 | //TODO: BUSCO EL ULTIMO INVENTARIO EN LA BD PARA PODER CREAR EL PROXIMO | 111 | //TODO: BUSCO EL ULTIMO INVENTARIO EN LA BD PARA PODER CREAR EL PROXIMO |
111 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = AppDb.getAppDb((activity as MainActivity))?.InvHeadDAO()?.findLastInv()?.plus(1) ?: 1 | 112 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = AppDb.getAppDb((activity as MainActivity))?.InvHeadDAO()?.findLastInv()?.plus(1) ?: 1 |
112 | //TODO: CREAMOS EL INVENTARIO EN LA CABECERA DEL INVENTARIO | 113 | //TODO: CREAMOS EL INVENTARIO EN LA CABECERA DEL INVENTARIO |
113 | invHead = InvHead( | 114 | invHead = InvHead( |
114 | (inventarioViewModel as InventarioViewModel).InventarioNuevo, | 115 | (inventarioViewModel as InventarioViewModel).InventarioNuevo, |
115 | if (!SerchArea()) "Ventas" else "Deposito", | 116 | if (!SerchArea()) "Ventas" else "Deposito", |
116 | 1, | 117 | 1, |
117 | obtenerFechaActual(), | 118 | obtenerFechaActual(), |
118 | obtenerFechaActual(), | 119 | obtenerFechaActual(), |
119 | 0L, | 120 | 0L, |
120 | SerchArea(), | 121 | SerchArea(), |
121 | AjusteProductos(), | 122 | AjusteProductos(), |
122 | ProdNoCont() | 123 | ProdNoCont() |
123 | ) | 124 | ) |
124 | AppDb.getAppDb((activity as MainActivity))!!.InvHeadDAO()!!.insertInvHead(invHead) | 125 | AppDb.getAppDb((activity as MainActivity))!!.InvHeadDAO()!!.insertInvHead(invHead) |
125 | 126 | ||
126 | tvTitulo.text = "Inventario " + " # ${(inventarioViewModel as InventarioViewModel).InventarioNuevo} " + descArea | 127 | tvTitulo.text = "Inventario " + " # ${(inventarioViewModel as InventarioViewModel).InventarioNuevo} " + descArea |
127 | } | 128 | } |
128 | } else {// TODO (SI VENGO DE FRAGMENT DESCRIPCION) | 129 | } else {// TODO (SI VENGO DE FRAGMENT DESCRIPCION) |
129 | listArticulos.clear() | 130 | listArticulos.clear() |
130 | cargarDeBdInventario((inventarioViewModel as InventarioViewModel).InventarioNuevo) | 131 | cargarDeBdInventario((inventarioViewModel as InventarioViewModel).InventarioNuevo) |
131 | tvTitulo.text = "Inventario " + " # ${(inventarioViewModel as InventarioViewModel).InventarioNuevo} " + descArea | 132 | tvTitulo.text = "Inventario " + " # ${(inventarioViewModel as InventarioViewModel).InventarioNuevo} " + descArea |
132 | } | 133 | } |
133 | 134 | ||
134 | tCodigoBarras.setOnKeyListener { _, keyCode, keyEvent -> | 135 | tCodigoBarras.setOnKeyListener { _, keyCode, keyEvent -> |
135 | if (keyCode == KeyEvent.KEYCODE_ENTER && keyEvent.action == KeyEvent.ACTION_UP) { | 136 | if (keyCode == KeyEvent.KEYCODE_ENTER && keyEvent.action == KeyEvent.ACTION_UP) { |
136 | sChangeUpper = tCodigoBarras.text.toString() | 137 | sChangeUpper = tCodigoBarras.text.toString() |
137 | 138 | ||
138 | // val esnumero = try { | 139 | // val esnumero = try { |
139 | // val retorno = java.lang.Double.valueOf(sChangeUpper) | 140 | // val retorno = java.lang.Double.valueOf(sChangeUpper) |
140 | // true | 141 | // true |
141 | // } catch (e: NumberFormatException) { | 142 | // } catch (e: NumberFormatException) { |
142 | // //retorno = 0.0 | 143 | // //retorno = 0.0 |
143 | // false | 144 | // false |
144 | // } | 145 | // } |
145 | // if (esnumero){} | 146 | // if (esnumero){} |
146 | var indiceDelArtEncontrado = 0 | 147 | var indiceDelArtEncontrado = 0 |
147 | 148 | ||
148 | if (tCodigoBarras.text.isNullOrBlank()) { | 149 | if (tCodigoBarras.text.isNullOrBlank()) { |
149 | tCodigoBarras.error = "No puede estar vacio" | 150 | tCodigoBarras.error = "No puede estar vacio" |
150 | tCodigoBarras.requestFocus() | 151 | tCodigoBarras.requestFocus() |
151 | tCodigoBarras.hint = "No puede estar vacio" | 152 | tCodigoBarras.hint = "No puede estar vacio" |
152 | } else if (tCodigoBarras.text.toString().length < 4 && iEstado == 2) { | 153 | } else if (tCodigoBarras.text.toString().length < 4 && iEstado == 2) { |
153 | tCodigoBarras.error = "Minimo 4 caracteres" | 154 | tCodigoBarras.error = "Minimo 4 caracteres" |
154 | tCodigoBarras.requestFocus() | 155 | tCodigoBarras.requestFocus() |
155 | tCodigoBarras.hint = "4 Minimo" | 156 | tCodigoBarras.hint = "4 Minimo" |
156 | 157 | ||
157 | } else { | 158 | } else { |
158 | tCodigoBarras.hint = "" | 159 | tCodigoBarras.hint = "" |
159 | //TODO COMIENZA LA BUSQUEDA POR CODIGO DE BARRAS | 160 | //TODO COMIENZA LA BUSQUEDA POR CODIGO DE BARRAS |
160 | when (iBusquedaPor) { | 161 | when (iBusquedaPor) { |
161 | 0 -> { | 162 | 0 -> { |
162 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 163 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
163 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 164 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
164 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 165 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
165 | 166 | ||
166 | if (sharedPreferences.contains("cbHabiLectura")) { | 167 | if (sharedPreferences.contains("cbHabiLectura")) { |
167 | if (sharedPreferences.getString("cbHabiLectura", "").toString() == "1") { | 168 | if (sharedPreferences.getString("cbHabiLectura", "").toString() == "1") { |
168 | if (sChangeUpper.length == 13) | 169 | if (sChangeUpper.length == 13) |
169 | if (sChangeUpper.substring(0, 2) == "20" && sChangeUpper.substring(12, 13) == "2") { | 170 | if (sChangeUpper.substring(0, 2) == "20" && sChangeUpper.substring(12, 13) == "2") { |
170 | EsBalanza=true | 171 | EsBalanza=true |
171 | sectorBalanza = sChangeUpper.substring(2, 4).toInt() | 172 | codBarBalanza = sChangeUpper.substring(2,7).toString() |
172 | codigoBalanza = sChangeUpper.substring(4, 7).toInt() | ||
173 | cantEnteraBalanza = sChangeUpper.substring(7, 9).toInt() | 173 | cantEnteraBalanza = sChangeUpper.substring(7, 9).toInt() |
174 | cantDecimalBalanza = sChangeUpper.substring(9, 12).toInt() | 174 | cantDecimalBalanza = sChangeUpper.substring(9, 12).toInt() |
175 | } | 175 | } |
176 | } | 176 | } |
177 | } | 177 | } |
178 | GlobalScope.launch(Main) { | 178 | GlobalScope.launch(Main) { |
179 | if (EsBalanza) sChangeUpper=codBarBalanza | ||
179 | indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 0)//TODO Si encuentra el articulo en el RV devuelve el indice | 180 | indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 0)//TODO Si encuentra el articulo en el RV devuelve el indice |
180 | //TODO (Si no lo encuentra devuelve -1) | 181 | //TODO (Si no lo encuentra devuelve -1) |
181 | if (indiceDelArtEncontrado != -1) { | 182 | if (indiceDelArtEncontrado != -1) { |
182 | if (!EsBalanza) { | 183 | if (EsBalanza) { |
183 | // //TODO ACTUALIZO LA CANTIDAD EN LA BD | 184 | // //TODO SI ES BALANZA NO HAGO NADA |
184 | // updateCantidad( | 185 | |
185 | // sectorBalanza.toString(), | 186 | }else{ |
186 | // codigoBalanza.toString(), | ||
187 | // ("$cantEnteraBalanza.$cantDecimalBalanza").toFloat()) | ||
188 | // //TODO ACTUALIZO LA CANTIDAD EN EL RV | ||
189 | // listArticulos[indiceDelArtEncontrado].cantTomada = ("$cantEnteraBalanza.$cantDecimalBalanza").toFloat() | ||
190 | // viewAdapter.notifyDataSetChanged() | ||
191 | // }else{ | ||
192 | if (swSumaUno!!.isChecked) { | 187 | if (swSumaUno!!.isChecked) { |
193 | //TODO ACTUALIZO LA CANTIDAD EN LA BD | 188 | //TODO ACTUALIZO LA CANTIDAD EN LA BD |
194 | updateCantidad( | 189 | updateCantidad( |
195 | listArticulos[indiceDelArtEncontrado].sector.toString(), | 190 | listArticulos[indiceDelArtEncontrado].sector.toString(), |
196 | listArticulos[indiceDelArtEncontrado].codigo.toString(), | 191 | listArticulos[indiceDelArtEncontrado].codigo.toString(), |
197 | listArticulos[indiceDelArtEncontrado].cantTomada + 1 | 192 | listArticulos[indiceDelArtEncontrado].cantTomada + 1 |
198 | ) | 193 | ) |
199 | //TODO ACTUALIZO LA CANTIDAD EN EL RV | 194 | //TODO ACTUALIZO LA CANTIDAD EN EL RV |
200 | listArticulos[indiceDelArtEncontrado].cantTomada = listArticulos[indiceDelArtEncontrado].cantTomada + 1 | 195 | listArticulos[indiceDelArtEncontrado].cantTomada = listArticulos[indiceDelArtEncontrado].cantTomada + 1 |
201 | viewAdapter.notifyDataSetChanged() | 196 | viewAdapter.notifyDataSetChanged() |
202 | 197 | ||
203 | } else { | 198 | } else { |
204 | dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) | 199 | dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) |
205 | } | 200 | } |
206 | } | 201 | } |
207 | } else if (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD | 202 | } else if (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD |
208 | //TODO BUSCO EN BASE DE DATOS | 203 | //TODO BUSCO EN BASE DE DATOS |
209 | val artEncontrado:Articles? = if (EsBalanza) { | 204 | val artEncontrado:Articles? = if (EsBalanza) { |
210 | buscarCodigoDeboEnBD(sectorBalanza.toString(), codigoBalanza.toString()) | 205 | buscarCBEnBD(codBarBalanza) |
211 | }else{ | 206 | }else{ |
212 | buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | 207 | buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
213 | } | 208 | } |
214 | continuarCargaCB(artEncontrado)//TODO SE MANDA CERO POR QUE ES UN ARTICULO ESCANEADO NUEVO PARA QUE SEA COMPATIBLE | 209 | continuarCargaCB(artEncontrado)//TODO SE MANDA CERO POR QUE ES UN ARTICULO ESCANEADO NUEVO PARA QUE SEA COMPATIBLE |
215 | } | 210 | } |
216 | etCodigoBarras.requestFocus() | 211 | etCodigoBarras.requestFocus() |
217 | tCodigoBarras.setText("") | 212 | tCodigoBarras.setText("") |
218 | tCodigoBarras.selectAll() | 213 | tCodigoBarras.selectAll() |
219 | } | 214 | } |
220 | return@setOnKeyListener true | 215 | return@setOnKeyListener true |
221 | 216 | ||
222 | |||
223 | } | 217 | } |
224 | 1 -> {//TODO: BUSQUEDA POR DESCRIPCION************************************************************************** | 218 | 1 -> {//TODO: BUSQUEDA POR DESCRIPCION************************************************************************** |
225 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 219 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
226 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 220 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
227 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 221 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
228 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 1) //TODO :Si encuentra el articulo en el RV devuelve el indice | 222 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 1) //TODO :Si encuentra el articulo en el RV devuelve el indice |
229 | // //TODO Si no lo encuentra devuelve -1 | 223 | // //TODO Si no lo encuentra devuelve -1 |
230 | // if (indiceDelArtEncontrado != -1) { | 224 | // if (indiceDelArtEncontrado != -1) { |
231 | //// if (swSumaUno!!.isChecked) { | 225 | //// if (swSumaUno!!.isChecked) { |
232 | //// fCant = 0F | 226 | //// fCant = 0F |
233 | //// fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 227 | //// fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
234 | //// fCant += 1F | 228 | //// fCant += 1F |
235 | //// listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 229 | //// listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
236 | //// viewAdapter.notifyDataSetChanged() | 230 | //// viewAdapter.notifyDataSetChanged() |
237 | //// } else { | 231 | //// } else { |
238 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 232 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
239 | // MaterialDialog(requireContext()).show { | 233 | // MaterialDialog(requireContext()).show { |
240 | // title(R.string.sTituloNueva) | 234 | // title(R.string.sTituloNueva) |
241 | // message(R.string.sCantidadNueva) | 235 | // message(R.string.sCantidadNueva) |
242 | // input { materialDialog, charSequence -> | 236 | // input { materialDialog, charSequence -> |
243 | // fCant = 0F | 237 | // fCant = 0F |
244 | // fCant = charSequence.toString().toFloat() | 238 | // fCant = charSequence.toString().toFloat() |
245 | // } | 239 | // } |
246 | // positiveButton(R.string.btnOk) { | 240 | // positiveButton(R.string.btnOk) { |
247 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 241 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
248 | // viewAdapter.notifyDataSetChanged() | 242 | // viewAdapter.notifyDataSetChanged() |
249 | // dismiss() | 243 | // dismiss() |
250 | // } | 244 | // } |
251 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 245 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
252 | //// } | 246 | //// } |
253 | // | 247 | // |
254 | // } else if | 248 | // } else if |
255 | // (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD | 249 | // (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD |
256 | GlobalScope.launch(Main) { | 250 | GlobalScope.launch(Main) { |
257 | val artEncontrado = buscarDescEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | 251 | val artEncontrado = buscarDescEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
258 | continuarCargaDesc(artEncontrado as ArrayList<Articles>) | 252 | continuarCargaDesc(artEncontrado as ArrayList<Articles>) |
259 | } | 253 | } |
260 | 254 | ||
261 | ivCamara.setImageResource(R.drawable.codbar) | 255 | ivCamara.setImageResource(R.drawable.codbar) |
262 | etCodigoBarras.hint = "Busqueda por Código de Barras" | 256 | etCodigoBarras.hint = "Busqueda por Código de Barras" |
263 | swSumaUno.visibility = View.VISIBLE | 257 | swSumaUno.visibility = View.VISIBLE |
264 | iBusquedaPor = 0 | 258 | iBusquedaPor = 0 |
265 | iEstado = 0 | 259 | iEstado = 0 |
266 | bFirst = false | 260 | bFirst = false |
267 | // } | 261 | // } |
268 | 262 | ||
269 | return@setOnKeyListener true | 263 | return@setOnKeyListener true |
270 | } | 264 | } |
271 | 2 -> {//TODO: BUSQUEDA POR CODIGO DE ORIGEN************************************************************************** | 265 | 2 -> {//TODO: BUSQUEDA POR CODIGO DE ORIGEN************************************************************************** |
272 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 266 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
273 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 267 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
274 | 268 | ||
275 | // GlobalScope.launch(Dispatchers.Main) { | 269 | // GlobalScope.launch(Dispatchers.Main) { |
276 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 2)//TODO Si encuentra el articulo en el RV devuelve el indice | 270 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 2)//TODO Si encuentra el articulo en el RV devuelve el indice |
277 | //// //TODO Si no lo encuentra devuelve -1 | 271 | //// //TODO Si no lo encuentra devuelve -1 |
278 | // if (indiceDelArtEncontrado != -1) { | 272 | // if (indiceDelArtEncontrado != -1) { |
279 | // if (swSumaUno!!.isChecked) { | 273 | // if (swSumaUno!!.isChecked) { |
280 | // fCant = 0F | 274 | // fCant = 0F |
281 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 275 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
282 | // fCant += 1F | 276 | // fCant += 1F |
283 | // //TODO ACTUALIZO LA CANTIDAD EN LA BD | 277 | // //TODO ACTUALIZO LA CANTIDAD EN LA BD |
284 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 278 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
285 | // //TODO ACTUALIZO LA CANTIDAD EN EL RV | 279 | // //TODO ACTUALIZO LA CANTIDAD EN EL RV |
286 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 280 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
287 | // viewAdapter.notifyDataSetChanged() | 281 | // viewAdapter.notifyDataSetChanged() |
288 | // } else { | 282 | // } else { |
289 | // dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) | 283 | // dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) |
290 | // } | 284 | // } |
291 | // } else { | 285 | // } else { |
292 | // val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | 286 | // val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) |
293 | // val mBuilder = | 287 | // val mBuilder = |
294 | // AlertDialog.Builder(context).setView(mDialogView).setTitle("Producto '${listArticulos[indiceDelArtEncontrado].descripcion}', se encuentra cargado.") | 288 | // AlertDialog.Builder(context).setView(mDialogView).setTitle("Producto '${listArticulos[indiceDelArtEncontrado].descripcion}', se encuentra cargado.") |
295 | // .setCancelable(false) | 289 | // .setCancelable(false) |
296 | // mDialogView.tvCantInicial.text = listArticulos[indiceDelArtEncontrado].cantTomada.toString() | 290 | // mDialogView.tvCantInicial.text = listArticulos[indiceDelArtEncontrado].cantTomada.toString() |
297 | // val mAlertDialog = mBuilder.show() | 291 | // val mAlertDialog = mBuilder.show() |
298 | // mDialogView.rbSumar.setOnClickListener { | 292 | // mDialogView.rbSumar.setOnClickListener { |
299 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 293 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
300 | // mDialogView.tvgenerico4.text = (mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() | 294 | // mDialogView.tvgenerico4.text = (mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() |
301 | // } | 295 | // } |
302 | // } | 296 | // } |
303 | // mDialogView.rbRestar.setOnClickListener { | 297 | // mDialogView.rbRestar.setOnClickListener { |
304 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 298 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
305 | // if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | 299 | // if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { |
306 | // mDialogView.tvgenerico4.text = | 300 | // mDialogView.tvgenerico4.text = |
307 | // (mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() | 301 | // (mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() |
308 | // } | 302 | // } |
309 | // } | 303 | // } |
310 | // } | 304 | // } |
311 | // mDialogView.rbMdodificar.setOnClickListener { | 305 | // mDialogView.rbMdodificar.setOnClickListener { |
312 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 306 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
313 | // mDialogView.tvgenerico4.text = (mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() | 307 | // mDialogView.tvgenerico4.text = (mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() |
314 | // } | 308 | // } |
315 | // } | 309 | // } |
316 | // mDialogView.btnAceptar.setOnClickListener { | 310 | // mDialogView.btnAceptar.setOnClickListener { |
317 | // mAlertDialog.dismiss() | 311 | // mAlertDialog.dismiss() |
318 | // val name = mDialogView.tvgenerico4.text.toString().toFloat() | 312 | // val name = mDialogView.tvgenerico4.text.toString().toFloat() |
319 | // fCant = 0F | 313 | // fCant = 0F |
320 | // fCant = name | 314 | // fCant = name |
321 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 315 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
322 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 316 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
323 | // viewAdapter.notifyDataSetChanged() | 317 | // viewAdapter.notifyDataSetChanged() |
324 | // } | 318 | // } |
325 | // mDialogView.dialogCancelBtn.setOnClickListener { | 319 | // mDialogView.dialogCancelBtn.setOnClickListener { |
326 | // mAlertDialog.dismiss() | 320 | // mAlertDialog.dismiss() |
327 | // } | 321 | // } |
328 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 322 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
329 | // val type = InputType.TYPE_CLASS_NUMBER | 323 | // val type = InputType.TYPE_CLASS_NUMBER |
330 | // MaterialDialog(requireContext()).show { | 324 | // MaterialDialog(requireContext()).show { |
331 | // | 325 | // |
332 | // title(text = "Producto '$sChangeUpper', se encuentra cargado.") | 326 | // title(text = "Producto '$sChangeUpper', se encuentra cargado.") |
333 | // message(R.string.sCantidadNueva) | 327 | // message(R.string.sCantidadNueva) |
334 | // input(waitForPositiveButton = false, hint = "99.99", inputType = type) { materialDialog, charSequence -> | 328 | // input(waitForPositiveButton = false, hint = "99.99", inputType = type) { materialDialog, charSequence -> |
335 | // fCant = 0F | 329 | // fCant = 0F |
336 | // fCant = charSequence.toString().toFloat() | 330 | // fCant = charSequence.toString().toFloat() |
337 | // } | 331 | // } |
338 | // positiveButton(R.string.btnOk) { | 332 | // positiveButton(R.string.btnOk) { |
339 | // //TODO ACTUALIZO CANTIADAD EN BD | 333 | // //TODO ACTUALIZO CANTIADAD EN BD |
340 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 334 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
341 | // //TODO ACTUALIZO CANTIDAD EN RV | 335 | // //TODO ACTUALIZO CANTIDAD EN RV |
342 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 336 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
343 | // viewAdapter.notifyDataSetChanged() | 337 | // viewAdapter.notifyDataSetChanged() |
344 | // dismiss() | 338 | // dismiss() |
345 | // } | 339 | // } |
346 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 340 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
347 | // } | 341 | // } |
348 | // } else if (indiceDelArtEncontrado == -1) { | 342 | // } else if (indiceDelArtEncontrado == -1) { |
349 | // no lo encontro en el RV, lo va a buscar en al BD | 343 | // no lo encontro en el RV, lo va a buscar en al BD |
350 | 344 | ||
351 | GlobalScope.launch(Dispatchers.Main) { | 345 | GlobalScope.launch(Dispatchers.Main) { |
352 | //TODO BUSCO EN BASE DE DATOS | 346 | //TODO BUSCO EN BASE DE DATOS |
353 | val artEncontrado = buscarCodiogoOriEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | 347 | val artEncontrado = buscarCodiogoOriEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
354 | continuarCargaCodigoOri(artEncontrado) | 348 | continuarCargaCodigoOri(artEncontrado) |
355 | } | 349 | } |
356 | ivCamara.setImageResource(R.drawable.codbar) | 350 | ivCamara.setImageResource(R.drawable.codbar) |
357 | etCodigoBarras.hint = "Busqueda por Código de Barras" | 351 | etCodigoBarras.hint = "Busqueda por Código de Barras" |
358 | swSumaUno.visibility = View.VISIBLE | 352 | swSumaUno.visibility = View.VISIBLE |
359 | iBusquedaPor = 0 | 353 | iBusquedaPor = 0 |
360 | iEstado = 0 | 354 | iEstado = 0 |
361 | bFirst = false | 355 | bFirst = false |
362 | 356 | ||
363 | // } | 357 | // } |
364 | // } | 358 | // } |
365 | return@setOnKeyListener true | 359 | return@setOnKeyListener true |
366 | } | 360 | } |
367 | } | 361 | } |
368 | } | 362 | } |
369 | } | 363 | } |
370 | return@setOnKeyListener false | 364 | return@setOnKeyListener false |
371 | } | 365 | } |
372 | return v | 366 | return v |
373 | } | 367 | } |
374 | 368 | ||
375 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 369 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
376 | super.onViewCreated(view, savedInstanceState) | 370 | super.onViewCreated(view, savedInstanceState) |
377 | navController = Navigation.findNavController(view) | 371 | navController = Navigation.findNavController(view) |
378 | etCodigoBarras.requestFocus() | 372 | etCodigoBarras.requestFocus() |
379 | // val modalDialog = NoEncontradoSimple() | 373 | // val modalDialog = NoEncontradoSimple() |
380 | // modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 374 | // modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
381 | 375 | ||
382 | btnBorrarInv.setOnClickListener { | 376 | btnBorrarInv.setOnClickListener { |
383 | AlertDialog.Builder(requireContext()).setTitle("Eliminación de Inventarios").setMessage("¿Confirma que desea eliminar el inventario?") | 377 | AlertDialog.Builder(requireContext()).setTitle("Eliminación de Inventarios").setMessage("¿Confirma que desea eliminar el inventario?") |
384 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> | 378 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> |
385 | borrarInvActualCabecera() | 379 | borrarInvActualCabecera() |
386 | borrarInvActualCuerpo() | 380 | borrarInvActualCuerpo() |
387 | Toast.makeText(requireContext(), "El inventario fue Borrado", Toast.LENGTH_LONG).show() | 381 | Toast.makeText(requireContext(), "El inventario fue Borrado", Toast.LENGTH_LONG).show() |
388 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) | 382 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) |
389 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = 0 | 383 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = 0 |
390 | 384 | ||
391 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> | 385 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> |
392 | //botón cancel pulsado | 386 | //botón cancel pulsado |
393 | }).show() | 387 | }).show() |
394 | } | 388 | } |
395 | 389 | ||
396 | btnExportarInv.setOnClickListener { | 390 | btnExportarInv.setOnClickListener { |
397 | AlertDialog.Builder(requireContext()).setTitle(R.string.sTituloExportar).setMessage(R.string.sMensajeExportar) | 391 | AlertDialog.Builder(requireContext()).setTitle(R.string.sTituloExportar).setMessage(R.string.sMensajeExportar) |
398 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> | 392 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> |
399 | preparaInvParaExportar((inventarioViewModel as InventarioViewModel).InventarioNuevo) | 393 | preparaInvParaExportar((inventarioViewModel as InventarioViewModel).InventarioNuevo) |
400 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> }).show() | 394 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> }).show() |
401 | } | 395 | } |
402 | ivCamara.setOnClickListener { | 396 | ivCamara.setOnClickListener { |
403 | if (!bFirst) { | 397 | if (!bFirst) { |
404 | iEstado = 1 | 398 | iEstado = 1 |
405 | bFirst = true | 399 | bFirst = true |
406 | } | 400 | } |
407 | 401 | ||
408 | when (iEstado) { | 402 | when (iEstado) { |
409 | 0 -> { | 403 | 0 -> { |
410 | ivCamara.setImageResource(R.drawable.codbar) | 404 | ivCamara.setImageResource(R.drawable.codbar) |
411 | etCodigoBarras.hint = "Busqueda por Código de Barras" | 405 | etCodigoBarras.hint = "Busqueda por Código de Barras" |
412 | swSumaUno.visibility = View.VISIBLE | 406 | swSumaUno.visibility = View.VISIBLE |
413 | iBusquedaPor = 0 | 407 | iBusquedaPor = 0 |
414 | iEstado = 1 | 408 | iEstado = 1 |
415 | } | 409 | } |
416 | 1 -> { | 410 | 1 -> { |
417 | ivCamara.setImageResource(R.drawable.desc) | 411 | ivCamara.setImageResource(R.drawable.desc) |
418 | etCodigoBarras.hint = "Busqueda por Descripción" | 412 | etCodigoBarras.hint = "Busqueda por Descripción" |
419 | swSumaUno.visibility = View.GONE | 413 | swSumaUno.visibility = View.GONE |
420 | iBusquedaPor = 1 | 414 | iBusquedaPor = 1 |
421 | iEstado = 2 | 415 | iEstado = 2 |
422 | } | 416 | } |
423 | 2 -> { | 417 | 2 -> { |
424 | ivCamara.setImageResource(R.drawable.cod_origen) | 418 | ivCamara.setImageResource(R.drawable.cod_origen) |
425 | etCodigoBarras.hint = "Busqueda por Código de Origen" | 419 | etCodigoBarras.hint = "Busqueda por Código de Origen" |
426 | swSumaUno.visibility = View.GONE | 420 | swSumaUno.visibility = View.GONE |
427 | iBusquedaPor = 2 | 421 | iBusquedaPor = 2 |
428 | iEstado = 0 | 422 | iEstado = 0 |
429 | } | 423 | } |
430 | } | 424 | } |
431 | } | 425 | } |
432 | } | 426 | } |
433 | 427 | ||
434 | private fun preparaInvParaExportar(inventario: Int) { | 428 | private fun preparaInvParaExportar(inventario: Int) { |
435 | 429 | ||
436 | var fecInicio: String | 430 | var fecInicio: String |
437 | var lug: Int | 431 | var lug: Int |
438 | var itomInvC: ItomInvC | 432 | var itomInvC: ItomInvC |
439 | lifecycleScope.launch(Main) { | 433 | // lifecycleScope.launch(Main) { |
440 | // fragmentScopeInvFrag.launch(Main) { | 434 | fragmentScopeInvFrag.launch(Main) { |
441 | 435 | ||
442 | val datosCabecera = foundInvHeadDB(inventario) | 436 | val datosCabecera = foundInvHeadDB(inventario) |
443 | val datosCuerpo = foundInvBodyBD(inventario) | 437 | val datosCuerpo = foundInvBodyBD(inventario) |
444 | fecInicio = datosCabecera.fechaInicio.toString() | 438 | fecInicio = datosCabecera.fechaInicio.toString() |
445 | var fecActual: String = "${obtenerFechaActual()}" | 439 | var fecActual: String = "${obtenerFechaActual()}" |
446 | fecActual = "$fecActual" | 440 | fecActual = "$fecActual" |
447 | lug = if (datosCabecera.lugar!!) 1 else 0 | 441 | lug = if (datosCabecera.lugar!!) 1 else 0 |
448 | itomInvC = ItomInvC(fecInicio, fecActual, lug) | 442 | itomInvC = ItomInvC(fecInicio, fecActual, lug) |
449 | serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne() | 443 | serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne() |
450 | exportarInventarioHead(itomInvC, datosCuerpo) | 444 | exportarInventarioHead(itomInvC, datosCuerpo) |
451 | |||
452 | |||
453 | } | 445 | } |
454 | } | 446 | } |
455 | 447 | ||
456 | private fun exportarInventarioHead(aEnviar: ItomInvC, datosCuerpo: List<InvBody>) { | 448 | private fun exportarInventarioHead(aEnviar: ItomInvC, datosCuerpo: List<InvBody>) { |
457 | var exporto = false | 449 | var exporto = false |
458 | if (serverBajada != null) { | 450 | if (serverBajada != null) { |
459 | 451 | ||
460 | if (serverBajada!!.direccion.isNullOrEmpty()) { | 452 | if (serverBajada!!.direccion.isNullOrEmpty()) { |
461 | val modalDialog = NoServerConf() | 453 | val modalDialog = NoServerConf() |
462 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 454 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
463 | } else { | 455 | } else { |
464 | BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoSubida.toString() + "/" | 456 | BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoSubida.toString() + "/" |
465 | try { | 457 | try { |
466 | ItomInv.request.insertarItominvc(aEnviar) | 458 | ItomInv.request.insertarItominvc(aEnviar) |
467 | .enqueue(object : Callback<DefaultResponse> { | 459 | .enqueue(object : Callback<DefaultResponse> { |
468 | override fun onResponse(call: Call<DefaultResponse>, response: Response<DefaultResponse>) { | 460 | override fun onResponse(call: Call<DefaultResponse>, response: Response<DefaultResponse>) { |
469 | lifecycleScope.launch(Main) { | 461 | fragmentScopeInvFrag.launch(Main) { |
470 | loading_view.visibility=View.VISIBLE | 462 | loading_view.visibility=View.VISIBLE |
471 | if(exportarInventarioBody(datosCuerpo)) { | 463 | if(exportarInventarioBody(datosCuerpo)) { |
472 | borrarInvActualCabecera() | 464 | borrarInvActualCabecera() |
473 | borrarInvActualCuerpo() | 465 | borrarInvActualCuerpo() |
474 | loading_view.visibility = View.INVISIBLE | 466 | loading_view.visibility = View.INVISIBLE |
475 | 467 | ||
476 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) | 468 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) |
477 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = 0 | 469 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = 0 |
478 | 470 | ||
479 | val modalDialog = ExportacionExitosa() | 471 | val modalDialog = ExportacionExitosa() |
480 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 472 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
481 | }else { | 473 | }else { |
482 | loading_view.visibility = View.INVISIBLE | 474 | loading_view.visibility = View.INVISIBLE |
483 | val modalDialog = ExportacionFracasada() | 475 | val modalDialog = ExportacionFracasada() |
484 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 476 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
485 | } | 477 | } |
486 | } | 478 | } |
487 | } | 479 | } |
488 | 480 | ||
489 | override fun onFailure(call: Call<DefaultResponse>, t: Throwable) { | 481 | override fun onFailure(call: Call<DefaultResponse>, t: Throwable) { |
490 | val modalDialog = ExportacionFracasada() | 482 | val modalDialog = ExportacionFracasada() |
491 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 483 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
492 | } | 484 | } |
493 | }) | 485 | }) |
494 | 486 | ||
495 | } catch (e: RuntimeException) { | 487 | } catch (e: RuntimeException) { |
496 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | 488 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() |
497 | } catch (e: Error) { | 489 | } catch (e: Error) { |
498 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | 490 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() |
499 | } catch (e: ErrnoException) { | 491 | } catch (e: ErrnoException) { |
500 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | 492 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() |
501 | } catch (e: InternalError) { | 493 | } catch (e: InternalError) { |
502 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | 494 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() |
503 | } catch (e: IOException) { | 495 | } catch (e: IOException) { |
504 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | 496 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() |
505 | } catch (e: SocketTimeoutException) { | 497 | } catch (e: SocketTimeoutException) { |
506 | Toast.makeText(requireContext(), e.message, Toast.LENGTH_SHORT).show() | 498 | Toast.makeText(requireContext(), e.message, Toast.LENGTH_SHORT).show() |
507 | } | 499 | } |
508 | } | 500 | } |
509 | } else { | 501 | } else { |
510 | val modalDialog = ServerNoConf() | 502 | val modalDialog = ServerNoConf() |
511 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 503 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
512 | } | 504 | } |
513 | } | 505 | } |
514 | 506 | ||
515 | private fun exportarInventarioBody(datosCuerpo: List<InvBody>):Boolean { | 507 | private fun exportarInventarioBody(datosCuerpo: List<InvBody>):Boolean { |
516 | 508 | ||
517 | 509 | ||
518 | for (cuerpo in datosCuerpo) { | 510 | for (cuerpo in datosCuerpo) { |
519 | val aEnviar: ItomInvD = ItomInvD( | 511 | val aEnviar: ItomInvD = ItomInvD( |
520 | cuerpo.sector.toString(), | 512 | cuerpo.sector.toString(), |
521 | cuerpo.codigo.toString(), | 513 | cuerpo.codigo.toString(), |
522 | cuerpo.descripcion.toString(), | 514 | cuerpo.descripcion.toString(), |
523 | cuerpo.cantTomada.toString(), | 515 | cuerpo.cantTomada.toString(), |
524 | cuerpo.fechaInicio.toString(), | 516 | cuerpo.fechaInicio.toString(), |
525 | cuerpo.fechaFinal.toString() | 517 | cuerpo.fechaFinal.toString() |
526 | ) | 518 | ) |
527 | 519 | ||
528 | ItomInv.request.insertarItominvd(aEnviar) | 520 | ItomInv.request.insertarItominvd(aEnviar) |
529 | .enqueue(object : Callback<Void?> { | 521 | .enqueue(object : Callback<Void?> { |
530 | override fun onResponse(call: Call<Void?>, response: Response<Void?>) {} | 522 | override fun onResponse(call: Call<Void?>, response: Response<Void?>) {} |
531 | override fun onFailure(call: Call<Void?>, t: Throwable) {} | 523 | override fun onFailure(call: Call<Void?>, t: Throwable) {} |
532 | // val call: Call<Void?>? = WebService.instance | 524 | // val call: Call<Void?>? = WebService.instance |
533 | // ?.createService(WebServiceApi::class.java) | 525 | // ?.createService(WebServiceApi::class.java) |
534 | // ?.insertarItominvd(aEnviar) | 526 | // ?.insertarItominvd(aEnviar) |
535 | // call?.enqueue(object : Callback<Void?> { | 527 | // call?.enqueue(object : Callback<Void?> { |
536 | // override fun onResponse(call: Call<Void?>, response: Response<Void?>) { | 528 | // override fun onResponse(call: Call<Void?>, response: Response<Void?>) { |
537 | // if (response.code() == 200) { } | 529 | // if (response.code() == 200) { } |
538 | // if (response.code() == 400) { } | 530 | // if (response.code() == 400) { } |
539 | // } | 531 | // } |
540 | // override fun onFailure(call: Call<Void?>?, t: Throwable?) {} | 532 | // override fun onFailure(call: Call<Void?>?, t: Throwable?) {} |
541 | }) | 533 | }) |
542 | 534 | ||
543 | } | 535 | } |
544 | return true | 536 | return true |
545 | } | 537 | } |
546 | 538 | ||
547 | private suspend fun foundInvHeadDB(inv: Int): InvHead { | 539 | private suspend fun foundInvHeadDB(inv: Int): InvHead { |
548 | var busqueda: InvHead | 540 | var busqueda: InvHead |
549 | return GlobalScope.async(IO) { | 541 | return GlobalScope.async(IO) { |
550 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.InvHeadDAO()!!.foundInvHead(inv) | 542 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.InvHeadDAO()!!.foundInvHead(inv) |
551 | return@async busqueda | 543 | return@async busqueda |
552 | }.await() | 544 | }.await() |
553 | } | 545 | } |
554 | 546 | ||
555 | private suspend fun foundInvBodyBD(inv: Int): List<InvBody> { | 547 | private suspend fun foundInvBodyBD(inv: Int): List<InvBody> { |
556 | var busqueda: List<InvBody> | 548 | var busqueda: List<InvBody> |
557 | return GlobalScope.async(IO) { | 549 | return GlobalScope.async(IO) { |
558 | busqueda = AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.fetchAllInvBody(inv) | 550 | busqueda = AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.fetchAllInvBody(inv) |
559 | return@async busqueda | 551 | return@async busqueda |
560 | }.await() | 552 | }.await() |
561 | } | 553 | } |
562 | 554 | ||
563 | private fun borrarInvActualCabecera() { | 555 | private fun borrarInvActualCabecera() { |
564 | GlobalScope.launch(IO) { | 556 | GlobalScope.launch(IO) { |
565 | AppDb.getAppDb(requireContext())!!.InvHeadDAO()!!.deleteinvHead((inventarioViewModel as InventarioViewModel).InventarioNuevo) | 557 | AppDb.getAppDb(requireContext())!!.InvHeadDAO()!!.deleteinvHead((inventarioViewModel as InventarioViewModel).InventarioNuevo) |
566 | } | 558 | } |
567 | } | 559 | } |
568 | 560 | ||
569 | private fun borrarInvActualCuerpo() { | 561 | private fun borrarInvActualCuerpo() { |
570 | GlobalScope.launch(IO) { | 562 | GlobalScope.launch(IO) { |
571 | AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.deleteInvBody((inventarioViewModel as InventarioViewModel).InventarioNuevo) | 563 | AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.deleteInvBody((inventarioViewModel as InventarioViewModel).InventarioNuevo) |
572 | } | 564 | } |
573 | } | 565 | } |
574 | 566 | ||
575 | private fun cargarDeBdInventario(ultimoInv: Int) { | 567 | private fun cargarDeBdInventario(ultimoInv: Int) { |
576 | GlobalScope.launch(Main) { | 568 | GlobalScope.launch(Main) { |
577 | val invbody = cargarInventario(ultimoInv) | 569 | val invbody = cargarInventario(ultimoInv) |
578 | for ((i, _) in invbody!!.withIndex()) { | 570 | for ((i, _) in invbody!!.withIndex()) { |
579 | val art = Articles( | 571 | val art = Articles( |
580 | invbody[i].sector, | 572 | invbody[i].sector, |
581 | invbody[i].codigo, | 573 | invbody[i].codigo, |
582 | invbody[i].descripcion, | 574 | invbody[i].descripcion, |
583 | invbody[i].codBar, | 575 | invbody[i].codBar, |
584 | invbody[i].codOrigen, | 576 | invbody[i].codOrigen, |
585 | invbody[i].precio, | 577 | invbody[i].precio, |
586 | invbody[i].costo, | 578 | invbody[i].costo, |
587 | "", | 579 | "", |
588 | "", | 580 | "", |
589 | "", | 581 | "", |
590 | invbody[i].balanza, | 582 | invbody[i].balanza, |
591 | invbody[i].depSn, | 583 | invbody[i].depSn, |
592 | invbody[i].costo | 584 | invbody[i].costo |
593 | ) | 585 | ) |
594 | cargarRecicler(art, invbody[i].cantTomada!!.toFloat()) | 586 | cargarRecicler(art, invbody[i].cantTomada!!.toFloat()) |
595 | } | 587 | } |
596 | } | 588 | } |
597 | } | 589 | } |
598 | 590 | ||
599 | private fun continuarCargaCodigoOri(artAcargar: List<Articles>) { | 591 | private fun continuarCargaCodigoOri(artAcargar: List<Articles>) { |
600 | 592 | ||
601 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD | 593 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD |
602 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 594 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
603 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 595 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
604 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 596 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
605 | 597 | ||
606 | var bundle = Bundle() | 598 | var bundle = Bundle() |
607 | bundle = bundleOf("ArrayDesc" to artAcargar) | 599 | bundle = bundleOf("ArrayDesc" to artAcargar) |
608 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) | 600 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) |
609 | navController.navigate(R.id.action_inventarioFragment_to_codigoOriFragment, bundle) | 601 | navController.navigate(R.id.action_inventarioFragment_to_codigoOriFragment, bundle) |
610 | 602 | ||
611 | } else {//TODO si no lo encuentra en la BD | 603 | } else {//TODO si no lo encuentra en la BD |
612 | val modalDialog = NoEncontradoSimple() | 604 | val modalDialog = NoEncontradoSimple() |
613 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 605 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
614 | } | 606 | } |
615 | // etCodigoBarras.focusable = View.FOCUSABLE | 607 | // etCodigoBarras.focusable = View.FOCUSABLE |
616 | etCodigoBarras.requestFocus() | 608 | etCodigoBarras.requestFocus() |
617 | etCodigoBarras.setText("") | 609 | etCodigoBarras.setText("") |
618 | etCodigoBarras.selectAll() | 610 | etCodigoBarras.selectAll() |
619 | } | 611 | } |
620 | 612 | ||
621 | private fun continuarCargaDesc(artAcargar: ArrayList<Articles>) { | 613 | private fun continuarCargaDesc(artAcargar: ArrayList<Articles>) { |
622 | //TODO DESPUES DE INGRESAR LA DESCRIPCION Y DE BUSCAR LOS CAINCIDENCIAS EN LA BASE SE VA A MOSTRAR LAS MISMAS | 614 | //TODO DESPUES DE INGRESAR LA DESCRIPCION Y DE BUSCAR LOS CAINCIDENCIAS EN LA BASE SE VA A MOSTRAR LAS MISMAS |
623 | //TODO SI LA CANTIDAD ENCONTRADA ES UNO, LO CARGO DIRECTAMENTE EN EL RV | 615 | //TODO SI LA CANTIDAD ENCONTRADA ES UNO, LO CARGO DIRECTAMENTE EN EL RV |
624 | 616 | ||
625 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD | 617 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD |
626 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV | 618 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV |
627 | // fCant = 0F | 619 | // fCant = 0F |
628 | // fCant += 1F | 620 | // fCant += 1F |
629 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV | 621 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV |
630 | // val acargarPorDesc = Articles(artAcargar[0].sector, | 622 | // val acargarPorDesc = Articles(artAcargar[0].sector, |
631 | // artAcargar[0].codigo, | 623 | // artAcargar[0].codigo, |
632 | // artAcargar[0].descripcion, | 624 | // artAcargar[0].descripcion, |
633 | // artAcargar[0].codBar, | 625 | // artAcargar[0].codBar, |
634 | // artAcargar[0].codOrigen, | 626 | // artAcargar[0].codOrigen, |
635 | // artAcargar[0].precio, | 627 | // artAcargar[0].precio, |
636 | // artAcargar[0].costo, | 628 | // artAcargar[0].costo, |
637 | // "", | 629 | // "", |
638 | // "", | 630 | // "", |
639 | // "", | 631 | // "", |
640 | // artAcargar[0].balanza, | 632 | // artAcargar[0].balanza, |
641 | // artAcargar[0].depSn, | 633 | // artAcargar[0].depSn, |
642 | // "") | 634 | // "") |
643 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD | 635 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD |
644 | // cargarArtEnBd(acargarPorDesc, fCant) | 636 | // cargarArtEnBd(acargarPorDesc, fCant) |
645 | // cargarRecicler(acargarPorDesc, fCant) | 637 | // cargarRecicler(acargarPorDesc, fCant) |
646 | // } else { | 638 | // } else { |
647 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 639 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
648 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 640 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
649 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 641 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
650 | var bundle = Bundle() | 642 | var bundle = Bundle() |
651 | bundle = bundleOf("ArrayDesc" to artAcargar) | 643 | bundle = bundleOf("ArrayDesc" to artAcargar) |
652 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) | 644 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) |
653 | navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) | 645 | navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) |
654 | //navController.backStack.removeLast() | 646 | //navController.backStack.removeLast() |
655 | // } | 647 | // } |
656 | // } else {//SI NO ESTA +1 | 648 | // } else {//SI NO ESTA +1 |
657 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV | 649 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV |
658 | // fCant = listArticulos[0].cantTomada | 650 | // fCant = listArticulos[0].cantTomada |
659 | // MaterialDialog(requireContext()).show { | 651 | // MaterialDialog(requireContext()).show { |
660 | // title(R.string.sTituloNueva) | 652 | // title(R.string.sTituloNueva) |
661 | // message(R.string.sCantidadNueva) | 653 | // message(R.string.sCantidadNueva) |
662 | // input { materialDialog, charSequence -> | 654 | // input { materialDialog, charSequence -> |
663 | // fCant = 0F | 655 | // fCant = 0F |
664 | // fCant = charSequence.toString().toFloat() | 656 | // fCant = charSequence.toString().toFloat() |
665 | // } | 657 | // } |
666 | // positiveButton(R.string.btnOk) { | 658 | // positiveButton(R.string.btnOk) { |
667 | // listArticulos[0].cantTomada = fCant | 659 | // listArticulos[0].cantTomada = fCant |
668 | // viewAdapter.notifyDataSetChanged() | 660 | // viewAdapter.notifyDataSetChanged() |
669 | // dismiss() | 661 | // dismiss() |
670 | // } | 662 | // } |
671 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 663 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
672 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV | 664 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV |
673 | // val acargarPorDesc = Articles(artAcargar[0].sector, | 665 | // val acargarPorDesc = Articles(artAcargar[0].sector, |
674 | // artAcargar[0].codigo, | 666 | // artAcargar[0].codigo, |
675 | // artAcargar[0].descripcion, | 667 | // artAcargar[0].descripcion, |
676 | // artAcargar[0].codBar, | 668 | // artAcargar[0].codBar, |
677 | // artAcargar[0].cod_origen, | 669 | // artAcargar[0].cod_origen, |
678 | // artAcargar[0].precio, | 670 | // artAcargar[0].precio, |
679 | // artAcargar[0].costo, | 671 | // artAcargar[0].costo, |
680 | // artAcargar[0].balanza, | 672 | // artAcargar[0].balanza, |
681 | // artAcargar[0].depSn, | 673 | // artAcargar[0].depSn, |
682 | // "") | 674 | // "") |
683 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD | 675 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD |
684 | // cargarArtEnBd(acargarPorDesc, fCant) | 676 | // cargarArtEnBd(acargarPorDesc, fCant) |
685 | // cargarRecicler(acargarPorDesc, fCant) | 677 | // cargarRecicler(acargarPorDesc, fCant) |
686 | // } else { | 678 | // } else { |
687 | // var bundle = Bundle() | 679 | // var bundle = Bundle() |
688 | // bundle = bundleOf("ArrayDesc" to artAcargar) | 680 | // bundle = bundleOf("ArrayDesc" to artAcargar) |
689 | // bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) | 681 | // bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) |
690 | // navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) | 682 | // navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) |
691 | // } | 683 | // } |
692 | // } | 684 | // } |
693 | } else {//TODO si no lo encuentra en la BD | 685 | } else {//TODO si no lo encuentra en la BD |
694 | val modalDialog = NoEncontradoSimple() | 686 | val modalDialog = NoEncontradoSimple() |
695 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 687 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
696 | } | 688 | } |
697 | // etCodigoBarras.focusable = View.FOCUSABLE | 689 | // etCodigoBarras.focusable = View.FOCUSABLE |
698 | etCodigoBarras.requestFocus() | 690 | etCodigoBarras.requestFocus() |
699 | etCodigoBarras.setText("") | 691 | etCodigoBarras.setText("") |
700 | etCodigoBarras.selectAll() | 692 | etCodigoBarras.selectAll() |
701 | } | 693 | } |
702 | 694 | ||
703 | private fun continuarCargaCB(artAcargar: Articles?) { | 695 | private fun continuarCargaCB(artAcargar: Articles?) { |
704 | 696 | ||
705 | if (artAcargar != null) { // TODO: Si lo encuentra en la BD | 697 | if (artAcargar != null) { // TODO: Si lo encuentra en la BD |
706 | if (EsBalanza) { | 698 | if (EsBalanza) { |
707 | cargarArtEnBd(artAcargar, (Math.round(("$cantEnteraBalanza.$cantDecimalBalanza").toFloat() * 100.0) / 100.0).toFloat().toString()) | 699 | cargarArtEnBd(artAcargar, ("$cantEnteraBalanza.$cantDecimalBalanza")) |
708 | cargarRecicler(artAcargar, (Math.round(("$cantEnteraBalanza.$cantDecimalBalanza").toFloat() * 100.0) / 100.0).toFloat()) | 700 | cargarRecicler(artAcargar, ("$cantEnteraBalanza.$cantDecimalBalanza").toFloat()) |
709 | modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, true, requireContext()) | 701 | modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, true, requireContext()) |
710 | EsBalanza=false | 702 | EsBalanza=false |
711 | }else{ | 703 | }else{ |
712 | if (swSumaUno!!.isChecked) {//TODO: SI ESTA +1, PONE CANTIDAD 1 | 704 | if (swSumaUno!!.isChecked) {//TODO: SI ESTA +1, PONE CANTIDAD 1 |
713 | fCant = 0F | 705 | fCant = 0F |
714 | fCant += 1F | 706 | fCant += 1F |
715 | 707 | ||
716 | cargarArtEnBd(artAcargar, (Math.round(fCant * 100.0) / 100.0).toFloat().toString()) | 708 | cargarArtEnBd(artAcargar, (Math.round(fCant * 100.0) / 100.0).toFloat().toString()) |
717 | cargarRecicler(artAcargar, (Math.round(fCant * 100.0) / 100.0).toFloat()) | 709 | cargarRecicler(artAcargar, (Math.round(fCant * 100.0) / 100.0).toFloat()) |
718 | } else {//TODO: SI NO ESTA +1 PREGUNTA CANTIDAD | 710 | } else {//TODO: SI NO ESTA +1 PREGUNTA CANTIDAD |
719 | dialogingresarCantidad(requireContext(), artAcargar) | 711 | dialogingresarCantidad(requireContext(), artAcargar) |
720 | } | 712 | } |
721 | } | 713 | } |
722 | } else {// TODO si no lo encuentra en la BD | 714 | } else {// TODO si no lo encuentra en la BD |
723 | val modalDialog = NoEncontradoSimple() | 715 | val modalDialog = NoEncontradoSimple() |
724 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 716 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
725 | } | 717 | } |
726 | etCodigoBarras.requestFocus() | 718 | etCodigoBarras.requestFocus() |
727 | etCodigoBarras.setText("") | 719 | etCodigoBarras.setText("") |
728 | etCodigoBarras.selectAll() | 720 | etCodigoBarras.selectAll() |
729 | } | 721 | } |
730 | 722 | ||
731 | fun dialogingresarCantidad(cnxt: Context, artAcargar: Articles?): Float { | 723 | fun dialogingresarCantidad(cnxt: Context, artAcargar: Articles?): Float { |
732 | var cantidad = 0F | 724 | var cantidad = 0F |
733 | val mDialogView = LayoutInflater.from(cnxt).inflate(R.layout.ingresar_cantidad, null) | 725 | val mDialogView = LayoutInflater.from(cnxt).inflate(R.layout.ingresar_cantidad, null) |
734 | val mBuilder = AlertDialog.Builder(cnxt).setView(mDialogView).setCancelable(false) | 726 | val mBuilder = AlertDialog.Builder(cnxt).setView(mDialogView).setCancelable(false) |
735 | if (artAcargar!!.balanza!!.toInt() == 1 || artAcargar.balanza!!.toInt() == 3 || artAcargar.balanza!!.toInt() == 7) mDialogView.etCantidad.inputType = TYPE_CLASS_NUMBER | 727 | if (artAcargar!!.balanza!!.toInt() == 1 || artAcargar.balanza!!.toInt() == 3 || artAcargar.balanza!!.toInt() == 7) mDialogView.etCantidad.inputType = TYPE_CLASS_NUMBER |
736 | mDialogView.tvTitulo.text = artAcargar.descripcion.toString() | 728 | mDialogView.tvTitulo.text = artAcargar.descripcion.toString() |
737 | val mAlertDialog = mBuilder.show() | 729 | val mAlertDialog = mBuilder.show() |
738 | 730 | ||
739 | mDialogView.etCantidad.requestFocus() | 731 | mDialogView.etCantidad.requestFocus() |
740 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 732 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
741 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 733 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
742 | 734 | ||
743 | mDialogView.btnAceptar.setOnClickListener { | 735 | mDialogView.btnAceptar.setOnClickListener { |
744 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { | 736 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { |
745 | mDialogView.etCantidad.error = "No vacio" | 737 | mDialogView.etCantidad.error = "No vacio" |
746 | mDialogView.etCantidad.requestFocus() | 738 | mDialogView.etCantidad.requestFocus() |
747 | mDialogView.etCantidad.hint = "Ingrese un valor" | 739 | mDialogView.etCantidad.hint = "Ingrese un valor" |
748 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { | 740 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { |
749 | mAlertDialog.dismiss() | 741 | mAlertDialog.dismiss() |
750 | cantidad = (Math.round(mDialogView.etCantidad.text.toString().toFloat() * 100.0) / 100.0).toFloat() | 742 | cantidad = (Math.round(mDialogView.etCantidad.text.toString().toFloat() * 100.0) / 100.0).toFloat() |
751 | cargarArtEnBd(artAcargar, cantidad.toString()) | 743 | cargarArtEnBd(artAcargar, cantidad.toString()) |
752 | cargarRecicler(artAcargar, cantidad) | 744 | cargarRecicler(artAcargar, cantidad) |
753 | modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, true, requireContext()) | 745 | modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, true, requireContext()) |
754 | } | 746 | } |
755 | } | 747 | } |
756 | return cantidad | 748 | return cantidad |
757 | } | 749 | } |
758 | 750 | ||
759 | fun dialogoSumaResta(context: Context, indiceDelArtEncontrado: Int, univta: String, cancelable: Boolean) { | 751 | fun dialogoSumaResta(context: Context, indiceDelArtEncontrado: Int, univta: String, cancelable: Boolean) { |
760 | var cantidadTemp: Float | 752 | var cantidadTemp: Float |
761 | mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | 753 | mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) |
762 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(cancelable) | 754 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(cancelable) |
763 | // TODO: SI PERMITE QUE INGRESE DECIMALES | 755 | // TODO: SI PERMITE QUE INGRESE DECIMALES |
764 | if (univta.contains("1") || univta.contains("3") || univta.contains("7")) mDialogView.tvNuevaCantidad.inputType = TYPE_CLASS_NUMBER | 756 | if (univta.contains("1") || univta.contains("3") || univta.contains("7")) mDialogView.tvNuevaCantidad.inputType = TYPE_CLASS_NUMBER |
765 | mDialogView.tvTitulo2.text = "${listArticulos[indiceDelArtEncontrado].descripcion}" | 757 | mDialogView.tvTitulo2.text = "${listArticulos[indiceDelArtEncontrado].descripcion}" |
766 | cantidadTemp = (Math.round(listArticulos[indiceDelArtEncontrado].cantTomada * 100.0) / 100.0).toFloat() | 758 | cantidadTemp = (Math.round(listArticulos[indiceDelArtEncontrado].cantTomada * 100.0) / 100.0).toFloat() |
767 | mDialogView.tvCantInicial.text = cantidadTemp.toString() | 759 | mDialogView.tvCantInicial.text = cantidadTemp.toString() |
768 | val mAlertDialog = mBuilder.show() | 760 | val mAlertDialog = mBuilder.show() |
769 | mDialogView.tvNuevaCantidad.requestFocus() | 761 | mDialogView.tvNuevaCantidad.requestFocus() |
770 | 762 | ||
771 | 763 | ||
772 | 764 | ||
773 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 765 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
774 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 766 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
775 | 767 | ||
776 | mDialogView.tvNuevaCantidad.addTextChangedListener(textWatcher) | 768 | mDialogView.tvNuevaCantidad.addTextChangedListener(textWatcher) |
777 | 769 | ||
778 | mDialogView.rbSumar.setOnClickListener { | 770 | mDialogView.rbSumar.setOnClickListener { |
779 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 771 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
780 | cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat() | 772 | cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat() |
781 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() | 773 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() |
782 | } | 774 | } |
783 | } | 775 | } |
784 | mDialogView.rbRestar.setOnClickListener { | 776 | mDialogView.rbRestar.setOnClickListener { |
785 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 777 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
786 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | 778 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { |
787 | cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat() | 779 | cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat() |
788 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() | 780 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() |
789 | // mDialogView.tvNuevaCantidad.isEnabled = false | 781 | // mDialogView.tvNuevaCantidad.isEnabled = false |
790 | } else { | 782 | } else { |
791 | mDialogView.tvResultado.text = "" | 783 | mDialogView.tvResultado.text = "" |
792 | mDialogView.tvResultado.error = "Operación No Valida" | 784 | mDialogView.tvResultado.error = "Operación No Valida" |
793 | mDialogView.tvResultado.requestFocus() | 785 | mDialogView.tvResultado.requestFocus() |
794 | mDialogView.tvResultado.hint = "Error" | 786 | mDialogView.tvResultado.hint = "Error" |
795 | } | 787 | } |
796 | } | 788 | } |
797 | } | 789 | } |
798 | mDialogView.rbMdodificar.setOnClickListener { | 790 | mDialogView.rbMdodificar.setOnClickListener { |
799 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 791 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
800 | mDialogView.tvResultado.text = (Math.round(mDialogView.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString() | 792 | mDialogView.tvResultado.text = (Math.round(mDialogView.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString() |
801 | } | 793 | } |
802 | } | 794 | } |
803 | mDialogView.btnAceptar.setOnClickListener { | 795 | mDialogView.btnAceptar.setOnClickListener { |
804 | if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || !mDialogView.tvNuevaCantidad.text.isBlank()) { | 796 | if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || !mDialogView.tvNuevaCantidad.text.isBlank()) { |
805 | if (mDialogView.tvResultado.text.isNotEmpty() || !mDialogView.tvResultado.text.isBlank()) { | 797 | if (mDialogView.tvResultado.text.isNotEmpty() || !mDialogView.tvResultado.text.isBlank()) { |
806 | mAlertDialog.dismiss() | 798 | mAlertDialog.dismiss() |
807 | listArticulos[indiceDelArtEncontrado].cantTomada = (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toFloat() | 799 | listArticulos[indiceDelArtEncontrado].cantTomada = (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toFloat() |
808 | updateCantidad( | 800 | updateCantidad( |
809 | listArticulos[indiceDelArtEncontrado].sector.toString(), | 801 | listArticulos[indiceDelArtEncontrado].sector.toString(), |
810 | listArticulos[indiceDelArtEncontrado].codigo.toString(), | 802 | listArticulos[indiceDelArtEncontrado].codigo.toString(), |
811 | (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toFloat() | 803 | (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toFloat() |
812 | ) | 804 | ) |
813 | 805 | ||
814 | viewAdapter.notifyDataSetChanged() | 806 | viewAdapter.notifyDataSetChanged() |
815 | } else if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { | 807 | } else if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { |
816 | mDialogView.tvResultado.error = "Operación Requerida" | 808 | mDialogView.tvResultado.error = "Operación Requerida" |
817 | mDialogView.tvResultado.requestFocus() | 809 | mDialogView.tvResultado.requestFocus() |
818 | mDialogView.tvResultado.hint = "Seleccione Operación" | 810 | mDialogView.tvResultado.hint = "Seleccione Operación" |
819 | } | 811 | } |
820 | } else if (mDialogView.tvNuevaCantidad.text.isEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { | 812 | } else if (mDialogView.tvNuevaCantidad.text.isEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { |
821 | mDialogView.tvNuevaCantidad.error = "Completar" | 813 | mDialogView.tvNuevaCantidad.error = "Completar" |
822 | mDialogView.tvNuevaCantidad.requestFocus() | 814 | mDialogView.tvNuevaCantidad.requestFocus() |
823 | mDialogView.tvNuevaCantidad.hint = "Ingrese un valor" | 815 | mDialogView.tvNuevaCantidad.hint = "Ingrese un valor" |
824 | } | 816 | } |
825 | } | 817 | } |
826 | mDialogView.dialogCancelBtn.setOnClickListener { | 818 | mDialogView.dialogCancelBtn.setOnClickListener { |
827 | mAlertDialog.dismiss() | 819 | mAlertDialog.dismiss() |
828 | } | 820 | } |
829 | } | 821 | } |
830 | 822 | ||
831 | suspend fun buscarCodiogoOriEnBD(CodOri: String): List<Articles> { | 823 | suspend fun buscarCodiogoOriEnBD(CodOri: String): List<Articles> { |
832 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 824 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
833 | var busqueda: List<Articles> | 825 | var busqueda: List<Articles> |
834 | return GlobalScope.async(IO) { | 826 | return GlobalScope.async(IO) { |
835 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByCodOri(CodOri, SerchAreaInventario()) | 827 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByCodOri(CodOri, SerchAreaInventario()) |
836 | return@async busqueda | 828 | return@async busqueda |
837 | }.await() | 829 | }.await() |
838 | } | 830 | } |
839 | 831 | ||
840 | suspend fun buscarCBEnBD(CodigoBarras: String): Articles? { | 832 | suspend fun buscarCBEnBD(CodigoBarras: String): Articles? { |
841 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 833 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
842 | var busqueda: Articles? = null | 834 | var busqueda: Articles? = null |
843 | return GlobalScope.async(IO) { | 835 | return GlobalScope.async(IO) { |
844 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, SerchAreaInventario()) | 836 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, SerchAreaInventario()) |
845 | return@async busqueda | 837 | return@async busqueda |
846 | }.await() | 838 | }.await() |
847 | } | 839 | } |
848 | 840 | ||
849 | suspend fun buscarCodigoDeboEnBD(sector: String?, codigo: String?): Articles? { | 841 | suspend fun buscarCodigoDeboEnBD(sector: String?, codigo: String?): Articles? { |
850 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 842 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
851 | var busqueda: Articles? | 843 | var busqueda: Articles? |
852 | return GlobalScope.async(IO) { | 844 | return GlobalScope.async(IO) { |
853 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.fetchArticuloByCodSec(sector, codigo) | 845 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.fetchArticuloByCodSec(sector, codigo) |
854 | return@async busqueda | 846 | return@async busqueda |
855 | }.await() | 847 | }.await() |
856 | } | 848 | } |
857 | 849 | ||
858 | suspend fun buscarDescEnBD(descripcion: String): List<Articles>? { | 850 | suspend fun buscarDescEnBD(descripcion: String): List<Articles>? { |
859 | //TODO BUSQUEDA POR DESCRIPCION | 851 | //TODO BUSQUEDA POR DESCRIPCION |
860 | var busqueda: List<Articles>? = null | 852 | var busqueda: List<Articles>? = null |
861 | return GlobalScope.async(IO) { | 853 | return GlobalScope.async(IO) { |
862 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, SerchAreaInventario()) | 854 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, SerchAreaInventario()) |
863 | return@async busqueda | 855 | return@async busqueda |
864 | }.await() | 856 | }.await() |
865 | } | 857 | } |
866 | 858 | ||
867 | suspend fun borrarArticulo(sector: String, codigo: String, inventario: String): Int? { | 859 | suspend fun borrarArticulo(sector: String, codigo: String, inventario: String): Int? { |
868 | //TODO BUSQUEDA POR DESCRIPCION | 860 | //TODO BUSQUEDA POR DESCRIPCION |
869 | var result: Int | 861 | var result: Int |
870 | return GlobalScope.async(IO) { | 862 | return GlobalScope.async(IO) { |
871 | result = AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.deleteItemFromInvBody(sector.toLong(), codigo.toLong(), inventario.toInt()) | 863 | result = AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.deleteItemFromInvBody(sector.toLong(), codigo.toLong(), inventario.toInt()) |
872 | return@async result | 864 | return@async result |
873 | }.await() | 865 | }.await() |
874 | } | 866 | } |
875 | 867 | ||
876 | private suspend fun buscoArtEnRv(codigoBarras: String, sTipoBusqueda: Int): Int { | 868 | private suspend fun buscoArtEnRv(codigoBarras: String, sTipoBusqueda: Int): Int { |
877 | return GlobalScope.async(IO) { | 869 | return GlobalScope.async(IO) { |
878 | var indice = 0 | 870 | var indice = 0 |
879 | var bEncontrado = false | 871 | var bEncontrado = false |
880 | if (sTipoBusqueda == 0) {//TODO BUSQUEDA POR CODIGO DE BARRAS | 872 | if (sTipoBusqueda == 0) {//TODO BUSQUEDA POR CODIGO DE BARRAS |
881 | // TODO CAMBIO DE CB A CODIGO DEBO | 873 | // TODO CAMBIO DE CB A CODIGO DEBO |
882 | if (EsBalanza){ | ||
883 | for (item in listArticulos) { | ||
884 | if (item.sector!!.toInt() == sectorBalanza.toInt() && item.codigo!!.toInt() == codigoBalanza.toInt()) { | ||
885 | bEncontrado = true | ||
886 | break | ||
887 | } | ||
888 | indice += 1 | ||
889 | } | ||
890 | }else { | ||
891 | val any = cambioCBporCodigoDebo(codigoBarras) | 874 | val any = cambioCBporCodigoDebo(codigoBarras) |
892 | if (any != null) { | 875 | if (any != null) { |
893 | for (item in listArticulos) { | 876 | for (item in listArticulos) { |
894 | if (item.sector!!.toInt() == any.sector!!.toInt() && item.codigo!!.toInt() == any.codigo!!.toInt()) { | 877 | if (item.sector!!.toInt() == any.sector!!.toInt() && item.codigo!!.toInt() == any.codigo!!.toInt()) { |
895 | bEncontrado = true | 878 | bEncontrado = true |
896 | break | 879 | break |
897 | } | 880 | } |
898 | indice += 1 | 881 | indice += 1 |
899 | } | 882 | } |
900 | } | 883 | } |
901 | } | 884 | |
902 | 885 | ||
903 | } else if (sTipoBusqueda == 1) {//TODO BUSQUEDA POR DESCRIPCION | 886 | } else if (sTipoBusqueda == 1) {//TODO BUSQUEDA POR DESCRIPCION |
904 | for (item in listArticulos) { | 887 | for (item in listArticulos) { |
905 | if (item.descripcion!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { | 888 | if (item.descripcion!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { |
906 | bEncontrado = true | 889 | bEncontrado = true |
907 | break | 890 | break |
908 | } | 891 | } |
909 | indice += 1 | 892 | indice += 1 |
910 | } | 893 | } |
911 | } else if (sTipoBusqueda == 2) {//TODO BUSQUEDA POR CODIGO DE ORIGEN | 894 | } else if (sTipoBusqueda == 2) {//TODO BUSQUEDA POR CODIGO DE ORIGEN |
912 | for (item in listArticulos) { | 895 | for (item in listArticulos) { |
913 | if (item.codigoOrigen!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { | 896 | if (item.codigoOrigen!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { |
914 | bEncontrado = true | 897 | bEncontrado = true |
915 | break | 898 | break |
916 | } | 899 | } |
917 | indice += 1 | 900 | indice += 1 |
918 | } | 901 | } |
919 | } | 902 | } |
920 | return@async if (bEncontrado) indice else -1 | 903 | return@async if (bEncontrado) indice else -1 |
921 | }.await() | 904 | }.await() |
922 | } | 905 | } |
923 | 906 | ||
924 | suspend fun cambioCBporCodigoDebo(codigoBarras: String): Articles? { | 907 | suspend fun cambioCBporCodigoDebo(codigoBarras: String): Articles? { |
925 | //TODO BUSQUEDA POR DESCRIPCION | 908 | //TODO BUSQUEDA POR DESCRIPCION |
926 | var busqueda: Articles? = null | 909 | var busqueda: Articles? = null |
927 | return GlobalScope.async(IO) { | 910 | return GlobalScope.async(IO) { |
928 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByCodBar(codigoBarras, SerchAreaInventario()) | 911 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByCodBar(codigoBarras, SerchAreaInventario()) |
929 | return@async busqueda | 912 | return@async busqueda |
930 | }.await() | 913 | }.await() |
931 | } | 914 | } |
932 | 915 | ||
933 | private fun cargarArtEnBd(articulos: Articles, cant: String) { | 916 | private fun cargarArtEnBd(articulos: Articles, cant: String) { |
934 | val body = InvBody( | 917 | val body = InvBody( |
935 | (inventarioViewModel as InventarioViewModel).InventarioNuevo,// TODO PREPARO PARA MANDAR A CARGAR EN LA BD | 918 | (inventarioViewModel as InventarioViewModel).InventarioNuevo,// TODO PREPARO PARA MANDAR A CARGAR EN LA BD |
936 | articulos.sector, | 919 | articulos.sector, |
937 | articulos.codigo, | 920 | articulos.codigo, |
938 | articulos.descripcion, | 921 | articulos.descripcion, |
939 | cant, | 922 | cant, |
940 | articulos.codBar, | 923 | articulos.codBar, |
941 | articulos.codOrigen, | 924 | articulos.codOrigen, |
942 | articulos.precio, | 925 | articulos.precio, |
943 | articulos.precio, | 926 | articulos.precio, |
944 | articulos.balanza, | 927 | articulos.balanza, |
945 | articulos.depSn, | 928 | articulos.depSn, |
946 | obtenerFechaActual(), | 929 | obtenerFechaActual(), |
947 | obtenerFechaActual() | 930 | obtenerFechaActual() |
948 | ) | 931 | ) |
949 | InsertarArtEnDB(body)// TODO MANDO A CARGAR A LA BASE DE DATOS | 932 | InsertarArtEnDB(body)// TODO MANDO A CARGAR A LA BASE DE DATOS |
950 | } | 933 | } |
951 | 934 | ||
952 | fun cargarRecicler(articulos: Articles, cant: Float) { | 935 | fun cargarRecicler(articulos: Articles, cant: Float) { |
953 | //TODO CARGO EN LE RV | 936 | //TODO CARGO EN LE RV |
954 | val item = ItemsRecycler( | 937 | val item = ItemsRecycler( |
955 | if (articulos.sector.toString().toInt() < 9) "0${articulos.sector.toString()}" else articulos.sector.toString(), | 938 | if (articulos.sector.toString().toInt() < 9) "0${articulos.sector.toString()}" else articulos.sector.toString(), |
956 | articulos.codigo, | 939 | articulos.codigo, |
957 | articulos.descripcion, | 940 | articulos.descripcion, |
958 | cant, | 941 | cant, |
959 | articulos.codBar, | 942 | articulos.codBar, |
960 | articulos.codOrigen, | 943 | articulos.codOrigen, |
961 | articulos.balanza.toString(), | 944 | articulos.balanza.toString(), |
962 | articulos.de.toString() | 945 | articulos.de.toString() |
963 | ) | 946 | ) |
964 | listArticulos.add(item) | 947 | listArticulos.add(item) |
965 | 948 | ||
966 | viewAdapter = ProductosListAdapter(requireContext(), listArticulos, this) | 949 | viewAdapter = ProductosListAdapter(requireContext(), listArticulos, this) |
967 | viewManager = LinearLayoutManager(requireContext()) | 950 | viewManager = LinearLayoutManager(requireContext()) |
968 | deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! | 951 | deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! |
969 | rcInventarios.apply { | 952 | rcInventarios.apply { |
970 | adapter = viewAdapter | 953 | adapter = viewAdapter |
971 | layoutManager = viewManager | 954 | layoutManager = viewManager |
972 | } | 955 | } |
973 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { | 956 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { |
974 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { | 957 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { |
975 | return false | 958 | return false |
976 | } | 959 | } |
977 | 960 | ||
978 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { | 961 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { |
979 | 962 | ||
980 | GlobalScope.launch(Dispatchers.Main) { | 963 | GlobalScope.launch(Dispatchers.Main) { |
981 | borrarArticulo( | 964 | borrarArticulo( |
982 | listArticulos[viewHolder.adapterPosition].sector.toString(), | 965 | listArticulos[viewHolder.adapterPosition].sector.toString(), |
983 | listArticulos[viewHolder.adapterPosition].codigo.toString(), | 966 | listArticulos[viewHolder.adapterPosition].codigo.toString(), |
984 | (inventarioViewModel as InventarioViewModel).InventarioNuevo.toString() | 967 | (inventarioViewModel as InventarioViewModel).InventarioNuevo.toString() |
985 | ) | 968 | ) |
986 | (viewAdapter as ProductosListAdapter).removeItem(viewHolder) | 969 | (viewAdapter as ProductosListAdapter).removeItem(viewHolder) |
987 | viewAdapter.notifyDataSetChanged() | 970 | viewAdapter.notifyDataSetChanged() |
988 | modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, false, requireContext()) | 971 | modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, false, requireContext()) |
989 | } | 972 | } |
990 | } | 973 | } |
991 | 974 | ||
992 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { | 975 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { |
993 | val itemView = viewHolder.itemView | 976 | val itemView = viewHolder.itemView |
994 | val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2 | 977 | val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2 |
995 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) | 978 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) |
996 | 979 | ||
997 | if (dX > 0) { | 980 | if (dX > 0) { |
998 | 981 | ||
999 | if (dX < c.width / 2) c.drawColor(Color.GREEN) | 982 | if (dX < c.width / 2) c.drawColor(Color.GREEN) |
1000 | else c.drawColor(Color.RED) | 983 | else c.drawColor(Color.RED) |
1001 | deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom - iconMargin) | 984 | deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom - iconMargin) |
1002 | } else { | 985 | } else { |
1003 | } | 986 | } |
1004 | 987 | ||
1005 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | 988 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) |
1006 | deleteIcon.draw(c) | 989 | deleteIcon.draw(c) |
1007 | } | 990 | } |
1008 | } | 991 | } |
1009 | 992 | ||
1010 | val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback) | 993 | val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback) |
1011 | itemTouchHelper.attachToRecyclerView(rcInventarios) | 994 | itemTouchHelper.attachToRecyclerView(rcInventarios) |
1012 | } | 995 | } |
1013 | 996 | ||
1014 | private fun ProdNoCont(): Int? { | 997 | private fun ProdNoCont(): Int? { |
1015 | var mostrarStock = 0 | 998 | var mostrarStock = 0 |
1016 | if (sharedPreferences.contains("cbMostrarStock")) if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") mostrarStock = 1 | 999 | if (sharedPreferences.contains("cbMostrarStock")) if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") mostrarStock = 1 |
1017 | return mostrarStock | 1000 | return mostrarStock |
1018 | } | 1001 | } |
1019 | 1002 | ||
1020 | private fun AjusteProductos(): Int? { | 1003 | private fun AjusteProductos(): Int? { |
1021 | var prodInclu = 0 | 1004 | var prodInclu = 0 |
1022 | if (sharedPreferences.contains("rbProInclu")) if (sharedPreferences.getString("rbProInclu", "").toString() == "1") prodInclu = 1 | 1005 | if (sharedPreferences.contains("rbProInclu")) if (sharedPreferences.getString("rbProInclu", "").toString() == "1") prodInclu = 1 |
1023 | 1006 | ||
1024 | if (sharedPreferences.contains("rbProNoInclu")) if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") prodInclu = 0 | 1007 | if (sharedPreferences.contains("rbProNoInclu")) if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") prodInclu = 0 |
1025 | return prodInclu | 1008 | return prodInclu |
1026 | } | 1009 | } |
1027 | 1010 | ||
1028 | private fun SerchArea(): Boolean { | 1011 | private fun SerchArea(): Boolean { |
1029 | if (sharedPreferences.contains("rbVentas")) if (sharedPreferences.getString("rbVentas", "").toString() == "1") iArea = false | 1012 | if (sharedPreferences.contains("rbVentas")) if (sharedPreferences.getString("rbVentas", "").toString() == "1") iArea = false |
1030 | if (sharedPreferences.contains("rbDeposito")) if (sharedPreferences.getString("rbDeposito", "").toString() == "1") iArea = true | 1013 | if (sharedPreferences.contains("rbDeposito")) if (sharedPreferences.getString("rbDeposito", "").toString() == "1") iArea = true |
1031 | return iArea | 1014 | return iArea |
1032 | } | 1015 | } |
1033 | 1016 | ||
1034 | private suspend fun SerchAreaInventario(): Boolean { | 1017 | private suspend fun SerchAreaInventario(): Boolean { |
1035 | return GlobalScope.async(IO) { | 1018 | return GlobalScope.async(IO) { |
1036 | return@async AppDb.getAppDb((activity as MainActivity))!!.InvHeadDAO()!!.fetchAreaInvH((inventarioViewModel as InventarioViewModel).InventarioNuevo) | 1019 | return@async AppDb.getAppDb((activity as MainActivity))!!.InvHeadDAO()!!.fetchAreaInvH((inventarioViewModel as InventarioViewModel).InventarioNuevo) |
1037 | }.await() | 1020 | }.await() |
1038 | 1021 | ||
1039 | } | 1022 | } |
1040 | 1023 | ||
1041 | private fun InsertarArtEnDB(cuarpoInventario: InvBody) { | 1024 | private fun InsertarArtEnDB(cuarpoInventario: InvBody) { |
1042 | lifecycleScope.launch { | 1025 | lifecycleScope.launch { |
1043 | withContext(Dispatchers.IO) { | 1026 | withContext(Dispatchers.IO) { |
1044 | AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) | 1027 | AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) |
1045 | } | 1028 | } |
1046 | } | 1029 | } |
1047 | } | 1030 | } |
1048 | 1031 | ||
1049 | private fun updateCantidad(sector: String, codigo: String, cantidad: Float) { | 1032 | private fun updateCantidad(sector: String, codigo: String, cantidad: Float) { |
1050 | lifecycleScope.launch { | 1033 | lifecycleScope.launch { |
1051 | withContext(IO) { | 1034 | withContext(IO) { |
1052 | AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.updateInvBody(cantidad, sector.toLong(), codigo.toLong(), obtenerFechaActual()) | 1035 | AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.updateInvBody(cantidad, sector.toLong(), codigo.toLong(), obtenerFechaActual()) |
1053 | } | 1036 | } |
1054 | } | 1037 | } |
1055 | } | 1038 | } |
1056 | 1039 | ||
1057 | private suspend fun cargarInventario(inventario: Int): List<InvBody>? { | 1040 | private suspend fun cargarInventario(inventario: Int): List<InvBody>? { |
1058 | return GlobalScope.async(IO) { | 1041 | return GlobalScope.async(IO) { |
1059 | return@async AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.fetchAllInvBody(inventario) | 1042 | return@async AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.fetchAllInvBody(inventario) |
1060 | }.await() | 1043 | }.await() |
1061 | } | 1044 | } |
1062 | 1045 | ||
1063 | override fun onImageDotsClick(sector: String?, codigo: String?) { | 1046 | override fun onImageDotsClick(sector: String?, codigo: String?) { |
1064 | val bundle = Bundle() | 1047 | val bundle = Bundle() |
1065 | bundle.putString("sector", sector!!.toInt().toString()) | 1048 | bundle.putString("sector", sector!!.toInt().toString()) |
1066 | bundle.putString("codigo", codigo) | 1049 | bundle.putString("codigo", codigo) |
1067 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) | 1050 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) |
1068 | navController.navigate(R.id.action_inventarioFragment_to_detalleArtFragment, bundle) | 1051 | navController.navigate(R.id.action_inventarioFragment_to_detalleArtFragment, bundle) |
1069 | } | 1052 | } |
1070 | 1053 | ||
1071 | override fun onImagePenClick(sector: String?, codigo: String?, cantidad: String?, position: String) { | 1054 | override fun onImagePenClick(sector: String?, codigo: String?, cantidad: String?, position: String) { |
1072 | dialogoSumaResta(requireContext(), position.toInt(), listArticulos[position.toInt()].univta, true) | 1055 | dialogoSumaResta(requireContext(), position.toInt(), listArticulos[position.toInt()].univta, true) |
1073 | } | 1056 | } |
1074 | 1057 | ||
1075 | private val textWatcher = object : TextWatcher { | 1058 | private val textWatcher = object : TextWatcher { |
1076 | override fun afterTextChanged(s: Editable?) { | 1059 | override fun afterTextChanged(s: Editable?) { |
1077 | if (mDialogView.tvNuevaCantidad.text.toString() == "") { | 1060 | if (mDialogView.tvNuevaCantidad.text.toString() == "") { |
1078 | mDialogView.tvResultado.text = "" | 1061 | mDialogView.tvResultado.text = "" |
1079 | } | 1062 | } |
1080 | } | 1063 | } |
1081 | 1064 | ||
1082 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {} | 1065 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {} |
1083 | 1066 | ||
1084 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { | 1067 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
1085 | var cantidadTemp: Float | 1068 | var cantidadTemp: Float |
1086 | if (mDialogView.tvNuevaCantidad.text.toString() != "") { | 1069 | if (mDialogView.tvNuevaCantidad.text.toString() != "") { |
1087 | if (mDialogView.rbSumar.isChecked) { | 1070 | if (mDialogView.rbSumar.isChecked) { |
1088 | cantidadTemp = mDialogView.tvNuevaCantidad.text.toString().toFloat() + mDialogView.tvCantInicial.text.toString().toFloat() | 1071 | cantidadTemp = mDialogView.tvNuevaCantidad.text.toString().toFloat() + mDialogView.tvCantInicial.text.toString().toFloat() |
1089 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() | 1072 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() |
1090 | } | 1073 | } |
1091 | if (mDialogView.rbRestar.isChecked) { | 1074 | if (mDialogView.rbRestar.isChecked) { |
1092 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 1075 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
1093 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | 1076 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { |
1094 | cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat() | 1077 | cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat() |
1095 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() | 1078 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() |
1096 | // mDialogView.tvNuevaCantidad.isEnabled = false | 1079 | // mDialogView.tvNuevaCantidad.isEnabled = false |
1097 | } else { | 1080 | } else { |
1098 | mDialogView.tvResultado.text = "" | 1081 | mDialogView.tvResultado.text = "" |
1099 | mDialogView.tvResultado.error = "Operación No Valida" | 1082 | mDialogView.tvResultado.error = "Operación No Valida" |
1100 | mDialogView.tvResultado.requestFocus() | 1083 | mDialogView.tvResultado.requestFocus() |
1101 | mDialogView.tvResultado.hint = "Error" | 1084 | mDialogView.tvResultado.hint = "Error" |
1102 | } | 1085 | } |
1103 | } | 1086 | } |
1104 | } | 1087 | } |
1105 | if (mDialogView.rbMdodificar.isChecked) { | 1088 | if (mDialogView.rbMdodificar.isChecked) { |
1106 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 1089 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
1107 | mDialogView.tvResultado.text = (Math.round(mDialogView.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString() | 1090 | mDialogView.tvResultado.text = (Math.round(mDialogView.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString() |
1108 | } | 1091 | } |
1109 | } | 1092 | } |
1110 | } | 1093 | } |
1111 | } | 1094 | } |
1112 | } | 1095 | } |
1113 | } | 1096 | } |
1114 | 1097 | ||
1115 | 1098 | ||
1116 | 1099 | ||
1117 | 1100 | ||
1118 | 1101 | ||
1119 | 1102 | ||
1120 | 1103 | ||
1121 | 1104 | ||
1122 | 1105 | ||
1123 | 1106 | ||
1124 | 1107 | ||
1125 | 1108 | ||
1126 | 1109 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/main/InventarioSecListAdapter.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 androidx.recyclerview.widget.RecyclerView | 7 | import androidx.recyclerview.widget.RecyclerView |
8 | import com.focasoftware.deboinventariov20.Model.InvHeadSec | 8 | import com.focasoftware.deboinventariov20.Model.InvHeadSec |
9 | import com.focasoftware.deboinventariov20.R | 9 | import com.focasoftware.deboinventariov20.R |
10 | import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder | 10 | import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder |
11 | import kotlinx.android.synthetic.main.item_principal.view.* | 11 | import kotlinx.android.synthetic.main.item_principal.view.* |
12 | 12 | ||
13 | class InventarioSecListAdapter(private val context: Context, private val inv: ArrayList<InvHeadSec>, private val itemClickListener: MainFragment) : | 13 | class InventarioSecListAdapter(private val context: Context, private val inv: List<InvHeadSec>, private val itemClickListener: MainFragment) : |
14 | RecyclerView.Adapter<BaseViewHolder<*>>() { | 14 | RecyclerView.Adapter<BaseViewHolder<*>>() { |
15 | 15 | ||
16 | interface OnInventarioSecClickListener { | 16 | interface OnInventarioSecClickListener { |
17 | fun onItemSecClick(inventario: String?, nombre: String?) | 17 | fun onItemSecClick(inventario: String?, nombre: String?) |
18 | } | 18 | } |
19 | 19 | ||
20 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item_principal, parent, false)) | 20 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item_principal, parent, false)) |
21 | 21 | ||
22 | override fun getItemCount() = inv.size | 22 | override fun getItemCount() = inv.size |
23 | 23 | ||
24 | inner class ItemsViewHolder(itemView: View) : BaseViewHolder<InvHeadSec>(itemView) { | 24 | inner class ItemsViewHolder(itemView: View) : BaseViewHolder<InvHeadSec>(itemView) { |
25 | override fun bind(item: InvHeadSec, position: Int) { | 25 | override fun bind(item: InvHeadSec, position: Int) { |
26 | itemView.setOnClickListener { itemClickListener.onItemSecClick(item.invNum.toString(), item.detalle.toString()) } | 26 | itemView.setOnClickListener { itemClickListener.onItemSecClick(item.invNum.toString(), item.detalle.toString()) } |
27 | itemView.tvPrincipalinventario.text = if (item.invNum < 10) "#0${item.invNum}" else "#" + item.invNum.toString() | 27 | itemView.tvPrincipalinventario.text = if (item.invNum < 10) "#0${item.invNum}" else "#" + item.invNum.toString() |
28 | 28 | ||
29 | itemView.tvDescription.text = item.detalle.toString() | 29 | itemView.tvDescription.text = item.detalle.toString() |
30 | itemView.tvFecha.text = item.fechaInicio.toString() | 30 | itemView.tvFecha.text = item.fechaInicio.toString() |
31 | //SimpleDateFormat("dd/MM/yyyy HH:mm:SS").format(DateFormat(hd)).toString() | 31 | //SimpleDateFormat("dd/MM/yyyy HH:mm:SS").format(DateFormat(hd)).toString() |
32 | itemView.tvCantContada.text = item.prodContados.toString() | 32 | itemView.tvCantContada.text = item.prodContados.toString() |
33 | } | 33 | } |
34 | } | 34 | } |
35 | 35 | ||
36 | override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) { | 36 | override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) { |
37 | when (holder) { | 37 | when (holder) { |
38 | is ItemsViewHolder -> holder.bind(inv[position], position) | 38 | is ItemsViewHolder -> holder.bind(inv[position], position) |
39 | else -> IllegalArgumentException("No se pudo pasar el ViewHolder") | 39 | else -> IllegalArgumentException("No se pudo pasar el ViewHolder") |
40 | } | 40 | } |
41 | } | 41 | } |
42 | } | 42 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/main/MainFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.main | 1 | package com.focasoftware.deboinventariov20.UI.main |
2 | 2 | ||
3 | import android.app.AlertDialog | 3 | import android.app.AlertDialog |
4 | import android.content.Context | 4 | import android.content.Context |
5 | import android.content.Intent | 5 | import android.content.Intent |
6 | import android.content.SharedPreferences | 6 | import android.content.SharedPreferences |
7 | import android.os.Bundle | 7 | import android.os.Bundle |
8 | import android.provider.Settings | 8 | import android.provider.Settings |
9 | import android.view.LayoutInflater | 9 | import android.view.LayoutInflater |
10 | import android.view.View | 10 | import android.view.View |
11 | import android.view.ViewGroup | 11 | import android.view.ViewGroup |
12 | import android.view.WindowManager | 12 | import android.view.WindowManager |
13 | import android.view.inputmethod.InputMethodManager | 13 | import android.view.inputmethod.InputMethodManager |
14 | import android.widget.CheckBox | 14 | import android.widget.CheckBox |
15 | import android.widget.ImageButton | 15 | import android.widget.ImageButton |
16 | import android.widget.ImageView | 16 | import android.widget.ImageView |
17 | import android.widget.TextView | 17 | import android.widget.TextView |
18 | import androidx.fragment.app.Fragment | 18 | import androidx.fragment.app.Fragment |
19 | import androidx.fragment.app.FragmentActivity | 19 | import androidx.fragment.app.FragmentActivity |
20 | import androidx.navigation.NavController | 20 | import androidx.navigation.NavController |
21 | import androidx.navigation.Navigation | 21 | import androidx.navigation.Navigation |
22 | import androidx.recyclerview.widget.LinearLayoutManager | 22 | import androidx.recyclerview.widget.LinearLayoutManager |
23 | import androidx.recyclerview.widget.RecyclerView | 23 | import androidx.recyclerview.widget.RecyclerView |
24 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 24 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
25 | import com.focasoftware.deboinventariov20.Model.* | 25 | import com.focasoftware.deboinventariov20.Model.* |
26 | import com.focasoftware.deboinventariov20.R | 26 | import com.focasoftware.deboinventariov20.R |
27 | import com.focasoftware.deboinventariov20.UI.MainActivity | 27 | import com.focasoftware.deboinventariov20.UI.MainActivity |
28 | import com.focasoftware.deboinventariov20.UI.Utils.* | 28 | import com.focasoftware.deboinventariov20.UI.Utils.* |
29 | import kotlinx.android.synthetic.main.fragment_main.* | 29 | import kotlinx.android.synthetic.main.fragment_main.* |
30 | import kotlinx.android.synthetic.main.solicitar_fecha.view.* | 30 | import kotlinx.android.synthetic.main.solicitar_fecha.view.* |
31 | import kotlinx.coroutines.* | 31 | import kotlinx.coroutines.* |
32 | import kotlinx.coroutines.Dispatchers.Main | 32 | import kotlinx.coroutines.Dispatchers.Main |
33 | import retrofit2.Call | 33 | import retrofit2.Call |
34 | import retrofit2.Callback | 34 | import retrofit2.Callback |
35 | import retrofit2.Response | 35 | import retrofit2.Response |
36 | import java.net.SocketTimeoutException | 36 | import java.net.SocketTimeoutException |
37 | import java.util.* | 37 | import java.util.* |
38 | import kotlin.math.absoluteValue | 38 | import kotlin.math.absoluteValue |
39 | 39 | ||
40 | class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener, InventarioSecListAdapter.OnInventarioSecClickListener { | 40 | class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener, InventarioSecListAdapter.OnInventarioSecClickListener { |
41 | private var inventarios: List<InvHead>? = null | 41 | private var inventarios: List<InvHead>? = null |
42 | private var inventariosII: List<InvHeadSec>? = null | 42 | private var inventariosII: List<InvHeadSec>? = null |
43 | private lateinit var ordenado: List<InvHead> | 43 | private lateinit var ordenado: List<InvHead> |
44 | private lateinit var ordenadoII: List<InvHeadSec> | ||
44 | private lateinit var rcInventario: RecyclerView | 45 | private lateinit var rcInventario: RecyclerView |
45 | private lateinit var rcInventarioII: RecyclerView | 46 | private lateinit var rcInventarioII: RecyclerView |
46 | private lateinit var viewAdapter: RecyclerView.Adapter<*> | 47 | private lateinit var viewAdapter: RecyclerView.Adapter<*> |
47 | private lateinit var viewManager: RecyclerView.LayoutManager | 48 | private lateinit var viewManager: RecyclerView.LayoutManager |
48 | private var listIvn2 = ArrayList<InvHead>() | 49 | private var listIvn2 = ArrayList<InvHead>() |
49 | private var listIvn2II = ArrayList<InvHeadSec>() | 50 | private var listIvn2II = ArrayList<InvHeadSec>() |
50 | private lateinit var navController: NavController | 51 | private lateinit var navController: NavController |
51 | private lateinit var sharedPreferences: SharedPreferences | 52 | private lateinit var sharedPreferences: SharedPreferences |
52 | private var cantidadInventarios: Int = 0 | 53 | private var cantidadInventarios: Int = 0 |
53 | private var cantidadInventariosII: Int = 0 | 54 | private var cantidadInventariosII: Int = 0 |
54 | private val job: Job = Job() | 55 | private val job: Job = Job() |
55 | private val fragmentScopeMain = CoroutineScope(Dispatchers.IO + job) | 56 | private val fragmentScopeMain = CoroutineScope(Dispatchers.IO + job) |
56 | private var serverBajada: ServeInv? = null | 57 | private var serverBajada: ServeInv? = null |
57 | 58 | ||
58 | override fun onCreate(savedInstanceState: Bundle?) { | 59 | override fun onCreate(savedInstanceState: Bundle?) { |
59 | super.onCreate(savedInstanceState) | 60 | super.onCreate(savedInstanceState) |
60 | 61 | ||
61 | sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 62 | sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
62 | 63 | ||
63 | if (sharedPreferences.contains("inicio")) { | 64 | if (sharedPreferences.contains("inicio")) { |
64 | if (sharedPreferences.getString("inicio", "").toString() == "inicio") { | 65 | if (sharedPreferences.getString("inicio", "").toString() == "inicio") { |
65 | if (sharedPreferences.contains("cbAskTimeServerToStart")) { | 66 | if (sharedPreferences.contains("cbAskTimeServerToStart")) { |
66 | if (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "1") { | 67 | if (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "1") { |
67 | GlobalScope.launch(Main) { | 68 | GlobalScope.launch(Main) { |
68 | serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne() | 69 | serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne() |
69 | if (serverBajada != null) { | 70 | if (serverBajada != null) { |
70 | if (serverBajada!!.direccion.isNullOrEmpty()) { | 71 | if (serverBajada!!.direccion.isNullOrEmpty()) { |
71 | val modalDialog = NoServerConf() | 72 | val modalDialog = NoServerConf() |
72 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | 73 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
73 | } else { | 74 | } else { |
74 | BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoBajada.toString() + "/" | 75 | BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoBajada.toString() + "/" |
75 | } | 76 | } |
76 | } | 77 | } |
77 | 78 | ||
78 | val call: Call<List<Time?>?>? = WebService.instance | 79 | val call: Call<List<Time?>?>? = WebService.instance |
79 | ?.createService(WebServiceApi::class.java) | 80 | ?.createService(WebServiceApi::class.java) |
80 | ?.getTime() | 81 | ?.getTime() |
81 | call!!.enqueue(object : Callback<List<Time?>?> { | 82 | call!!.enqueue(object : Callback<List<Time?>?> { |
82 | override fun onResponse(call: Call<List<Time?>?>?, response: Response<List<Time?>?>) { | 83 | override fun onResponse(call: Call<List<Time?>?>?, response: Response<List<Time?>?>) { |
83 | if (response.code() == 200) { | 84 | if (response.code() == 200) { |
84 | try { | 85 | try { |
85 | val timeServer = | 86 | val timeServer = |
86 | response.body()?.get(0)?.dia + "/" + | 87 | response.body()?.get(0)?.dia + "/" + |
87 | response.body()?.get(0)?.mes + "/" + | 88 | response.body()?.get(0)?.mes + "/" + |
88 | response.body()?.get(0)?.ano + " " + | 89 | response.body()?.get(0)?.ano + " " + |
89 | response.body()?.get(0)?.hora + ":" + | 90 | response.body()?.get(0)?.hora + ":" + |
90 | response.body()?.get(0)?.minutos + ":" + | 91 | response.body()?.get(0)?.minutos + ":" + |
91 | response.body()?.get(0)?.segundos | 92 | response.body()?.get(0)?.segundos |
92 | val horaServer = response.body()?.get(0)?.hora + "" + | 93 | val horaServer = response.body()?.get(0)?.hora + "" + |
93 | response.body()?.get(0)?.minutos + "" + | 94 | response.body()?.get(0)?.minutos + "" + |
94 | response.body()?.get(0)?.segundos | 95 | response.body()?.get(0)?.segundos |
95 | val fechaServer = response.body()?.get(0)?.dia + "" + | 96 | val fechaServer = response.body()?.get(0)?.dia + "" + |
96 | response.body()?.get(0)?.mes + "" + | 97 | response.body()?.get(0)?.mes + "" + |
97 | response.body()?.get(0)?.ano | 98 | response.body()?.get(0)?.ano |
98 | if (!askTimeServer(timeServer, horaServer, fechaServer)) { | 99 | if (!askTimeServer(timeServer, horaServer, fechaServer)) { |
99 | } | 100 | } |
100 | } catch (e: SocketTimeoutException) { | 101 | } catch (e: SocketTimeoutException) { |
101 | } | 102 | } |
102 | } else if (response.code() == 400) { | 103 | } else if (response.code() == 400) { |
103 | } | 104 | } |
104 | } | 105 | } |
105 | 106 | ||
106 | override fun onFailure(call: Call<List<Time?>?>?, t: Throwable?) {} | 107 | override fun onFailure(call: Call<List<Time?>?>?, t: Throwable?) {} |
107 | }) | 108 | }) |
108 | } | 109 | } |
109 | val editor = sharedPreferences.edit() | 110 | val editor = sharedPreferences.edit() |
110 | editor?.putString("inicio", "") | 111 | editor?.putString("inicio", "") |
111 | editor?.apply() | 112 | editor?.apply() |
112 | editor.commit() | 113 | editor.commit() |
113 | } | 114 | } |
114 | } | 115 | } |
115 | } | 116 | } |
116 | } | 117 | } |
117 | } | 118 | } |
118 | 119 | ||
119 | override fun onDestroy() { | 120 | override fun onDestroy() { |
120 | super.onDestroy() | 121 | super.onDestroy() |
121 | fragmentScopeMain.cancel() | 122 | fragmentScopeMain.cancel() |
122 | } | 123 | } |
123 | 124 | ||
124 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 125 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
125 | var bAbiertoCerrado = false | 126 | var bAbiertoCerrado = false |
126 | var bAbiertoCerradoII = false | 127 | var bAbiertoCerradoII = false |
127 | val v = inflater.inflate(R.layout.fragment_main, container, false) | 128 | val v = inflater.inflate(R.layout.fragment_main, container, false) |
128 | val tvInvDinamicos = v.findViewById<TextView>(R.id.tvInvDinamicos) | 129 | val tvInvDinamicos = v.findViewById<TextView>(R.id.tvInvDinamicos) |
129 | val tvInvImportados = v.findViewById<TextView>(R.id.tvInvImportados) | 130 | val tvInvImportados = v.findViewById<TextView>(R.id.tvInvImportados) |
130 | val ivSort19 = v.findViewById<ImageButton>(R.id.ivSort19) | 131 | val ivSort19 = v.findViewById<ImageButton>(R.id.ivSort19) |
131 | val ivSort91 = v.findViewById<ImageButton>(R.id.ivSort91) | 132 | val ivSort91 = v.findViewById<ImageButton>(R.id.ivSort91) |
133 | val ivSort19II = v.findViewById<ImageButton>(R.id.ivSort19II) | ||
134 | val ivSort91II = v.findViewById<ImageButton>(R.id.ivSort91II) | ||
132 | val cbVentas = v.findViewById<CheckBox>(R.id.cbVentas) | 135 | val cbVentas = v.findViewById<CheckBox>(R.id.cbVentas) |
133 | val cbDeposito = v.findViewById<CheckBox>(R.id.cbDeposito) | 136 | val cbDeposito = v.findViewById<CheckBox>(R.id.cbDeposito) |
134 | val tvTipo = v.findViewById<TextView>(R.id.tvTipo) | 137 | val tvTipo = v.findViewById<TextView>(R.id.tvTipo) |
135 | val ivPortada = v.findViewById<ImageView>(R.id.ivPortada) | 138 | val ivPortada = v.findViewById<ImageView>(R.id.ivPortada) |
136 | rcInventario = v.findViewById(R.id.rcInventario) | 139 | rcInventario = v.findViewById(R.id.rcInventario) |
137 | rcInventarioII = v.findViewById(R.id.rcInventarioII) | 140 | rcInventarioII = v.findViewById(R.id.rcInventarioII) |
138 | ivPortada.visibility = View.VISIBLE | 141 | ivPortada.visibility = View.VISIBLE |
139 | 142 | ||
140 | fragmentScopeMain.launch(Main) { | 143 | fragmentScopeMain.launch(Main) { |
141 | 144 | ||
142 | 145 | ||
143 | 146 | ||
144 | 147 | ||
145 | 148 | ||
146 | 149 | ||
147 | inventarios = buscarEnBDInvHead() | 150 | inventarios = buscarEnBDInvHead() |
148 | for ((i, item) in inventarios!!.withIndex()) { | 151 | for ((i, item) in inventarios!!.withIndex()) { |
149 | val inv = InvHead( | 152 | val inv = InvHead( |
150 | inventarios!![i].invNum, | 153 | inventarios!![i].invNum, |
151 | inventarios!![i].descripcion, | 154 | inventarios!![i].descripcion, |
152 | inventarios!![i].estado, | 155 | inventarios!![i].estado, |
153 | inventarios!![i].fechaInicio, | 156 | inventarios!![i].fechaInicio, |
154 | inventarios!![i].fechaFinal, | 157 | inventarios!![i].fechaFinal, |
155 | inventarios!![i].prodContados, | 158 | inventarios!![i].prodContados, |
156 | inventarios!![i].lugar, | 159 | inventarios!![i].lugar, |
157 | inventarios!![i].stDesc, | 160 | inventarios!![i].stDesc, |
158 | inventarios!![i].proNoCont | 161 | inventarios!![i].proNoCont |
159 | ) | 162 | ) |
160 | cargarRecicler(inv) | 163 | cargarRecicler(inv) |
161 | cantidadInventarios = i + 1 | 164 | cantidadInventarios = i + 1 |
162 | } | 165 | } |
163 | tvInvDinamicos.text = "Inventarios Dinámicos ($cantidadInventarios) +" | 166 | tvInvDinamicos.text = "Inventarios Dinámicos ($cantidadInventarios) +" |
164 | listIvn2II.clear() | 167 | listIvn2II.clear() |
165 | inventariosII = buscarEnBDInvSecHead() | 168 | inventariosII = buscarEnBDInvSecHead() |
166 | for ((i, item) in inventariosII!!.withIndex()) { | 169 | for ((i, item) in inventariosII!!.withIndex()) { |
167 | val invII = InvHeadSec( | 170 | val invII = InvHeadSec( |
168 | inventariosII!![i].invNum, | 171 | inventariosII!![i].invNum, |
169 | inventariosII!![i].detalle, | 172 | inventariosII!![i].detalle, |
170 | inventariosII!![i].fechaInicio, | 173 | inventariosII!![i].fechaInicio, |
171 | inventariosII!![i].depsn, | 174 | inventariosII!![i].depsn, |
172 | inventariosII!![i].estado, | 175 | inventariosII!![i].estado, |
173 | inventariosII!![i].fechaFinal, | 176 | inventariosII!![i].fechaFinal, |
174 | inventariosII!![i].prodContados | 177 | inventariosII!![i].prodContados |
175 | ) | 178 | ) |
176 | cargarReciclerII(invII) | 179 | cargarReciclerII(invII) |
177 | cantidadInventariosII = i + 1 | 180 | cantidadInventariosII = i + 1 |
178 | } | 181 | } |
179 | tvInvImportados.text = "Inventarios Importados ($cantidadInventariosII) +" | 182 | tvInvImportados.text = "Inventarios Importados ($cantidadInventariosII) +" |
180 | 183 | ||
181 | tvInvDinamicos.setOnClickListener { | 184 | tvInvDinamicos.setOnClickListener { |
182 | if (!bAbiertoCerrado) { | 185 | if (!bAbiertoCerrado) { |
183 | bAbiertoCerrado = true | 186 | bAbiertoCerrado = true |
184 | tvInvImportados.visibility = View.GONE | 187 | tvInvImportados.visibility = View.GONE |
188 | ivSort91II.visibility = View.GONE | ||
189 | ivSort19II.visibility = View.GONE | ||
185 | rcInventario.visibility = View.VISIBLE | 190 | rcInventario.visibility = View.VISIBLE |
186 | ivSort91.visibility = View.INVISIBLE | 191 | ivSort91.visibility = View.INVISIBLE |
187 | ivSort19.visibility = View.VISIBLE | 192 | ivSort19.visibility = View.VISIBLE |
188 | cbVentas.visibility = View.VISIBLE | 193 | cbVentas.visibility = View.VISIBLE |
189 | cbDeposito.visibility = View.VISIBLE | 194 | cbDeposito.visibility = View.VISIBLE |
190 | tvTipo.visibility = View.VISIBLE | 195 | tvTipo.visibility = View.VISIBLE |
191 | ivPortada.visibility = View.GONE | 196 | ivPortada.visibility = View.GONE |
192 | tvInvDinamicos.text = "Inventarios Dinamicos ($cantidadInventarios) -" | 197 | tvInvDinamicos.text = "Inventarios Dinamicos ($cantidadInventarios) -" |
193 | } else { | 198 | } else { |
194 | bAbiertoCerrado = false | 199 | bAbiertoCerrado = false |
195 | rcInventario.visibility = View.GONE | 200 | rcInventario.visibility = View.GONE |
196 | ivSort91.visibility = View.GONE | 201 | ivSort91.visibility = View.GONE |
197 | ivSort19.visibility = View.GONE | 202 | ivSort19.visibility = View.GONE |
198 | tvInvImportados.visibility = View.VISIBLE | 203 | tvInvImportados.visibility = View.VISIBLE |
199 | cbVentas.visibility = View.GONE | 204 | cbVentas.visibility = View.GONE |
200 | cbDeposito.visibility = View.GONE | 205 | cbDeposito.visibility = View.GONE |
201 | tvTipo.visibility = View.GONE | 206 | tvTipo.visibility = View.GONE |
202 | ivPortada.visibility = View.VISIBLE | 207 | ivPortada.visibility = View.VISIBLE |
203 | tvInvDinamicos.text = "Inventarios Dinamicos ($cantidadInventarios) +" | 208 | tvInvDinamicos.text = "Inventarios Dinamicos ($cantidadInventarios) +" |
204 | } | 209 | } |
205 | } | 210 | } |
206 | 211 | ||
207 | ordenado = inventarios!!.sortedBy { it.invNum } | 212 | ordenado = inventarios!!.sortedBy { it.invNum } |
208 | 213 | ||
209 | ivSort19.setOnClickListener { | 214 | ivSort19.setOnClickListener { |
210 | ordenado = inventarios!!.sortedByDescending { | 215 | ordenado = inventarios!!.sortedByDescending { |
211 | it.invNum | 216 | it.invNum |
212 | } | 217 | } |
213 | cbDeposito.isChecked = true | 218 | cbDeposito.isChecked = true |
214 | cbVentas.isChecked = true | 219 | cbVentas.isChecked = true |
215 | viewAdapter = InventarioListAdapter(requireContext(), ordenado, this@MainFragment) | 220 | viewAdapter = InventarioListAdapter(requireContext(), ordenado, this@MainFragment) |
216 | viewManager = LinearLayoutManager(requireContext()) | 221 | viewManager = LinearLayoutManager(requireContext()) |
217 | 222 | ||
218 | rcInventario.apply { | 223 | rcInventario.apply { |
219 | adapter = viewAdapter | 224 | adapter = viewAdapter |
220 | layoutManager = viewManager | 225 | layoutManager = viewManager |
221 | } | 226 | } |
222 | viewAdapter.notifyDataSetChanged() | 227 | viewAdapter.notifyDataSetChanged() |
223 | ivSort19.visibility = View.INVISIBLE | 228 | ivSort19.visibility = View.INVISIBLE |
224 | ivSort91.visibility = View.VISIBLE | 229 | ivSort91.visibility = View.VISIBLE |
225 | } | 230 | } |
226 | 231 | ||
227 | ivSort91.setOnClickListener { | 232 | ivSort91.setOnClickListener { |
228 | ordenado = inventarios!!.sortedBy { | 233 | ordenado = inventarios!!.sortedBy { |
229 | it.invNum | 234 | it.invNum |
230 | } | 235 | } |
231 | cbDeposito.isChecked = true | 236 | cbDeposito.isChecked = true |
232 | cbVentas.isChecked = true | 237 | cbVentas.isChecked = true |
233 | viewAdapter = InventarioListAdapter(requireContext(), ordenado, this@MainFragment) | 238 | viewAdapter = InventarioListAdapter(requireContext(), ordenado, this@MainFragment) |
234 | viewManager = LinearLayoutManager(requireContext()) | 239 | viewManager = LinearLayoutManager(requireContext()) |
235 | 240 | ||
236 | rcInventario.apply { | 241 | rcInventario.apply { |
237 | adapter = viewAdapter | 242 | adapter = viewAdapter |
238 | layoutManager = viewManager | 243 | layoutManager = viewManager |
239 | } | 244 | } |
240 | viewAdapter.notifyDataSetChanged() | 245 | viewAdapter.notifyDataSetChanged() |
241 | ivSort91.visibility = View.INVISIBLE | 246 | ivSort91.visibility = View.INVISIBLE |
242 | ivSort19.visibility = View.VISIBLE | 247 | ivSort19.visibility = View.VISIBLE |
243 | } | 248 | } |
244 | 249 | ||
245 | tvInvImportados.setOnClickListener { | 250 | tvInvImportados.setOnClickListener { |
246 | if (!bAbiertoCerradoII) { | 251 | if (!bAbiertoCerradoII) { |
247 | bAbiertoCerradoII = true | 252 | bAbiertoCerradoII = true |
248 | tvInvDinamicos.visibility = View.GONE | 253 | tvInvDinamicos.visibility = View.GONE |
249 | ivSort19.visibility = View.GONE | 254 | ivSort19.visibility = View.GONE |
250 | ivSort91.visibility = View.GONE | 255 | ivSort91.visibility = View.GONE |
251 | cbVentas.visibility = View.GONE | 256 | cbVentas.visibility = View.GONE |
252 | cbDeposito.visibility = View.GONE | 257 | cbDeposito.visibility = View.GONE |
253 | ivPortada.visibility = View.GONE | 258 | ivPortada.visibility = View.GONE |
254 | tvInvDinamicos.visibility = View.GONE | 259 | tvInvDinamicos.visibility = View.GONE |
255 | rcInventarioII.visibility = View.VISIBLE | 260 | rcInventarioII.visibility = View.VISIBLE |
261 | rcInventario.visibility = View.GONE | ||
262 | ivSort91II.visibility = View.INVISIBLE | ||
263 | ivSort19II.visibility = View.VISIBLE | ||
256 | tvInvImportados.text = "Inventarios Importados ($cantidadInventariosII) -" | 264 | tvInvImportados.text = "Inventarios Importados ($cantidadInventariosII) -" |
257 | } else { | 265 | } else { |
258 | bAbiertoCerradoII = false | 266 | bAbiertoCerradoII = false |
259 | ivPortada.visibility = View.VISIBLE | 267 | ivPortada.visibility = View.VISIBLE |
260 | rcInventarioII.visibility = View.GONE | 268 | rcInventarioII.visibility = View.GONE |
269 | ivSort91II.visibility = View.GONE | ||
270 | ivSort19II.visibility = View.GONE | ||
261 | tvInvImportados.visibility = View.VISIBLE | 271 | tvInvImportados.visibility = View.VISIBLE |
262 | tvInvDinamicos.visibility = View.VISIBLE | 272 | tvInvDinamicos.visibility = View.VISIBLE |
263 | tvInvImportados.text = "Inventarios Importados ($cantidadInventariosII) +" | 273 | tvInvImportados.text = "Inventarios Importados ($cantidadInventariosII) +" |
264 | } | 274 | } |
265 | } | 275 | } |
276 | ordenadoII = inventariosII!!.sortedBy { it.invNum } | ||
277 | |||
278 | ivSort19II.setOnClickListener { | ||
279 | ordenadoII = inventariosII!!.sortedByDescending { | ||
280 | it.invNum | ||
281 | } | ||
282 | viewAdapter = InventarioSecListAdapter(requireContext(), ordenadoII, this@MainFragment) | ||
283 | viewManager = LinearLayoutManager(requireContext()) | ||
284 | |||
285 | rcInventarioII.apply { | ||
286 | adapter = viewAdapter | ||
287 | layoutManager = viewManager | ||
288 | } | ||
289 | viewAdapter.notifyDataSetChanged() | ||
290 | ivSort19II.visibility = View.INVISIBLE | ||
291 | ivSort91II.visibility = View.VISIBLE | ||
292 | } | ||
293 | |||
294 | ivSort91II.setOnClickListener { | ||
295 | ordenadoII = inventariosII!!.sortedBy { | ||
296 | it.invNum | ||
297 | } | ||
298 | viewAdapter = InventarioSecListAdapter(requireContext(), ordenadoII, this@MainFragment) | ||
299 | viewManager = LinearLayoutManager(requireContext()) | ||
300 | |||
301 | rcInventarioII.apply { | ||
302 | adapter = viewAdapter | ||
303 | layoutManager = viewManager | ||
304 | } | ||
305 | viewAdapter.notifyDataSetChanged() | ||
306 | ivSort91II.visibility = View.INVISIBLE | ||
307 | ivSort19II.visibility = View.VISIBLE | ||
308 | } | ||
309 | |||
266 | } | 310 | } |
267 | 311 | ||
268 | cbVentas.setOnClickListener { | 312 | cbVentas.setOnClickListener { |
269 | if (!cbVentas.isChecked) { | 313 | if (!cbVentas.isChecked) { |
270 | cbDeposito.isChecked = true | 314 | cbDeposito.isChecked = true |
271 | listIvn2.clear() | 315 | listIvn2.clear() |
272 | ordenado.forEach { | 316 | ordenado.forEach { |
273 | if (it.lugar == true) { | 317 | if (it.lugar == true) { |
274 | listIvn2.add(it) | 318 | listIvn2.add(it) |
275 | } | 319 | } |
276 | } | 320 | } |
277 | } else { | 321 | } else { |
278 | listIvn2.clear() | 322 | listIvn2.clear() |
279 | listIvn2.addAll(ordenado) | 323 | listIvn2.addAll(ordenado) |
280 | } | 324 | } |
281 | viewAdapter = InventarioListAdapter(requireContext(), listIvn2, this@MainFragment) | 325 | viewAdapter = InventarioListAdapter(requireContext(), listIvn2, this@MainFragment) |
282 | viewManager = LinearLayoutManager(requireContext()) | 326 | viewManager = LinearLayoutManager(requireContext()) |
283 | rcInventario.apply { | 327 | rcInventario.apply { |
284 | adapter = viewAdapter | 328 | adapter = viewAdapter |
285 | layoutManager = viewManager | 329 | layoutManager = viewManager |
286 | } | 330 | } |
287 | viewAdapter.notifyDataSetChanged() | 331 | viewAdapter.notifyDataSetChanged() |
288 | } | 332 | } |
289 | 333 | ||
290 | cbDeposito.setOnClickListener { | 334 | cbDeposito.setOnClickListener { |
291 | if (!cbDeposito.isChecked) { | 335 | if (!cbDeposito.isChecked) { |
292 | cbVentas.isChecked = true | 336 | cbVentas.isChecked = true |
293 | listIvn2.clear() | 337 | listIvn2.clear() |
294 | ordenado.forEach { | 338 | ordenado.forEach { |
295 | if (it.lugar == false) { | 339 | if (it.lugar == false) { |
296 | listIvn2.add(it) | 340 | listIvn2.add(it) |
297 | } | 341 | } |
298 | } | 342 | } |
299 | } else { | 343 | } else { |
300 | listIvn2.clear() | 344 | listIvn2.clear() |
301 | listIvn2.addAll(ordenado) | 345 | listIvn2.addAll(ordenado) |
302 | } | 346 | } |
303 | viewAdapter = InventarioListAdapter(requireContext(), listIvn2, this@MainFragment) | 347 | viewAdapter = InventarioListAdapter(requireContext(), listIvn2, this@MainFragment) |
304 | viewManager = LinearLayoutManager(requireContext()) | 348 | viewManager = LinearLayoutManager(requireContext()) |
305 | rcInventario.apply { | 349 | rcInventario.apply { |
306 | adapter = viewAdapter | 350 | adapter = viewAdapter |
307 | layoutManager = viewManager | 351 | layoutManager = viewManager |
308 | } | 352 | } |
309 | viewAdapter.notifyDataSetChanged() | 353 | viewAdapter.notifyDataSetChanged() |
310 | } | 354 | } |
311 | 355 | ||
312 | return v | 356 | return v |
313 | } | 357 | } |
314 | 358 | ||
315 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 359 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
316 | super.onViewCreated(view, savedInstanceState) | 360 | super.onViewCreated(view, savedInstanceState) |
317 | navController = Navigation.findNavController(view) | 361 | navController = Navigation.findNavController(view) |
318 | listIvn2.clear() | 362 | listIvn2.clear() |
319 | listIvn2II.clear() | 363 | listIvn2II.clear() |
320 | ivPortada.visibility = View.VISIBLE | 364 | ivPortada.visibility = View.VISIBLE |
321 | } | 365 | } |
322 | 366 | ||
323 | fun cargarRecicler(inv: InvHead) { | 367 | fun cargarRecicler(inv: InvHead) { |
324 | //TODO CARGO EN LE RV | 368 | //TODO CARGO EN LE RV |
325 | 369 | ||
326 | listIvn2.add(inv) | 370 | listIvn2.add(inv) |
327 | viewAdapter = InventarioListAdapter(requireContext(), listIvn2, this) | 371 | viewAdapter = InventarioListAdapter(requireContext(), listIvn2, this) |
328 | viewManager = LinearLayoutManager(requireContext()) | 372 | viewManager = LinearLayoutManager(requireContext()) |
329 | 373 | ||
330 | rcInventario.apply { | 374 | rcInventario.apply { |
331 | adapter = viewAdapter | 375 | adapter = viewAdapter |
332 | layoutManager = viewManager | 376 | layoutManager = viewManager |
333 | } | 377 | } |
334 | } | 378 | } |
335 | 379 | ||
336 | fun cargarReciclerII(inv: InvHeadSec) { | 380 | fun cargarReciclerII(inv: InvHeadSec) { |
337 | //TODO CARGO EN LE RV | 381 | //TODO CARGO EN LE RV |
338 | 382 | ||
339 | listIvn2II.add(inv) | 383 | listIvn2II.add(inv) |
340 | viewAdapter = InventarioSecListAdapter(requireContext(), listIvn2II, this) | 384 | viewAdapter = InventarioSecListAdapter(requireContext(), listIvn2II, this) |
341 | viewManager = LinearLayoutManager(requireContext()) | 385 | viewManager = LinearLayoutManager(requireContext()) |
342 | 386 | ||
343 | rcInventarioII.apply { | 387 | rcInventarioII.apply { |
344 | adapter = viewAdapter | 388 | adapter = viewAdapter |
345 | layoutManager = viewManager | 389 | layoutManager = viewManager |
346 | } | 390 | } |
347 | } | 391 | } |
348 | 392 | ||
349 | override fun onItemClick(inventario: String?) { | 393 | override fun onItemClick(inventario: String?) { |
350 | val editor = sharedPreferences.edit() | 394 | val editor = sharedPreferences.edit() |
351 | editor?.putString("Inventario", inventario) | 395 | editor?.putString("Inventario", inventario) |
352 | editor?.apply() | 396 | editor?.apply() |
353 | editor.commit() | 397 | editor.commit() |
354 | navController.navigate(R.id.action_mainFragment2_to_inventarioFragment) | 398 | navController.navigate(R.id.action_mainFragment2_to_inventarioFragment) |
355 | } | 399 | } |
356 | 400 | ||
357 | override fun onItemSecClick(inventario: String?, nombre: String?) { | 401 | override fun onItemSecClick(inventario: String?, nombre: String?) { |
358 | val editor = sharedPreferences.edit() | 402 | val editor = sharedPreferences.edit() |
359 | editor?.putString("InventarioSecNum", inventario) | 403 | editor?.putString("InventarioSecNum", inventario) |
360 | editor?.putString("InventarioSecNom", nombre) | 404 | editor?.putString("InventarioSecNom", nombre) |
361 | editor?.apply() | 405 | editor?.apply() |
362 | editor.commit() | 406 | editor.commit() |
363 | navController.navigate(R.id.action_mainFragment2_to_invSecFragment) | 407 | navController.navigate(R.id.action_mainFragment2_to_invSecFragment) |
364 | } | 408 | } |
365 | 409 | ||
366 | private suspend fun buscarEnBDInvHead(): List<InvHead> { | 410 | private suspend fun buscarEnBDInvHead(): List<InvHead> { |
367 | //TODO BUSQUEDA POR DESCRIPCION | 411 | //TODO BUSQUEDA POR DESCRIPCION |
368 | var busqueda: List<InvHead> | 412 | var busqueda: List<InvHead> |
369 | return fragmentScopeMain.async(Dispatchers.IO) { | 413 | return fragmentScopeMain.async(Dispatchers.IO) { |
370 | busqueda = AppDb.getAppDb(requireContext())!!.InvHeadDAO()!!.fetchAllInvHead() | 414 | busqueda = AppDb.getAppDb(requireContext())!!.InvHeadDAO()!!.fetchAllInvHead() |
371 | return@async busqueda | 415 | return@async busqueda |
372 | }.await() | 416 | }.await() |
373 | } | 417 | } |
374 | 418 | ||
375 | private suspend fun buscarEnBDInvSecHead(): List<InvHeadSec> { | 419 | private suspend fun buscarEnBDInvSecHead(): List<InvHeadSec> { |
376 | //TODO BUSQUEDA POR DESCRIPCION | 420 | //TODO BUSQUEDA POR DESCRIPCION |
377 | var busqueda: List<InvHeadSec> | 421 | var busqueda: List<InvHeadSec> |
378 | return fragmentScopeMain.async(Dispatchers.IO) { | 422 | return fragmentScopeMain.async(Dispatchers.IO) { |
379 | busqueda = AppDb.getAppDb(requireContext())!!.InvHeadSecDAO()!!.fetchAllInvSecHead() | 423 | busqueda = AppDb.getAppDb(requireContext())!!.InvHeadSecDAO()!!.fetchAllInvSecHead() |
380 | return@async busqueda | 424 | return@async busqueda |
381 | }.await() | 425 | }.await() |
382 | } | 426 | } |
383 | 427 | ||
384 | 428 | ||
385 | private suspend fun fetchServerPreOne(): ServeInv? { | 429 | private suspend fun fetchServerPreOne(): ServeInv? { |
386 | return fragmentScopeMain.async(Dispatchers.IO) { | 430 | return fragmentScopeMain.async(Dispatchers.IO) { |
387 | return@async AppDb.getAppDb(requireContext())!!.ServeInvDao()!!.fetchServerPreOne() | 431 | return@async AppDb.getAppDb(requireContext())!!.ServeInvDao()!!.fetchServerPreOne() |
388 | }.await() | 432 | }.await() |
389 | } | 433 | } |
390 | 434 | ||
391 | 435 | ||
392 | private fun askTimeServer(timeServer: String, horaServer: String, fechaServer: String): Boolean { | 436 | private fun askTimeServer(timeServer: String, horaServer: String, fechaServer: String): Boolean { |
393 | 437 | ||
394 | var existeDiferencias = false | 438 | var existeDiferencias = false |
395 | val horaAct = obtenerHoraActual().toDouble() | 439 | val horaAct = obtenerHoraActual().toDouble() |
396 | val fechaAct = obtenerDiaActual().toDouble() | 440 | val fechaAct = obtenerDiaActual().toDouble() |
397 | val difFecha = fechaAct - fechaServer.toDouble() | 441 | val difFecha = fechaAct - fechaServer.toDouble() |
398 | val difHora = horaAct - horaServer.toDouble() | 442 | val difHora = horaAct - horaServer.toDouble() |
399 | if (difFecha.absoluteValue > 0) existeDiferencias = true | 443 | if (difFecha.absoluteValue > 0) existeDiferencias = true |
400 | if (difHora.absoluteValue > 130) existeDiferencias = true | 444 | if (difHora.absoluteValue > 130) existeDiferencias = true |
401 | 445 | ||
402 | if (existeDiferencias) { | 446 | if (existeDiferencias) { |
403 | dialogoHoraServer((activity as MainActivity), requireContext(), obtenerFechaActual(), timeServer) | 447 | dialogoHoraServer((activity as MainActivity), requireContext(), obtenerFechaActual(), timeServer) |
404 | } | 448 | } |
405 | 449 | ||
406 | return existeDiferencias | 450 | return existeDiferencias |
407 | } | 451 | } |
408 | 452 | ||
409 | //private fun dialogoHoraServerLocal(reqActivity: FragmentActivity, context: Context, fechaHoraDispositivo: String, fechaHoraServer: String) { | 453 | //private fun dialogoHoraServerLocal(reqActivity: FragmentActivity, context: Context, fechaHoraDispositivo: String, fechaHoraServer: String) { |
410 | // val mDialogView: View = LayoutInflater.from(context).inflate(R.layout.solicitar_fecha, null) | 454 | // val mDialogView: View = LayoutInflater.from(context).inflate(R.layout.solicitar_fecha, null) |
411 | // val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(false) | 455 | // val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(false) |
412 | // | 456 | // |
413 | // mDialogView.tvHoraDispositivo.text = fechaHoraDispositivo | 457 | // mDialogView.tvHoraDispositivo.text = fechaHoraDispositivo |
414 | // mDialogView.tvHoraServidor.text = fechaHoraServer | 458 | // mDialogView.tvHoraServidor.text = fechaHoraServer |
415 | // val mAlertDialog = mBuilder.show() | 459 | // val mAlertDialog = mBuilder.show() |
416 | // val imm = reqActivity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager? | 460 | // val imm = reqActivity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager? |
417 | // imm!!.hideSoftInputFromWindow(reqActivity.currentFocus?.windowToken, InputMethodManager.HIDE_IMPLICIT_ONLY ) | 461 | // imm!!.hideSoftInputFromWindow(reqActivity.currentFocus?.windowToken, InputMethodManager.HIDE_IMPLICIT_ONLY ) |
418 | // | 462 | // |
419 | //// mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 463 | //// mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
420 | //// mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 464 | //// mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
421 | // | 465 | // |
422 | // | 466 | // |
423 | // mDialogView.btnCambiarHora.setOnClickListener { | 467 | // mDialogView.btnCambiarHora.setOnClickListener { |
424 | // context.startActivity(Intent(Settings.ACTION_DATE_SETTINGS)) | 468 | // context.startActivity(Intent(Settings.ACTION_DATE_SETTINGS)) |
425 | // mAlertDialog.dismiss() | 469 | // mAlertDialog.dismiss() |
426 | // } | 470 | // } |
427 | // | 471 | // |
428 | // mDialogView.btnSalir.setOnClickListener { | 472 | // mDialogView.btnSalir.setOnClickListener { |
429 | // mAlertDialog.dismiss() | 473 | // mAlertDialog.dismiss() |
430 | // } | 474 | // } |
431 | //} | 475 | //} |
432 | } | 476 | } |
433 | 477 | ||
434 | 478 |
app/src/main/res/layout-land/fragment_configuracion.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 | 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 | tools:context=".UI.configuracion.ConfiguracionFragment"> | 7 | tools:context=".UI.configuracion.ConfiguracionFragment"> |
8 | 8 | ||
9 | <androidx.constraintlayout.widget.ConstraintLayout | 9 | <androidx.constraintlayout.widget.ConstraintLayout |
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 | 12 | ||
13 | <androidx.appcompat.widget.AppCompatTextView | 13 | <androidx.appcompat.widget.AppCompatTextView |
14 | android:id="@+id/textView2" | 14 | android:id="@+id/textView2" |
15 | android:layout_width="match_parent" | 15 | android:layout_width="match_parent" |
16 | android:layout_height="wrap_content" | 16 | android:layout_height="wrap_content" |
17 | android:layout_marginTop="@dimen/MarginTopTitulos" | 17 | android:layout_marginTop="@dimen/MarginTopTitulos" |
18 | android:gravity="center" | 18 | android:gravity="center" |
19 | android:lines="1" | 19 | android:lines="1" |
20 | android:text="@string/tvTituloConf" | 20 | android:text="@string/tvTituloConf" |
21 | android:textColor="@color/colorAccent" | 21 | android:textColor="@color/colorAccent" |
22 | android:textSize="@dimen/Titulos" | 22 | android:textSize="@dimen/Titulos" |
23 | app:fontFamily="sans-serif-condensed" | 23 | app:fontFamily="sans-serif-condensed" |
24 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | 24 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" |
25 | app:layout_constraintEnd_toEndOf="parent" | 25 | app:layout_constraintEnd_toEndOf="parent" |
26 | app:layout_constraintStart_toStartOf="parent" | 26 | app:layout_constraintStart_toStartOf="parent" |
27 | app:layout_constraintTop_toTopOf="parent" /> | 27 | app:layout_constraintTop_toTopOf="parent" /> |
28 | 28 | ||
29 | <TextView | 29 | <TextView |
30 | android:id="@+id/tvSeleccioneServidor" | 30 | android:id="@+id/tvSeleccioneServidor" |
31 | android:layout_width="0dp" | 31 | android:layout_width="0dp" |
32 | android:layout_height="wrap_content" | 32 | android:layout_height="wrap_content" |
33 | 33 | ||
34 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 34 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
35 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 35 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
36 | android:gravity="start" | 36 | android:gravity="start" |
37 | android:lines="1" | 37 | android:lines="1" |
38 | android:text="@string/tvSeleccioneServidor" | 38 | android:text="@string/tvSeleccioneServidor" |
39 | android:textColor="@android:color/black" | 39 | android:textColor="@android:color/black" |
40 | android:textSize="@dimen/SubTitulos" | 40 | android:textSize="@dimen/SubTitulos" |
41 | app:fontFamily="sans-serif-condensed" | 41 | app:fontFamily="sans-serif-condensed" |
42 | app:layout_constraintBottom_toTopOf="@+id/spServidor" | 42 | app:layout_constraintBottom_toTopOf="@+id/spServidor" |
43 | app:layout_constraintEnd_toEndOf="parent" | 43 | app:layout_constraintEnd_toEndOf="parent" |
44 | app:layout_constraintStart_toStartOf="parent" | 44 | app:layout_constraintStart_toStartOf="parent" |
45 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | 45 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> |
46 | 46 | ||
47 | <Spinner | 47 | <Spinner |
48 | android:id="@+id/spServidor" | 48 | android:id="@+id/spServidor" |
49 | android:layout_width="0dp" | 49 | android:layout_width="0dp" |
50 | android:layout_height="wrap_content" | 50 | android:layout_height="wrap_content" |
51 | android:backgroundTint="@color/LightGray" | 51 | android:backgroundTint="@color/LightGray" |
52 | android:elevation="5dp" | 52 | android:elevation="5dp" |
53 | android:fadeScrollbars="true" | 53 | android:fadeScrollbars="true" |
54 | android:foregroundTint="@android:color/holo_orange_dark" | 54 | android:foregroundTint="@android:color/holo_orange_dark" |
55 | android:prompt="@string/leyendaSpinner" | 55 | android:prompt="@string/leyendaSpinner" |
56 | android:soundEffectsEnabled="true" | 56 | android:soundEffectsEnabled="true" |
57 | android:spinnerMode="dialog" | 57 | android:spinnerMode="dialog" |
58 | android:splitMotionEvents="false" | 58 | android:splitMotionEvents="false" |
59 | android:textAlignment="center" | 59 | android:textAlignment="center" |
60 | android:textSize="@dimen/NormalText" | 60 | android:textSize="@dimen/NormalText" |
61 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | 61 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" |
62 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" | 62 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" |
63 | app:layout_constraintHorizontal_chainStyle="packed" | 63 | app:layout_constraintHorizontal_chainStyle="packed" |
64 | app:layout_constraintStart_toStartOf="parent" | 64 | app:layout_constraintStart_toStartOf="parent" |
65 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> | 65 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> |
66 | 66 | ||
67 | <Button | 67 | <Button |
68 | android:id="@+id/btnValidarServidor" | 68 | android:id="@+id/btnValidarServidor" |
69 | android:layout_width="wrap_content" | 69 | android:layout_width="wrap_content" |
70 | android:layout_height="wrap_content" | 70 | android:layout_height="wrap_content" |
71 | android:background="@drawable/boton_borde_redondeado" | 71 | android:background="@drawable/boton_borde_redondeado" |
72 | android:padding="10dp" | 72 | android:padding="10dp" |
73 | android:text="@string/btnValidarServidor" | 73 | android:text="@string/btnValidarServidor" |
74 | android:textColor="@android:color/white" | 74 | android:textColor="@android:color/white" |
75 | android:textSize="@dimen/NormalText" | 75 | android:textSize="@dimen/NormalText" |
76 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | 76 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" |
77 | app:layout_constraintEnd_toEndOf="parent" | 77 | app:layout_constraintEnd_toEndOf="parent" |
78 | app:layout_constraintHorizontal_chainStyle="packed" | 78 | app:layout_constraintHorizontal_chainStyle="packed" |
79 | app:layout_constraintStart_toEndOf="@id/spServidor" | 79 | app:layout_constraintStart_toEndOf="@id/spServidor" |
80 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> | 80 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> |
81 | 81 | ||
82 | <Button | 82 | <Button |
83 | android:id="@+id/btnAgregarServidor" | 83 | android:id="@+id/btnAgregarServidor" |
84 | android:layout_width="0dp" | 84 | android:layout_width="0dp" |
85 | android:layout_height="wrap_content" | 85 | android:layout_height="wrap_content" |
86 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 86 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
87 | android:layout_marginEnd="@dimen/MarginBotAgreSer" | 87 | android:layout_marginEnd="@dimen/MarginBotAgreSer" |
88 | android:background="@drawable/boton_borde_redondeado" | 88 | android:background="@drawable/boton_borde_redondeado" |
89 | android:padding="10dp" | 89 | android:padding="10dp" |
90 | android:text="@string/btnAgregarServidor" | 90 | android:text="@string/btnAgregarServidor" |
91 | android:textColor="@android:color/white" | 91 | android:textColor="@android:color/white" |
92 | android:textSize="@dimen/NormalText" | 92 | android:textSize="@dimen/NormalText" |
93 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" | 93 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" |
94 | app:layout_constraintEnd_toEndOf="parent" | 94 | app:layout_constraintEnd_toEndOf="parent" |
95 | app:layout_constraintStart_toStartOf="parent" | 95 | app:layout_constraintStart_toStartOf="parent" |
96 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> | 96 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> |
97 | 97 | ||
98 | 98 | ||
99 | <TextView | 99 | <TextView |
100 | android:id="@+id/tvUbicacionCarpetas" | 100 | android:id="@+id/tvUbicacionCarpetas" |
101 | android:layout_width="0dp" | 101 | android:layout_width="0dp" |
102 | android:layout_height="wrap_content" | 102 | android:layout_height="wrap_content" |
103 | android:visibility="gone" | 103 | android:visibility="gone" |
104 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 104 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
105 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 105 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
106 | android:gravity="start" | 106 | android:gravity="start" |
107 | android:lines="1" | 107 | android:lines="1" |
108 | android:text="@string/tvUbicacionCarpetas" | 108 | android:text="@string/tvUbicacionCarpetas" |
109 | android:textColor="@android:color/black" | 109 | android:textColor="@android:color/black" |
110 | android:textSize="@dimen/SubTitulos" | 110 | android:textSize="@dimen/SubTitulos" |
111 | app:fontFamily="sans-serif-condensed" | 111 | app:fontFamily="sans-serif-condensed" |
112 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" | 112 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" |
113 | app:layout_constraintEnd_toEndOf="parent" | 113 | app:layout_constraintEnd_toEndOf="parent" |
114 | app:layout_constraintStart_toStartOf="parent" | 114 | app:layout_constraintStart_toStartOf="parent" |
115 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> | 115 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> |
116 | 116 | ||
117 | <ImageButton | 117 | <ImageButton |
118 | android:id="@+id/ibSearch" | 118 | android:id="@+id/ibSearch" |
119 | android:layout_width="36dp" | 119 | android:layout_width="36dp" |
120 | android:layout_height="37dp" | 120 | android:layout_height="37dp" |
121 | android:layout_margin="10dp" | 121 | android:layout_margin="10dp" |
122 | android:background="@drawable/boton_borde_redondeado" | 122 | android:background="@drawable/boton_borde_redondeado" |
123 | android:padding="10dp" | 123 | android:padding="10dp" |
124 | android:visibility="gone" | 124 | android:visibility="gone" |
125 | android:src="@drawable/search" | 125 | android:src="@drawable/search" |
126 | android:textColor="@android:color/white" | 126 | android:textColor="@android:color/white" |
127 | app:layout_constraintEnd_toStartOf="@+id/etRuta" | 127 | app:layout_constraintEnd_toStartOf="@+id/etRuta" |
128 | app:layout_constraintStart_toStartOf="parent" | 128 | app:layout_constraintStart_toStartOf="parent" |
129 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | 129 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> |
130 | 130 | ||
131 | <EditText | 131 | <EditText |
132 | android:id="@+id/etRuta" | 132 | android:id="@+id/etRuta" |
133 | android:layout_width="0dp" | 133 | android:layout_width="0dp" |
134 | android:layout_height="wrap_content" | 134 | android:layout_height="wrap_content" |
135 | android:layout_marginTop="10dp" | 135 | android:layout_marginTop="10dp" |
136 | android:layout_marginEnd="10dp" | 136 | android:layout_marginEnd="10dp" |
137 | android:clickable="true" | 137 | android:clickable="true" |
138 | android:ems="10" | 138 | android:ems="10" |
139 | android:focusable="true" | 139 | android:focusable="true" |
140 | android:inputType="textPersonName" | 140 | android:inputType="textPersonName" |
141 | android:lines="1" | 141 | android:lines="1" |
142 | android:text="" | 142 | android:text="" |
143 | android:visibility="gone" | 143 | android:visibility="gone" |
144 | android:textSize="@dimen/NormalText" | 144 | android:textSize="@dimen/NormalText" |
145 | app:layout_constraintEnd_toEndOf="parent" | 145 | app:layout_constraintEnd_toEndOf="parent" |
146 | app:layout_constraintStart_toEndOf="@id/ibSearch" | 146 | app:layout_constraintStart_toEndOf="@id/ibSearch" |
147 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | 147 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> |
148 | 148 | ||
149 | <TextView | 149 | <TextView |
150 | android:id="@+id/tvActuFecha" | 150 | android:id="@+id/tvActuFecha" |
151 | android:layout_width="0dp" | 151 | android:layout_width="0dp" |
152 | android:layout_height="wrap_content" | 152 | android:layout_height="wrap_content" |
153 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 153 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
154 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 154 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
155 | android:gravity="start" | 155 | android:gravity="start" |
156 | android:lines="1" | 156 | android:lines="1" |
157 | android:text="@string/tvTituloArea" | 157 | android:text="@string/tvTituloArea" |
158 | android:textColor="@android:color/black" | 158 | android:textColor="@android:color/black" |
159 | android:textSize="@dimen/SubTitulos" | 159 | android:textSize="@dimen/SubTitulos" |
160 | app:fontFamily="sans-serif-condensed" | 160 | app:fontFamily="sans-serif-condensed" |
161 | app:layout_constraintEnd_toEndOf="parent" | 161 | app:layout_constraintEnd_toEndOf="parent" |
162 | app:layout_constraintStart_toStartOf="parent" | 162 | app:layout_constraintStart_toStartOf="parent" |
163 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> | 163 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> |
164 | 164 | ||
165 | <RadioGroup | 165 | <RadioGroup |
166 | android:id="@+id/rgFechaHora" | 166 | android:id="@+id/rgFechaHora" |
167 | android:layout_width="0dp" | 167 | android:layout_width="0dp" |
168 | android:layout_height="wrap_content" | 168 | android:layout_height="wrap_content" |
169 | 169 | ||
170 | android:gravity="center" | 170 | android:gravity="center" |
171 | android:orientation="horizontal" | 171 | android:orientation="horizontal" |
172 | app:layout_constraintEnd_toEndOf="parent" | 172 | app:layout_constraintEnd_toEndOf="parent" |
173 | app:layout_constraintStart_toStartOf="parent" | 173 | app:layout_constraintStart_toStartOf="parent" |
174 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> | 174 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> |
175 | 175 | ||
176 | <RadioButton | 176 | <RadioButton |
177 | android:id="@+id/rbVentas" | 177 | android:id="@+id/rbVentas" |
178 | android:layout_width="wrap_content" | 178 | android:layout_width="wrap_content" |
179 | android:layout_height="wrap_content" | 179 | android:layout_height="wrap_content" |
180 | android:layout_margin="5dp" | 180 | android:layout_margin="5dp" |
181 | android:checked="true" | 181 | android:checked="true" |
182 | android:padding="5dp" | 182 | android:padding="5dp" |
183 | android:text="@string/rbVentas" | 183 | android:text="@string/rbVentas" |
184 | android:textSize="@dimen/NormalText" /> | 184 | android:textSize="@dimen/NormalText" /> |
185 | 185 | ||
186 | <RadioButton | 186 | <RadioButton |
187 | android:id="@+id/rbDeposito" | 187 | android:id="@+id/rbDeposito" |
188 | android:layout_width="wrap_content" | 188 | android:layout_width="wrap_content" |
189 | android:layout_height="wrap_content" | 189 | android:layout_height="wrap_content" |
190 | android:layout_margin="5dp" | 190 | android:layout_margin="5dp" |
191 | android:checked="false" | 191 | android:checked="false" |
192 | android:padding="5dp" | 192 | android:padding="5dp" |
193 | android:text="@string/rbDeposito" | 193 | android:text="@string/rbDeposito" |
194 | android:textSize="@dimen/NormalText" /> | 194 | android:textSize="@dimen/NormalText" /> |
195 | 195 | ||
196 | </RadioGroup> | 196 | </RadioGroup> |
197 | 197 | ||
198 | <TextView | 198 | <TextView |
199 | android:id="@+id/tvLosProductos" | 199 | android:id="@+id/tvLosProductos" |
200 | android:layout_width="0dp" | 200 | android:layout_width="0dp" |
201 | android:layout_height="wrap_content" | 201 | android:layout_height="wrap_content" |
202 | 202 | ||
203 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 203 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
204 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | 204 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" |
205 | android:gravity="start" | 205 | android:gravity="start" |
206 | android:lines="1" | 206 | android:lines="1" |
207 | android:text="@string/tvLosProductos" | 207 | android:text="@string/tvLosProductos" |
208 | android:textColor="@android:color/black" | 208 | android:textColor="@android:color/black" |
209 | android:textSize="@dimen/SubTitulos" | 209 | android:textSize="@dimen/SubTitulos" |
210 | app:fontFamily="sans-serif-condensed" | 210 | app:fontFamily="sans-serif-condensed" |
211 | app:layout_constraintEnd_toEndOf="parent" | 211 | app:layout_constraintEnd_toEndOf="parent" |
212 | app:layout_constraintStart_toStartOf="parent" | 212 | app:layout_constraintStart_toStartOf="parent" |
213 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | 213 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> |
214 | 214 | ||
215 | <RadioGroup | 215 | <RadioGroup |
216 | android:id="@+id/rgLosProductos" | 216 | android:id="@+id/rgLosProductos" |
217 | android:layout_width="0dp" | 217 | android:layout_width="0dp" |
218 | android:layout_height="wrap_content" | 218 | android:layout_height="wrap_content" |
219 | 219 | ||
220 | android:gravity="center" | 220 | android:gravity="center" |
221 | android:orientation="vertical" | 221 | android:orientation="vertical" |
222 | app:layout_constraintEnd_toEndOf="parent" | 222 | app:layout_constraintEnd_toEndOf="parent" |
223 | app:layout_constraintStart_toStartOf="parent" | 223 | app:layout_constraintStart_toStartOf="parent" |
224 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> | 224 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> |
225 | 225 | ||
226 | <RadioButton | 226 | <RadioButton |
227 | android:id="@+id/rbProInclu" | 227 | android:id="@+id/rbProInclu" |
228 | android:layout_width="match_parent" | 228 | android:layout_width="match_parent" |
229 | android:layout_height="wrap_content" | 229 | android:layout_height="wrap_content" |
230 | 230 | ||
231 | android:layout_margin="@dimen/PadingCbyRb" | 231 | android:layout_margin="@dimen/PadingCbyRb" |
232 | android:checked="true" | 232 | android:checked="true" |
233 | android:padding="@dimen/PadingCbyRb" | 233 | android:padding="@dimen/PadingCbyRb" |
234 | android:text="@string/rbProInclu" | 234 | android:text="@string/rbProInclu" |
235 | android:textSize="@dimen/NormalText" /> | 235 | android:textSize="@dimen/NormalText" /> |
236 | 236 | ||
237 | <RadioButton | 237 | <RadioButton |
238 | android:id="@+id/rbProNoInclu" | 238 | android:id="@+id/rbProNoInclu" |
239 | android:layout_width="match_parent" | 239 | android:layout_width="match_parent" |
240 | android:layout_height="wrap_content" | 240 | android:layout_height="wrap_content" |
241 | android:layout_margin="@dimen/PadingCbyRb" | 241 | android:layout_margin="@dimen/PadingCbyRb" |
242 | android:checked="false" | 242 | android:checked="false" |
243 | android:padding="@dimen/PadingCbyRb" | 243 | android:padding="@dimen/PadingCbyRb" |
244 | android:text="@string/rbProNoInclu" | 244 | android:text="@string/rbProNoInclu" |
245 | android:textSize="@dimen/NormalText" /> | 245 | android:textSize="@dimen/NormalText" /> |
246 | 246 | ||
247 | </RadioGroup> | 247 | </RadioGroup> |
248 | 248 | ||
249 | <CheckBox | 249 | <CheckBox |
250 | android:id="@+id/cbHabiLectura" | 250 | android:id="@+id/cbHabiLectura" |
251 | android:layout_width="0dp" | 251 | android:layout_width="0dp" |
252 | android:layout_height="wrap_content" | 252 | android:layout_height="wrap_content" |
253 | android:layout_margin="@dimen/PadingCbyRb" | 253 | android:layout_margin="@dimen/PadingCbyRb" |
254 | android:padding="@dimen/PadingCbyRb" | 254 | android:padding="@dimen/PadingCbyRb" |
255 | android:text="@string/cbHabiLectura" | 255 | android:text="@string/cbHabiLectura" |
256 | android:textSize="@dimen/NormalText" | 256 | android:textSize="@dimen/NormalText" |
257 | app:layout_constraintEnd_toEndOf="parent" | 257 | app:layout_constraintEnd_toEndOf="parent" |
258 | app:layout_constraintStart_toStartOf="parent" | 258 | app:layout_constraintStart_toStartOf="parent" |
259 | app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" /> | 259 | app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" /> |
260 | 260 | ||
261 | <CheckBox | 261 | <CheckBox |
262 | android:id="@+id/cbMostrarStock" | 262 | android:id="@+id/cbMostrarStock" |
263 | android:layout_width="0dp" | 263 | android:layout_width="0dp" |
264 | android:layout_height="wrap_content" | 264 | android:layout_height="wrap_content" |
265 | android:layout_margin="@dimen/PadingCbyRb" | 265 | android:layout_margin="@dimen/PadingCbyRb" |
266 | android:padding="@dimen/PadingCbyRb" | 266 | android:padding="@dimen/PadingCbyRb" |
267 | android:text="@string/cbMostrarStock" | 267 | android:text="@string/cbMostrarStock" |
268 | android:textSize="@dimen/NormalText" | 268 | android:textSize="@dimen/NormalText" |
269 | app:layout_constraintEnd_toEndOf="parent" | 269 | app:layout_constraintEnd_toEndOf="parent" |
270 | app:layout_constraintStart_toStartOf="parent" | 270 | app:layout_constraintStart_toStartOf="parent" |
271 | app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" /> | 271 | app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" /> |
272 | 272 | ||
273 | <TextView | 273 | <TextView |
274 | android:id="@+id/tvColumMostrar" | 274 | android:id="@+id/tvColumMostrar" |
275 | android:layout_width="0dp" | 275 | android:layout_width="0dp" |
276 | android:layout_height="wrap_content" | 276 | android:layout_height="wrap_content" |
277 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 277 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
278 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | 278 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" |
279 | android:gravity="start" | 279 | android:gravity="start" |
280 | android:lines="1" | 280 | android:lines="1" |
281 | android:text="@string/tvColumMostrar" | 281 | android:text="@string/tvColumMostrar" |
282 | android:textColor="@android:color/black" | 282 | android:textColor="@android:color/black" |
283 | android:textSize="@dimen/SubTitulos" | 283 | android:textSize="@dimen/SubTitulos" |
284 | android:visibility="gone" | 284 | android:visibility="gone" |
285 | app:fontFamily="sans-serif-condensed" | 285 | app:fontFamily="sans-serif-condensed" |
286 | app:layout_constraintEnd_toEndOf="parent" | 286 | app:layout_constraintEnd_toEndOf="parent" |
287 | app:layout_constraintStart_toStartOf="parent" | 287 | app:layout_constraintStart_toStartOf="parent" |
288 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> | 288 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> |
289 | 289 | ||
290 | <RadioGroup | 290 | <RadioGroup |
291 | android:id="@+id/rgCodigosMostrar" | 291 | android:id="@+id/rgCodigosMostrar" |
292 | android:layout_width="0dp" | 292 | android:layout_width="0dp" |
293 | android:layout_height="wrap_content" | 293 | android:layout_height="wrap_content" |
294 | android:gravity="center" | 294 | android:gravity="center" |
295 | android:orientation="horizontal" | 295 | android:orientation="horizontal" |
296 | android:visibility="gone" | 296 | android:visibility="gone" |
297 | app:layout_constraintEnd_toEndOf="parent" | 297 | app:layout_constraintEnd_toEndOf="parent" |
298 | app:layout_constraintStart_toStartOf="parent" | 298 | app:layout_constraintStart_toStartOf="parent" |
299 | app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar"> | 299 | app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar"> |
300 | 300 | ||
301 | <RadioButton | 301 | <RadioButton |
302 | android:id="@+id/rbCodigoDebo" | 302 | android:id="@+id/rbCodigoDebo" |
303 | android:layout_width="wrap_content" | 303 | android:layout_width="wrap_content" |
304 | android:layout_height="wrap_content" | 304 | android:layout_height="wrap_content" |
305 | android:layout_margin="5dp" | 305 | android:layout_margin="5dp" |
306 | android:checked="true" | 306 | android:checked="true" |
307 | android:padding="5dp" | 307 | android:padding="5dp" |
308 | android:text="@string/rbCodigoDebo" | 308 | android:text="@string/rbCodigoDebo" |
309 | android:textSize="@dimen/NormalText" /> | 309 | android:textSize="@dimen/NormalText" /> |
310 | 310 | ||
311 | <RadioButton | 311 | <RadioButton |
312 | android:id="@+id/rbCodigoOrigen" | 312 | android:id="@+id/rbCodigoOrigen" |
313 | android:layout_width="wrap_content" | 313 | android:layout_width="wrap_content" |
314 | android:layout_height="wrap_content" | 314 | android:layout_height="wrap_content" |
315 | android:layout_margin="5dp" | 315 | android:layout_margin="5dp" |
316 | android:checked="false" | 316 | android:checked="false" |
317 | android:padding="5dp" | 317 | android:padding="5dp" |
318 | android:text="@string/rbCodigoOrigen" | 318 | android:text="@string/rbCodigoOrigen" |
319 | android:textSize="@dimen/NormalText" /> | 319 | android:textSize="@dimen/NormalText" /> |
320 | 320 | ||
321 | <RadioButton | 321 | <RadioButton |
322 | android:id="@+id/rbCodigoBarras" | 322 | android:id="@+id/rbCodigoBarras" |
323 | android:layout_width="wrap_content" | 323 | android:layout_width="wrap_content" |
324 | android:layout_height="wrap_content" | 324 | android:layout_height="wrap_content" |
325 | android:layout_margin="5dp" | 325 | android:layout_margin="5dp" |
326 | android:padding="5dp" | 326 | android:padding="5dp" |
327 | android:text="@string/rbCodigoBarras" | 327 | android:text="@string/rbCodigoBarras" |
328 | android:textSize="@dimen/NormalText" /> | 328 | android:textSize="@dimen/NormalText" /> |
329 | </RadioGroup> | 329 | </RadioGroup> |
330 | 330 | ||
331 | <Button | 331 | <Button |
332 | android:id="@+id/btnAskTimeServer" | 332 | android:id="@+id/btnAskTimeServer" |
333 | android:layout_width="wrap_content" | 333 | android:layout_width="wrap_content" |
334 | android:layout_height="wrap_content" | 334 | android:layout_height="wrap_content" |
335 | android:layout_margin="@dimen/PadingCbyRb" | 335 | android:layout_margin="@dimen/PadingCbyRb" |
336 | android:background="@drawable/boton_borde_redondeado" | 336 | android:background="@drawable/boton_borde_redondeado" |
337 | android:checked="false" | 337 | android:checked="false" |
338 | android:padding="10dp" | 338 | android:padding="10dp" |
339 | android:text="@string/btnAskTimeServer" | 339 | android:text="@string/btnAskTimeServer" |
340 | android:textColor="@android:color/white" | 340 | android:textColor="@android:color/white" |
341 | android:textSize="@dimen/NormalText" | 341 | android:textSize="@dimen/NormalText" |
342 | android:visibility="gone" | 342 | android:visibility="gone" |
343 | app:layout_constraintStart_toStartOf="parent" | 343 | app:layout_constraintStart_toStartOf="parent" |
344 | app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" /> | 344 | app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" /> |
345 | 345 | ||
346 | <CheckBox | 346 | <CheckBox |
347 | android:id="@+id/cbAskTimeServerToStart" | 347 | android:id="@+id/cbAskTimeServerToStart" |
348 | android:layout_width="wrap_content" | 348 | android:layout_width="wrap_content" |
349 | android:layout_height="wrap_content" | 349 | android:layout_height="wrap_content" |
350 | android:layout_margin="@dimen/PadingCbyRb" | 350 | android:layout_margin="@dimen/PadingCbyRb" |
351 | android:checked="false" | 351 | android:checked="true" |
352 | android:padding="@dimen/PadingCbyRb" | 352 | android:padding="@dimen/PadingCbyRb" |
353 | android:text="@string/cbAskTimeServerToStart" | 353 | android:text="@string/cbAskTimeServerToStart" |
354 | android:textSize="@dimen/NormalText" | 354 | android:textSize="@dimen/NormalText" |
355 | android:visibility="visible" | 355 | android:visibility="invisible" |
356 | app:layout_constraintStart_toStartOf="parent" | 356 | app:layout_constraintStart_toStartOf="parent" |
357 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> | 357 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> |
358 | 358 | ||
359 | <Button | 359 | <Button |
360 | android:id="@+id/btnGuardar" | 360 | android:id="@+id/btnGuardar" |
361 | android:layout_width="wrap_content" | 361 | android:layout_width="wrap_content" |
362 | android:layout_height="wrap_content" | 362 | android:layout_height="wrap_content" |
363 | android:background="@drawable/boton_borde_redondeado" | 363 | android:background="@drawable/boton_borde_redondeado" |
364 | android:padding="10dp" | 364 | android:padding="10dp" |
365 | android:text="@string/btnGuardar" | 365 | android:text="@string/btnGuardar" |
366 | android:textColor="@android:color/white" | 366 | android:textColor="@android:color/white" |
367 | android:textSize="@dimen/NormalText" | 367 | android:textSize="@dimen/NormalText" |
368 | app:layout_constraintBottom_toBottomOf="parent" | 368 | app:layout_constraintBottom_toBottomOf="parent" |
369 | app:layout_constraintEnd_toEndOf="parent" | 369 | app:layout_constraintEnd_toEndOf="parent" |
370 | app:layout_constraintStart_toStartOf="parent" | 370 | app:layout_constraintStart_toStartOf="parent" |
371 | app:layout_constraintTop_toBottomOf="@+id/cbAskTimeServerToStart" /> | 371 | app:layout_constraintTop_toBottomOf="@+id/cbAskTimeServerToStart" /> |
372 | 372 | ||
373 | </androidx.constraintlayout.widget.ConstraintLayout> | 373 | </androidx.constraintlayout.widget.ConstraintLayout> |
374 | 374 | ||
375 | </ScrollView> | 375 | </ScrollView> |
app/src/main/res/layout-large-v26/fragment_main.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: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.appcompat.widget.AppCompatTextView | 8 | <androidx.appcompat.widget.AppCompatTextView |
9 | android:id="@+id/tvInvDinamicos" | 9 | android:id="@+id/tvInvDinamicos" |
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
11 | android:layout_height="110dp" | 11 | android:layout_height="110dp" |
12 | android:autoSizeMaxTextSize="150sp" | 12 | android:autoSizeMaxTextSize="150sp" |
13 | android:autoSizeMinTextSize="25sp" | 13 | android:autoSizeMinTextSize="25sp" |
14 | android:autoSizeStepGranularity="5sp" | 14 | android:autoSizeStepGranularity="5sp" |
15 | android:autoSizeTextType="uniform" | 15 | android:autoSizeTextType="uniform" |
16 | android:gravity="start" | 16 | android:gravity="start" |
17 | android:lines="1" | 17 | android:lines="1" |
18 | android:padding="10dp" | 18 | android:padding="10dp" |
19 | android:text="@string/invDinamicoVenta" | 19 | android:text="@string/invDinamicoVenta" |
20 | android:textColor="@color/colorAccent" | 20 | android:textColor="@color/colorAccent" |
21 | android:visibility="visible" | 21 | android:visibility="visible" |
22 | app:fontFamily="sans-serif-condensed" | 22 | app:fontFamily="sans-serif-condensed" |
23 | app:layout_constraintEnd_toEndOf="parent" | 23 | app:layout_constraintEnd_toEndOf="parent" |
24 | app:layout_constraintStart_toStartOf="parent" | 24 | app:layout_constraintStart_toStartOf="parent" |
25 | app:layout_constraintTop_toTopOf="parent" /> | 25 | app:layout_constraintTop_toTopOf="parent" /> |
26 | 26 | ||
27 | <androidx.appcompat.widget.AppCompatImageButton | 27 | <androidx.appcompat.widget.AppCompatImageButton |
28 | android:id="@+id/ivSort19" | 28 | android:id="@+id/ivSort19" |
29 | android:layout_width="@dimen/icon_dim10" | 29 | android:layout_width="@dimen/icon_dim10" |
30 | android:layout_height="@dimen/icon_dim10" | 30 | android:layout_height="@dimen/icon_dim10" |
31 | android:layout_marginStart="10dp" | 31 | android:layout_marginStart="10dp" |
32 | android:padding="5dp" | 32 | android:padding="5dp" |
33 | android:src="@drawable/ic_sort19" | 33 | android:src="@drawable/ic_sort19" |
34 | android:visibility="gone" | 34 | android:visibility="gone" |
35 | app:layout_constraintHorizontal_bias="0.0" | 35 | app:layout_constraintHorizontal_bias="0.0" |
36 | app:layout_constraintHorizontal_chainStyle="packed" | 36 | app:layout_constraintHorizontal_chainStyle="packed" |
37 | app:layout_constraintStart_toStartOf="parent" | 37 | app:layout_constraintStart_toStartOf="parent" |
38 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 38 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
39 | 39 | ||
40 | <androidx.appcompat.widget.AppCompatImageButton | 40 | <androidx.appcompat.widget.AppCompatImageButton |
41 | android:id="@+id/ivSort91" | 41 | android:id="@+id/ivSort91" |
42 | android:layout_width="@dimen/icon_dim10" | 42 | android:layout_width="@dimen/icon_dim10" |
43 | android:layout_height="@dimen/icon_dim10" | 43 | android:layout_height="@dimen/icon_dim10" |
44 | android:layout_marginStart="10dp" | 44 | android:layout_marginStart="10dp" |
45 | android:padding="5dp" | 45 | android:padding="5dp" |
46 | android:src="@drawable/ic_sort91" | 46 | android:src="@drawable/ic_sort91" |
47 | android:visibility="gone" | 47 | android:visibility="gone" |
48 | app:layout_constraintHorizontal_chainStyle="packed" | 48 | app:layout_constraintHorizontal_chainStyle="packed" |
49 | app:layout_constraintStart_toStartOf="parent" | 49 | app:layout_constraintStart_toStartOf="parent" |
50 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 50 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
51 | 51 | ||
52 | <TextView | 52 | <TextView |
53 | android:id="@+id/tvTipo" | 53 | android:id="@+id/tvTipo" |
54 | android:layout_width="wrap_content" | 54 | android:layout_width="wrap_content" |
55 | android:layout_height="wrap_content" | 55 | android:layout_height="wrap_content" |
56 | android:layout_margin="5dp" | 56 | android:layout_margin="5dp" |
57 | android:layout_marginTop="12dp" | 57 | android:layout_marginTop="12dp" |
58 | android:text="Tipo:" | 58 | android:text="Tipo:" |
59 | android:textSize="@dimen/md_message_textsize" | 59 | android:textSize="@dimen/md_message_textsize" |
60 | android:visibility="gone" | 60 | android:visibility="gone" |
61 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" | 61 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" |
62 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> | 62 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> |
63 | 63 | ||
64 | <com.google.android.material.checkbox.MaterialCheckBox | 64 | <com.google.android.material.checkbox.MaterialCheckBox |
65 | android:id="@+id/cbVentas" | 65 | android:id="@+id/cbVentas" |
66 | android:layout_width="wrap_content" | 66 | android:layout_width="wrap_content" |
67 | android:layout_height="wrap_content" | 67 | android:layout_height="wrap_content" |
68 | android:layout_margin="5dp" | 68 | android:layout_margin="5dp" |
69 | android:layout_marginTop="12dp" | 69 | android:layout_marginTop="12dp" |
70 | android:checked="true" | 70 | android:checked="true" |
71 | android:text="Ventas" | 71 | android:text="Ventas" |
72 | android:textSize="@dimen/SubTitulos10" | 72 | android:textSize="@dimen/SubTitulos10" |
73 | android:visibility="gone" | 73 | android:visibility="gone" |
74 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" | 74 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" |
75 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 75 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
76 | 76 | ||
77 | <com.google.android.material.checkbox.MaterialCheckBox | 77 | <com.google.android.material.checkbox.MaterialCheckBox |
78 | android:id="@+id/cbDeposito" | 78 | android:id="@+id/cbDeposito" |
79 | android:layout_width="wrap_content" | 79 | android:layout_width="wrap_content" |
80 | android:layout_height="wrap_content" | 80 | android:layout_height="wrap_content" |
81 | android:layout_margin="5dp" | 81 | android:layout_margin="5dp" |
82 | android:layout_marginTop="12dp" | 82 | android:layout_marginTop="12dp" |
83 | android:checked="true" | 83 | android:checked="true" |
84 | android:text="Deposito" | 84 | android:text="Deposito" |
85 | android:textSize="@dimen/SubTitulos10" | 85 | android:textSize="@dimen/SubTitulos10" |
86 | android:visibility="gone" | 86 | android:visibility="gone" |
87 | app:layout_constraintEnd_toEndOf="parent" | 87 | app:layout_constraintEnd_toEndOf="parent" |
88 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 88 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
89 | 89 | ||
90 | <androidx.recyclerview.widget.RecyclerView | 90 | <androidx.recyclerview.widget.RecyclerView |
91 | android:id="@+id/rcInventario" | 91 | android:id="@+id/rcInventario" |
92 | android:layout_width="match_parent" | 92 | android:layout_width="match_parent" |
93 | android:layout_height="0dp" | 93 | android:layout_height="0dp" |
94 | android:background="@android:color/darker_gray" | 94 | android:background="@android:color/darker_gray" |
95 | android:scrollbars="vertical" | 95 | android:scrollbars="vertical" |
96 | android:visibility="gone" | 96 | android:visibility="gone" |
97 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | 97 | app:layout_constraintBottom_toTopOf="@+id/guideline6" |
98 | app:layout_constraintEnd_toEndOf="parent" | 98 | app:layout_constraintEnd_toEndOf="parent" |
99 | app:layout_constraintStart_toStartOf="parent" | 99 | app:layout_constraintStart_toStartOf="parent" |
100 | app:layout_constraintTop_toBottomOf="@id/ivSort19" | 100 | app:layout_constraintTop_toBottomOf="@id/ivSort19" |
101 | tools:listitem="@layout/item_principal" /> | 101 | tools:listitem="@layout/item_principal" /> |
102 | 102 | ||
103 | 103 | ||
104 | <androidx.appcompat.widget.AppCompatTextView | 104 | <androidx.appcompat.widget.AppCompatTextView |
105 | android:id="@+id/tvInvImportados" | 105 | android:id="@+id/tvInvImportados" |
106 | android:layout_width="match_parent" | 106 | android:layout_width="match_parent" |
107 | android:layout_height="110dp" | 107 | android:layout_height="110dp" |
108 | android:autoSizeMaxTextSize="150sp" | 108 | android:autoSizeMaxTextSize="150sp" |
109 | android:autoSizeMinTextSize="25sp" | 109 | android:autoSizeMinTextSize="25sp" |
110 | android:autoSizeStepGranularity="5sp" | 110 | android:autoSizeStepGranularity="5sp" |
111 | android:autoSizeTextType="uniform" | 111 | android:autoSizeTextType="uniform" |
112 | android:gravity="start" | 112 | android:gravity="start" |
113 | android:lines="1" | 113 | android:lines="1" |
114 | android:padding="10dp" | 114 | android:padding="10dp" |
115 | android:text="@string/invDinamicoCompra" | 115 | android:text="@string/invDinamicoCompra" |
116 | android:textColor="@color/colorAccent" | 116 | android:textColor="@color/colorAccent" |
117 | android:visibility="visible" | 117 | android:visibility="visible" |
118 | app:fontFamily="sans-serif-condensed" | 118 | app:fontFamily="sans-serif-condensed" |
119 | app:layout_constraintBottom_toBottomOf="parent" | 119 | app:layout_constraintBottom_toBottomOf="parent" |
120 | app:layout_constraintEnd_toEndOf="parent" | 120 | app:layout_constraintEnd_toEndOf="parent" |
121 | app:layout_constraintStart_toStartOf="parent" | 121 | app:layout_constraintStart_toStartOf="parent" |
122 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" | 122 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" |
123 | app:layout_constraintVertical_bias="0.0" /> | 123 | app:layout_constraintVertical_bias="0.0" /> |
124 | 124 | ||
125 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | 125 | <androidx.appcompat.widget.AppCompatImageButton |
126 | <!-- android:id="@+id/ivSort19II"--> | 126 | android:id="@+id/ivSort19II" |
127 | <!-- android:layout_width="@dimen/icon_dim10"--> | 127 | android:layout_width="@dimen/icon_dim10" |
128 | <!-- android:layout_height="@dimen/icon_dim10"--> | 128 | android:layout_height="@dimen/icon_dim10" |
129 | <!-- android:layout_marginStart="10dp"--> | 129 | android:layout_marginStart="10dp" |
130 | <!-- android:padding="5dp"--> | 130 | android:padding="5dp" |
131 | <!-- android:src="@drawable/ic_sort19"--> | 131 | android:src="@drawable/ic_sort19" |
132 | <!-- android:visibility="invisible"--> | 132 | android:visibility="gone" |
133 | <!-- app:layout_constraintHorizontal_bias="0.0"--> | 133 | app:layout_constraintStart_toStartOf="parent" |
134 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | 134 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" |
135 | <!-- app:layout_constraintStart_toStartOf="parent"--> | 135 | app:layout_constraintBottom_toTopOf="@+id/rcInventarioII" /> |
136 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | 136 | |
137 | <androidx.appcompat.widget.AppCompatImageButton | ||
138 | android:id="@+id/ivSort91II" | ||
139 | android:layout_width="@dimen/icon_dim10" | ||
140 | android:layout_height="@dimen/icon_dim10" | ||
141 | android:layout_marginStart="10dp" | ||
142 | android:padding="5dp" | ||
143 | android:src="@drawable/ic_sort91" | ||
144 | android:visibility="gone" | ||
145 | app:layout_constraintStart_toStartOf="parent" | ||
146 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" | ||
147 | app:layout_constraintBottom_toTopOf="@+id/rcInventarioII"/> | ||
148 | |||
149 | <androidx.recyclerview.widget.RecyclerView | ||
150 | android:id="@+id/rcInventarioII" | ||
151 | android:layout_width="match_parent" | ||
152 | android:layout_height="0dp" | ||
153 | android:background="@android:color/darker_gray" | ||
154 | android:scrollbars="vertical" | ||
155 | android:visibility="gone" | ||
156 | app:layout_constraintEnd_toEndOf="parent" | ||
157 | app:layout_constraintStart_toStartOf="parent" | ||
158 | app:layout_constraintTop_toBottomOf="@id/ivSort91II" | ||
159 | tools:listitem="@layout/item_principal" | ||
160 | app:layout_constraintBottom_toTopOf="@+id/guideline1"/> | ||
137 | 161 | ||
138 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | ||
139 | <!-- android:id="@+id/ivSort91II"--> | ||
140 | <!-- android:layout_width="@dimen/icon_dim10"--> | ||
141 | <!-- android:layout_height="@dimen/icon_dim10"--> | ||
142 | <!-- android:layout_marginStart="10dp"--> | ||
143 | <!-- android:padding="5dp"--> | ||
144 | <!-- android:src="@drawable/ic_sort91"--> | ||
145 | <!-- android:visibility="invisible"--> | ||
146 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
147 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
148 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
149 | <ImageView | 162 | <ImageView |
150 | android:id="@+id/ivPortada" | 163 | android:id="@+id/ivPortada" |
151 | android:layout_width="452dp" | 164 | android:layout_width="452dp" |
152 | android:layout_height="259dp" | 165 | android:layout_height="259dp" |
153 | android:elevation="10dp" | 166 | android:elevation="10dp" |
154 | android:visibility="visible" | 167 | android:visibility="visible" |
155 | app:layout_constraintBottom_toBottomOf="parent" | 168 | app:layout_constraintBottom_toBottomOf="parent" |
156 | app:layout_constraintEnd_toEndOf="parent" | 169 | app:layout_constraintEnd_toEndOf="parent" |
app/src/main/res/layout-large/fragment_main.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: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.appcompat.widget.AppCompatTextView | 8 | <androidx.appcompat.widget.AppCompatTextView |
9 | android:id="@+id/tvInvDinamicos" | 9 | android:id="@+id/tvInvDinamicos" |
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:textSize="60sp" | 12 | android:textSize="60sp" |
13 | android:gravity="start" | 13 | android:gravity="start" |
14 | android:lines="1" | 14 | android:lines="1" |
15 | android:padding="10dp" | 15 | android:padding="10dp" |
16 | android:text="@string/invDinamicoVenta" | 16 | android:text="@string/invDinamicoVenta" |
17 | android:textColor="@color/colorAccent" | 17 | android:textColor="@color/colorAccent" |
18 | android:visibility="visible" | 18 | android:visibility="visible" |
19 | app:fontFamily="sans-serif-condensed" | 19 | app:fontFamily="sans-serif-condensed" |
20 | app:layout_constraintEnd_toEndOf="parent" | 20 | app:layout_constraintEnd_toEndOf="parent" |
21 | app:layout_constraintStart_toStartOf="parent" | 21 | app:layout_constraintStart_toStartOf="parent" |
22 | app:layout_constraintTop_toTopOf="parent" /> | 22 | app:layout_constraintTop_toTopOf="parent" /> |
23 | 23 | ||
24 | <androidx.appcompat.widget.AppCompatImageButton | 24 | <androidx.appcompat.widget.AppCompatImageButton |
25 | android:id="@+id/ivSort19" | 25 | android:id="@+id/ivSort19" |
26 | android:layout_width="@dimen/icon_dim10" | 26 | android:layout_width="@dimen/icon_dim10" |
27 | android:layout_height="@dimen/icon_dim10" | 27 | android:layout_height="@dimen/icon_dim10" |
28 | android:layout_marginStart="10dp" | 28 | android:layout_marginStart="10dp" |
29 | android:padding="5dp" | 29 | android:padding="5dp" |
30 | android:src="@drawable/ic_sort19" | 30 | android:src="@drawable/ic_sort19" |
31 | android:visibility="gone" | 31 | android:visibility="gone" |
32 | app:layout_constraintHorizontal_bias="0.0" | 32 | app:layout_constraintHorizontal_bias="0.0" |
33 | app:layout_constraintHorizontal_chainStyle="packed" | 33 | app:layout_constraintHorizontal_chainStyle="packed" |
34 | app:layout_constraintStart_toStartOf="parent" | 34 | app:layout_constraintStart_toStartOf="parent" |
35 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 35 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
36 | 36 | ||
37 | <androidx.appcompat.widget.AppCompatImageButton | 37 | <androidx.appcompat.widget.AppCompatImageButton |
38 | android:id="@+id/ivSort91" | 38 | android:id="@+id/ivSort91" |
39 | android:layout_width="@dimen/icon_dim10" | 39 | android:layout_width="@dimen/icon_dim10" |
40 | android:layout_height="@dimen/icon_dim10" | 40 | android:layout_height="@dimen/icon_dim10" |
41 | android:layout_marginStart="10dp" | 41 | android:layout_marginStart="10dp" |
42 | android:padding="5dp" | 42 | android:padding="5dp" |
43 | android:src="@drawable/ic_sort91" | 43 | android:src="@drawable/ic_sort91" |
44 | android:visibility="gone" | 44 | android:visibility="gone" |
45 | app:layout_constraintHorizontal_chainStyle="packed" | 45 | app:layout_constraintHorizontal_chainStyle="packed" |
46 | app:layout_constraintStart_toStartOf="parent" | 46 | app:layout_constraintStart_toStartOf="parent" |
47 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 47 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
48 | 48 | ||
49 | <TextView | 49 | <TextView |
50 | android:id="@+id/tvTipo" | 50 | android:id="@+id/tvTipo" |
51 | android:layout_width="wrap_content" | 51 | android:layout_width="wrap_content" |
52 | android:layout_height="wrap_content" | 52 | android:layout_height="wrap_content" |
53 | android:layout_margin="5dp" | 53 | android:layout_margin="5dp" |
54 | android:layout_marginTop="12dp" | 54 | android:layout_marginTop="12dp" |
55 | android:text="Tipo:" | 55 | android:text="Tipo:" |
56 | android:textSize="@dimen/md_message_textsize" | 56 | android:textSize="@dimen/md_message_textsize" |
57 | android:visibility="gone" | 57 | android:visibility="gone" |
58 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" | 58 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" |
59 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> | 59 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> |
60 | 60 | ||
61 | <com.google.android.material.checkbox.MaterialCheckBox | 61 | <com.google.android.material.checkbox.MaterialCheckBox |
62 | android:id="@+id/cbVentas" | 62 | android:id="@+id/cbVentas" |
63 | android:layout_width="wrap_content" | 63 | android:layout_width="wrap_content" |
64 | android:layout_height="wrap_content" | 64 | android:layout_height="wrap_content" |
65 | android:layout_margin="5dp" | 65 | android:layout_margin="5dp" |
66 | android:layout_marginTop="12dp" | 66 | android:layout_marginTop="12dp" |
67 | android:checked="true" | 67 | android:checked="true" |
68 | android:text="Ventas" | 68 | android:text="Ventas" |
69 | android:textSize="@dimen/SubTitulos10" | 69 | android:textSize="@dimen/SubTitulos10" |
70 | android:visibility="gone" | 70 | android:visibility="gone" |
71 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" | 71 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" |
72 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 72 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
73 | 73 | ||
74 | <com.google.android.material.checkbox.MaterialCheckBox | 74 | <com.google.android.material.checkbox.MaterialCheckBox |
75 | android:id="@+id/cbDeposito" | 75 | android:id="@+id/cbDeposito" |
76 | android:layout_width="wrap_content" | 76 | android:layout_width="wrap_content" |
77 | android:layout_height="wrap_content" | 77 | android:layout_height="wrap_content" |
78 | android:layout_margin="5dp" | 78 | android:layout_margin="5dp" |
79 | android:layout_marginTop="12dp" | 79 | android:layout_marginTop="12dp" |
80 | android:checked="true" | 80 | android:checked="true" |
81 | android:text="Deposito" | 81 | android:text="Deposito" |
82 | android:textSize="@dimen/SubTitulos10" | 82 | android:textSize="@dimen/SubTitulos10" |
83 | android:visibility="gone" | 83 | android:visibility="gone" |
84 | app:layout_constraintEnd_toEndOf="parent" | 84 | app:layout_constraintEnd_toEndOf="parent" |
85 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 85 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
86 | 86 | ||
87 | <androidx.recyclerview.widget.RecyclerView | 87 | <androidx.recyclerview.widget.RecyclerView |
88 | android:id="@+id/rcInventario" | 88 | android:id="@+id/rcInventario" |
89 | android:layout_width="match_parent" | 89 | android:layout_width="match_parent" |
90 | android:layout_height="0dp" | 90 | android:layout_height="0dp" |
91 | android:background="@android:color/darker_gray" | 91 | android:background="@android:color/darker_gray" |
92 | android:scrollbars="vertical" | 92 | android:scrollbars="vertical" |
93 | android:visibility="gone" | 93 | android:visibility="gone" |
94 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | 94 | app:layout_constraintBottom_toTopOf="@+id/guideline6" |
95 | app:layout_constraintEnd_toEndOf="parent" | 95 | app:layout_constraintEnd_toEndOf="parent" |
96 | app:layout_constraintStart_toStartOf="parent" | 96 | app:layout_constraintStart_toStartOf="parent" |
97 | app:layout_constraintTop_toBottomOf="@id/ivSort19" | 97 | app:layout_constraintTop_toBottomOf="@id/ivSort19" |
98 | tools:listitem="@layout/item_principal" /> | 98 | tools:listitem="@layout/item_principal" /> |
99 | 99 | ||
100 | 100 | ||
101 | <androidx.appcompat.widget.AppCompatTextView | 101 | <androidx.appcompat.widget.AppCompatTextView |
102 | android:id="@+id/tvInvImportados" | 102 | android:id="@+id/tvInvImportados" |
103 | android:layout_width="match_parent" | 103 | android:layout_width="match_parent" |
104 | android:layout_height="wrap_content" | 104 | android:layout_height="wrap_content" |
105 | android:textSize="60sp" | 105 | android:textSize="60sp" |
106 | android:gravity="start" | 106 | android:gravity="start" |
107 | android:lines="1" | 107 | android:lines="1" |
108 | android:padding="10dp" | 108 | android:padding="10dp" |
109 | android:text="@string/invDinamicoCompra" | 109 | android:text="@string/invDinamicoCompra" |
110 | android:textColor="@color/colorAccent" | 110 | android:textColor="@color/colorAccent" |
111 | android:visibility="visible" | 111 | android:visibility="visible" |
112 | app:fontFamily="sans-serif-condensed" | 112 | app:fontFamily="sans-serif-condensed" |
113 | app:layout_constraintBottom_toBottomOf="parent" | 113 | app:layout_constraintBottom_toBottomOf="parent" |
114 | app:layout_constraintEnd_toEndOf="parent" | 114 | app:layout_constraintEnd_toEndOf="parent" |
115 | app:layout_constraintStart_toStartOf="parent" | 115 | app:layout_constraintStart_toStartOf="parent" |
116 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" | 116 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" |
117 | app:layout_constraintVertical_bias="0.0" /> | 117 | app:layout_constraintVertical_bias="0.0" /> |
118 | 118 | ||
119 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | 119 | <androidx.appcompat.widget.AppCompatImageButton |
120 | <!-- android:id="@+id/ivSort19II"--> | 120 | android:id="@+id/ivSort19II" |
121 | <!-- android:layout_width="@dimen/icon_dim10"--> | 121 | android:layout_width="@dimen/icon_dim10" |
122 | <!-- android:layout_height="@dimen/icon_dim10"--> | 122 | android:layout_height="@dimen/icon_dim10" |
123 | <!-- android:layout_marginStart="10dp"--> | 123 | android:layout_marginStart="10dp" |
124 | <!-- android:padding="5dp"--> | 124 | android:padding="5dp" |
125 | <!-- android:src="@drawable/ic_sort19"--> | 125 | android:src="@drawable/ic_sort19" |
126 | <!-- android:visibility="invisible"--> | 126 | android:visibility="gone" |
127 | <!-- app:layout_constraintHorizontal_bias="0.0"--> | ||
128 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
129 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
130 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
131 | |||
132 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | ||
133 | <!-- android:id="@+id/ivSort91II"--> | ||
134 | <!-- android:layout_width="@dimen/icon_dim10"--> | ||
135 | <!-- android:layout_height="@dimen/icon_dim10"--> | ||
136 | <!-- android:layout_marginStart="10dp"--> | ||
137 | <!-- android:padding="5dp"--> | ||
138 | <!-- android:src="@drawable/ic_sort91"--> | ||
139 | <!-- android:visibility="invisible"--> | ||
140 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
141 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
142 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
143 | <ImageView | ||
144 | android:id="@+id/ivPortada" | ||
145 | android:layout_width="706dp" | ||
146 | android:layout_height="448dp" | ||
147 | android:elevation="10dp" | ||
148 | android:visibility="visible" | ||
149 | app:layout_constraintBottom_toBottomOf="parent" | ||
150 | app:layout_constraintEnd_toEndOf="parent" | ||
151 | app:layout_constraintStart_toStartOf="parent" | 127 | app:layout_constraintStart_toStartOf="parent" |
152 | app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" | 128 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" |
153 | tools:srcCompat="@drawable/imagen_portada" /> | 129 | app:layout_constraintBottom_toTopOf="@+id/rcInventarioII" /> |
130 | |||
131 | <androidx.appcompat.widget.AppCompatImageButton | ||
132 | android:id="@+id/ivSort91II" | ||
133 | android:layout_width="@dimen/icon_dim10" | ||
134 | android:layout_height="@dimen/icon_dim10" | ||
135 | android:layout_marginStart="10dp" | ||
136 | android:padding="5dp" | ||
137 | android:src="@drawable/ic_sort91" | ||
138 | android:visibility="gone" | ||
139 | app:layout_constraintStart_toStartOf="parent" | ||
140 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" | ||
141 | app:layout_constraintBottom_toTopOf="@+id/rcInventarioII"/> | ||
154 | 142 | ||
155 | <androidx.recyclerview.widget.RecyclerView | 143 | <androidx.recyclerview.widget.RecyclerView |
156 | android:id="@+id/rcInventarioII" | 144 | android:id="@+id/rcInventarioII" |
157 | android:layout_width="match_parent" | 145 | android:layout_width="match_parent" |
158 | android:layout_height="0dp" | 146 | android:layout_height="0dp" |
159 | android:background="@android:color/darker_gray" | 147 | android:background="@android:color/darker_gray" |
160 | android:scrollbars="vertical" | 148 | android:scrollbars="vertical" |
161 | android:visibility="gone" | 149 | android:visibility="gone" |
162 | app:layout_constraintBottom_toTopOf="@+id/guideline6" |
app/src/main/res/layout-xlarge-v26/fragment_actua_maestros.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:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> | 7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> |
8 | 8 | ||
9 | <androidx.appcompat.widget.AppCompatTextView | 9 | <androidx.appcompat.widget.AppCompatTextView |
10 | android:id="@+id/tvActMaestros" | 10 | android:id="@+id/tvActMaestros" |
11 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" |
12 | android:layout_height="120dp" | 12 | android:layout_height="120dp" |
13 | android:layout_marginTop="15dp" | 13 | android:layout_marginTop="25dp" |
14 | android:autoSizeMaxTextSize="100sp" | 14 | android:autoSizeMaxTextSize="100sp" |
15 | android:autoSizeMinTextSize="20sp" | 15 | android:autoSizeMinTextSize="20sp" |
16 | android:autoSizeStepGranularity="5sp" | 16 | android:autoSizeStepGranularity="5sp" |
17 | android:autoSizeTextType="uniform" | 17 | android:autoSizeTextType="uniform" |
18 | android:gravity="center" | 18 | android:gravity="center" |
19 | android:lines="1" | 19 | android:lines="1" |
20 | android:text="@string/tvActMaestros" | 20 | android:text="@string/tvActMaestros" |
21 | android:textColor="@color/colorAccent" | 21 | android:textColor="@color/colorAccent" |
22 | app:fontFamily="sans-serif-condensed" | 22 | app:fontFamily="sans-serif-condensed" |
23 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | 23 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" |
24 | app:layout_constraintEnd_toEndOf="parent" | 24 | app:layout_constraintEnd_toEndOf="parent" |
25 | app:layout_constraintStart_toStartOf="parent" | 25 | app:layout_constraintStart_toStartOf="parent" |
26 | app:layout_constraintTop_toTopOf="parent" /> | 26 | app:layout_constraintTop_toTopOf="parent" /> |
27 | 27 | ||
28 | <TextView | 28 | <TextView |
29 | android:id="@+id/tvSeleccioneServidor" | 29 | android:id="@+id/tvSeleccioneServidor" |
30 | android:layout_width="0dp" | 30 | android:layout_width="0dp" |
31 | android:layout_height="wrap_content" | 31 | android:layout_height="wrap_content" |
32 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 32 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
33 | android:layout_marginTop="20dp" | 33 | android:layout_marginTop="120dp" |
34 | android:gravity="start" | 34 | android:gravity="start" |
35 | android:lines="1" | 35 | android:lines="1" |
36 | android:text="@string/tvMedio" | 36 | android:text="@string/tvMedio" |
37 | android:textColor="@android:color/black" | 37 | android:textColor="@android:color/black" |
38 | android:textSize="@dimen/VentasDeposito10" | 38 | android:textSize="@dimen/tvServerConectado" |
39 | app:fontFamily="sans-serif-condensed" | 39 | app:fontFamily="sans-serif-condensed" |
40 | app:layout_constraintEnd_toEndOf="parent" | 40 | app:layout_constraintEnd_toEndOf="parent" |
41 | app:layout_constraintStart_toStartOf="parent" | 41 | app:layout_constraintStart_toStartOf="parent" |
42 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> | 42 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> |
43 | 43 | ||
44 | <RadioGroup | 44 | <RadioGroup |
45 | android:id="@+id/rgTipoActualizacion" | 45 | android:id="@+id/rgTipoActualizacion" |
46 | android:layout_width="0dp" | 46 | android:layout_width="0dp" |
47 | android:layout_height="wrap_content" | 47 | android:layout_height="wrap_content" |
48 | android:layout_marginTop="20dp" | 48 | android:layout_marginTop="84dp" |
49 | android:gravity="start" | 49 | android:gravity="start" |
50 | android:orientation="vertical" | 50 | android:orientation="vertical" |
51 | app:layout_constraintEnd_toEndOf="parent" | 51 | app:layout_constraintEnd_toEndOf="parent" |
52 | app:layout_constraintHorizontal_bias="0.0" | ||
52 | app:layout_constraintStart_toStartOf="parent" | 53 | app:layout_constraintStart_toStartOf="parent" |
53 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> | 54 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> |
54 | 55 | ||
55 | <RadioButton | 56 | <RadioButton |
56 | android:id="@+id/obPorWifi" | 57 | android:id="@+id/obPorWifi" |
57 | android:layout_width="wrap_content" | 58 | android:layout_width="wrap_content" |
58 | android:layout_height="wrap_content" | 59 | android:layout_height="wrap_content" |
59 | android:layout_margin="10dp" | 60 | android:layout_margin="10dp" |
60 | android:checked="true" | 61 | android:checked="true" |
61 | android:padding="5dp" | 62 | android:padding="5dp" |
62 | android:text="@string/obPorWifi" | 63 | android:text="@string/obPorWifi" |
63 | android:textSize="@dimen/SubTitulos10" /> | 64 | android:textSize="@dimen/VentasDeposito10" /> |
64 | 65 | ||
65 | <RadioButton | 66 | <RadioButton |
66 | android:id="@+id/obImpInventarios" | 67 | android:id="@+id/obImpInventarios" |
67 | android:layout_width="wrap_content" | 68 | android:layout_width="wrap_content" |
68 | android:layout_height="wrap_content" | 69 | android:layout_height="wrap_content" |
69 | android:layout_margin="10dp" | 70 | android:layout_margin="10dp" |
70 | android:checked="false" | 71 | android:checked="false" |
71 | android:padding="5dp" | 72 | android:padding="5dp" |
72 | android:text="@string/obViaArchivo" | 73 | android:text="@string/obViaArchivo" |
73 | android:textSize="@dimen/SubTitulos10"/> | 74 | android:textSize="@dimen/VentasDeposito10" /> |
74 | </RadioGroup> | 75 | </RadioGroup> |
75 | 76 | ||
76 | <TextView | 77 | <TextView |
77 | android:id="@+id/tvServerConectado" | 78 | android:id="@+id/tvServerConectado" |
78 | android:layout_width="match_parent" | 79 | android:layout_width="match_parent" |
79 | android:layout_height="wrap_content" | 80 | android:layout_height="wrap_content" |
80 | android:layout_margin="30dp" | ||
81 | android:gravity="center" | 81 | android:gravity="center" |
82 | android:lines="2" | 82 | android:lines="2" |
83 | android:text="" | 83 | android:text="" |
84 | android:textColor="@android:color/black" | 84 | android:textColor="@android:color/black" |
85 | android:textSize="@dimen/textCantidad10" | 85 | android:textSize="@dimen/textCantidad10" |
86 | android:textStyle="bold" | 86 | android:textStyle="bold" |
87 | app:fontFamily="sans-serif-condensed" | 87 | app:fontFamily="sans-serif-condensed" |
88 | app:layout_constraintBottom_toTopOf="@+id/countriesList" | 88 | app:layout_constraintBottom_toTopOf="@+id/countriesList" |
89 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" /> | 89 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" |
90 | app:layout_constraintVertical_bias="0.343" | ||
91 | tools:layout_editor_absoluteX="20dp" /> | ||
90 | 92 | ||
91 | <TextView | 93 | <TextView |
92 | android:id="@+id/countriesList" | 94 | android:id="@+id/countriesList" |
93 | android:layout_width="0dp" | 95 | android:layout_width="0dp" |
94 | android:layout_height="wrap_content" | 96 | android:layout_height="wrap_content" |
95 | android:layout_marginTop="@dimen/MarginTopTitulos" | 97 | android:layout_marginTop="@dimen/MarginTopTitulos" |
96 | android:gravity="center" | 98 | android:gravity="center" |
97 | android:text="" | 99 | android:text="" |
98 | android:textColor="@android:color/black" | 100 | android:textColor="@android:color/black" |
99 | android:textSize="@dimen/SubTitulos10" | 101 | android:textSize="@dimen/SubTitulos10" |
100 | android:textStyle="bold" | 102 | android:textStyle="bold" |
101 | android:visibility="visible" | 103 | android:visibility="visible" |
102 | app:fontFamily="sans-serif-condensed" | 104 | app:fontFamily="sans-serif-condensed" |
103 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" | 105 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" |
104 | app:layout_constraintEnd_toEndOf="parent" | 106 | app:layout_constraintEnd_toEndOf="parent" |
105 | app:layout_constraintHorizontal_bias="0.0" | 107 | app:layout_constraintHorizontal_bias="0.0" |
106 | app:layout_constraintStart_toStartOf="parent" | 108 | app:layout_constraintStart_toStartOf="parent" |
107 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" | 109 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" |
108 | app:layout_constraintVertical_bias="0.106" /> | 110 | app:layout_constraintVertical_bias="0.229" /> |
109 | 111 | ||
110 | <Button | 112 | <Button |
111 | android:id="@+id/btnConfirmarAct" | 113 | android:id="@+id/btnConfirmarAct" |
112 | android:layout_width="0dp" | 114 | android:layout_width="0dp" |
113 | android:layout_height="wrap_content" | 115 | android:layout_height="wrap_content" |
114 | android:layout_margin="20dp" | 116 | android:layout_margin="20dp" |
115 | android:background="@drawable/boton_borde_redondeado" | 117 | android:background="@drawable/boton_borde_redondeado" |
116 | android:padding="10dp" | 118 | android:padding="10dp" |
117 | android:text="@string/btnConfirmarAct" | 119 | android:text="@string/btnConfirmarAct" |
118 | android:textColor="@android:color/white" | 120 | android:textColor="@android:color/white" |
119 | android:textSize="@dimen/SubTitulos10" | 121 | android:textSize="@dimen/SubTitulos10" |
120 | app:layout_constraintBottom_toBottomOf="parent" | 122 | app:layout_constraintBottom_toBottomOf="parent" |
121 | app:layout_constraintEnd_toEndOf="parent" | 123 | app:layout_constraintEnd_toEndOf="parent" |
122 | app:layout_constraintStart_toStartOf="parent" /> | 124 | app:layout_constraintStart_toStartOf="parent" /> |
123 | 125 | ||
124 | <ProgressBar | 126 | <ProgressBar |
125 | android:id="@+id/loading_view" | 127 | android:id="@+id/loading_view" |
126 | android:layout_width="wrap_content" | 128 | android:layout_width="wrap_content" |
127 | android:layout_height="wrap_content" | 129 | android:layout_height="wrap_content" |
128 | android:layout_marginStart="8dp" | 130 | android:layout_marginStart="8dp" |
129 | android:layout_marginLeft="8dp" | 131 | android:layout_marginLeft="8dp" |
130 | android:layout_marginTop="8dp" | 132 | android:layout_marginTop="8dp" |
131 | android:layout_marginEnd="8dp" | 133 | android:layout_marginEnd="8dp" |
132 | android:layout_marginRight="8dp" | 134 | android:layout_marginRight="8dp" |
133 | android:layout_marginBottom="8dp" | 135 | android:layout_marginBottom="8dp" |
134 | android:visibility="gone" | 136 | android:visibility="gone" |
135 | app:layout_constraintBottom_toBottomOf="parent" | 137 | app:layout_constraintBottom_toBottomOf="parent" |
136 | app:layout_constraintEnd_toEndOf="parent" | 138 | app:layout_constraintEnd_toEndOf="parent" |
137 | app:layout_constraintStart_toStartOf="parent" | 139 | app:layout_constraintStart_toStartOf="parent" |
138 | app:layout_constraintTop_toTopOf="parent" /> | 140 | app:layout_constraintTop_toTopOf="parent" /> |
139 | 141 | ||
140 | </androidx.constraintlayout.widget.ConstraintLayout> | 142 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-xlarge-v26/fragment_main.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: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.appcompat.widget.AppCompatTextView | 8 | <androidx.appcompat.widget.AppCompatTextView |
9 | android:id="@+id/tvInvDinamicos" | 9 | android:id="@+id/tvInvDinamicos" |
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
11 | android:layout_height="110dp" | 11 | android:layout_height="110dp" |
12 | android:autoSizeMaxTextSize="150sp" | 12 | android:autoSizeMaxTextSize="150sp" |
13 | android:autoSizeMinTextSize="25sp" | 13 | android:autoSizeMinTextSize="25sp" |
14 | android:autoSizeStepGranularity="5sp" | 14 | android:autoSizeStepGranularity="5sp" |
15 | android:autoSizeTextType="uniform" | 15 | android:autoSizeTextType="uniform" |
16 | android:gravity="start" | 16 | android:gravity="start" |
17 | android:lines="1" | 17 | android:lines="1" |
18 | android:padding="10dp" | 18 | android:padding="10dp" |
19 | android:text="@string/invDinamicoVenta" | 19 | android:text="@string/invDinamicoVenta" |
20 | android:textColor="@color/colorAccent" | 20 | android:textColor="@color/colorAccent" |
21 | android:visibility="visible" | 21 | android:visibility="visible" |
22 | app:fontFamily="sans-serif-condensed" | 22 | app:fontFamily="sans-serif-condensed" |
23 | app:layout_constraintEnd_toEndOf="parent" | 23 | app:layout_constraintEnd_toEndOf="parent" |
24 | app:layout_constraintStart_toStartOf="parent" | 24 | app:layout_constraintStart_toStartOf="parent" |
25 | app:layout_constraintTop_toTopOf="parent" /> | 25 | app:layout_constraintTop_toTopOf="parent" /> |
26 | 26 | ||
27 | <androidx.appcompat.widget.AppCompatImageButton | 27 | <androidx.appcompat.widget.AppCompatImageButton |
28 | android:id="@+id/ivSort19" | 28 | android:id="@+id/ivSort19" |
29 | android:layout_width="@dimen/icon_dim10" | 29 | android:layout_width="@dimen/icon_dim10" |
30 | android:layout_height="@dimen/icon_dim10" | 30 | android:layout_height="@dimen/icon_dim10" |
31 | android:layout_marginStart="10dp" | 31 | android:layout_marginStart="10dp" |
32 | android:padding="5dp" | 32 | android:padding="5dp" |
33 | android:src="@drawable/ic_sort19" | 33 | android:src="@drawable/ic_sort19" |
34 | android:visibility="gone" | 34 | android:visibility="gone" |
35 | app:layout_constraintHorizontal_bias="0.0" | 35 | app:layout_constraintHorizontal_bias="0.0" |
36 | app:layout_constraintHorizontal_chainStyle="packed" | 36 | app:layout_constraintHorizontal_chainStyle="packed" |
37 | app:layout_constraintStart_toStartOf="parent" | 37 | app:layout_constraintStart_toStartOf="parent" |
38 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 38 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
39 | 39 | ||
40 | <androidx.appcompat.widget.AppCompatImageButton | 40 | <androidx.appcompat.widget.AppCompatImageButton |
41 | android:id="@+id/ivSort91" | 41 | android:id="@+id/ivSort91" |
42 | android:layout_width="@dimen/icon_dim10" | 42 | android:layout_width="@dimen/icon_dim10" |
43 | android:layout_height="@dimen/icon_dim10" | 43 | android:layout_height="@dimen/icon_dim10" |
44 | android:layout_marginStart="10dp" | 44 | android:layout_marginStart="10dp" |
45 | android:padding="5dp" | 45 | android:padding="5dp" |
46 | android:src="@drawable/ic_sort91" | 46 | android:src="@drawable/ic_sort91" |
47 | android:visibility="gone" | 47 | android:visibility="gone" |
48 | app:layout_constraintHorizontal_chainStyle="packed" | 48 | app:layout_constraintHorizontal_chainStyle="packed" |
49 | app:layout_constraintStart_toStartOf="parent" | 49 | app:layout_constraintStart_toStartOf="parent" |
50 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 50 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
51 | 51 | ||
52 | <TextView | 52 | <TextView |
53 | android:id="@+id/tvTipo" | 53 | android:id="@+id/tvTipo" |
54 | android:layout_width="wrap_content" | 54 | android:layout_width="wrap_content" |
55 | android:layout_height="wrap_content" | 55 | android:layout_height="wrap_content" |
56 | android:layout_margin="5dp" | 56 | android:layout_margin="5dp" |
57 | android:layout_marginTop="12dp" | 57 | android:layout_marginTop="12dp" |
58 | android:text="Tipo:" | 58 | android:text="Tipo:" |
59 | android:textSize="@dimen/md_message_textsize" | 59 | android:textSize="@dimen/md_message_textsize" |
60 | android:visibility="gone" | 60 | android:visibility="gone" |
61 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" | 61 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" |
62 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> | 62 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> |
63 | 63 | ||
64 | <com.google.android.material.checkbox.MaterialCheckBox | 64 | <com.google.android.material.checkbox.MaterialCheckBox |
65 | android:id="@+id/cbVentas" | 65 | android:id="@+id/cbVentas" |
66 | android:layout_width="wrap_content" | 66 | android:layout_width="wrap_content" |
67 | android:layout_height="wrap_content" | 67 | android:layout_height="wrap_content" |
68 | android:layout_margin="5dp" | 68 | android:layout_margin="5dp" |
69 | android:layout_marginTop="12dp" | 69 | android:layout_marginTop="12dp" |
70 | android:checked="true" | 70 | android:checked="true" |
71 | android:text="Ventas" | 71 | android:text="Ventas" |
72 | android:textSize="@dimen/SubTitulos10" | 72 | android:textSize="@dimen/SubTitulos10" |
73 | android:visibility="gone" | 73 | android:visibility="gone" |
74 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" | 74 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" |
75 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 75 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
76 | 76 | ||
77 | <com.google.android.material.checkbox.MaterialCheckBox | 77 | <com.google.android.material.checkbox.MaterialCheckBox |
78 | android:id="@+id/cbDeposito" | 78 | android:id="@+id/cbDeposito" |
79 | android:layout_width="wrap_content" | 79 | android:layout_width="wrap_content" |
80 | android:layout_height="wrap_content" | 80 | android:layout_height="wrap_content" |
81 | android:layout_margin="5dp" | 81 | android:layout_margin="5dp" |
82 | android:layout_marginTop="12dp" | 82 | android:layout_marginTop="12dp" |
83 | android:checked="true" | 83 | android:checked="true" |
84 | android:text="Deposito" | 84 | android:text="Deposito" |
85 | android:textSize="@dimen/SubTitulos10" | 85 | android:textSize="@dimen/SubTitulos10" |
86 | android:visibility="gone" | 86 | android:visibility="gone" |
87 | app:layout_constraintEnd_toEndOf="parent" | 87 | app:layout_constraintEnd_toEndOf="parent" |
88 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 88 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
89 | 89 | ||
90 | <androidx.recyclerview.widget.RecyclerView | 90 | <androidx.recyclerview.widget.RecyclerView |
91 | android:id="@+id/rcInventario" | 91 | android:id="@+id/rcInventario" |
92 | android:layout_width="match_parent" | 92 | android:layout_width="match_parent" |
93 | android:layout_height="0dp" | 93 | android:layout_height="0dp" |
94 | android:background="@android:color/darker_gray" | 94 | android:background="@android:color/darker_gray" |
95 | android:scrollbars="vertical" | 95 | android:scrollbars="vertical" |
96 | android:visibility="gone" | 96 | android:visibility="gone" |
97 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | 97 | app:layout_constraintBottom_toTopOf="@+id/guideline6" |
98 | app:layout_constraintEnd_toEndOf="parent" | 98 | app:layout_constraintEnd_toEndOf="parent" |
99 | app:layout_constraintStart_toStartOf="parent" | 99 | app:layout_constraintStart_toStartOf="parent" |
100 | app:layout_constraintTop_toBottomOf="@id/ivSort19" | 100 | app:layout_constraintTop_toBottomOf="@id/ivSort19" |
101 | tools:listitem="@layout/item_principal" /> | 101 | tools:listitem="@layout/item_principal" /> |
102 | 102 | ||
103 | 103 | ||
104 | <androidx.appcompat.widget.AppCompatTextView | 104 | <androidx.appcompat.widget.AppCompatTextView |
105 | android:id="@+id/tvInvImportados" | 105 | android:id="@+id/tvInvImportados" |
106 | android:layout_width="match_parent" | 106 | android:layout_width="match_parent" |
107 | android:layout_height="110dp" | 107 | android:layout_height="110dp" |
108 | android:autoSizeMaxTextSize="150sp" | 108 | android:autoSizeMaxTextSize="150sp" |
109 | android:autoSizeMinTextSize="25sp" | 109 | android:autoSizeMinTextSize="25sp" |
110 | android:autoSizeStepGranularity="5sp" | 110 | android:autoSizeStepGranularity="5sp" |
111 | android:autoSizeTextType="uniform" | 111 | android:autoSizeTextType="uniform" |
112 | android:gravity="start" | 112 | android:gravity="start" |
113 | android:lines="1" | 113 | android:lines="1" |
114 | android:padding="10dp" | 114 | android:padding="10dp" |
115 | android:text="@string/invDinamicoCompra" | 115 | android:text="@string/invDinamicoCompra" |
116 | android:textColor="@color/colorAccent" | 116 | android:textColor="@color/colorAccent" |
117 | android:visibility="visible" | 117 | android:visibility="visible" |
118 | app:fontFamily="sans-serif-condensed" | 118 | app:fontFamily="sans-serif-condensed" |
119 | app:layout_constraintBottom_toBottomOf="parent" | 119 | app:layout_constraintBottom_toBottomOf="parent" |
120 | app:layout_constraintEnd_toEndOf="parent" | 120 | app:layout_constraintEnd_toEndOf="parent" |
121 | app:layout_constraintStart_toStartOf="parent" | 121 | app:layout_constraintStart_toStartOf="parent" |
122 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" | 122 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" |
123 | app:layout_constraintVertical_bias="0.0" /> | 123 | app:layout_constraintVertical_bias="0.0" /> |
124 | 124 | ||
125 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | 125 | <androidx.appcompat.widget.AppCompatImageButton |
126 | <!-- android:id="@+id/ivSort19II"--> | 126 | android:id="@+id/ivSort19II" |
127 | <!-- android:layout_width="@dimen/icon_dim10"--> | 127 | android:layout_width="@dimen/icon_dim10" |
128 | <!-- android:layout_height="@dimen/icon_dim10"--> | 128 | android:layout_height="@dimen/icon_dim10" |
129 | <!-- android:layout_marginStart="10dp"--> | 129 | android:layout_marginStart="10dp" |
130 | <!-- android:padding="5dp"--> | 130 | android:padding="5dp" |
131 | <!-- android:src="@drawable/ic_sort19"--> | 131 | android:src="@drawable/ic_sort19" |
132 | <!-- android:visibility="invisible"--> | 132 | android:visibility="gone" |
133 | <!-- app:layout_constraintHorizontal_bias="0.0"--> | 133 | app:layout_constraintStart_toStartOf="parent" |
134 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | 134 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" |
135 | <!-- app:layout_constraintStart_toStartOf="parent"--> | 135 | app:layout_constraintBottom_toTopOf="@+id/rcInventarioII" /> |
136 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | 136 | |
137 | <androidx.appcompat.widget.AppCompatImageButton | ||
138 | android:id="@+id/ivSort91II" | ||
139 | android:layout_width="@dimen/icon_dim10" | ||
140 | android:layout_height="@dimen/icon_dim10" | ||
141 | android:layout_marginStart="10dp" | ||
142 | android:padding="5dp" | ||
143 | android:src="@drawable/ic_sort91" | ||
144 | android:visibility="gone" | ||
145 | app:layout_constraintStart_toStartOf="parent" | ||
146 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" | ||
147 | app:layout_constraintBottom_toTopOf="@+id/rcInventarioII"/> | ||
137 | 148 | ||
138 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | 149 | <androidx.recyclerview.widget.RecyclerView |
139 | <!-- android:id="@+id/ivSort91II"--> | 150 | android:id="@+id/rcInventarioII" |
140 | <!-- android:layout_width="@dimen/icon_dim10"--> | 151 | android:layout_width="match_parent" |
141 | <!-- android:layout_height="@dimen/icon_dim10"--> | 152 | android:layout_height="0dp" |
142 | <!-- android:layout_marginStart="10dp"--> | 153 | android:background="@android:color/darker_gray" |
143 | <!-- android:padding="5dp"--> | 154 | android:scrollbars="vertical" |
144 | <!-- android:src="@drawable/ic_sort91"--> | 155 | android:visibility="gone" |
145 | <!-- android:visibility="invisible"--> | 156 | app:layout_constraintEnd_toEndOf="parent" |
146 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | 157 | app:layout_constraintStart_toStartOf="parent" |
147 | <!-- app:layout_constraintStart_toStartOf="parent"--> | 158 | app:layout_constraintTop_toBottomOf="@id/ivSort91II" |
148 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | 159 | tools:listitem="@layout/item_principal" |
160 | app:layout_constraintBottom_toTopOf="@+id/guideline1"/> | ||
149 | 161 | ||
150 | <ImageView | 162 | <ImageView |
151 | android:id="@+id/ivPortada" | 163 | android:id="@+id/ivPortada" |
152 | android:layout_width="730dp" | 164 | android:layout_width="730dp" |
153 | android:layout_height="491dp" | 165 | android:layout_height="491dp" |
154 | android:layout_marginBottom="156dp" | 166 | android:layout_marginBottom="156dp" |
155 | android:elevation="10dp" | 167 | android:elevation="10dp" |
156 | android:visibility="visible" | 168 | android:visibility="visible" |
157 | app:layout_constraintBottom_toBottomOf="parent" | 169 | app:layout_constraintBottom_toBottomOf="parent" |
158 | app:layout_constraintEnd_toEndOf="parent" | 170 | app:layout_constraintEnd_toEndOf="parent" |
159 | app:layout_constraintStart_toStartOf="parent" | 171 | app:layout_constraintStart_toStartOf="parent" |
160 | app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" | 172 | app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" |
161 | tools:srcCompat="@drawable/imagen_portada" /> | 173 | tools:srcCompat="@drawable/imagen_portada" /> |
162 | 174 | ||
163 | <androidx.recyclerview.widget.RecyclerView | ||
164 | android:id="@+id/rcInventarioII" | ||
165 | android:layout_width="match_parent" | ||
166 | android:layout_height="0dp" | ||
167 | android:background="@android:color/darker_gray" | ||
168 | android:scrollbars="vertical" | ||
169 | android:visibility="gone" | ||
170 | app:layout_constraintBottom_toTopOf="@+id/guideline6" |
app/src/main/res/layout-xlarge/fragment_actua_maestros.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:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> | 7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> |
8 | 8 | ||
9 | <androidx.appcompat.widget.AppCompatTextView | 9 | <androidx.appcompat.widget.AppCompatTextView |
10 | android:id="@+id/tvActMaestros" | 10 | android:id="@+id/tvActMaestros" |
11 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" |
12 | android:layout_height="120dp" | 12 | android:layout_height="120dp" |
13 | android:layout_marginTop="15dp" | 13 | android:layout_marginTop="25dp" |
14 | android:textSize="60sp" | 14 | android:textSize="90sp" |
15 | android:gravity="center" | 15 | android:gravity="center" |
16 | android:lines="1" | 16 | android:lines="1" |
17 | android:text="@string/tvActMaestros" | 17 | android:text="@string/tvActMaestros" |
18 | android:textColor="@color/colorAccent" | 18 | android:textColor="@color/colorAccent" |
19 | app:fontFamily="sans-serif-condensed" | 19 | app:fontFamily="sans-serif-condensed" |
20 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | 20 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" |
21 | app:layout_constraintEnd_toEndOf="parent" | 21 | app:layout_constraintEnd_toEndOf="parent" |
22 | app:layout_constraintStart_toStartOf="parent" | 22 | app:layout_constraintStart_toStartOf="parent" |
23 | app:layout_constraintTop_toTopOf="parent" /> | 23 | app:layout_constraintTop_toTopOf="parent" /> |
24 | 24 | ||
25 | <TextView | 25 | <TextView |
26 | android:id="@+id/tvSeleccioneServidor" | 26 | android:id="@+id/tvSeleccioneServidor" |
27 | android:layout_width="0dp" | 27 | android:layout_width="0dp" |
28 | android:layout_height="wrap_content" | 28 | android:layout_height="wrap_content" |
29 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 29 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
30 | android:layout_marginTop="20dp" | 30 | android:layout_marginTop="120dp" |
31 | android:gravity="start" | 31 | android:gravity="start" |
32 | android:lines="1" | 32 | android:lines="1" |
33 | android:text="@string/tvMedio" | 33 | android:text="@string/tvMedio" |
34 | android:textColor="@android:color/black" | 34 | android:textColor="@android:color/black" |
35 | android:textSize="@dimen/VentasDeposito10" | 35 | android:textSize="@dimen/VentasDeposito10" |
36 | app:fontFamily="sans-serif-condensed" | 36 | app:fontFamily="sans-serif-condensed" |
37 | app:layout_constraintEnd_toEndOf="parent" | 37 | app:layout_constraintEnd_toEndOf="parent" |
38 | app:layout_constraintStart_toStartOf="parent" | 38 | app:layout_constraintStart_toStartOf="parent" |
39 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> | 39 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> |
40 | 40 | ||
41 | <RadioGroup | 41 | <RadioGroup |
42 | android:id="@+id/rgTipoActualizacion" | 42 | android:id="@+id/rgTipoActualizacion" |
43 | android:layout_width="0dp" | 43 | android:layout_width="0dp" |
44 | android:layout_height="wrap_content" | 44 | android:layout_height="wrap_content" |
45 | android:layout_marginTop="20dp" | 45 | android:layout_marginTop="84dp" |
46 | android:gravity="start" | 46 | android:gravity="start" |
47 | android:orientation="vertical" | 47 | android:orientation="vertical" |
48 | app:layout_constraintEnd_toEndOf="parent" | 48 | app:layout_constraintEnd_toEndOf="parent" |
49 | app:layout_constraintStart_toStartOf="parent" | 49 | app:layout_constraintStart_toStartOf="parent" |
50 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> | 50 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> |
51 | 51 | ||
52 | <RadioButton | 52 | <RadioButton |
53 | android:id="@+id/obPorWifi" | 53 | android:id="@+id/obPorWifi" |
54 | android:layout_width="wrap_content" | 54 | android:layout_width="wrap_content" |
55 | android:layout_height="wrap_content" | 55 | android:layout_height="wrap_content" |
56 | android:layout_margin="10dp" | 56 | android:layout_margin="10dp" |
57 | android:checked="true" | 57 | android:checked="true" |
58 | android:padding="5dp" | 58 | android:padding="5dp" |
59 | android:text="@string/obPorWifi" | 59 | android:text="@string/obPorWifi" |
60 | android:textSize="@dimen/SubTitulos10" /> | 60 | android:textSize="@dimen/VentasDeposito10" /> |
61 | 61 | ||
62 | <RadioButton | 62 | <RadioButton |
63 | android:id="@+id/obImpInventarios" | 63 | android:id="@+id/obImpInventarios" |
64 | android:layout_width="wrap_content" | 64 | android:layout_width="wrap_content" |
65 | android:layout_height="wrap_content" | 65 | android:layout_height="wrap_content" |
66 | android:layout_margin="10dp" | 66 | android:layout_margin="10dp" |
67 | android:checked="false" | 67 | android:checked="false" |
68 | android:padding="5dp" | 68 | android:padding="5dp" |
69 | android:text="@string/obViaArchivo" | 69 | android:text="@string/obViaArchivo" |
70 | android:textSize="@dimen/SubTitulos10"/> | 70 | android:textSize="@dimen/VentasDeposito10"/> |
71 | </RadioGroup> | 71 | </RadioGroup> |
72 | 72 | ||
73 | <TextView | 73 | <TextView |
74 | android:id="@+id/tvServerConectado" | 74 | android:id="@+id/tvServerConectado" |
75 | android:layout_width="match_parent" | 75 | android:layout_width="match_parent" |
76 | android:layout_height="wrap_content" | 76 | android:layout_height="wrap_content" |
77 | android:layout_margin="30dp" | 77 | android:layout_margin="30dp" |
78 | android:gravity="center" | 78 | android:gravity="center" |
79 | android:lines="2" | 79 | android:lines="2" |
80 | android:text="" | 80 | android:text="" |
81 | android:textColor="@android:color/black" | 81 | android:textColor="@android:color/black" |
82 | android:textSize="@dimen/textCantidad10" | 82 | android:textSize="@dimen/textCantidad10" |
83 | android:textStyle="bold" | 83 | android:textStyle="bold" |
84 | app:fontFamily="sans-serif-condensed" | 84 | app:fontFamily="sans-serif-condensed" |
85 | app:layout_constraintBottom_toTopOf="@+id/countriesList" | 85 | app:layout_constraintBottom_toTopOf="@+id/countriesList" |
86 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" /> | 86 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" /> |
87 | 87 | ||
88 | <TextView | 88 | <TextView |
89 | android:id="@+id/countriesList" | 89 | android:id="@+id/countriesList" |
90 | android:layout_width="0dp" | 90 | android:layout_width="0dp" |
91 | android:layout_height="wrap_content" | 91 | android:layout_height="wrap_content" |
92 | android:layout_marginTop="@dimen/MarginTopTitulos" | 92 | android:layout_marginTop="@dimen/MarginTopTitulos" |
93 | android:gravity="center" | 93 | android:gravity="center" |
94 | android:text="" | 94 | android:text="" |
95 | android:textColor="@android:color/black" | 95 | android:textColor="@android:color/black" |
96 | android:textSize="@dimen/SubTitulos10" | 96 | android:textSize="@dimen/SubTitulos10" |
97 | android:textStyle="bold" | 97 | android:textStyle="bold" |
98 | android:visibility="visible" | 98 | android:visibility="visible" |
99 | app:fontFamily="sans-serif-condensed" | 99 | app:fontFamily="sans-serif-condensed" |
100 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" | 100 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" |
101 | app:layout_constraintEnd_toEndOf="parent" | 101 | app:layout_constraintEnd_toEndOf="parent" |
102 | app:layout_constraintHorizontal_bias="0.0" | 102 | app:layout_constraintHorizontal_bias="0.0" |
103 | app:layout_constraintStart_toStartOf="parent" | 103 | app:layout_constraintStart_toStartOf="parent" |
104 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" | 104 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" |
105 | app:layout_constraintVertical_bias="0.106" /> | 105 | app:layout_constraintVertical_bias="0.106" /> |
106 | 106 | ||
107 | <Button | 107 | <Button |
108 | android:id="@+id/btnConfirmarAct" | 108 | android:id="@+id/btnConfirmarAct" |
109 | android:layout_width="0dp" | 109 | android:layout_width="0dp" |
110 | android:layout_height="wrap_content" | 110 | android:layout_height="wrap_content" |
111 | android:layout_margin="20dp" | 111 | android:layout_margin="20dp" |
112 | android:background="@drawable/boton_borde_redondeado" | 112 | android:background="@drawable/boton_borde_redondeado" |
113 | android:padding="10dp" | 113 | android:padding="10dp" |
114 | android:text="@string/btnConfirmarAct" | 114 | android:text="@string/btnConfirmarAct" |
115 | android:textColor="@android:color/white" | 115 | android:textColor="@android:color/white" |
116 | android:textSize="@dimen/SubTitulos10" | 116 | android:textSize="@dimen/SubTitulos10" |
117 | app:layout_constraintBottom_toBottomOf="parent" | 117 | app:layout_constraintBottom_toBottomOf="parent" |
118 | app:layout_constraintEnd_toEndOf="parent" | 118 | app:layout_constraintEnd_toEndOf="parent" |
119 | app:layout_constraintStart_toStartOf="parent" /> | 119 | app:layout_constraintStart_toStartOf="parent" /> |
120 | 120 | ||
121 | <ProgressBar | 121 | <ProgressBar |
122 | android:id="@+id/loading_view" | 122 | android:id="@+id/loading_view" |
123 | android:layout_width="wrap_content" | 123 | android:layout_width="wrap_content" |
124 | android:layout_height="wrap_content" | 124 | android:layout_height="wrap_content" |
125 | android:layout_marginStart="8dp" | 125 | android:layout_marginStart="8dp" |
126 | android:layout_marginLeft="8dp" | 126 | android:layout_marginLeft="8dp" |
127 | android:layout_marginTop="8dp" | 127 | android:layout_marginTop="8dp" |
128 | android:layout_marginEnd="8dp" | 128 | android:layout_marginEnd="8dp" |
129 | android:layout_marginRight="8dp" | 129 | android:layout_marginRight="8dp" |
130 | android:layout_marginBottom="8dp" | 130 | android:layout_marginBottom="8dp" |
131 | android:visibility="gone" | 131 | android:visibility="gone" |
132 | app:layout_constraintBottom_toBottomOf="parent" | 132 | app:layout_constraintBottom_toBottomOf="parent" |
133 | app:layout_constraintEnd_toEndOf="parent" | 133 | app:layout_constraintEnd_toEndOf="parent" |
134 | app:layout_constraintStart_toStartOf="parent" | 134 | app:layout_constraintStart_toStartOf="parent" |
135 | app:layout_constraintTop_toTopOf="parent" /> | 135 | app:layout_constraintTop_toTopOf="parent" /> |
136 | 136 | ||
137 | </androidx.constraintlayout.widget.ConstraintLayout> | 137 | </androidx.constraintlayout.widget.ConstraintLayout> |
138 | 138 |
app/src/main/res/layout-xlarge/fragment_configuracion.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 | 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 | tools:context=".UI.configuracion.ConfiguracionFragment"> | 7 | tools:context=".UI.configuracion.ConfiguracionFragment"> |
8 | 8 | ||
9 | <androidx.constraintlayout.widget.ConstraintLayout | 9 | <androidx.constraintlayout.widget.ConstraintLayout |
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 | tools:context=".UI.configuracion.ConfiguracionFragment"> | 12 | tools:context=".UI.configuracion.ConfiguracionFragment"> |
13 | 13 | ||
14 | 14 | ||
15 | <androidx.appcompat.widget.AppCompatTextView | 15 | <androidx.appcompat.widget.AppCompatTextView |
16 | android:id="@+id/textView2" | 16 | android:id="@+id/textView2" |
17 | android:layout_width="match_parent" | 17 | android:layout_width="match_parent" |
18 | android:layout_height="100dp" | 18 | android:layout_height="100dp" |
19 | android:layout_marginStart="8dp" | 19 | android:layout_marginStart="8dp" |
20 | android:layout_marginEnd="8dp" | 20 | android:layout_marginEnd="8dp" |
21 | android:gravity="center" | 21 | android:gravity="center" |
22 | android:lines="1" | 22 | android:lines="1" |
23 | android:text="@string/tvTituloConf" | 23 | android:text="@string/tvTituloConf" |
24 | android:textColor="@color/colorAccent" | 24 | android:textColor="@color/colorAccent" |
25 | android:textSize="60sp" | 25 | android:textSize="60sp" |
26 | 26 | ||
27 | app:fontFamily="sans-serif-condensed" | 27 | app:fontFamily="sans-serif-condensed" |
28 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | 28 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" |
29 | app:layout_constraintEnd_toEndOf="parent" | 29 | app:layout_constraintEnd_toEndOf="parent" |
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 | 32 | ||
33 | <TextView | 33 | <TextView |
34 | android:id="@+id/tvSeleccioneServidor" | 34 | android:id="@+id/tvSeleccioneServidor" |
35 | android:layout_width="0dp" | 35 | android:layout_width="0dp" |
36 | android:layout_height="wrap_content" | 36 | android:layout_height="wrap_content" |
37 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 37 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
38 | android:layout_marginTop="15dp" | 38 | android:layout_marginTop="15dp" |
39 | android:gravity="start" | 39 | android:gravity="start" |
40 | android:lines="1" | 40 | android:lines="1" |
41 | android:text="@string/tvSeleccioneServidor" | 41 | android:text="@string/tvSeleccioneServidor" |
42 | android:textColor="@android:color/black" | 42 | android:textColor="@android:color/black" |
43 | android:textSize="@dimen/SubTitulos10" | 43 | android:textSize="@dimen/SubTitulos10" |
44 | app:fontFamily="sans-serif-condensed" | 44 | app:fontFamily="sans-serif-condensed" |
45 | app:layout_constraintBottom_toTopOf="@+id/spServidor" | 45 | app:layout_constraintBottom_toTopOf="@+id/spServidor" |
46 | app:layout_constraintEnd_toEndOf="parent" | 46 | app:layout_constraintEnd_toEndOf="parent" |
47 | app:layout_constraintStart_toStartOf="parent" | 47 | app:layout_constraintStart_toStartOf="parent" |
48 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | 48 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> |
49 | 49 | ||
50 | <Spinner | 50 | <Spinner |
51 | android:id="@+id/spServidor" | 51 | android:id="@+id/spServidor" |
52 | style="@android:style/Widget.Holo.Light.Spinner" | 52 | style="@android:style/Widget.Holo.Light.Spinner" |
53 | android:layout_width="0dp" | 53 | android:layout_width="0dp" |
54 | android:layout_height="wrap_content" | 54 | android:layout_height="wrap_content" |
55 | android:elevation="5dp" | 55 | android:elevation="5dp" |
56 | android:textSize="@dimen/VentasDeposito10" | 56 | android:textSize="@dimen/VentasDeposito10" |
57 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | 57 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" |
58 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" | 58 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" |
59 | app:layout_constraintHorizontal_chainStyle="packed" | 59 | app:layout_constraintHorizontal_chainStyle="packed" |
60 | app:layout_constraintStart_toStartOf="parent" | 60 | app:layout_constraintStart_toStartOf="parent" |
61 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> | 61 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> |
62 | 62 | ||
63 | <Button | 63 | <Button |
64 | android:id="@+id/btnValidarServidor" | 64 | android:id="@+id/btnValidarServidor" |
65 | android:layout_width="wrap_content" | 65 | android:layout_width="wrap_content" |
66 | android:layout_height="wrap_content" | 66 | android:layout_height="wrap_content" |
67 | android:background="@drawable/boton_borde_redondeado" | 67 | android:background="@drawable/boton_borde_redondeado" |
68 | android:padding="10dp" | 68 | android:padding="10dp" |
69 | android:text="@string/btnValidarServidor" | 69 | android:text="@string/btnValidarServidor" |
70 | android:textColor="@android:color/white" | 70 | android:textColor="@android:color/white" |
71 | android:textSize="@dimen/SubTitulos10" | 71 | android:textSize="@dimen/SubTitulos10" |
72 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | 72 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" |
73 | app:layout_constraintEnd_toEndOf="parent" | 73 | app:layout_constraintEnd_toEndOf="parent" |
74 | app:layout_constraintHorizontal_chainStyle="packed" | 74 | app:layout_constraintHorizontal_chainStyle="packed" |
75 | app:layout_constraintStart_toEndOf="@id/spServidor" | 75 | app:layout_constraintStart_toEndOf="@id/spServidor" |
76 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> | 76 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> |
77 | 77 | ||
78 | <Button | 78 | <Button |
79 | android:id="@+id/btnAgregarServidor" | 79 | android:id="@+id/btnAgregarServidor" |
80 | android:layout_width="0dp" | 80 | android:layout_width="0dp" |
81 | android:layout_height="wrap_content" | 81 | android:layout_height="wrap_content" |
82 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 82 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
83 | android:layout_marginTop="10dp" | 83 | android:layout_marginTop="10dp" |
84 | android:layout_marginEnd="@dimen/MarginBotAgreSer" | 84 | android:layout_marginEnd="@dimen/MarginBotAgreSer" |
85 | android:background="@drawable/boton_borde_redondeado" | 85 | android:background="@drawable/boton_borde_redondeado" |
86 | android:padding="10dp" | 86 | android:padding="10dp" |
87 | android:text="@string/btnAgregarServidor" | 87 | android:text="@string/btnAgregarServidor" |
88 | android:textColor="@android:color/white" | 88 | android:textColor="@android:color/white" |
89 | android:textSize="@dimen/SubTitulos10" | 89 | android:textSize="@dimen/SubTitulos10" |
90 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" | 90 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" |
91 | app:layout_constraintEnd_toEndOf="parent" | 91 | app:layout_constraintEnd_toEndOf="parent" |
92 | app:layout_constraintStart_toStartOf="parent" | 92 | app:layout_constraintStart_toStartOf="parent" |
93 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> | 93 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> |
94 | 94 | ||
95 | 95 | ||
96 | <TextView | 96 | <TextView |
97 | android:id="@+id/tvUbicacionCarpetas" | 97 | android:id="@+id/tvUbicacionCarpetas" |
98 | android:layout_width="0dp" | 98 | android:layout_width="0dp" |
99 | android:layout_height="wrap_content" | 99 | android:layout_height="wrap_content" |
100 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 100 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
101 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 101 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
102 | android:gravity="start" | 102 | android:gravity="start" |
103 | android:lines="1" | 103 | android:lines="1" |
104 | android:text="@string/tvUbicacionCarpetas" | 104 | android:text="@string/tvUbicacionCarpetas" |
105 | android:textColor="@android:color/black" | 105 | android:textColor="@android:color/black" |
106 | android:textSize="@dimen/SubTitulos" | 106 | android:textSize="@dimen/SubTitulos" |
107 | android:visibility="gone" | 107 | android:visibility="gone" |
108 | app:fontFamily="sans-serif-condensed" | 108 | app:fontFamily="sans-serif-condensed" |
109 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" | 109 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" |
110 | app:layout_constraintEnd_toEndOf="parent" | 110 | app:layout_constraintEnd_toEndOf="parent" |
111 | app:layout_constraintStart_toStartOf="parent" | 111 | app:layout_constraintStart_toStartOf="parent" |
112 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> | 112 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> |
113 | 113 | ||
114 | <ImageButton | 114 | <ImageButton |
115 | android:id="@+id/ibSearch" | 115 | android:id="@+id/ibSearch" |
116 | android:layout_width="36dp" | 116 | android:layout_width="36dp" |
117 | android:layout_height="37dp" | 117 | android:layout_height="37dp" |
118 | android:layout_margin="10dp" | 118 | android:layout_margin="10dp" |
119 | android:background="@drawable/boton_borde_redondeado" | 119 | android:background="@drawable/boton_borde_redondeado" |
120 | android:padding="10dp" | 120 | android:padding="10dp" |
121 | android:src="@drawable/search" | 121 | android:src="@drawable/search" |
122 | android:textColor="@android:color/white" | 122 | android:textColor="@android:color/white" |
123 | android:visibility="gone" | 123 | android:visibility="gone" |
124 | app:layout_constraintEnd_toStartOf="@+id/etRuta" | 124 | app:layout_constraintEnd_toStartOf="@+id/etRuta" |
125 | app:layout_constraintStart_toStartOf="parent" | 125 | app:layout_constraintStart_toStartOf="parent" |
126 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | 126 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> |
127 | 127 | ||
128 | <EditText | 128 | <EditText |
129 | android:id="@+id/etRuta" | 129 | android:id="@+id/etRuta" |
130 | android:layout_width="0dp" | 130 | android:layout_width="0dp" |
131 | android:layout_height="wrap_content" | 131 | android:layout_height="wrap_content" |
132 | android:layout_marginTop="10dp" | 132 | android:layout_marginTop="10dp" |
133 | android:layout_marginEnd="10dp" | 133 | android:layout_marginEnd="10dp" |
134 | android:clickable="true" | 134 | android:clickable="true" |
135 | android:ems="10" | 135 | android:ems="10" |
136 | android:focusable="true" | 136 | android:focusable="true" |
137 | android:inputType="textPersonName" | 137 | android:inputType="textPersonName" |
138 | android:lines="1" | 138 | android:lines="1" |
139 | android:text="" | 139 | android:text="" |
140 | android:textSize="@dimen/NormalText" | 140 | android:textSize="@dimen/NormalText" |
141 | android:visibility="gone" | 141 | android:visibility="gone" |
142 | app:layout_constraintEnd_toEndOf="parent" | 142 | app:layout_constraintEnd_toEndOf="parent" |
143 | app:layout_constraintStart_toEndOf="@id/ibSearch" | 143 | app:layout_constraintStart_toEndOf="@id/ibSearch" |
144 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | 144 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> |
145 | 145 | ||
146 | <TextView | 146 | <TextView |
147 | android:id="@+id/tvActuFecha" | 147 | android:id="@+id/tvActuFecha" |
148 | android:layout_width="0dp" | 148 | android:layout_width="0dp" |
149 | android:layout_height="wrap_content" | 149 | android:layout_height="wrap_content" |
150 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 150 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
151 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 151 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
152 | android:gravity="start" | 152 | android:gravity="start" |
153 | android:lines="1" | 153 | android:lines="1" |
154 | android:text="@string/tvTituloArea" | 154 | android:text="@string/tvTituloArea" |
155 | android:textColor="@android:color/black" | 155 | android:textColor="@android:color/black" |
156 | android:textSize="@dimen/SubTitulos10" | 156 | android:textSize="@dimen/SubTitulos10" |
157 | app:fontFamily="sans-serif-condensed" | 157 | app:fontFamily="sans-serif-condensed" |
158 | app:layout_constraintEnd_toEndOf="parent" | 158 | app:layout_constraintEnd_toEndOf="parent" |
159 | app:layout_constraintStart_toStartOf="parent" | 159 | app:layout_constraintStart_toStartOf="parent" |
160 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> | 160 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> |
161 | 161 | ||
162 | <RadioGroup | 162 | <RadioGroup |
163 | android:id="@+id/rgFechaHora" | 163 | android:id="@+id/rgFechaHora" |
164 | android:layout_width="0dp" | 164 | android:layout_width="0dp" |
165 | android:layout_height="wrap_content" | 165 | android:layout_height="wrap_content" |
166 | 166 | ||
167 | android:gravity="center" | 167 | android:gravity="center" |
168 | android:orientation="horizontal" | 168 | android:orientation="horizontal" |
169 | app:layout_constraintEnd_toEndOf="parent" | 169 | app:layout_constraintEnd_toEndOf="parent" |
170 | app:layout_constraintStart_toStartOf="parent" | 170 | app:layout_constraintStart_toStartOf="parent" |
171 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> | 171 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> |
172 | 172 | ||
173 | <RadioButton | 173 | <RadioButton |
174 | android:id="@+id/rbVentas" | 174 | android:id="@+id/rbVentas" |
175 | android:layout_width="wrap_content" | 175 | android:layout_width="wrap_content" |
176 | android:layout_height="wrap_content" | 176 | android:layout_height="wrap_content" |
177 | android:layout_margin="5dp" | 177 | android:layout_margin="5dp" |
178 | android:checked="true" | 178 | android:checked="true" |
179 | android:padding="5dp" | 179 | android:padding="5dp" |
180 | android:text="@string/rbVentas" | 180 | android:text="@string/rbVentas" |
181 | android:textSize="@dimen/SubTitulos10" /> | 181 | android:textSize="@dimen/SubTitulos10" /> |
182 | 182 | ||
183 | <RadioButton | 183 | <RadioButton |
184 | android:id="@+id/rbDeposito" | 184 | android:id="@+id/rbDeposito" |
185 | android:layout_width="wrap_content" | 185 | android:layout_width="wrap_content" |
186 | android:layout_height="wrap_content" | 186 | android:layout_height="wrap_content" |
187 | android:layout_margin="5dp" | 187 | android:layout_margin="5dp" |
188 | android:checked="false" | 188 | android:checked="false" |
189 | android:padding="5dp" | 189 | android:padding="5dp" |
190 | android:text="@string/rbDeposito" | 190 | android:text="@string/rbDeposito" |
191 | android:textSize="@dimen/SubTitulos10" /> | 191 | android:textSize="@dimen/SubTitulos10" /> |
192 | 192 | ||
193 | </RadioGroup> | 193 | </RadioGroup> |
194 | 194 | ||
195 | <TextView | 195 | <TextView |
196 | android:id="@+id/tvLosProductos" | 196 | android:id="@+id/tvLosProductos" |
197 | android:layout_width="0dp" | 197 | android:layout_width="0dp" |
198 | android:layout_height="wrap_content" | 198 | android:layout_height="wrap_content" |
199 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 199 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
200 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | 200 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" |
201 | android:gravity="start" | 201 | android:gravity="start" |
202 | android:lines="1" | 202 | android:lines="1" |
203 | android:text="@string/tvLosProductos" | 203 | android:text="@string/tvLosProductos" |
204 | android:textColor="@android:color/black" | 204 | android:textColor="@android:color/black" |
205 | android:textSize="@dimen/SubTitulos10" | 205 | android:textSize="@dimen/SubTitulos10" |
206 | app:fontFamily="sans-serif-condensed" | 206 | app:fontFamily="sans-serif-condensed" |
207 | app:layout_constraintEnd_toEndOf="parent" | 207 | app:layout_constraintEnd_toEndOf="parent" |
208 | app:layout_constraintStart_toStartOf="parent" | 208 | app:layout_constraintStart_toStartOf="parent" |
209 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | 209 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> |
210 | 210 | ||
211 | <RadioGroup | 211 | <RadioGroup |
212 | android:id="@+id/rgLosProductos" | 212 | android:id="@+id/rgLosProductos" |
213 | android:layout_width="0dp" | 213 | android:layout_width="0dp" |
214 | android:layout_height="wrap_content" | 214 | android:layout_height="wrap_content" |
215 | 215 | ||
216 | android:gravity="center" | 216 | android:gravity="center" |
217 | android:orientation="vertical" | 217 | android:orientation="vertical" |
218 | app:layout_constraintEnd_toEndOf="parent" | 218 | app:layout_constraintEnd_toEndOf="parent" |
219 | app:layout_constraintStart_toStartOf="parent" | 219 | app:layout_constraintStart_toStartOf="parent" |
220 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> | 220 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> |
221 | 221 | ||
222 | <RadioButton | 222 | <RadioButton |
223 | android:id="@+id/rbProInclu" | 223 | android:id="@+id/rbProInclu" |
224 | android:layout_width="match_parent" | 224 | android:layout_width="match_parent" |
225 | android:layout_height="wrap_content" | 225 | android:layout_height="wrap_content" |
226 | android:layout_margin="@dimen/PadingCbyRb" | 226 | android:layout_margin="@dimen/PadingCbyRb" |
227 | android:checked="true" | 227 | android:checked="true" |
228 | android:padding="@dimen/PadingCbyRb" | 228 | android:padding="@dimen/PadingCbyRb" |
229 | android:text="@string/rbProInclu" | 229 | android:text="@string/rbProInclu" |
230 | android:textSize="@dimen/SubTitulos10" /> | 230 | android:textSize="@dimen/SubTitulos10" /> |
231 | 231 | ||
232 | <RadioButton | 232 | <RadioButton |
233 | android:id="@+id/rbProNoInclu" | 233 | android:id="@+id/rbProNoInclu" |
234 | android:layout_width="match_parent" | 234 | android:layout_width="match_parent" |
235 | android:layout_height="wrap_content" | 235 | android:layout_height="wrap_content" |
236 | android:layout_margin="@dimen/PadingCbyRb" | 236 | android:layout_margin="@dimen/PadingCbyRb" |
237 | android:checked="false" | 237 | android:checked="false" |
238 | android:padding="@dimen/PadingCbyRb" | 238 | android:padding="@dimen/PadingCbyRb" |
239 | android:text="@string/rbProNoInclu" | 239 | android:text="@string/rbProNoInclu" |
240 | android:textSize="@dimen/SubTitulos10" /> | 240 | android:textSize="@dimen/SubTitulos10" /> |
241 | 241 | ||
242 | </RadioGroup> | 242 | </RadioGroup> |
243 | 243 | ||
244 | <CheckBox | 244 | <CheckBox |
245 | android:id="@+id/cbHabiLectura" | 245 | android:id="@+id/cbHabiLectura" |
246 | android:layout_width="0dp" | 246 | android:layout_width="0dp" |
247 | android:layout_height="wrap_content" | 247 | android:layout_height="wrap_content" |
248 | android:layout_margin="@dimen/PadingCbyRb" | 248 | android:layout_margin="@dimen/PadingCbyRb" |
249 | android:padding="@dimen/PadingCbyRb" | 249 | android:padding="@dimen/PadingCbyRb" |
250 | android:text="@string/cbHabiLectura" | 250 | android:text="@string/cbHabiLectura" |
251 | android:textSize="@dimen/SubTitulos10" | 251 | android:textSize="@dimen/SubTitulos10" |
252 | app:layout_constraintEnd_toEndOf="parent" | 252 | app:layout_constraintEnd_toEndOf="parent" |
253 | app:layout_constraintStart_toStartOf="parent" | 253 | app:layout_constraintStart_toStartOf="parent" |
254 | app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" /> | 254 | app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" /> |
255 | 255 | ||
256 | <CheckBox | 256 | <CheckBox |
257 | android:id="@+id/cbMostrarStock" | 257 | android:id="@+id/cbMostrarStock" |
258 | android:layout_width="0dp" | 258 | android:layout_width="0dp" |
259 | android:layout_height="wrap_content" | 259 | android:layout_height="wrap_content" |
260 | android:layout_margin="@dimen/PadingCbyRb" | 260 | android:layout_margin="@dimen/PadingCbyRb" |
261 | android:padding="@dimen/PadingCbyRb" | 261 | android:padding="@dimen/PadingCbyRb" |
262 | android:text="@string/cbMostrarStock" | 262 | android:text="@string/cbMostrarStock" |
263 | android:textSize="@dimen/SubTitulos10" | 263 | android:textSize="@dimen/SubTitulos10" |
264 | app:layout_constraintEnd_toEndOf="parent" | 264 | app:layout_constraintEnd_toEndOf="parent" |
265 | app:layout_constraintStart_toStartOf="parent" | 265 | app:layout_constraintStart_toStartOf="parent" |
266 | app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" /> | 266 | app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" /> |
267 | 267 | ||
268 | 268 | ||
269 | <Button | 269 | <Button |
270 | android:id="@+id/btnAskTimeServer" | 270 | android:id="@+id/btnAskTimeServer" |
271 | android:layout_width="wrap_content" | 271 | android:layout_width="wrap_content" |
272 | android:layout_height="wrap_content" | 272 | android:layout_height="wrap_content" |
273 | android:layout_margin="10dp" | 273 | android:layout_margin="10dp" |
274 | android:background="@drawable/boton_borde_redondeado" | 274 | android:background="@drawable/boton_borde_redondeado" |
275 | android:checked="false" | 275 | android:checked="false" |
276 | android:padding="@dimen/PadingCbyRb" | 276 | android:padding="@dimen/PadingCbyRb" |
277 | android:text="@string/btnAskTimeServer" | 277 | android:text="@string/btnAskTimeServer" |
278 | android:textColor="@android:color/white" | 278 | android:textColor="@android:color/white" |
279 | android:textSize="@dimen/md_message_textsize" | 279 | android:textSize="@dimen/md_message_textsize" |
280 | android:visibility="gone" | 280 | android:visibility="gone" |
281 | app:layout_constraintStart_toStartOf="parent" | 281 | app:layout_constraintStart_toStartOf="parent" |
282 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> | 282 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> |
283 | 283 | ||
284 | <CheckBox | 284 | <CheckBox |
285 | android:id="@+id/cbAskTimeServerToStart" | 285 | android:id="@+id/cbAskTimeServerToStart" |
286 | android:layout_width="wrap_content" | 286 | android:layout_width="wrap_content" |
287 | android:layout_height="wrap_content" | 287 | android:layout_height="wrap_content" |
288 | android:layout_margin="@dimen/PadingCbyRb" | 288 | android:layout_margin="@dimen/PadingCbyRb" |
289 | android:checked="false" | 289 | android:checked="false" |
290 | android:padding="@dimen/PadingCbyRb" | 290 | android:padding="@dimen/PadingCbyRb" |
291 | android:text="@string/cbAskTimeServerToStart" | 291 | android:text="@string/cbAskTimeServerToStart" |
292 | android:textSize="@dimen/SubTitulos10" | 292 | android:textSize="@dimen/SubTitulos10" |
293 | android:visibility="visible" | 293 | android:visibility="invisible" |
294 | |||
295 | app:layout_constraintStart_toStartOf="parent" | 294 | app:layout_constraintStart_toStartOf="parent" |
296 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> | 295 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> |
297 | 296 | ||
298 | <Button | 297 | <Button |
299 | android:id="@+id/btnGuardar" | 298 | android:id="@+id/btnGuardar" |
300 | android:layout_width="wrap_content" | 299 | android:layout_width="wrap_content" |
301 | android:layout_height="wrap_content" | 300 | android:layout_height="wrap_content" |
302 | android:background="@drawable/boton_borde_redondeado" | 301 | android:background="@drawable/boton_borde_redondeado" |
303 | android:padding="10dp" | 302 | android:padding="10dp" |
304 | android:text="@string/btnGuardar" | 303 | android:text="@string/btnGuardar" |
305 | android:textColor="@android:color/white" | 304 | android:textColor="@android:color/white" |
306 | android:textSize="@dimen/SubTitulos10" | 305 | android:textSize="@dimen/SubTitulos10" |
307 | app:layout_constraintEnd_toEndOf="parent" | 306 | app:layout_constraintEnd_toEndOf="parent" |
308 | app:layout_constraintStart_toStartOf="parent" | 307 | app:layout_constraintStart_toStartOf="parent" |
309 | app:layout_constraintTop_toBottomOf="@+id/cbAskTimeServerToStart" /> | 308 | app:layout_constraintTop_toBottomOf="@+id/cbAskTimeServerToStart" /> |
310 | 309 | ||
311 | </androidx.constraintlayout.widget.ConstraintLayout> | 310 | </androidx.constraintlayout.widget.ConstraintLayout> |
312 | </ScrollView> | 311 | </ScrollView> |
313 | 312 | ||
314 | 313 |
app/src/main/res/layout-xlarge/fragment_main.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: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.appcompat.widget.AppCompatTextView | 8 | <androidx.appcompat.widget.AppCompatTextView |
9 | android:id="@+id/tvInvDinamicos" | 9 | android:id="@+id/tvInvDinamicos" |
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:textSize="60sp" | 12 | android:textSize="60sp" |
13 | android:gravity="start" | 13 | android:gravity="start" |
14 | android:lines="1" | 14 | android:lines="1" |
15 | android:padding="10dp" | 15 | android:padding="10dp" |
16 | android:text="@string/invDinamicoVenta" | 16 | android:text="@string/invDinamicoVenta" |
17 | android:textColor="@color/colorAccent" | 17 | android:textColor="@color/colorAccent" |
18 | android:visibility="visible" | 18 | android:visibility="visible" |
19 | app:fontFamily="sans-serif-condensed" | 19 | app:fontFamily="sans-serif-condensed" |
20 | app:layout_constraintEnd_toEndOf="parent" | 20 | app:layout_constraintEnd_toEndOf="parent" |
21 | app:layout_constraintStart_toStartOf="parent" | 21 | app:layout_constraintStart_toStartOf="parent" |
22 | app:layout_constraintTop_toTopOf="parent" /> | 22 | app:layout_constraintTop_toTopOf="parent" /> |
23 | 23 | ||
24 | <androidx.appcompat.widget.AppCompatImageButton | 24 | <androidx.appcompat.widget.AppCompatImageButton |
25 | android:id="@+id/ivSort19" | 25 | android:id="@+id/ivSort19" |
26 | android:layout_width="@dimen/icon_dim10" | 26 | android:layout_width="@dimen/icon_dim10" |
27 | android:layout_height="@dimen/icon_dim10" | 27 | android:layout_height="@dimen/icon_dim10" |
28 | android:layout_marginStart="10dp" | 28 | android:layout_marginStart="10dp" |
29 | android:padding="5dp" | 29 | android:padding="5dp" |
30 | android:src="@drawable/ic_sort19" | 30 | android:src="@drawable/ic_sort19" |
31 | android:visibility="gone" | 31 | android:visibility="gone" |
32 | app:layout_constraintHorizontal_bias="0.0" | 32 | app:layout_constraintHorizontal_bias="0.0" |
33 | app:layout_constraintHorizontal_chainStyle="packed" | 33 | app:layout_constraintHorizontal_chainStyle="packed" |
34 | app:layout_constraintStart_toStartOf="parent" | 34 | app:layout_constraintStart_toStartOf="parent" |
35 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 35 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
36 | 36 | ||
37 | <androidx.appcompat.widget.AppCompatImageButton | 37 | <androidx.appcompat.widget.AppCompatImageButton |
38 | android:id="@+id/ivSort91" | 38 | android:id="@+id/ivSort91" |
39 | android:layout_width="@dimen/icon_dim10" | 39 | android:layout_width="@dimen/icon_dim10" |
40 | android:layout_height="@dimen/icon_dim10" | 40 | android:layout_height="@dimen/icon_dim10" |
41 | android:layout_marginStart="10dp" | 41 | android:layout_marginStart="10dp" |
42 | android:padding="5dp" | 42 | android:padding="5dp" |
43 | android:src="@drawable/ic_sort91" | 43 | android:src="@drawable/ic_sort91" |
44 | android:visibility="gone" | 44 | android:visibility="gone" |
45 | app:layout_constraintHorizontal_chainStyle="packed" | 45 | app:layout_constraintHorizontal_chainStyle="packed" |
46 | app:layout_constraintStart_toStartOf="parent" | 46 | app:layout_constraintStart_toStartOf="parent" |
47 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 47 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
48 | 48 | ||
49 | <TextView | 49 | <TextView |
50 | android:id="@+id/tvTipo" | 50 | android:id="@+id/tvTipo" |
51 | android:layout_width="wrap_content" | 51 | android:layout_width="wrap_content" |
52 | android:layout_height="wrap_content" | 52 | android:layout_height="wrap_content" |
53 | android:layout_margin="5dp" | 53 | android:layout_margin="5dp" |
54 | android:layout_marginTop="12dp" | 54 | android:layout_marginTop="12dp" |
55 | android:text="Tipo:" | 55 | android:text="Tipo:" |
56 | android:textSize="@dimen/md_message_textsize" | 56 | android:textSize="@dimen/md_message_textsize" |
57 | android:visibility="gone" | 57 | android:visibility="gone" |
58 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" | 58 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" |
59 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> | 59 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> |
60 | 60 | ||
61 | <com.google.android.material.checkbox.MaterialCheckBox | 61 | <com.google.android.material.checkbox.MaterialCheckBox |
62 | android:id="@+id/cbVentas" | 62 | android:id="@+id/cbVentas" |
63 | android:layout_width="wrap_content" | 63 | android:layout_width="wrap_content" |
64 | android:layout_height="wrap_content" | 64 | android:layout_height="wrap_content" |
65 | android:layout_margin="5dp" | 65 | android:layout_margin="5dp" |
66 | android:layout_marginTop="12dp" | 66 | android:layout_marginTop="12dp" |
67 | android:checked="true" | 67 | android:checked="true" |
68 | android:text="Ventas" | 68 | android:text="Ventas" |
69 | android:textSize="@dimen/SubTitulos10" | 69 | android:textSize="@dimen/SubTitulos10" |
70 | android:visibility="gone" | 70 | android:visibility="gone" |
71 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" | 71 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" |
72 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 72 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
73 | 73 | ||
74 | <com.google.android.material.checkbox.MaterialCheckBox | 74 | <com.google.android.material.checkbox.MaterialCheckBox |
75 | android:id="@+id/cbDeposito" | 75 | android:id="@+id/cbDeposito" |
76 | android:layout_width="wrap_content" | 76 | android:layout_width="wrap_content" |
77 | android:layout_height="wrap_content" | 77 | android:layout_height="wrap_content" |
78 | android:layout_margin="5dp" | 78 | android:layout_margin="5dp" |
79 | android:layout_marginTop="12dp" | 79 | android:layout_marginTop="12dp" |
80 | android:checked="true" | 80 | android:checked="true" |
81 | android:text="Deposito" | 81 | android:text="Deposito" |
82 | android:textSize="@dimen/SubTitulos10" | 82 | android:textSize="@dimen/SubTitulos10" |
83 | android:visibility="gone" | 83 | android:visibility="gone" |
84 | app:layout_constraintEnd_toEndOf="parent" | 84 | app:layout_constraintEnd_toEndOf="parent" |
85 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 85 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
86 | 86 | ||
87 | <androidx.recyclerview.widget.RecyclerView | 87 | <androidx.recyclerview.widget.RecyclerView |
88 | android:id="@+id/rcInventario" | 88 | android:id="@+id/rcInventario" |
89 | android:layout_width="match_parent" | 89 | android:layout_width="match_parent" |
90 | android:layout_height="0dp" | 90 | android:layout_height="0dp" |
91 | android:background="@android:color/darker_gray" | 91 | android:background="@android:color/darker_gray" |
92 | android:scrollbars="vertical" | 92 | android:scrollbars="vertical" |
93 | android:visibility="gone" | 93 | android:visibility="gone" |
94 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | 94 | app:layout_constraintBottom_toTopOf="@+id/guideline6" |
95 | app:layout_constraintEnd_toEndOf="parent" | 95 | app:layout_constraintEnd_toEndOf="parent" |
96 | app:layout_constraintStart_toStartOf="parent" | 96 | app:layout_constraintStart_toStartOf="parent" |
97 | app:layout_constraintTop_toBottomOf="@id/ivSort19" | 97 | app:layout_constraintTop_toBottomOf="@id/ivSort19" |
98 | tools:listitem="@layout/item_principal" /> | 98 | tools:listitem="@layout/item_principal" /> |
99 | 99 | ||
100 | 100 | ||
101 | <androidx.appcompat.widget.AppCompatTextView | 101 | <androidx.appcompat.widget.AppCompatTextView |
102 | android:id="@+id/tvInvImportados" | 102 | android:id="@+id/tvInvImportados" |
103 | android:layout_width="match_parent" | 103 | android:layout_width="match_parent" |
104 | android:layout_height="110dp" | 104 | android:layout_height="110dp" |
105 | android:textSize="60sp" | 105 | android:textSize="60sp" |
106 | android:gravity="start" | 106 | android:gravity="start" |
107 | android:lines="1" | 107 | android:lines="1" |
108 | android:padding="10dp" | 108 | android:padding="10dp" |
109 | android:text="@string/invDinamicoCompra" | 109 | android:text="@string/invDinamicoCompra" |
110 | android:textColor="@color/colorAccent" | 110 | android:textColor="@color/colorAccent" |
111 | android:visibility="visible" | 111 | android:visibility="visible" |
112 | app:fontFamily="sans-serif-condensed" | 112 | app:fontFamily="sans-serif-condensed" |
113 | app:layout_constraintBottom_toBottomOf="parent" | 113 | app:layout_constraintBottom_toBottomOf="parent" |
114 | app:layout_constraintEnd_toEndOf="parent" | 114 | app:layout_constraintEnd_toEndOf="parent" |
115 | app:layout_constraintStart_toStartOf="parent" | 115 | app:layout_constraintStart_toStartOf="parent" |
116 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" | 116 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" |
117 | app:layout_constraintVertical_bias="0.0" /> | 117 | app:layout_constraintVertical_bias="0.0" /> |
118 | 118 | ||
119 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | 119 | <androidx.appcompat.widget.AppCompatImageButton |
120 | <!-- android:id="@+id/ivSort19II"--> | 120 | android:id="@+id/ivSort19II" |
121 | <!-- android:layout_width="@dimen/icon_dim10"--> | 121 | android:layout_width="@dimen/icon_dim10" |
122 | <!-- android:layout_height="@dimen/icon_dim10"--> | 122 | android:layout_height="@dimen/icon_dim10" |
123 | <!-- android:layout_marginStart="10dp"--> | 123 | android:layout_marginStart="10dp" |
124 | <!-- android:padding="5dp"--> | 124 | android:padding="5dp" |
125 | <!-- android:src="@drawable/ic_sort19"--> | 125 | android:src="@drawable/ic_sort19" |
126 | <!-- android:visibility="invisible"--> | 126 | android:visibility="gone" |
127 | <!-- app:layout_constraintHorizontal_bias="0.0"--> | 127 | app:layout_constraintStart_toStartOf="parent" |
128 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | 128 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" |
129 | <!-- app:layout_constraintStart_toStartOf="parent"--> | 129 | app:layout_constraintBottom_toTopOf="@+id/rcInventarioII" /> |
130 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
131 | 130 | ||
132 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | 131 | <androidx.appcompat.widget.AppCompatImageButton |
133 | <!-- android:id="@+id/ivSort91II"--> | 132 | android:id="@+id/ivSort91II" |
134 | <!-- android:layout_width="@dimen/icon_dim10"--> | 133 | android:layout_width="@dimen/icon_dim10" |
135 | <!-- android:layout_height="@dimen/icon_dim10"--> | 134 | android:layout_height="@dimen/icon_dim10" |
136 | <!-- android:layout_marginStart="10dp"--> | 135 | android:layout_marginStart="10dp" |
137 | <!-- android:padding="5dp"--> | 136 | android:padding="5dp" |
138 | <!-- android:src="@drawable/ic_sort91"--> | 137 | android:src="@drawable/ic_sort91" |
139 | <!-- android:visibility="invisible"--> | 138 | android:visibility="gone" |
140 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | 139 | app:layout_constraintStart_toStartOf="parent" |
141 | <!-- app:layout_constraintStart_toStartOf="parent"--> | 140 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" |
142 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | 141 | app:layout_constraintBottom_toTopOf="@+id/rcInventarioII"/> |
143 | 142 | ||
144 | <androidx.recyclerview.widget.RecyclerView | 143 | <androidx.recyclerview.widget.RecyclerView |
145 | android:id="@+id/rcInventarioII" | 144 | android:id="@+id/rcInventarioII" |
146 | android:layout_width="match_parent" | 145 | android:layout_width="match_parent" |
147 | android:layout_height="0dp" | 146 | android:layout_height="0dp" |
148 | android:background="@android:color/darker_gray" | 147 | android:background="@android:color/darker_gray" |
149 | android:scrollbars="vertical" | 148 | android:scrollbars="vertical" |
150 | android:visibility="gone" | 149 | android:visibility="gone" |
151 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | 150 | app:layout_constraintEnd_toEndOf="parent" |
152 | app:layout_constraintEnd_toEndOf="parent" | 151 | app:layout_constraintStart_toStartOf="parent" |
153 | app:layout_constraintStart_toStartOf="parent" | 152 | app:layout_constraintTop_toBottomOf="@id/ivSort91II" |
154 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" | 153 | tools:listitem="@layout/item_principal" |
155 | tools:listitem="@layout/item_principal" /> | 154 | app:layout_constraintBottom_toTopOf="@+id/guideline1"/> |
156 | 155 | ||
157 | <androidx.constraintlayout.widget.Guideline | 156 | <androidx.constraintlayout.widget.Guideline |
158 | android:id="@+id/guideline6" | 157 | android:id="@+id/guideline6" |
159 | android:layout_width="wrap_content" | 158 | android:layout_width="wrap_content" |
160 | android:layout_height="wrap_content" | 159 | android:layout_height="wrap_content" |
161 | android:orientation="horizontal" | 160 | android:orientation="horizontal" |
162 | app:layout_constraintGuide_percent="0.97" /> | 161 | app:layout_constraintGuide_percent="0.97" /> |
163 | 162 | ||
164 | <ImageView | 163 | <ImageView |
165 | android:id="@+id/ivPortada" | 164 | android:id="@+id/ivPortada" |
166 | android:layout_width="730dp" | 165 | android:layout_width="730dp" |
167 | android:layout_height="491dp" | 166 | android:layout_height="491dp" |
168 | android:elevation="10dp" | 167 | android:elevation="10dp" |
169 | android:visibility="visible" | 168 | android:visibility="visible" |
170 | app:layout_constraintBottom_toBottomOf="parent" | 169 | app:layout_constraintBottom_toBottomOf="parent" |
171 | app:layout_constraintEnd_toEndOf="parent" | 170 | app:layout_constraintEnd_toEndOf="parent" |
172 | app:layout_constraintStart_toStartOf="parent" | 171 | app:layout_constraintStart_toStartOf="parent" |
173 | app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" | 172 | app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" |
174 | tools:srcCompat="@drawable/imagen_portada" /> | 173 | tools:srcCompat="@drawable/imagen_portada" /> |
175 | </androidx.constraintlayout.widget.ConstraintLayout> | 174 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-xlarge/nav_header_main.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <LinearLayout 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="@dimen/nav_header_height10" | 5 | android:layout_height="@dimen/nav_header_height10" |
6 | android:background="@drawable/side_nav_bar" | 6 | android:background="@drawable/side_nav_bar" |
7 | android:gravity="bottom" | 7 | android:gravity="bottom" |
8 | android:orientation="vertical" | 8 | android:orientation="vertical" |
9 | android:paddingLeft="@dimen/activity_horizontal_margin" | 9 | android:paddingLeft="@dimen/activity_horizontal_margin" |
10 | android:paddingTop="@dimen/activity_vertical_margin" | 10 | android:paddingTop="@dimen/activity_vertical_margin" |
11 | android:paddingRight="@dimen/activity_horizontal_margin" | 11 | android:paddingRight="@dimen/activity_horizontal_margin" |
12 | android:paddingBottom="@dimen/activity_vertical_margin" | 12 | android:paddingBottom="@dimen/activity_vertical_margin" |
13 | android:theme="@style/ThemeOverlay.AppCompat.Dark"> | 13 | android:theme="@style/ThemeOverlay.AppCompat.Dark"> |
14 | 14 | ||
15 | <ImageView | 15 | <!-- <ImageView--> |
16 | android:id="@+id/imageView" | 16 | <!-- android:id="@+id/imageView"--> |
17 | android:layout_width="246dp" | 17 | <!-- android:layout_width="246dp"--> |
18 | android:layout_height="136dp" | 18 | <!-- android:layout_height="136dp"--> |
19 | android:contentDescription=" " | 19 | <!-- android:contentDescription=" "--> |
20 | android:paddingTop="@dimen/nav_header_vertical_spacing" | 20 | <!-- android:paddingTop="@dimen/nav_header_vertical_spacing"--> |
21 | app:srcCompat="@drawable/logo" /> | 21 | <!-- app:srcCompat="@drawable/logo" />--> |
22 | 22 | ||
23 | <TextView | 23 | <TextView |
24 | android:layout_width="match_parent" | 24 | android:layout_width="wrap_content" |
25 | android:layout_height="wrap_content" | 25 | android:layout_height="wrap_content" |
26 | android:paddingTop="@dimen/nav_header_vertical_spacing" | 26 | android:paddingTop="@dimen/nav_header_vertical_spacing" |
27 | android:textSize="@dimen/SubTitulos10" | 27 | android:textSize="90sp" |
28 | android:text="Debo Inventario" | 28 | android:text="DEBO Inventario" |
29 | android:textAppearance="@style/TextAppearance.AppCompat.Body1" /> | 29 | android:textAppearance="@style/TextAppearance.AppCompat.Body1" /> |
30 | 30 | ||
31 | <TextView | 31 | <TextView |
32 | android:id="@+id/textView1" | 32 | android:id="@+id/textView1" |
33 | android:layout_width="wrap_content" | 33 | android:layout_width="wrap_content" |
34 | android:layout_height="wrap_content" | 34 | android:layout_height="wrap_content" |
35 | android:text="FocaSoftware SA" | 35 | android:text="FocaSoftware SA" |
36 | android:textSize="@dimen/SubTitulos10"/> | 36 | android:textSize="@dimen/tvServerConectado"/> |
37 | </LinearLayout> | 37 | </LinearLayout> |
app/src/main/res/layout/fragment_actua_maestros.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:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> | 7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> |
8 | 8 | ||
9 | <androidx.appcompat.widget.AppCompatTextView | 9 | <androidx.appcompat.widget.AppCompatTextView |
10 | android:id="@+id/tvActMaestros" | 10 | android:id="@+id/tvActMaestros" |
11 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" |
12 | android:layout_height="wrap_content" | 12 | android:layout_height="wrap_content" |
13 | android:layout_marginTop="@dimen/MarginTopTitulos" | 13 | android:layout_marginTop="@dimen/MarginTopTitulos" |
14 | android:gravity="center" | 14 | android:gravity="center" |
15 | android:text="@string/tvActMaestros" | 15 | android:text="@string/tvActMaestros" |
16 | android:textColor="@color/colorAccent" | 16 | android:textColor="@color/colorAccent" |
17 | android:textSize="@dimen/Titulos" | 17 | android:textSize="@dimen/Titulos" |
18 | app:fontFamily="sans-serif-condensed" | 18 | app:fontFamily="sans-serif-condensed" |
19 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | 19 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" |
20 | app:layout_constraintEnd_toEndOf="parent" | 20 | app:layout_constraintEnd_toEndOf="parent" |
21 | app:layout_constraintStart_toStartOf="parent" | 21 | app:layout_constraintStart_toStartOf="parent" |
22 | app:layout_constraintTop_toTopOf="parent" /> | 22 | app:layout_constraintTop_toTopOf="parent" /> |
23 | 23 | ||
24 | <TextView | 24 | <TextView |
25 | android:id="@+id/tvSeleccioneServidor" | 25 | android:id="@+id/tvSeleccioneServidor" |
26 | android:layout_width="0dp" | 26 | android:layout_width="0dp" |
27 | android:layout_height="wrap_content" | 27 | android:layout_height="wrap_content" |
28 | android:layout_margin="30dp" | 28 | |
29 | android:layout_marginTop="40dp" | ||
29 | android:gravity="center" | 30 | android:gravity="center" |
30 | android:lines="2" | 31 | android:lines="2" |
31 | android:text="@string/tvMedio" | 32 | android:text="@string/tvMedio" |
32 | android:textColor="@android:color/black" | 33 | android:textColor="@android:color/black" |
33 | android:textSize="@dimen/SubTitulos" | 34 | android:textSize="@dimen/SubTitulos" |
34 | app:fontFamily="sans-serif-condensed" | 35 | app:fontFamily="sans-serif-condensed" |
35 | app:layout_constraintEnd_toEndOf="parent" | 36 | app:layout_constraintEnd_toEndOf="parent" |
36 | app:layout_constraintStart_toStartOf="parent" | 37 | app:layout_constraintStart_toStartOf="parent" |
37 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> | 38 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> |
38 | 39 | ||
39 | <RadioGroup | 40 | <RadioGroup |
40 | android:id="@+id/rgTipoActualizacion" | 41 | android:id="@+id/rgTipoActualizacion" |
41 | android:layout_width="0dp" | 42 | android:layout_width="0dp" |
42 | android:layout_height="wrap_content" | 43 | android:layout_height="wrap_content" |
43 | android:layout_margin="25dp" | 44 | android:layout_margin="25dp" |
45 | android:layout_marginTop="100dp" | ||
44 | android:gravity="center" | 46 | android:gravity="center" |
45 | android:orientation="horizontal" | 47 | android:orientation="horizontal" |
46 | app:layout_constraintEnd_toEndOf="parent" | 48 | app:layout_constraintEnd_toEndOf="parent" |
49 | app:layout_constraintHorizontal_bias="0.32" | ||
47 | app:layout_constraintStart_toStartOf="parent" | 50 | app:layout_constraintStart_toStartOf="parent" |
48 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> | 51 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> |
49 | 52 | ||
50 | <RadioButton | 53 | <RadioButton |
51 | android:id="@+id/obPorWifi" | 54 | android:id="@+id/obPorWifi" |
52 | android:layout_width="wrap_content" | 55 | android:layout_width="wrap_content" |
53 | android:layout_height="wrap_content" | 56 | android:layout_height="wrap_content" |
54 | android:layout_margin="5dp" | 57 | android:layout_margin="5dp" |
55 | android:checked="true" | 58 | android:checked="true" |
56 | android:padding="5dp" | 59 | android:padding="5dp" |
57 | android:text="@string/obPorWifi" | 60 | android:text="@string/obPorWifi" |
58 | android:textSize="@dimen/NormalText" /> | 61 | android:textSize="@dimen/NormalText" /> |
59 | 62 | ||
60 | <RadioButton | 63 | <RadioButton |
61 | android:id="@+id/obImpInventarios" | 64 | android:id="@+id/obImpInventarios" |
62 | android:layout_width="wrap_content" | 65 | android:layout_width="wrap_content" |
63 | android:layout_height="wrap_content" | 66 | android:layout_height="wrap_content" |
64 | android:layout_margin="5dp" | 67 | android:layout_margin="5dp" |
65 | android:checked="false" | 68 | android:checked="false" |
66 | android:padding="5dp" | 69 | android:padding="5dp" |
67 | android:text="@string/obViaArchivo" | 70 | android:text="@string/obViaArchivo" |
68 | android:textSize="@dimen/NormalText" /> | 71 | android:textSize="@dimen/NormalText" /> |
69 | 72 | ||
70 | </RadioGroup> | 73 | </RadioGroup> |
71 | 74 | ||
72 | <TextView | 75 | <TextView |
73 | android:id="@+id/tvServerConectado" | 76 | android:id="@+id/tvServerConectado" |
74 | android:layout_width="match_parent" | 77 | android:layout_width="match_parent" |
75 | android:layout_height="wrap_content" | 78 | android:layout_height="wrap_content" |
76 | android:layout_margin="30dp" | 79 | android:layout_margin="30dp" |
77 | android:gravity="center" | 80 | android:gravity="center" |
78 | android:lines="2" | 81 | android:lines="2" |
79 | android:text="" | 82 | android:text="" |
80 | android:textColor="@android:color/black" | 83 | android:textColor="@android:color/black" |
81 | android:textSize="@dimen/SubTitulos" | 84 | android:textSize="@dimen/SubTitulos" |
82 | app:fontFamily="sans-serif-condensed" | 85 | app:fontFamily="sans-serif-condensed" |
83 | app:layout_constraintBottom_toTopOf="@+id/countriesList" | 86 | app:layout_constraintBottom_toTopOf="@+id/countriesList" |
84 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" /> | 87 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" /> |
85 | 88 | ||
86 | <TextView | 89 | <TextView |
87 | android:id="@+id/countriesList" | 90 | android:id="@+id/countriesList" |
88 | android:layout_width="0dp" | 91 | android:layout_width="0dp" |
89 | android:layout_height="wrap_content" | 92 | android:layout_height="wrap_content" |
90 | android:layout_marginTop="@dimen/MarginTopTitulos" | 93 | android:layout_marginTop="@dimen/MarginTopTitulos" |
91 | android:gravity="center" | 94 | android:gravity="center" |
92 | android:text="" | 95 | android:text="" |
93 | android:textColor="@android:color/black" | 96 | android:textColor="@android:color/black" |
94 | android:textSize="@dimen/SubTitulos" | 97 | android:textSize="@dimen/SubTitulos" |
95 | android:visibility="visible" | 98 | android:visibility="visible" |
96 | app:fontFamily="sans-serif-condensed" | 99 | app:fontFamily="sans-serif-condensed" |
97 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" | 100 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" |
98 | app:layout_constraintEnd_toEndOf="parent" | 101 | app:layout_constraintEnd_toEndOf="parent" |
99 | app:layout_constraintHorizontal_bias="0.0" | 102 | app:layout_constraintHorizontal_bias="0.0" |
100 | app:layout_constraintStart_toStartOf="parent" | 103 | app:layout_constraintStart_toStartOf="parent" |
101 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" | 104 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" |
102 | app:layout_constraintVertical_bias="0.106" /> | 105 | app:layout_constraintVertical_bias="0.312" /> |
103 | 106 | ||
104 | <Button | 107 | <Button |
105 | android:id="@+id/btnConfirmarAct" | 108 | android:id="@+id/btnConfirmarAct" |
106 | android:layout_width="0dp" | 109 | android:layout_width="0dp" |
107 | android:layout_height="wrap_content" | 110 | android:layout_height="wrap_content" |
108 | android:layout_margin="20dp" | 111 | android:layout_margin="20dp" |
109 | android:text="@string/btnConfirmarAct" | 112 | android:text="@string/btnConfirmarAct" |
110 | android:textSize="@dimen/NormalText" | 113 | android:textSize="@dimen/NormalText" |
111 | android:textColor="@android:color/white" | 114 | android:textColor="@android:color/white" |
112 | android:padding="10dp" | 115 | android:padding="10dp" |
113 | android:background="@drawable/boton_borde_redondeado" | 116 | android:background="@drawable/boton_borde_redondeado" |
114 | app:layout_constraintBottom_toBottomOf="parent" | 117 | app:layout_constraintBottom_toBottomOf="parent" |
115 | app:layout_constraintEnd_toEndOf="parent" | 118 | app:layout_constraintEnd_toEndOf="parent" |
116 | app:layout_constraintStart_toStartOf="parent" /> | 119 | app:layout_constraintStart_toStartOf="parent" /> |
117 | 120 | ||
118 | <ProgressBar | 121 | <ProgressBar |
119 | android:id="@+id/loading_view" | 122 | android:id="@+id/loading_view" |
120 | android:layout_width="wrap_content" | 123 | android:layout_width="wrap_content" |
121 | android:layout_height="wrap_content" | 124 | android:layout_height="wrap_content" |
122 | android:layout_marginStart="8dp" | 125 | android:layout_marginStart="8dp" |
123 | android:layout_marginLeft="8dp" | ||
124 | android:layout_marginTop="8dp" | 126 | android:layout_marginTop="8dp" |
125 | android:layout_marginEnd="8dp" | 127 | android:layout_marginEnd="8dp" |
126 | android:layout_marginRight="8dp" | ||
127 | android:layout_marginBottom="8dp" | 128 | android:layout_marginBottom="8dp" |
128 | android:visibility="invisible" | 129 | android:visibility="invisible" |
129 | app:layout_constraintBottom_toBottomOf="parent" | 130 | app:layout_constraintBottom_toBottomOf="parent" |
130 | app:layout_constraintEnd_toEndOf="parent" | 131 | app:layout_constraintEnd_toEndOf="parent" |
132 | app:layout_constraintHorizontal_bias="0.524" | ||
131 | app:layout_constraintStart_toStartOf="parent" | 133 | app:layout_constraintStart_toStartOf="parent" |
132 | app:layout_constraintTop_toTopOf="parent" /> | 134 | app:layout_constraintTop_toTopOf="parent" |
135 | app:layout_constraintVertical_bias="0.619" /> | ||
133 | 136 |
app/src/main/res/layout/fragment_configuracion.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:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="wrap_content" | 6 | android:layout_height="wrap_content" |
7 | tools:context=".UI.configuracion.ConfiguracionFragment"> | 7 | tools:context=".UI.configuracion.ConfiguracionFragment"> |
8 | 8 | ||
9 | 9 | ||
10 | <androidx.appcompat.widget.AppCompatTextView | 10 | <androidx.appcompat.widget.AppCompatTextView |
11 | android:id="@+id/textView2" | 11 | android:id="@+id/textView2" |
12 | android:layout_width="match_parent" | 12 | android:layout_width="match_parent" |
13 | android:layout_height="wrap_content" | 13 | android:layout_height="wrap_content" |
14 | android:layout_marginTop="@dimen/MarginTopTitulos" | 14 | android:layout_marginTop="@dimen/MarginTopTitulos" |
15 | android:gravity="center" | 15 | android:gravity="center" |
16 | android:lines="1" | 16 | android:lines="1" |
17 | android:text="@string/tvTituloConf" | 17 | android:text="@string/tvTituloConf" |
18 | android:textColor="@color/colorAccent" | 18 | android:textColor="@color/colorAccent" |
19 | android:textSize="@dimen/Titulos" | 19 | android:textSize="@dimen/Titulos" |
20 | app:fontFamily="sans-serif-condensed" | 20 | app:fontFamily="sans-serif-condensed" |
21 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | 21 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" |
22 | app:layout_constraintEnd_toEndOf="parent" | 22 | app:layout_constraintEnd_toEndOf="parent" |
23 | app:layout_constraintStart_toStartOf="parent" | 23 | app:layout_constraintStart_toStartOf="parent" |
24 | app:layout_constraintTop_toTopOf="parent" /> | 24 | app:layout_constraintTop_toTopOf="parent" /> |
25 | 25 | ||
26 | <TextView | 26 | <TextView |
27 | android:id="@+id/tvSeleccioneServidor" | 27 | android:id="@+id/tvSeleccioneServidor" |
28 | android:layout_width="0dp" | 28 | android:layout_width="0dp" |
29 | android:layout_height="wrap_content" | 29 | android:layout_height="wrap_content" |
30 | 30 | ||
31 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 31 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
32 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 32 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
33 | android:gravity="start" | 33 | android:gravity="start" |
34 | android:lines="1" | 34 | android:lines="1" |
35 | android:text="@string/tvSeleccioneServidor" | 35 | android:text="@string/tvSeleccioneServidor" |
36 | android:textColor="@android:color/black" | 36 | android:textColor="@android:color/black" |
37 | android:textSize="@dimen/SubTitulos" | 37 | android:textSize="@dimen/SubTitulos" |
38 | app:fontFamily="sans-serif-condensed" | 38 | app:fontFamily="sans-serif-condensed" |
39 | app:layout_constraintBottom_toTopOf="@+id/spServidor" | 39 | app:layout_constraintBottom_toTopOf="@+id/spServidor" |
40 | app:layout_constraintEnd_toEndOf="parent" | 40 | app:layout_constraintEnd_toEndOf="parent" |
41 | app:layout_constraintStart_toStartOf="parent" | 41 | app:layout_constraintStart_toStartOf="parent" |
42 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | 42 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> |
43 | 43 | ||
44 | <Spinner | 44 | <Spinner |
45 | android:id="@+id/spServidor" | 45 | android:id="@+id/spServidor" |
46 | style="@android:style/Widget.Holo.Light.Spinner" | 46 | style="@android:style/Widget.Holo.Light.Spinner" |
47 | android:layout_width="0dp" | 47 | android:layout_width="0dp" |
48 | android:layout_height="wrap_content" | 48 | android:layout_height="wrap_content" |
49 | android:elevation="5dp" | 49 | android:elevation="5dp" |
50 | android:textSize="@dimen/NormalText" | 50 | android:textSize="@dimen/NormalText" |
51 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | 51 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" |
52 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" | 52 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" |
53 | app:layout_constraintHorizontal_chainStyle="packed" | 53 | app:layout_constraintHorizontal_chainStyle="packed" |
54 | app:layout_constraintStart_toStartOf="parent" | 54 | app:layout_constraintStart_toStartOf="parent" |
55 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> | 55 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> |
56 | 56 | ||
57 | <Button | 57 | <Button |
58 | android:id="@+id/btnValidarServidor" | 58 | android:id="@+id/btnValidarServidor" |
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:background="@drawable/boton_borde_redondeado" | 61 | android:background="@drawable/boton_borde_redondeado" |
62 | android:padding="10dp" | 62 | android:padding="10dp" |
63 | android:text="@string/btnValidarServidor" | 63 | android:text="@string/btnValidarServidor" |
64 | android:textColor="@android:color/white" | 64 | android:textColor="@android:color/white" |
65 | android:textSize="@dimen/NormalText" | 65 | android:textSize="@dimen/NormalText" |
66 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | 66 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" |
67 | app:layout_constraintEnd_toEndOf="parent" | 67 | app:layout_constraintEnd_toEndOf="parent" |
68 | app:layout_constraintHorizontal_chainStyle="packed" | 68 | app:layout_constraintHorizontal_chainStyle="packed" |
69 | app:layout_constraintStart_toEndOf="@id/spServidor" | 69 | app:layout_constraintStart_toEndOf="@id/spServidor" |
70 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> | 70 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> |
71 | 71 | ||
72 | <Button | 72 | <Button |
73 | android:id="@+id/btnAgregarServidor" | 73 | android:id="@+id/btnAgregarServidor" |
74 | android:layout_width="0dp" | 74 | android:layout_width="0dp" |
75 | android:layout_height="wrap_content" | 75 | android:layout_height="wrap_content" |
76 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 76 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
77 | android:layout_marginEnd="@dimen/MarginBotAgreSer" | 77 | android:layout_marginEnd="@dimen/MarginBotAgreSer" |
78 | android:background="@drawable/boton_borde_redondeado" | 78 | android:background="@drawable/boton_borde_redondeado" |
79 | android:padding="10dp" | 79 | android:padding="10dp" |
80 | android:text="@string/btnAgregarServidor" | 80 | android:text="@string/btnAgregarServidor" |
81 | android:textColor="@android:color/white" | 81 | android:textColor="@android:color/white" |
82 | android:textSize="@dimen/NormalText" | 82 | android:textSize="@dimen/NormalText" |
83 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" | 83 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" |
84 | app:layout_constraintEnd_toEndOf="parent" | 84 | app:layout_constraintEnd_toEndOf="parent" |
85 | app:layout_constraintStart_toStartOf="parent" | 85 | app:layout_constraintStart_toStartOf="parent" |
86 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> | 86 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> |
87 | 87 | ||
88 | 88 | ||
89 | <TextView | 89 | <TextView |
90 | android:id="@+id/tvUbicacionCarpetas" | 90 | android:id="@+id/tvUbicacionCarpetas" |
91 | android:layout_width="0dp" | 91 | android:layout_width="0dp" |
92 | android:layout_height="wrap_content" | 92 | android:layout_height="wrap_content" |
93 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 93 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
94 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 94 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
95 | android:gravity="start" | 95 | android:gravity="start" |
96 | android:lines="1" | 96 | android:lines="1" |
97 | android:text="@string/tvUbicacionCarpetas" | 97 | android:text="@string/tvUbicacionCarpetas" |
98 | android:textColor="@android:color/black" | 98 | android:textColor="@android:color/black" |
99 | android:textSize="@dimen/SubTitulos" | 99 | android:textSize="@dimen/SubTitulos" |
100 | android:visibility="gone" | 100 | android:visibility="gone" |
101 | app:fontFamily="sans-serif-condensed" | 101 | app:fontFamily="sans-serif-condensed" |
102 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" | 102 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" |
103 | app:layout_constraintEnd_toEndOf="parent" | 103 | app:layout_constraintEnd_toEndOf="parent" |
104 | app:layout_constraintStart_toStartOf="parent" | 104 | app:layout_constraintStart_toStartOf="parent" |
105 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> | 105 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> |
106 | 106 | ||
107 | <ImageButton | 107 | <ImageButton |
108 | android:id="@+id/ibSearch" | 108 | android:id="@+id/ibSearch" |
109 | android:layout_width="36dp" | 109 | android:layout_width="36dp" |
110 | android:layout_height="37dp" | 110 | android:layout_height="37dp" |
111 | android:layout_margin="10dp" | 111 | android:layout_margin="10dp" |
112 | android:background="@drawable/boton_borde_redondeado" | 112 | android:background="@drawable/boton_borde_redondeado" |
113 | android:padding="10dp" | 113 | android:padding="10dp" |
114 | android:src="@drawable/search" | 114 | android:src="@drawable/search" |
115 | android:textColor="@android:color/white" | 115 | android:textColor="@android:color/white" |
116 | android:visibility="gone" | 116 | android:visibility="gone" |
117 | app:layout_constraintEnd_toStartOf="@+id/etRuta" | 117 | app:layout_constraintEnd_toStartOf="@+id/etRuta" |
118 | app:layout_constraintStart_toStartOf="parent" | 118 | app:layout_constraintStart_toStartOf="parent" |
119 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | 119 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> |
120 | 120 | ||
121 | <EditText | 121 | <EditText |
122 | android:id="@+id/etRuta" | 122 | android:id="@+id/etRuta" |
123 | android:layout_width="0dp" | 123 | android:layout_width="0dp" |
124 | android:layout_height="wrap_content" | 124 | android:layout_height="wrap_content" |
125 | android:layout_marginTop="10dp" | 125 | android:layout_marginTop="10dp" |
126 | android:layout_marginEnd="10dp" | 126 | android:layout_marginEnd="10dp" |
127 | android:clickable="true" | 127 | android:clickable="true" |
128 | android:ems="10" | 128 | android:ems="10" |
129 | android:focusable="true" | 129 | android:focusable="true" |
130 | android:inputType="textPersonName" | 130 | android:inputType="textPersonName" |
131 | android:lines="1" | 131 | android:lines="1" |
132 | android:text="" | 132 | android:text="" |
133 | android:textSize="@dimen/NormalText" | 133 | android:textSize="@dimen/NormalText" |
134 | android:visibility="gone" | 134 | android:visibility="gone" |
135 | app:layout_constraintEnd_toEndOf="parent" | 135 | app:layout_constraintEnd_toEndOf="parent" |
136 | app:layout_constraintStart_toEndOf="@id/ibSearch" | 136 | app:layout_constraintStart_toEndOf="@id/ibSearch" |
137 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | 137 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> |
138 | 138 | ||
139 | <TextView | 139 | <TextView |
140 | android:id="@+id/tvActuFecha" | 140 | android:id="@+id/tvActuFecha" |
141 | android:layout_width="0dp" | 141 | android:layout_width="0dp" |
142 | android:layout_height="wrap_content" | 142 | android:layout_height="wrap_content" |
143 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 143 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
144 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 144 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
145 | android:gravity="start" | 145 | android:gravity="start" |
146 | android:lines="1" | 146 | android:lines="1" |
147 | android:text="@string/tvTituloArea" | 147 | android:text="@string/tvTituloArea" |
148 | android:textColor="@android:color/black" | 148 | android:textColor="@android:color/black" |
149 | android:textSize="@dimen/SubTitulos" | 149 | android:textSize="@dimen/SubTitulos" |
150 | app:fontFamily="sans-serif-condensed" | 150 | app:fontFamily="sans-serif-condensed" |
151 | app:layout_constraintEnd_toEndOf="parent" | 151 | app:layout_constraintEnd_toEndOf="parent" |
152 | app:layout_constraintStart_toStartOf="parent" | 152 | app:layout_constraintStart_toStartOf="parent" |
153 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> | 153 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> |
154 | 154 | ||
155 | <RadioGroup | 155 | <RadioGroup |
156 | android:id="@+id/rgFechaHora" | 156 | android:id="@+id/rgFechaHora" |
157 | android:layout_width="0dp" | 157 | android:layout_width="0dp" |
158 | android:layout_height="wrap_content" | 158 | android:layout_height="wrap_content" |
159 | 159 | ||
160 | android:gravity="center" | 160 | android:gravity="center" |
161 | android:orientation="horizontal" | 161 | android:orientation="horizontal" |
162 | app:layout_constraintEnd_toEndOf="parent" | 162 | app:layout_constraintEnd_toEndOf="parent" |
163 | app:layout_constraintStart_toStartOf="parent" | 163 | app:layout_constraintStart_toStartOf="parent" |
164 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> | 164 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> |
165 | 165 | ||
166 | <RadioButton | 166 | <RadioButton |
167 | android:id="@+id/rbVentas" | 167 | android:id="@+id/rbVentas" |
168 | android:layout_width="wrap_content" | 168 | android:layout_width="wrap_content" |
169 | android:layout_height="wrap_content" | 169 | android:layout_height="wrap_content" |
170 | android:layout_margin="5dp" | 170 | android:layout_margin="5dp" |
171 | android:checked="true" | 171 | android:checked="true" |
172 | android:padding="5dp" | 172 | android:padding="5dp" |
173 | android:text="@string/rbVentas" | 173 | android:text="@string/rbVentas" |
174 | android:textSize="@dimen/NormalText" /> | 174 | android:textSize="@dimen/NormalText" /> |
175 | 175 | ||
176 | <RadioButton | 176 | <RadioButton |
177 | android:id="@+id/rbDeposito" | 177 | android:id="@+id/rbDeposito" |
178 | android:layout_width="wrap_content" | 178 | android:layout_width="wrap_content" |
179 | android:layout_height="wrap_content" | 179 | android:layout_height="wrap_content" |
180 | android:layout_margin="5dp" | 180 | android:layout_margin="5dp" |
181 | android:checked="false" | 181 | android:checked="false" |
182 | android:padding="5dp" | 182 | android:padding="5dp" |
183 | android:text="@string/rbDeposito" | 183 | android:text="@string/rbDeposito" |
184 | android:textSize="@dimen/NormalText" /> | 184 | android:textSize="@dimen/NormalText" /> |
185 | 185 | ||
186 | </RadioGroup> | 186 | </RadioGroup> |
187 | 187 | ||
188 | <TextView | 188 | <TextView |
189 | android:id="@+id/tvLosProductos" | 189 | android:id="@+id/tvLosProductos" |
190 | android:layout_width="0dp" | 190 | android:layout_width="0dp" |
191 | android:layout_height="wrap_content" | 191 | android:layout_height="wrap_content" |
192 | |||
193 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 192 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
194 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | 193 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" |
195 | android:gravity="start" | 194 | android:gravity="start" |
196 | android:lines="1" | 195 | android:lines="1" |
197 | android:text="@string/tvLosProductos" | 196 | android:text="@string/tvLosProductos" |
198 | android:textColor="@android:color/black" | 197 | android:textColor="@android:color/black" |
199 | android:textSize="@dimen/SubTitulos" | 198 | android:textSize="@dimen/SubTitulos" |
200 | app:fontFamily="sans-serif-condensed" | 199 | app:fontFamily="sans-serif-condensed" |
201 | app:layout_constraintEnd_toEndOf="parent" | 200 | app:layout_constraintEnd_toEndOf="parent" |
202 | app:layout_constraintStart_toStartOf="parent" | 201 | app:layout_constraintStart_toStartOf="parent" |
203 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | 202 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> |
204 | 203 | ||
205 | <RadioGroup | 204 | <RadioGroup |
206 | android:id="@+id/rgLosProductos" | 205 | android:id="@+id/rgLosProductos" |
207 | android:layout_width="0dp" | 206 | android:layout_width="0dp" |
208 | android:layout_height="wrap_content" | 207 | android:layout_height="wrap_content" |
209 | 208 | ||
210 | android:gravity="center" | 209 | android:gravity="center" |
211 | android:orientation="vertical" | 210 | android:orientation="vertical" |
212 | app:layout_constraintEnd_toEndOf="parent" | 211 | app:layout_constraintEnd_toEndOf="parent" |
213 | app:layout_constraintStart_toStartOf="parent" | 212 | app:layout_constraintStart_toStartOf="parent" |
214 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> | 213 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> |
215 | 214 | ||
216 | <RadioButton | 215 | <RadioButton |
217 | android:id="@+id/rbProInclu" | 216 | android:id="@+id/rbProInclu" |
218 | android:layout_width="match_parent" | 217 | android:layout_width="match_parent" |
219 | android:layout_height="wrap_content" | 218 | android:layout_height="wrap_content" |
220 | android:layout_margin="@dimen/PadingCbyRb" | 219 | android:layout_margin="@dimen/PadingCbyRb" |
221 | android:checked="true" | 220 | android:checked="true" |
222 | android:padding="@dimen/PadingCbyRb" | 221 | android:padding="@dimen/PadingCbyRb" |
223 | android:text="@string/rbProInclu" | 222 | android:text="@string/rbProInclu" |
224 | android:textSize="@dimen/NormalText" /> | 223 | android:textSize="@dimen/NormalText" /> |
225 | 224 | ||
226 | <RadioButton | 225 | <RadioButton |
227 | android:id="@+id/rbProNoInclu" | 226 | android:id="@+id/rbProNoInclu" |
228 | android:layout_width="match_parent" | 227 | android:layout_width="match_parent" |
229 | android:layout_height="wrap_content" | 228 | android:layout_height="wrap_content" |
230 | android:layout_margin="@dimen/PadingCbyRb" | 229 | android:layout_margin="@dimen/PadingCbyRb" |
231 | android:checked="false" | 230 | android:checked="false" |
232 | android:padding="@dimen/PadingCbyRb" | 231 | android:padding="@dimen/PadingCbyRb" |
233 | android:text="@string/rbProNoInclu" | 232 | android:text="@string/rbProNoInclu" |
234 | android:textSize="@dimen/NormalText" /> | 233 | android:textSize="@dimen/NormalText" /> |
235 | 234 | ||
236 | </RadioGroup> | 235 | </RadioGroup> |
237 | 236 | ||
238 | <CheckBox | 237 | <CheckBox |
239 | android:id="@+id/cbHabiLectura" | 238 | android:id="@+id/cbHabiLectura" |
240 | android:layout_width="0dp" | 239 | android:layout_width="0dp" |
241 | android:layout_height="wrap_content" | 240 | android:layout_height="wrap_content" |
242 | android:layout_margin="@dimen/PadingCbyRb" | 241 | android:layout_margin="@dimen/PadingCbyRb" |
243 | android:padding="@dimen/PadingCbyRb" | 242 | android:padding="@dimen/PadingCbyRb" |
244 | android:text="@string/cbHabiLectura" | 243 | android:text="@string/cbHabiLectura" |
245 | android:textSize="@dimen/NormalText" | 244 | android:textSize="@dimen/NormalText" |
246 | app:layout_constraintEnd_toEndOf="parent" | 245 | app:layout_constraintEnd_toEndOf="parent" |
247 | app:layout_constraintStart_toStartOf="parent" | 246 | app:layout_constraintStart_toStartOf="parent" |
248 | app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" /> | 247 | app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" /> |
249 | 248 | ||
250 | <CheckBox | 249 | <CheckBox |
251 | android:id="@+id/cbMostrarStock" | 250 | android:id="@+id/cbMostrarStock" |
252 | android:layout_width="0dp" | 251 | android:layout_width="0dp" |
253 | android:layout_height="wrap_content" | 252 | android:layout_height="wrap_content" |
254 | android:layout_margin="@dimen/PadingCbyRb" | 253 | android:layout_margin="@dimen/PadingCbyRb" |
255 | android:padding="@dimen/PadingCbyRb" | 254 | android:padding="@dimen/PadingCbyRb" |
256 | android:text="@string/cbMostrarStock" | 255 | android:text="@string/cbMostrarStock" |
257 | android:textSize="@dimen/NormalText" | 256 | android:textSize="@dimen/NormalText" |
258 | app:layout_constraintEnd_toEndOf="parent" | 257 | app:layout_constraintEnd_toEndOf="parent" |
259 | app:layout_constraintStart_toStartOf="parent" | 258 | app:layout_constraintStart_toStartOf="parent" |
260 | app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" /> | 259 | app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" /> |
261 | 260 | ||
262 | <TextView | 261 | <TextView |
263 | android:id="@+id/tvColumMostrar" | 262 | android:id="@+id/tvColumMostrar" |
264 | android:layout_width="0dp" | 263 | android:layout_width="0dp" |
265 | android:layout_height="wrap_content" | 264 | android:layout_height="wrap_content" |
266 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 265 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
267 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | 266 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" |
268 | android:gravity="start" | 267 | android:gravity="start" |
269 | android:lines="1" | 268 | android:lines="1" |
270 | android:text="@string/tvColumMostrar" | 269 | android:text="@string/tvColumMostrar" |
271 | android:textColor="@android:color/black" | 270 | android:textColor="@android:color/black" |
272 | android:textSize="@dimen/SubTitulos" | 271 | android:textSize="@dimen/SubTitulos" |
273 | android:visibility="gone" | 272 | android:visibility="gone" |
274 | app:fontFamily="sans-serif-condensed" | 273 | app:fontFamily="sans-serif-condensed" |
275 | app:layout_constraintEnd_toEndOf="parent" | 274 | app:layout_constraintEnd_toEndOf="parent" |
276 | app:layout_constraintStart_toStartOf="parent" | 275 | app:layout_constraintStart_toStartOf="parent" |
277 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> | 276 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> |
278 | 277 | ||
279 | <!-- <RadioGroup--> | 278 | <!-- <RadioGroup--> |
280 | <!-- android:id="@+id/rgCodigosMostrar"--> | 279 | <!-- android:id="@+id/rgCodigosMostrar"--> |
281 | <!-- android:layout_width="0dp"--> | 280 | <!-- android:layout_width="0dp"--> |
282 | <!-- android:layout_height="wrap_content"--> | 281 | <!-- android:layout_height="wrap_content"--> |
283 | <!-- android:gravity="center"--> | 282 | <!-- android:gravity="center"--> |
284 | <!-- android:orientation="horizontal"--> | 283 | <!-- android:orientation="horizontal"--> |
285 | <!-- android:visibility="gone"--> | 284 | <!-- android:visibility="gone"--> |
286 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | 285 | <!-- app:layout_constraintEnd_toEndOf="parent"--> |
287 | <!-- app:layout_constraintStart_toStartOf="parent"--> | 286 | <!-- app:layout_constraintStart_toStartOf="parent"--> |
288 | <!-- app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar">--> | 287 | <!-- app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar">--> |
289 | 288 | ||
290 | <!-- <RadioButton--> | 289 | <!-- <RadioButton--> |
291 | <!-- android:id="@+id/rbCodigoDebo"--> | 290 | <!-- android:id="@+id/rbCodigoDebo"--> |
292 | <!-- android:layout_width="wrap_content"--> | 291 | <!-- android:layout_width="wrap_content"--> |
293 | <!-- android:layout_height="wrap_content"--> | 292 | <!-- android:layout_height="wrap_content"--> |
294 | <!-- android:layout_margin="5dp"--> | 293 | <!-- android:layout_margin="5dp"--> |
295 | <!-- android:checked="true"--> | 294 | <!-- android:checked="true"--> |
296 | <!-- android:padding="5dp"--> | 295 | <!-- android:padding="5dp"--> |
297 | <!-- android:text="@string/rbCodigoDebo"--> | 296 | <!-- android:text="@string/rbCodigoDebo"--> |
298 | <!-- android:textSize="@dimen/NormalText" />--> | 297 | <!-- android:textSize="@dimen/NormalText" />--> |
299 | 298 | ||
300 | <!-- <RadioButton--> | 299 | <!-- <RadioButton--> |
301 | <!-- android:id="@+id/rbCodigoOrigen"--> | 300 | <!-- android:id="@+id/rbCodigoOrigen"--> |
302 | <!-- android:layout_width="wrap_content"--> | 301 | <!-- android:layout_width="wrap_content"--> |
303 | <!-- android:layout_height="wrap_content"--> | 302 | <!-- android:layout_height="wrap_content"--> |
304 | <!-- android:layout_margin="5dp"--> | 303 | <!-- android:layout_margin="5dp"--> |
305 | <!-- android:checked="false"--> | 304 | <!-- android:checked="false"--> |
306 | <!-- android:padding="5dp"--> | 305 | <!-- android:padding="5dp"--> |
307 | <!-- android:text="@string/rbCodigoOrigen"--> | 306 | <!-- android:text="@string/rbCodigoOrigen"--> |
308 | <!-- android:textSize="@dimen/NormalText" />--> | 307 | <!-- android:textSize="@dimen/NormalText" />--> |
309 | 308 | ||
310 | <!-- <RadioButton--> | 309 | <!-- <RadioButton--> |
311 | <!-- android:id="@+id/rbCodigoBarras"--> | 310 | <!-- android:id="@+id/rbCodigoBarras"--> |
312 | <!-- android:layout_width="wrap_content"--> | 311 | <!-- android:layout_width="wrap_content"--> |
313 | <!-- android:layout_height="wrap_content"--> | 312 | <!-- android:layout_height="wrap_content"--> |
314 | <!-- android:layout_margin="5dp"--> | 313 | <!-- android:layout_margin="5dp"--> |
315 | <!-- android:padding="5dp"--> | 314 | <!-- android:padding="5dp"--> |
316 | <!-- android:text="@string/rbCodigoBarras"--> | 315 | <!-- android:text="@string/rbCodigoBarras"--> |
317 | <!-- android:textSize="@dimen/NormalText" />--> | 316 | <!-- android:textSize="@dimen/NormalText" />--> |
318 | <!-- </RadioGroup>--> | 317 | <!-- </RadioGroup>--> |
319 | 318 | ||
320 | <Button | 319 | <Button |
321 | android:id="@+id/btnAskTimeServer" | 320 | android:id="@+id/btnAskTimeServer" |
322 | android:layout_width="wrap_content" | 321 | android:layout_width="wrap_content" |
323 | android:layout_height="wrap_content" | 322 | android:layout_height="wrap_content" |
324 | android:layout_margin="@dimen/PadingCbyRb" | 323 | android:layout_margin="@dimen/PadingCbyRb" |
325 | android:background="@drawable/boton_borde_redondeado" | 324 | android:background="@drawable/boton_borde_redondeado" |
326 | android:checked="false" | 325 | android:checked="false" |
327 | android:padding="10dp" | 326 | android:padding="10dp" |
328 | android:text="@string/btnAskTimeServer" | 327 | android:text="@string/btnAskTimeServer" |
329 | android:textColor="@android:color/white" | 328 | android:textColor="@android:color/white" |
330 | android:textSize="@dimen/NormalText" | 329 | android:textSize="@dimen/NormalText" |
331 | android:visibility="gone" | 330 | android:visibility="gone" |
332 | app:layout_constraintStart_toStartOf="parent" | 331 | app:layout_constraintStart_toStartOf="parent" |
333 | app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" /> | 332 | app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" /> |
334 | 333 | ||
335 | <CheckBox | 334 | <CheckBox |
336 | android:id="@+id/cbAskTimeServerToStart" | 335 | android:id="@+id/cbAskTimeServerToStart" |
337 | android:layout_width="wrap_content" | 336 | android:layout_width="wrap_content" |
338 | android:layout_height="wrap_content" | 337 | android:layout_height="wrap_content" |
339 | android:layout_margin="5dp" | 338 | android:layout_margin="5dp" |
340 | android:checked="false" | 339 | android:checked="true" |
341 | android:padding="@dimen/PadingCbyRb" | 340 | android:padding="@dimen/PadingCbyRb" |
342 | android:text="@string/cbAskTimeServerToStart" | 341 | android:text="@string/cbAskTimeServerToStart" |
343 | android:textSize="@dimen/NormalText" | 342 | android:textSize="@dimen/NormalText" |
344 | android:visibility="visible" | 343 | android:visibility="invisible" |
345 | app:layout_constraintStart_toEndOf="@+id/btnAskTimeServer" | 344 | app:layout_constraintStart_toEndOf="@+id/btnAskTimeServer" |
346 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> | 345 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> |
347 | 346 | ||
348 | <Button | 347 | <Button |
349 | android:id="@+id/btnGuardar" | 348 | android:id="@+id/btnGuardar" |
350 | android:layout_width="wrap_content" | 349 | android:layout_width="wrap_content" |
351 | android:layout_height="wrap_content" | 350 | android:layout_height="wrap_content" |
352 | android:background="@drawable/boton_borde_redondeado" | 351 | android:background="@drawable/boton_borde_redondeado" |
353 | android:padding="10dp" | 352 | android:padding="10dp" |
354 | android:text="@string/btnGuardar" | 353 | android:text="@string/btnGuardar" |
355 | android:textColor="@android:color/white" | 354 | android:textColor="@android:color/white" |
356 | android:textSize="@dimen/NormalText" | 355 | android:textSize="@dimen/NormalText" |
357 | app:layout_constraintBottom_toBottomOf="parent" | 356 | app:layout_constraintBottom_toBottomOf="parent" |
358 | app:layout_constraintEnd_toEndOf="parent" | 357 | app:layout_constraintEnd_toEndOf="parent" |
359 | app:layout_constraintStart_toStartOf="parent" | 358 | app:layout_constraintStart_toStartOf="parent" |
360 | app:layout_constraintTop_toBottomOf="@+id/cbAskTimeServerToStart" /> | 359 | app:layout_constraintTop_toBottomOf="@+id/cbAskTimeServerToStart" /> |
361 | 360 | ||
362 | </androidx.constraintlayout.widget.ConstraintLayout> | 361 | </androidx.constraintlayout.widget.ConstraintLayout> |
363 | 362 | ||
364 | 363 |
app/src/main/res/layout/fragment_main.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: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.appcompat.widget.AppCompatTextView | 8 | <androidx.appcompat.widget.AppCompatTextView |
9 | android:id="@+id/tvInvDinamicos" | 9 | android:id="@+id/tvInvDinamicos" |
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
11 | android:layout_height="90dp" | 11 | android:layout_height="90dp" |
12 | android:autoSizeMaxTextSize="150sp" | 12 | android:autoSizeMaxTextSize="150sp" |
13 | android:autoSizeMinTextSize="25sp" | 13 | android:autoSizeMinTextSize="25sp" |
14 | android:autoSizeStepGranularity="5sp" | 14 | android:autoSizeStepGranularity="5sp" |
15 | android:autoSizeTextType="uniform" | 15 | android:autoSizeTextType="uniform" |
16 | android:gravity="start" | 16 | android:gravity="start" |
17 | android:lines="1" | 17 | android:lines="1" |
18 | android:padding="10dp" | 18 | android:padding="10dp" |
19 | android:text="@string/invDinamicoVenta" | 19 | android:text="@string/invDinamicoVenta" |
20 | android:textColor="@color/colorAccent" | 20 | android:textColor="@color/colorAccent" |
21 | android:visibility="visible" | 21 | android:visibility="visible" |
22 | app:fontFamily="sans-serif-condensed" | 22 | app:fontFamily="sans-serif-condensed" |
23 | app:layout_constraintEnd_toEndOf="parent" | 23 | app:layout_constraintEnd_toEndOf="parent" |
24 | app:layout_constraintStart_toStartOf="parent" | 24 | app:layout_constraintStart_toStartOf="parent" |
25 | app:layout_constraintTop_toTopOf="parent" /> | 25 | app:layout_constraintTop_toTopOf="parent" /> |
26 | 26 | ||
27 | <androidx.appcompat.widget.AppCompatImageButton | 27 | <androidx.appcompat.widget.AppCompatImageButton |
28 | android:id="@+id/ivSort19" | 28 | android:id="@+id/ivSort19" |
29 | android:layout_width="50dp" | 29 | android:layout_width="50dp" |
30 | android:layout_height="50dp" | 30 | android:layout_height="50dp" |
31 | android:layout_marginStart="10dp" | 31 | android:layout_marginStart="10dp" |
32 | android:padding="5dp" | 32 | android:padding="5dp" |
33 | android:src="@drawable/ic_sort19" | 33 | android:src="@drawable/ic_sort19" |
34 | android:visibility="gone" | 34 | android:visibility="gone" |
35 | app:layout_constraintHorizontal_bias="0.0" | 35 | app:layout_constraintHorizontal_bias="0.0" |
36 | app:layout_constraintHorizontal_chainStyle="packed" | 36 | app:layout_constraintHorizontal_chainStyle="packed" |
37 | app:layout_constraintStart_toStartOf="parent" | 37 | app:layout_constraintStart_toStartOf="parent" |
38 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 38 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
39 | 39 | ||
40 | <androidx.appcompat.widget.AppCompatImageButton | 40 | <androidx.appcompat.widget.AppCompatImageButton |
41 | android:id="@+id/ivSort91" | 41 | android:id="@+id/ivSort91" |
42 | android:layout_width="50dp" | 42 | android:layout_width="50dp" |
43 | android:layout_height="50dp" | 43 | android:layout_height="50dp" |
44 | android:layout_marginStart="10dp" | 44 | android:layout_marginStart="10dp" |
45 | android:padding="5dp" | 45 | android:padding="5dp" |
46 | android:src="@drawable/ic_sort91" | 46 | android:src="@drawable/ic_sort91" |
47 | android:visibility="gone" | 47 | android:visibility="gone" |
48 | app:layout_constraintHorizontal_chainStyle="packed" | 48 | app:layout_constraintHorizontal_chainStyle="packed" |
49 | app:layout_constraintStart_toStartOf="parent" | 49 | app:layout_constraintStart_toStartOf="parent" |
50 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 50 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
51 | 51 | ||
52 | <TextView | 52 | <TextView |
53 | android:id="@+id/tvTipo" | 53 | android:id="@+id/tvTipo" |
54 | android:layout_width="wrap_content" | 54 | android:layout_width="wrap_content" |
55 | android:layout_height="wrap_content" | 55 | android:layout_height="wrap_content" |
56 | android:layout_margin="5dp" | 56 | android:layout_margin="5dp" |
57 | android:text="Tipo:" | 57 | android:text="Tipo:" |
58 | android:layout_marginTop="12dp" | 58 | android:layout_marginTop="12dp" |
59 | android:textSize="15sp" | 59 | android:textSize="15sp" |
60 | android:visibility="gone" | 60 | android:visibility="gone" |
61 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" | 61 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" |
62 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> | 62 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> |
63 | 63 | ||
64 | <com.google.android.material.checkbox.MaterialCheckBox | 64 | <com.google.android.material.checkbox.MaterialCheckBox |
65 | android:id="@+id/cbVentas" | 65 | android:id="@+id/cbVentas" |
66 | android:layout_width="wrap_content" | 66 | android:layout_width="wrap_content" |
67 | android:layout_height="wrap_content" | 67 | android:layout_height="wrap_content" |
68 | android:layout_margin="5dp" | 68 | android:layout_margin="5dp" |
69 | android:checked="true" | 69 | android:checked="true" |
70 | android:text="Ventas" | 70 | android:text="Ventas" |
71 | android:layout_marginTop="12dp" | 71 | android:layout_marginTop="12dp" |
72 | android:visibility="gone" | 72 | android:visibility="gone" |
73 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" | 73 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" |
74 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 74 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
75 | 75 | ||
76 | <com.google.android.material.checkbox.MaterialCheckBox | 76 | <com.google.android.material.checkbox.MaterialCheckBox |
77 | android:id="@+id/cbDeposito" | 77 | android:id="@+id/cbDeposito" |
78 | android:layout_width="wrap_content" | 78 | android:layout_width="wrap_content" |
79 | android:layout_height="wrap_content" | 79 | android:layout_height="wrap_content" |
80 | android:layout_margin="5dp" | 80 | android:layout_margin="5dp" |
81 | android:checked="true" | 81 | android:checked="true" |
82 | android:text="Deposito" | 82 | android:text="Deposito" |
83 | android:layout_marginTop="12dp" | 83 | android:layout_marginTop="12dp" |
84 | android:visibility="gone" | 84 | android:visibility="gone" |
85 | app:layout_constraintEnd_toEndOf="parent" | 85 | app:layout_constraintEnd_toEndOf="parent" |
86 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 86 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
87 | 87 | ||
88 | <androidx.recyclerview.widget.RecyclerView | 88 | <androidx.recyclerview.widget.RecyclerView |
89 | android:id="@+id/rcInventario" | 89 | android:id="@+id/rcInventario" |
90 | android:layout_width="match_parent" | 90 | android:layout_width="match_parent" |
91 | android:layout_height="0dp" | 91 | android:layout_height="0dp" |
92 | android:background="@android:color/darker_gray" | 92 | android:background="@android:color/darker_gray" |
93 | android:scrollbars="vertical" | 93 | android:scrollbars="vertical" |
94 | android:visibility="gone" | 94 | android:visibility="gone" |
95 | app:layout_constraintEnd_toEndOf="parent" | 95 | app:layout_constraintEnd_toEndOf="parent" |
96 | app:layout_constraintStart_toStartOf="parent" | 96 | app:layout_constraintStart_toStartOf="parent" |
97 | app:layout_constraintTop_toBottomOf="@id/ivSort19" | 97 | app:layout_constraintTop_toBottomOf="@id/ivSort19" |
98 | tools:listitem="@layout/item_principal" | 98 | tools:listitem="@layout/item_principal" |
99 | app:layout_constraintBottom_toTopOf="@+id/guideline1"/> | 99 | app:layout_constraintBottom_toTopOf="@+id/guideline1"/> |
100 | 100 | ||
101 | 101 | ||
102 | <androidx.appcompat.widget.AppCompatTextView | 102 | <androidx.appcompat.widget.AppCompatTextView |
103 | android:id="@+id/tvInvImportados" | 103 | android:id="@+id/tvInvImportados" |
104 | android:layout_width="match_parent" | 104 | android:layout_width="match_parent" |
105 | android:layout_height="90dp" | 105 | android:layout_height="90dp" |
106 | android:autoSizeMaxTextSize="150sp" | 106 | android:autoSizeMaxTextSize="150sp" |
107 | android:autoSizeMinTextSize="25sp" | 107 | android:autoSizeMinTextSize="25sp" |
108 | android:autoSizeStepGranularity="5sp" | 108 | android:autoSizeStepGranularity="5sp" |
109 | android:autoSizeTextType="uniform" | 109 | android:autoSizeTextType="uniform" |
110 | android:gravity="start" | 110 | android:gravity="start" |
111 | android:lines="1" | 111 | android:lines="1" |
112 | android:padding="10dp" | 112 | android:padding="10dp" |
113 | android:text="@string/invDinamicoCompra" | 113 | android:text="@string/invDinamicoCompra" |
114 | android:textColor="@color/colorAccent" | 114 | android:textColor="@color/colorAccent" |
115 | android:visibility="visible" | 115 | android:visibility="visible" |
116 | app:fontFamily="sans-serif-condensed" | 116 | app:fontFamily="sans-serif-condensed" |
117 | app:layout_constraintBottom_toBottomOf="parent" | 117 | app:layout_constraintBottom_toBottomOf="parent" |
118 | app:layout_constraintEnd_toEndOf="parent" | 118 | app:layout_constraintEnd_toEndOf="parent" |
119 | app:layout_constraintStart_toStartOf="parent" | 119 | app:layout_constraintStart_toStartOf="parent" |
120 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" | 120 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" |
121 | app:layout_constraintVertical_bias="0.0" /> | 121 | app:layout_constraintVertical_bias="0.0" /> |
122 | 122 | ||
123 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | 123 | <androidx.appcompat.widget.AppCompatImageButton |
124 | <!-- android:id="@+id/ivSort19II"--> | 124 | android:id="@+id/ivSort19II" |
125 | <!-- android:layout_width="50dp"--> | 125 | android:layout_width="50dp" |
126 | <!-- android:layout_height="50dp"--> | 126 | android:layout_height="50dp" |
127 | <!-- android:layout_marginStart="10dp"--> | 127 | android:layout_marginStart="10dp" |
128 | <!-- android:padding="5dp"--> | 128 | android:padding="5dp" |
129 | <!-- android:src="@drawable/ic_sort19"--> | 129 | android:src="@drawable/ic_sort19" |
130 | <!-- android:visibility="gone"--> | 130 | android:visibility="gone" |
131 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
132 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
133 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
134 | |||
135 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | ||
136 | <!-- android:id="@+id/ivSort91II"--> | ||
137 | <!-- android:layout_width="50dp"--> | ||
138 | <!-- android:layout_height="50dp"--> | ||
139 | <!-- android:layout_marginStart="10dp"--> | ||
140 | <!-- android:padding="5dp"--> | ||
141 | <!-- android:src="@drawable/ic_sort91"--> | ||
142 | <!-- android:visibility="invisible"--> | ||
143 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
144 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
145 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
146 | <ImageView | ||
147 | android:id="@+id/ivPortada" | ||
148 | android:layout_width="404dp" | ||
149 | android:layout_height="248dp" | ||
150 | android:elevation="10dp" | ||
151 | android:visibility="visible" | ||
152 | app:layout_constraintBottom_toBottomOf="parent" | ||
153 | app:layout_constraintEnd_toEndOf="parent" | ||
154 | app:layout_constraintStart_toStartOf="parent" | 131 | app:layout_constraintStart_toStartOf="parent" |
155 | app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" | 132 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" |
156 | tools:srcCompat="@drawable/imagen_portada" /> | 133 | app:layout_constraintBottom_toTopOf="@+id/rcInventarioII" /> |
134 | |||
135 | <androidx.appcompat.widget.AppCompatImageButton | ||
136 | android:id="@+id/ivSort91II" | ||
137 | android:layout_width="50dp" | ||
138 | android:layout_height="50dp" | ||
139 | android:layout_marginStart="10dp" | ||
140 | android:padding="5dp" | ||
141 | android:src="@drawable/ic_sort91" | ||
142 | android:visibility="gone" | ||
143 | app:layout_constraintStart_toStartOf="parent" | ||
144 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" | ||
145 | app:layout_constraintBottom_toTopOf="@+id/rcInventarioII"/> | ||
157 | 146 | ||
158 | <androidx.recyclerview.widget.RecyclerView | 147 | <androidx.recyclerview.widget.RecyclerView |
159 | android:id="@+id/rcInventarioII" | 148 | android:id="@+id/rcInventarioII" |
160 | android:layout_width="match_parent" | 149 | android:layout_width="match_parent" |
161 | android:layout_height="0dp" | 150 | android:layout_height="0dp" |
162 | android:background="@android:color/darker_gray" | 151 | android:background="@android:color/darker_gray" |
163 | android:scrollbars="vertical" | 152 | android:scrollbars="vertical" |
164 | android:visibility="gone" | 153 | android:visibility="gone" |
165 | app:layout_constraintEnd_toEndOf="parent" | 154 | app:layout_constraintEnd_toEndOf="parent" |
166 | app:layout_constraintStart_toStartOf="parent" | 155 | app:layout_constraintStart_toStartOf="parent" |
app/src/main/res/layout/nav_header_main.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <LinearLayout 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="@dimen/nav_header_height" | 5 | android:layout_height="@dimen/nav_header_height" |
6 | android:background="@drawable/side_nav_bar" | 6 | android:background="@drawable/side_nav_bar" |
7 | android:gravity="bottom" | 7 | android:gravity="bottom" |
8 | android:orientation="vertical" | 8 | android:orientation="vertical" |
9 | android:paddingLeft="@dimen/activity_horizontal_margin" | 9 | android:paddingLeft="@dimen/activity_horizontal_margin" |
10 | android:paddingTop="@dimen/activity_vertical_margin" | 10 | android:paddingTop="@dimen/activity_vertical_margin" |
11 | android:paddingRight="@dimen/activity_horizontal_margin" | 11 | android:paddingRight="@dimen/activity_horizontal_margin" |
12 | android:paddingBottom="@dimen/activity_vertical_margin" | 12 | android:paddingBottom="@dimen/activity_vertical_margin" |
13 | android:theme="@style/ThemeOverlay.AppCompat.Dark"> | 13 | android:theme="@style/ThemeOverlay.AppCompat.Dark"> |
14 | 14 | ||
15 | <ImageView | 15 | <!-- <ImageView--> |
16 | android:id="@+id/imageView" | 16 | <!-- android:id="@+id/imageView"--> |
17 | android:layout_width="141dp" | 17 | <!-- android:layout_width="141dp"--> |
18 | android:layout_height="wrap_content" | 18 | <!-- android:layout_height="wrap_content"--> |
19 | android:contentDescription=" " | 19 | <!-- android:contentDescription=" "--> |
20 | android:paddingTop="@dimen/nav_header_vertical_spacing" | 20 | <!-- android:paddingTop="@dimen/nav_header_vertical_spacing"--> |
21 | app:srcCompat="@drawable/logo" /> | 21 | <!-- app:srcCompat="@drawable/logo" />--> |
22 | 22 | ||
23 | <TextView | 23 | <TextView |
24 | android:layout_width="match_parent" | 24 | android:layout_width="wrap_content" |
25 | android:layout_height="wrap_content" | 25 | android:layout_height="wrap_content" |
26 | android:paddingTop="@dimen/nav_header_vertical_spacing" | 26 | android:paddingTop="@dimen/nav_header_vertical_spacing" |
27 | android:textSize="@dimen/md_message_textsize" | 27 | android:textSize="@dimen/tvServerConectado" |
28 | android:text="Debo Inventario" | 28 | android:text="DEBO Inventario" |
29 | android:textAppearance="@style/TextAppearance.AppCompat.Body1" /> | 29 | android:textAppearance="@style/TextAppearance.AppCompat.Body1" /> |
30 | 30 | ||
31 | <TextView | 31 | <TextView |
32 | android:id="@+id/textView1" | 32 | android:id="@+id/textView1" |
33 | android:layout_width="wrap_content" | 33 | android:layout_width="wrap_content" |
34 | android:layout_height="wrap_content" | 34 | android:layout_height="wrap_content" |
35 | android:text="FocaSoftware SA" /> | 35 | android:text="FocaSoftware SA" /> |
36 | </LinearLayout> | 36 | </LinearLayout> |
app/src/main/res/values/strings.xml
1 | <resources> | 1 | <resources> |
2 | 2 | ||
3 | <string name="action_settings">Ayuda</string> | 3 | <string name="action_settings">Ayuda</string> |
4 | <string name="app_name">DEBO Inventarios</string> | 4 | <string name="app_name">DEBO Inventarios</string> |
5 | 5 | ||
6 | <!-- menu--> | 6 | <!-- menu--> |
7 | <string name="menuInicio">Principal</string> | 7 | <string name="menuInicio">Principal</string> |
8 | <string name="menuNueInv">Nuevo Inventario</string> | 8 | <string name="menuNueInv">Nuevo Inventario</string> |
9 | <string name="menuActMae">Importaciones</string> | 9 | <string name="menuActMae">Importaciones</string> |
10 | <string name="menuConf">Configuraciones</string> | 10 | <string name="menuConf">Configuraciones</string> |
11 | <string name="menuSal">Salir</string> | 11 | <string name="menuSal">Salir</string> |
12 | 12 | ||
13 | <!-- Menu header--> | 13 | <!-- Menu header--> |
14 | <string name="menuLeyenda">Debo Inventario</string> | 14 | <string name="menuLeyenda">Debo Inventario</string> |
15 | 15 | ||
16 | <string name="navigation_drawer_open">Open navigation drawer</string> | 16 | <string name="navigation_drawer_open">Open navigation drawer</string> |
17 | <string name="navigation_drawer_close">Close navigation drawer</string> | 17 | <string name="navigation_drawer_close">Close navigation drawer</string> |
18 | 18 | ||
19 | <!-- Pantalla de inicio--> | 19 | <!-- Pantalla de inicio--> |
20 | <string name="bien">Bienvenido</string> | 20 | <string name="bien">Bienvenido</string> |
21 | <string name="debo">DEBO®</string> | 21 | <string name="debo">DEBO®</string> |
22 | <string name="inventario">Inventario</string> | 22 | <string name="inventario">Inventario</string> |
23 | 23 | ||
24 | <!-- inventarios dinamicos--> | 24 | <!-- inventarios dinamicos--> |
25 | <string name="invDinamicoVenta">Inventarios Dinámicos (0) +</string> | 25 | <string name="invDinamicoVenta">Inventarios Dinámicos (0) +</string> |
26 | <string name="invDinamicoCompra">Inventarios Importados(0) +</string> | 26 | <string name="invDinamicoCompra">Inventarios Importados(0) +</string> |
27 | 27 | ||
28 | <!-- ventana emergente--> | 28 | <!-- ventana emergente--> |
29 | <string name="adv">Ingrese la cantidad contada</string> | 29 | <string name="adv">Ingrese la cantidad contada</string> |
30 | <string name="tvFechayHora">Error de fecha y hora</string> | 30 | <string name="tvFechayHora">Error de fecha y hora</string> |
31 | <string name="invVentas">Inventarios Dinámicos de Ventas</string> | 31 | <string name="invVentas">Inventarios Dinámicos de Ventas</string> |
32 | <string name="btnCancela">Cancelar</string> | 32 | <string name="btnCancela">Cancelar</string> |
33 | 33 | ||
34 | 34 | ||
35 | <!-- Fragment Inventario--> | 35 | <!-- Fragment Inventario--> |
36 | <string name="invTitulo">Inventarios Dinámicos</string> | 36 | <string name="invTitulo">Inventarios Dinámicos</string> |
37 | <string name="invTituloV">Inventarios de Ventas</string> | 37 | <string name="invTituloV">Inventarios de Ventas</string> |
38 | <string name="invTituloD">Inventarios de Depósitos</string> | 38 | <string name="invTituloD">Inventarios de Depósitos</string> |
39 | <string name="invCodigoBarras">Código Barras:</string> | 39 | <string name="invCodigoBarras">Código Barras:</string> |
40 | <string name="btnExportarInv">Exportar Inventario</string> | 40 | <string name="btnExportarInv">Exportar Inventario</string> |
41 | <string name="btnBorrarInv">Borrar Inventario</string> | 41 | <string name="btnBorrarInv">Borrar Inventario</string> |
42 | <string name="ibBusDesc">Búsqueda por Descripción</string> | 42 | <string name="ibBusDesc">Búsqueda por Descripción</string> |
43 | <string name="ibBusCB">Búsqueda por Código Barras</string> | 43 | <string name="ibBusCB">Búsqueda por Código Barras</string> |
44 | <string name="ibBusCO">Búsqueda por Código de Origen</string> | 44 | <string name="ibBusCO">Búsqueda por Código de Origen</string> |
45 | <string name="switch_1">+ 1</string> | 45 | <string name="switch_1">+ 1</string> |
46 | 46 | ||
47 | <!-- Fragmento Configuraciones--> | 47 | <!-- Fragmento Configuraciones--> |
48 | <string name="tvTituloConf">Configuraciones</string> | 48 | <string name="tvTituloConf">Configuraciones</string> |
49 | <string name="tvSeleccioneServidor">Seleccione un Servidor</string> | 49 | <string name="tvSeleccioneServidor">Seleccione un Servidor</string> |
50 | <string name="btnValidarServidor">Validar</string> | 50 | <string name="btnValidarServidor">Validar</string> |
51 | <string name="btnAgregarServidor">Agregar un nuevo servidor</string> | 51 | <string name="btnAgregarServidor">Agregar un nuevo servidor</string> |
52 | <string name="tvUbicacionCarpetas">Ubicación de las carpetas de uso interno</string> | 52 | <string name="tvUbicacionCarpetas">Ubicación de las carpetas de uso interno</string> |
53 | <string name="tvTituloArea">Area de Inventario</string> | 53 | <string name="tvTituloArea">Area de Inventario</string> |
54 | <string name="rbVentas">Inventarios de Ventas</string> | 54 | <string name="rbVentas">Inventarios de Ventas</string> |
55 | <string name="rbDeposito">Inventarios de Depositos</string> | 55 | <string name="rbDeposito">Inventarios de Depositos</string> |
56 | <string name="tvLosProductos">Los productos no contabilizados en Inventarios</string> | 56 | <string name="tvLosProductos">Para los productos no contabilizados en Inventarios</string> |
57 | <string name="tvColumnas">Columnas a Visualizar</string> | 57 | <string name="tvColumnas">Columnas a Visualizar</string> |
58 | 58 | ||
59 | <string name="rbProInclu">Solo se ajustan los productos incluidos en el conteo.</string> | 59 | <string name="rbProInclu">Solo se ajustan los productos incluidos en el conteo.</string> |
60 | <string name="rbProNoInclu">Ajusta productos no incluidos en el conteo con stock en cero.</string> | 60 | <string name="rbProNoInclu">Ajustar los productos no incluidos en el conteo con stock en cero.</string> |
61 | 61 | ||
62 | <string name="cbMostrarStock">Mostror stock en el sistema al momento de la descarga del maestro.</string> | 62 | <string name="cbMostrarStock">Mostror stock en el sistema al momento de la descarga del maestro.</string> |
63 | <string name="cbHabiLectura">Habilitar Lectura de código de barras en balanza.</string> | 63 | <string name="cbHabiLectura">Habilitar Lectura de código de barras en balanza.</string> |
64 | 64 | ||
65 | <string name="tvColumMostrar">Columnas a mostrar en inventario</string> | 65 | <string name="tvColumMostrar">Columnas a mostrar en inventario</string> |
66 | 66 | ||
67 | <string name="rbCodigoDebo">Código DEBO</string> | 67 | <string name="rbCodigoDebo">Código DEBO</string> |
68 | <string name="rbCodigoOrigen">Código Origen</string> | 68 | <string name="rbCodigoOrigen">Código Origen</string> |
69 | <string name="rbCodigoBarras">Código de Barras</string> | 69 | <string name="rbCodigoBarras">Código de Barras</string> |
70 | 70 | ||
71 | <string name="leyendaSpinner">Seleccione Servidor Predeterminado</string> | 71 | <string name="leyendaSpinner">Seleccione Servidor Predeterminado</string> |
72 | 72 | ||
73 | <string name="btnAskTimeServer">Fecha y hora Servidor</string> | 73 | <string name="btnAskTimeServer">Fecha y hora Servidor</string> |
74 | <string name="cbAskTimeServerToStart">Verificar fecha y hora al iniciar.</string> | 74 | <string name="cbAskTimeServerToStart">Verificar fecha y hora al iniciar.</string> |
75 | 75 | ||
76 | <string name="btnGuardar">Guardar Cambios</string> | 76 | <string name="btnGuardar">Guardar Cambios</string> |
77 | <string name="todo"> </string> | 77 | <string name="todo"> </string> |
78 | todo | 78 | todo |
79 | <!-- fragment Actualizacion de Maestros--> | 79 | <!-- fragment Actualizacion de Maestros--> |
80 | <string name="tvActMaestros">Importaciones</string> | 80 | <string name="tvActMaestros">Importaciones</string> |
81 | <string name="tvMedio">Seleccione que tipo de importación desea realizar</string> | 81 | <string name="tvMedio">Seleccione que tipo de importación desea realizar</string> |
82 | <string name="tvSeleccionInventario"> Seleccione el inventario a importar</string> | 82 | <string name="tvSeleccionInventario"> Seleccione el inventario a importar</string> |
83 | 83 | ||
84 | <string name="obPorWifi">Importación de artículos</string> | 84 | <string name="obPorWifi">Importación de artículos</string> |
85 | <string name="obViaArchivo">Importación de inventarios</string> | 85 | <string name="obViaArchivo">Importación de inventarios</string> |
86 | 86 | ||
87 | <string name="btnConfirmarAct">Confirmar Importación</string> | 87 | <string name="btnConfirmarAct">Confirmar Importación</string> |
88 | <string name="btnConfirmarInv">Confirmar Inventarios</string> | 88 | <string name="btnConfirmarInv">Confirmar Inventarios</string> |
89 | 89 | ||
90 | <!-- Fragment Save--> | 90 | <!-- Fragment Save--> |
91 | <string name="tvConfServi">Configuración de Servidores</string> | 91 | <string name="tvConfServi">Configuración de Servidores</string> |
92 | <string name="server">Ingrese la dirección del servidor</string> | 92 | <string name="server">Ingrese la dirección del servidor</string> |
93 | <string name="etNomServer">Ingrese una descripción para la conexión</string> | 93 | <string name="etNomServer">Ingrese una descripción para la conexión</string> |
94 | <string name="btnGuardarConfServ">Guardar Conexión</string> | 94 | <string name="btnGuardarConfServ">Guardar Conexión</string> |
95 | 95 | ||
96 | <!-- Dialog--> | 96 | <!-- Dialog--> |
97 | <string name="sTitulo">Producto Buscado</string> | 97 | <string name="sTitulo">Producto Buscado</string> |
98 | <string name="btnOk">Aceptar</string> | 98 | <string name="btnOk">Aceptar</string> |
99 | <string name="btnSalir">Salir</string> | 99 | <string name="btnSalir">Salir</string> |
100 | <string name="btnCambiarHora">Configura aquí la fecha y hora </string> | 100 | <string name="btnCambiarHora">Configura aquí la fecha y hora </string> |
101 | 101 | ||
102 | <string name="btnConfirmar">Confirmar</string> | 102 | <string name="btnConfirmar">Confirmar</string> |
103 | <string name="btnCancelar">Cancelar</string> | 103 | <string name="btnCancelar">Cancelar</string> |
104 | <string name="sMensaje">¡No se encontro el producto ingresado!</string> | 104 | <string name="sMensaje">¡No se encontro el producto ingresado!</string> |
105 | <string name="sMensajeEncontrado">¡Ingrese nueva cantidad!</string> | 105 | <string name="sMensajeEncontrado">¡Ingrese nueva cantidad!</string> |
106 | <string name="sTituloNueva">Producto ingresado esta cargado</string> | 106 | <string name="sTituloNueva">Producto ingresado esta cargado</string> |
107 | <string name="sCantidadNueva">¡Por favor ingrese la nueva Cantidad!</string> | 107 | <string name="sCantidadNueva">¡Por favor ingrese la nueva Cantidad!</string> |
108 | 108 | ||
109 | <string name="sMensajeExportar">¡Confirma que exporta el Inventario!</string> | 109 | <string name="sMensajeExportar">¡Confirma que exporta el Inventario!</string> |
110 | <string name="sTituloExportar">Exportación de Inventarios</string> | 110 | <string name="sTituloExportar">Exportación de Inventarios</string> |
111 | 111 | ||
112 | <!-- FRAGMENT SERVIDOR--> | 112 | <!-- FRAGMENT SERVIDOR--> |
113 | <string name="tvTitutloServer">Alta de Servidores</string> | 113 | <string name="tvTitutloServer">Alta de Servidores</string> |
114 | <string name="tvNomServer">Descripción para identificar al servidor</string> | 114 | <string name="tvNomServer">Descripción para identificar al servidor</string> |
115 | <string name="tvDirServer">Dirección del servidor</string> | 115 | <string name="tvDirServer">Dirección del servidor</string> |
116 | <string name="btnGuardarServidores">Guardar Servidor</string> | 116 | <string name="btnGuardarServidores">Guardar Servidor</string> |
117 | 117 | ||
118 | <string name="tvSeleccion">Toque sobre la operación que desea realizar</string> | 118 | <string name="tvSeleccion">Toque sobre la operación que desea realizar</string> |
119 | <string name="rbSumar">Sumar</string> | 119 | <string name="rbSumar">Sumar</string> |
120 | <string name="rbRestar">Restar</string> | 120 | <string name="rbRestar">Restar</string> |
121 | <string name="rbModificar">Reemplazar</string> | 121 | <string name="rbModificar">Reemplazar</string> |
122 | <string name="tvTotal">Cantidad Final</string>tvTotal | 122 | <string name="tvTotal">Cantidad Final</string>tvTotal |
123 | <string name="tvResultado">Resultado:</string>tvTotal | 123 | <string name="tvResultado">Resultado:</string>tvTotal |
124 | 124 | ||
125 | <string name="large_text"> | 125 | <string name="large_text"> |
126 | "Material is the metaphor.\n\n" | 126 | "Material is the metaphor.\n\n" |
127 | 127 | ||
128 | "A material metaphor is the unifying theory of a rationalized space and a system of motion." | 128 | "A material metaphor is the unifying theory of a rationalized space and a system of motion." |
129 | "The material is grounded in tactile reality, inspired by the study of paper and ink, yet " | 129 | "The material is grounded in tactile reality, inspired by the study of paper and ink, yet " |
130 | "technologically advanced and open to imagination and magic.\n" | 130 | "technologically advanced and open to imagination and magic.\n" |
131 | "Surfaces and edges of the material provide visual cues that are grounded in reality. The " | 131 | "Surfaces and edges of the material provide visual cues that are grounded in reality. The " |
132 | "use of familiar tactile attributes helps users quickly understand affordances. Yet the " | 132 | "use of familiar tactile attributes helps users quickly understand affordances. Yet the " |
133 | "flexibility of the material creates new affordances that supercede those in the physical " | 133 | "flexibility of the material creates new affordances that supercede those in the physical " |
134 | "world, without breaking the rules of physics.\n" | 134 | "world, without breaking the rules of physics.\n" |
135 | "The fundamentals of light, surface, and movement are key to conveying how objects move, " | 135 | "The fundamentals of light, surface, and movement are key to conveying how objects move, " |
136 | "interact, and exist in space and in relation to each other. Realistic lighting shows " | 136 | "interact, and exist in space and in relation to each other. Realistic lighting shows " |
137 | "seams, divides space, and indicates moving parts.\n\n" | 137 | "seams, divides space, and indicates moving parts.\n\n" |
138 | 138 | ||
139 | "Bold, graphic, intentional.\n\n" | 139 | "Bold, graphic, intentional.\n\n" |
140 | 140 | ||
141 | "The foundational elements of print based design typography, grids, space, scale, color, " | 141 | "The foundational elements of print based design typography, grids, space, scale, color, " |
142 | "and use of imagery guide visual treatments. These elements do far more than please the " | 142 | "and use of imagery guide visual treatments. These elements do far more than please the " |
143 | "eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge " | 143 | "eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge " |
144 | "imagery, large scale typography, and intentional white space create a bold and graphic " | 144 | "imagery, large scale typography, and intentional white space create a bold and graphic " |
145 | "interface that immerse the user in the experience.\n" | 145 | "interface that immerse the user in the experience.\n" |
146 | "An emphasis on user actions makes core functionality immediately apparent and provides " | 146 | "An emphasis on user actions makes core functionality immediately apparent and provides " |
147 | "waypoints for the user.\n\n" | 147 | "waypoints for the user.\n\n" |
148 | 148 | ||
149 | "Motion provides meaning.\n\n" | 149 | "Motion provides meaning.\n\n" |
150 | 150 | ||
151 | "Motion respects and reinforces the user as the prime mover. Primary user actions are " | 151 | "Motion respects and reinforces the user as the prime mover. Primary user actions are " |
152 | "inflection points that initiate motion, transforming the whole design.\n" | 152 | "inflection points that initiate motion, transforming the whole design.\n" |
153 | "All action takes place in a single environment. Objects are presented to the user without " | 153 | "All action takes place in a single environment. Objects are presented to the user without " |
154 | "breaking the continuity of experience even as they transform and reorganize.\n" | 154 | "breaking the continuity of experience even as they transform and reorganize.\n" |
155 | "Motion is meaningful and appropriate, serving to focus attention and maintain continuity. " | 155 | "Motion is meaningful and appropriate, serving to focus attention and maintain continuity. " |
156 | "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n" | 156 | "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n" |
157 | 157 | ||
158 | "3D world.\n\n" | 158 | "3D world.\n\n" |
159 | 159 | ||
160 | "The material environment is a 3D space, which means all objects have x, y, and z " | 160 | "The material environment is a 3D space, which means all objects have x, y, and z " |
161 | "dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the " | 161 | "dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the " |
162 | "positive z-axis extending towards the viewer. Every sheet of material occupies a single " | 162 | "positive z-axis extending towards the viewer. Every sheet of material occupies a single " |
163 | "position along the z-axis and has a standard 1dp thickness.\n" | 163 | "position along the z-axis and has a standard 1dp thickness.\n" |
164 | "On the web, the z-axis is used for layering and not for perspective. The 3D world is " | 164 | "On the web, the z-axis is used for layering and not for perspective. The 3D world is " |
165 | "emulated by manipulating the y-axis.\n\n" | 165 | "emulated by manipulating the y-axis.\n\n" |
166 | 166 | ||
167 | "Light and shadow.\n\n" | 167 | "Light and shadow.\n\n" |
168 | 168 | ||
169 | "Within the material environment, virtual lights illuminate the scene. Key lights create " | 169 | "Within the material environment, virtual lights illuminate the scene. Key lights create " |
170 | "directional shadows, while ambient light creates soft shadows from all angles.\n" | 170 | "directional shadows, while ambient light creates soft shadows from all angles.\n" |
171 | "Shadows in the material environment are cast by these two light sources. In Android " | 171 | "Shadows in the material environment are cast by these two light sources. In Android " |
172 | "development, shadows occur when light sources are blocked by sheets of material at " | 172 | "development, shadows occur when light sources are blocked by sheets of material at " |
173 | "various positions along the z-axis. On the web, shadows are depicted by manipulating the " | 173 | "various positions along the z-axis. On the web, shadows are depicted by manipulating the " |
174 | "y-axis only. The following example shows the card with a height of 6dp.\n\n" | 174 | "y-axis only. The following example shows the card with a height of 6dp.\n\n" |
175 | 175 | ||
176 | "Resting elevation.\n\n" | 176 | "Resting elevation.\n\n" |
177 | 177 | ||
178 | "All material objects, regardless of size, have a resting elevation, or default elevation " | 178 | "All material objects, regardless of size, have a resting elevation, or default elevation " |
179 | "that does not change. If an object changes elevation, it should return to its resting " | 179 | "that does not change. If an object changes elevation, it should return to its resting " |
180 | "elevation as soon as possible.\n\n" | 180 | "elevation as soon as possible.\n\n" |
181 | 181 | ||
182 | "Component elevations.\n\n" | 182 | "Component elevations.\n\n" |
183 | 183 | ||
184 | "The resting elevation for a component type is consistent across apps (e.g., FAB elevation " | 184 | "The resting elevation for a component type is consistent across apps (e.g., FAB elevation " |
185 | "does not vary from 6dp in one app to 16dp in another app).\n" | 185 | "does not vary from 6dp in one app to 16dp in another app).\n" |
186 | "Components may have different resting elevations across platforms, depending on the depth " | 186 | "Components may have different resting elevations across platforms, depending on the depth " |
187 | "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n" | 187 | "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n" |
188 | 188 | ||
189 | "Responsive elevation and dynamic elevation offsets.\n\n" | 189 | "Responsive elevation and dynamic elevation offsets.\n\n" |
190 | 190 | ||
191 | "Some component types have responsive elevation, meaning they change elevation in response " | 191 | "Some component types have responsive elevation, meaning they change elevation in response " |
192 | "to user input (e.g., normal, focused, and pressed) or system events. These elevation " | 192 | "to user input (e.g., normal, focused, and pressed) or system events. These elevation " |
193 | "changes are consistently implemented using dynamic elevation offsets.\n" | 193 | "changes are consistently implemented using dynamic elevation offsets.\n" |
194 | "Dynamic elevation offsets are the goal elevation that a component moves towards, relative " | 194 | "Dynamic elevation offsets are the goal elevation that a component moves towards, relative " |
195 | "to the component’s resting state. They ensure that elevation changes are consistent " | 195 | "to the component’s resting state. They ensure that elevation changes are consistent " |
196 | "across actions and component types. For example, all components that lift on press have " | 196 | "across actions and component types. For example, all components that lift on press have " |
197 | "the same elevation change relative to their resting elevation.\n" | 197 | "the same elevation change relative to their resting elevation.\n" |
198 | "Once the input event is completed or cancelled, the component will return to its resting " | 198 | "Once the input event is completed or cancelled, the component will return to its resting " |
199 | "elevation.\n\n" | 199 | "elevation.\n\n" |
200 | 200 | ||
201 | "Avoiding elevation interference.\n\n" | 201 | "Avoiding elevation interference.\n\n" |
202 | 202 | ||
203 | "Components with responsive elevations may encounter other components as they move between " | 203 | "Components with responsive elevations may encounter other components as they move between " |
204 | "their resting elevations and dynamic elevation offsets. Because material cannot pass " | 204 | "their resting elevations and dynamic elevation offsets. Because material cannot pass " |
205 | "through other material, components avoid interfering with one another any number of ways, " | 205 | "through other material, components avoid interfering with one another any number of ways, " |
206 | "whether on a per component basis or using the entire app layout.\n" | 206 | "whether on a per component basis or using the entire app layout.\n" |
207 | "On a component level, components can move or be removed before they cause interference. " | 207 | "On a component level, components can move or be removed before they cause interference. " |
208 | "For example, a floating action button (FAB) can disappear or move off screen before a " | 208 | "For example, a floating action button (FAB) can disappear or move off screen before a " |
209 | "user picks up a card, or it can move if a snackbar appears.\n" | 209 | "user picks up a card, or it can move if a snackbar appears.\n" |
210 | "On the layout level, design your app layout to minimize opportunities for interference. " | 210 | "On the layout level, design your app layout to minimize opportunities for interference. " |
211 | "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere " | 211 | "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere " |
212 | "when a user tries to pick up one of cards.\n\n" | 212 | "when a user tries to pick up one of cards.\n\n" |
213 | </string> | 213 | </string> |
214 | <!-- TODO: Remove or change this placeholder text --> | 214 | <!-- TODO: Remove or change this placeholder text --> |
215 | <string name="hello_blank_fragment">Hello blank fragment</string> | 215 | <string name="hello_blank_fragment">Hello blank fragment</string> |
216 | </resources> | 216 | </resources> |