Commit 62463245e433a3ac4f527f5419c2bea1817d9571
1 parent
01fb822e19
Exists in
master
22092020 0500
Showing
44 changed files
with
2703 additions
and
172 deletions
Show diff stats
app/src/main/AndroidManifest.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:tools="http://schemas.android.com/tools" | 3 | xmlns:tools="http://schemas.android.com/tools" |
4 | package="com.focasoftware.deboinventariov20"> | 4 | package="com.focasoftware.deboinventariov20"> |
5 | 5 | ||
6 | <uses-permission android:name="android.permission.VIBRATE" /> | 6 | <uses-permission android:name="android.permission.VIBRATE" /> |
7 | <uses-permission android:name="android.permission.INTERNET" /> | 7 | <uses-permission android:name="android.permission.INTERNET" /> |
8 | 8 | ||
9 | <application | 9 | <application |
10 | android:exported="false" | 10 | android:exported="false" |
11 | android:allowBackup="true" | 11 | android:allowBackup="true" |
12 | android:icon="@drawable/icono_inventario_big" | 12 | android:icon="@drawable/icono_inventario_big" |
13 | android:label="@string/app_name" | 13 | android:label="@string/app_name" |
14 | android:roundIcon="@drawable/icono_inventario_big" | 14 | android:roundIcon="@drawable/icono_inventario_big" |
15 | android:supportsRtl="true" | 15 | android:supportsRtl="true" |
16 | android:windowSoftInputMode="adjustNothing" | ||
16 | android:theme="@style/AppTheme" | 17 | android:theme="@style/AppTheme" |
17 | android:usesCleartextTraffic="true"> | 18 | android:usesCleartextTraffic="true"> |
18 | <activity | 19 | <activity |
19 | android:name=".UI.SplashActivity" | 20 | android:name=".UI.SplashActivity" |
20 | android:label="@string/app_name" | 21 | android:label="@string/app_name" |
21 | android:theme="@style/AppTheme.NoActionBar"> | 22 | android:theme="@style/AppTheme.NoActionBar"> |
22 | <intent-filter> | 23 | <intent-filter> |
23 | <action android:name="android.intent.action.MAIN" /> | 24 | <action android:name="android.intent.action.MAIN" /> |
24 | 25 | ||
25 | <category android:name="android.intent.category.LAUNCHER" /> | 26 | <category android:name="android.intent.category.LAUNCHER" /> |
26 | </intent-filter> | 27 | </intent-filter> |
27 | </activity> | 28 | </activity> |
28 | <activity | 29 | <activity |
29 | android:name=".UI.MainActivity" | 30 | android:name=".UI.MainActivity" |
30 | android:label="@string/app_name" | 31 | android:label="@string/app_name" |
32 | android:windowSoftInputMode="adjustNothing" | ||
31 | android:theme="@style/AppTheme.NoActionBar"> | 33 | android:theme="@style/AppTheme.NoActionBar"> |
32 | 34 | ||
33 | </activity> | 35 | </activity> |
34 | </application> | 36 | </application> |
35 | 37 | ||
36 | </manifest> | 38 | </manifest> |
app/src/main/java/com/focasoftware/deboinventariov20/DB/DataBase/AppDb.kt
1 | package com.focasoftware.deboinventariov20.DB.DataBase | 1 | package com.focasoftware.deboinventariov20.DB.DataBase |
2 | 2 | ||
3 | import android.content.Context | 3 | import android.content.Context |
4 | import androidx.room.Database | 4 | import androidx.room.Database |
5 | import androidx.room.Room | 5 | import androidx.room.Room |
6 | import androidx.room.RoomDatabase | 6 | import androidx.room.RoomDatabase |
7 | import com.focasoftware.deboinventariov20.DB.Constans.Constans | 7 | import com.focasoftware.deboinventariov20.DB.Constans.Constans |
8 | import com.focasoftware.deboinventariov20.DB.DAO.* | 8 | import com.focasoftware.deboinventariov20.DB.DAO.* |
9 | import com.focasoftware.deboinventariov20.Model.Articles | 9 | import com.focasoftware.deboinventariov20.Model.Articles |
10 | import com.focasoftware.deboinventariov20.Model.InvBody | 10 | import com.focasoftware.deboinventariov20.Model.InvBody |
11 | import com.focasoftware.deboinventariov20.Model.InvHead | 11 | import com.focasoftware.deboinventariov20.Model.InvHead |
12 | import com.focasoftware.deboinventariov20.Model.ServeInv | 12 | import com.focasoftware.deboinventariov20.Model.ServeInv |
13 | 13 | ||
14 | 14 | ||
15 | @Database(entities = [Articles::class, InvHead::class, InvBody::class, ServeInv::class], version = 1, exportSchema = false) | 15 | @Database(entities = [Articles::class, InvHead::class, InvBody::class, ServeInv::class], version = 1, exportSchema = true) |
16 | abstract class AppDb : RoomDatabase() { | 16 | abstract class AppDb : RoomDatabase() { |
17 | abstract fun ArticulosDAO(): ArticulosDAO? | 17 | abstract fun ArticulosDAO(): ArticulosDAO? |
18 | abstract fun InvHeadDAO(): InvHeadDAO? | 18 | abstract fun InvHeadDAO(): InvHeadDAO? |
19 | abstract fun InvBodyDAO(): InvBodyDAO? | 19 | abstract fun InvBodyDAO(): InvBodyDAO? |
20 | abstract fun ServeInvDao(): ServeInvDao? | 20 | abstract fun ServeInvDao(): ServeInvDao? |
21 | 21 | ||
22 | companion object { | 22 | companion object { |
23 | private var INSTANCE: AppDb? = null | 23 | private var INSTANCE: AppDb? = null |
24 | fun getAppDb(context: Context): AppDb? { | 24 | fun getAppDb(context: Context): AppDb? { |
25 | if (INSTANCE == null) { | 25 | if (INSTANCE == null) { |
26 | INSTANCE = Room.databaseBuilder(context.applicationContext, AppDb::class.java, Constans.DB_NAME) | 26 | INSTANCE = Room.databaseBuilder(context.applicationContext, AppDb::class.java, Constans.DB_NAME) |
27 | .allowMainThreadQueries() | 27 | .allowMainThreadQueries() |
28 | .build() | 28 | .build() |
29 | } | 29 | } |
30 | return INSTANCE | 30 | return INSTANCE |
31 | } | 31 | } |
32 | 32 | ||
33 | fun destroyInstance() { | 33 | fun destroyInstance() { |
34 | INSTANCE = null | 34 | INSTANCE = null |
35 | } | 35 | } |
36 | } | 36 | } |
37 | } | 37 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/SplashActivity.kt
1 | package com.focasoftware.deboinventariov20.UI | 1 | package com.focasoftware.deboinventariov20.UI |
2 | 2 | ||
3 | import android.app.Activity | 3 | import android.app.Activity |
4 | import android.content.Intent | 4 | import android.content.Intent |
5 | import android.os.Bundle | 5 | import android.os.Bundle |
6 | import com.focasoftware.deboinventariov20.R | 6 | import com.focasoftware.deboinventariov20.R |
7 | 7 | ||
8 | class SplashActivity : Activity() { | 8 | class SplashActivity : Activity() { |
9 | 9 | ||
10 | override fun onCreate(savedInstanceState: Bundle?) { | 10 | override fun onCreate(savedInstanceState: Bundle?) { |
11 | super.onCreate(savedInstanceState) | 11 | super.onCreate(savedInstanceState) |
12 | setContentView(R.layout.activity_splash) | 12 | setContentView(R.layout.activity_splash) |
13 | //window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | 13 | //window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
14 | 14 | ||
15 | val bac = object : Thread(){ | 15 | val bac = object : Thread(){ |
16 | override fun run(){ | 16 | override fun run(){ |
17 | try { | 17 | try { |
18 | Thread.sleep(3) | 18 | Thread.sleep(3000) |
19 | val intent = Intent(baseContext, MainActivity:: class.java) | 19 | val intent = Intent(baseContext, MainActivity:: class.java) |
20 | startActivity(intent) | 20 | startActivity(intent) |
21 | finish() | 21 | finish() |
22 | } catch (e : Exception){ | 22 | } catch (e : Exception){ |
23 | e.printStackTrace() | 23 | e.printStackTrace() |
24 | } | 24 | } |
25 | } | 25 | } |
26 | } | 26 | } |
27 | bac.start() | 27 | bac.start() |
28 | } | 28 | } |
29 | } | 29 | } |
30 | 30 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/Utils/Utils.kt
1 | package com.focasoftware.deboinventariov20.UI.Utils | 1 | package com.focasoftware.deboinventariov20.UI.Utils |
2 | 2 | ||
3 | import android.app.AlertDialog | 3 | import android.app.AlertDialog |
4 | import android.app.Dialog | 4 | import android.app.Dialog |
5 | import android.content.Context | 5 | import android.content.Context |
6 | import android.os.Bundle | 6 | import android.os.Bundle |
7 | import androidx.fragment.app.DialogFragment | 7 | import androidx.fragment.app.DialogFragment |
8 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 8 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
9 | import kotlinx.coroutines.Dispatchers | 9 | import kotlinx.coroutines.Dispatchers |
10 | import kotlinx.coroutines.GlobalScope | 10 | import kotlinx.coroutines.GlobalScope |
11 | import kotlinx.coroutines.async | 11 | import kotlinx.coroutines.async |
12 | import java.io.IOException | 12 | import java.io.IOException |
13 | import java.net.UnknownHostException | 13 | import java.net.UnknownHostException |
14 | 14 | ||
15 | fun modificarCantidadEnCabecera(inventarioActual: Int, b: Boolean, context: Context) { | 15 | fun modificarCantidadEnCabecera(inventarioActual: Int, b: Boolean, context: Context) { |
16 | GlobalScope.async(Dispatchers.IO) { | 16 | GlobalScope.async(Dispatchers.IO) { |
17 | var cantProductos = 0 | 17 | var cantProductos = 0 |
18 | cantProductos = | 18 | cantProductos = |
19 | AppDb.getAppDb(context)!!.InvHeadDAO()!!.consultaCantidadInvH(inventarioActual.toLong()) | 19 | AppDb.getAppDb(context)!!.InvHeadDAO()!!.consultaCantidadInvH(inventarioActual.toLong()) |
20 | if (b) { | 20 | if (b) { |
21 | AppDb.getAppDb(context)!!.InvHeadDAO()!! | 21 | AppDb.getAppDb(context)!!.InvHeadDAO()!! |
22 | .updateInvBody(inventarioActual.toLong(), cantProductos + 1) | 22 | .updateInvBody(inventarioActual.toLong(), cantProductos + 1) |
23 | } else { | 23 | } else { |
24 | AppDb.getAppDb(context)!!.InvHeadDAO()!! | 24 | AppDb.getAppDb(context)!!.InvHeadDAO()!! |
25 | .updateInvBody(inventarioActual.toLong(), cantProductos - 1) | 25 | .updateInvBody(inventarioActual.toLong(), cantProductos - 1) |
26 | } | 26 | } |
27 | } | 27 | } |
28 | } | 28 | } |
29 | 29 | ||
30 | open class AlertDialogBorrarInv : DialogFragment() { | 30 | open class AlertDialogBorrarInv : DialogFragment() { |
31 | 31 | ||
32 | interface OnBorrarInvClickListener { | 32 | interface OnBorrarInvClickListener { |
33 | fun onPositiveClick() | 33 | fun onPositiveClick() |
34 | fun onCancelClick() | 34 | fun onCancelClick() |
35 | } | 35 | } |
36 | 36 | ||
37 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | 37 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |
38 | return activity?.let { | 38 | return activity?.let { |
39 | val title = "Borrar Inventario" | 39 | val title = "Borrar Inventario" |
40 | val content = "¿Seguro que desea Borrar el inventario?" | 40 | val content = "¿Seguro que desea Borrar el inventario?" |
41 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | 41 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) |
42 | builder.setTitle(title).setMessage(content) | 42 | builder.setTitle(title).setMessage(content) |
43 | |||
43 | .setPositiveButton(android.R.string.ok) { _, _ -> | 44 | .setPositiveButton(android.R.string.ok) { _, _ -> |
44 | val listener = activity as OnBorrarInvClickListener? | 45 | val listener = activity as OnBorrarInvClickListener? |
45 | listener!!.onPositiveClick() | 46 | listener!!.onPositiveClick() |
46 | } | 47 | } |
47 | .setNegativeButton(android.R.string.cancel) { _, _ -> | 48 | .setNegativeButton(android.R.string.cancel) { _, _ -> |
48 | val listener = activity as OnBorrarInvClickListener? | 49 | val listener = activity as OnBorrarInvClickListener? |
49 | listener!!.onCancelClick() | 50 | listener!!.onCancelClick() |
50 | } | 51 | } |
51 | return builder.create() | 52 | return builder.create() |
52 | } ?: throw IllegalStateException("Activity cannot be null") | 53 | } ?: throw IllegalStateException("Activity cannot be null") |
53 | } | 54 | } |
54 | } | 55 | } |
55 | 56 | ||
56 | class NoEncontradoSimple : DialogFragment() { | 57 | class NoEncontradoSimple : DialogFragment() { |
57 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | 58 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |
58 | return activity?.let { | 59 | return activity?.let { |
60 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | ||
61 | builder.show() | ||
59 | val title = "" | 62 | val title = "" |
60 | val content = "¡El producto buscado NO fue encontrado!" | 63 | val content = "¡El producto buscado NO fue encontrado!" |
61 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | 64 | |
62 | builder.setTitle(title).setMessage(content) | 65 | builder.setTitle(title).setMessage(content) |
63 | .setPositiveButton(android.R.string.ok) { _, _ -> } | 66 | .setPositiveButton(android.R.string.ok) { _, _ -> } |
64 | return builder.create() | 67 | return builder.create() |
65 | } ?: throw IllegalStateException("Activity cannot be null") | 68 | } ?: throw IllegalStateException("Activity cannot be null") |
66 | } | 69 | } |
67 | } | 70 | } |
68 | 71 | ||
69 | class noServerConf : DialogFragment() { | 72 | class noServerConf : DialogFragment() { |
70 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | 73 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |
71 | return activity?.let { | 74 | return activity?.let { |
72 | val title = "" | 75 | val title = "" |
73 | val content = "¡Antes de importar debe configurar un servidor!" | 76 | val content = "¡Antes de importar debe configurar un servidor!" |
74 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | 77 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) |
75 | builder.setTitle(title).setMessage(content) | 78 | builder.setTitle(title).setMessage(content) |
76 | .setPositiveButton(android.R.string.ok) { _, _ -> | 79 | .setPositiveButton(android.R.string.ok) { _, _ -> |
77 | activity?.onBackPressed() | 80 | activity?.onBackPressed() |
78 | } | 81 | } |
79 | 82 | ||
80 | return builder.create() | 83 | return builder.create() |
81 | } ?: throw IllegalStateException("Activity cannot be null") | 84 | } ?: throw IllegalStateException("Activity cannot be null") |
82 | } | 85 | } |
83 | } | 86 | } |
84 | 87 | ||
85 | fun isConnectedToThisServer(host: String): Boolean { | 88 | fun isConnectedToThisServer(host: String): Boolean { |
86 | 89 | ||
87 | val runtime = Runtime.getRuntime() | 90 | val runtime = Runtime.getRuntime() |
88 | try { | 91 | try { |
89 | val ipProcess = runtime.exec("/system/bin/ping -c 1 $host") | 92 | val ipProcess = runtime.exec("/system/bin/ping -c 1 $host") |
90 | val exitValue = ipProcess.waitFor() | 93 | val exitValue = ipProcess.waitFor() |
91 | ipProcess.destroy() | 94 | ipProcess.destroy() |
92 | return exitValue == 0 | 95 | return exitValue == 0 |
93 | } catch (e: UnknownHostException) { | 96 | } catch (e: UnknownHostException) { |
94 | e.printStackTrace() | 97 | e.printStackTrace() |
95 | } catch (e: IOException) { | 98 | } catch (e: IOException) { |
96 | e.printStackTrace() | 99 | e.printStackTrace() |
97 | } catch (e: InterruptedException) { | 100 | } catch (e: InterruptedException) { |
98 | e.printStackTrace() | 101 | e.printStackTrace() |
99 | } | 102 | } |
100 | 103 | ||
101 | return false | 104 | return false |
102 | } | 105 | } |
103 | class serverValido : DialogFragment() { | 106 | class serverValido : DialogFragment() { |
104 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | 107 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |
105 | return activity?.let { | 108 | return activity?.let { |
106 | val title = "" | 109 | val title = "" |
107 | val content = "¡La IP del servidor es correcta!" | 110 | val content = "¡La IP del servidor es correcta!" |
108 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | 111 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) |
109 | builder.setTitle(title).setMessage(content) | 112 | builder.setTitle(title).setMessage(content) |
110 | .setPositiveButton(android.R.string.ok) { _, _ -> } | 113 | .setPositiveButton(android.R.string.ok) { _, _ -> } |
111 | return builder.create() | 114 | return builder.create() |
112 | } ?: throw IllegalStateException("Activity cannot be null") | 115 | } ?: throw IllegalStateException("Activity cannot be null") |
113 | } | 116 | } |
114 | } | 117 | } |
115 | class serverNoValido : DialogFragment() { | 118 | class serverNoValido : DialogFragment() { |
116 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | 119 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |
117 | return activity?.let { | 120 | return activity?.let { |
118 | val title = "" | 121 | val title = "" |
119 | val content = "¡La IP del servidor es Incorrecta! Verfique en la carga de Servidores." | 122 | val content = "¡La IP del servidor es Incorrecta! Verfique en la carga de Servidores." |
120 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | 123 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) |
121 | builder.setTitle(title).setMessage(content) | 124 | builder.setTitle(title).setMessage(content) |
122 | .setPositiveButton(android.R.string.ok) { _, _ -> } | 125 | .setPositiveButton(android.R.string.ok) { _, _ -> } |
123 | return builder.create() | 126 | return builder.create() |
124 | } ?: throw IllegalStateException("Activity cannot be null") | 127 | } ?: throw IllegalStateException("Activity cannot be null") |
125 | } | 128 | } |
129 | } | ||
130 | class serverNoConf : DialogFragment() { | ||
131 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
132 | return activity?.let { | ||
133 | val title = "Servidor no Valido" | ||
134 | val content = "!Debe configurar el Servidor en Configuraciones¡" | ||
135 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | ||
136 | builder.setTitle(title).setMessage(content) | ||
137 | .setPositiveButton(android.R.string.ok) { _, _ -> } | ||
138 | return builder.create() | ||
139 | } ?: throw IllegalStateException("Activity cannot be null") | ||
140 | } | ||
126 | } | 141 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/ActuaMaestrosFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.actualizacionMaestros | 1 | package com.focasoftware.deboinventariov20.UI.actualizacionMaestros |
2 | 2 | ||
3 | import android.os.Bundle | 3 | import android.os.Bundle |
4 | import android.view.LayoutInflater | 4 | import android.view.LayoutInflater |
5 | import android.view.View | 5 | import android.view.View |
6 | import android.view.ViewGroup | 6 | import android.view.ViewGroup |
7 | import android.widget.Button | 7 | import android.widget.Button |
8 | import android.widget.Toast | ||
8 | import androidx.fragment.app.Fragment | 9 | import androidx.fragment.app.Fragment |
9 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 10 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
10 | import com.focasoftware.deboinventariov20.Model.Articles | 11 | import com.focasoftware.deboinventariov20.Model.Articles |
11 | import com.focasoftware.deboinventariov20.Model.ProductosService | 12 | import com.focasoftware.deboinventariov20.Model.ProductosService |
12 | import com.focasoftware.deboinventariov20.Model.ServeInv | 13 | import com.focasoftware.deboinventariov20.Model.ServeInv |
13 | import com.focasoftware.deboinventariov20.R | 14 | import com.focasoftware.deboinventariov20.R |
14 | import com.focasoftware.deboinventariov20.UI.Utils.noServerConf | 15 | import com.focasoftware.deboinventariov20.UI.Utils.noServerConf |
16 | import com.focasoftware.deboinventariov20.UI.Utils.serverNoConf | ||
17 | import com.focasoftware.deboinventariov20.UI.Utils.serverValido | ||
15 | import kotlinx.android.synthetic.main.fragment_actua_maestros.* | 18 | import kotlinx.android.synthetic.main.fragment_actua_maestros.* |
16 | import kotlinx.coroutines.* | 19 | import kotlinx.coroutines.* |
17 | import kotlinx.coroutines.Dispatchers.IO | 20 | import kotlinx.coroutines.Dispatchers.IO |
18 | import kotlinx.coroutines.Dispatchers.Main | 21 | import kotlinx.coroutines.Dispatchers.Main |
19 | import java.net.SocketTimeoutException | 22 | import java.net.SocketTimeoutException |
20 | 23 | ||
21 | 24 | ||
22 | var BASE_URL = "" | 25 | var BASE_URL = "" |
23 | 26 | var serverPre:ServeInv?=null | |
24 | class ActuaMaestrosFragment : Fragment() { | 27 | class ActuaMaestrosFragment : Fragment() { |
25 | 28 | ||
26 | override fun onCreate(savedInstanceState: Bundle?) { | 29 | override fun onCreate(savedInstanceState: Bundle?) { |
27 | super.onCreate(savedInstanceState) | 30 | super.onCreate(savedInstanceState) |
28 | 31 | ||
29 | GlobalScope.launch(Main) { | 32 | GlobalScope.launch(Main) { |
30 | val serverPre = fetchServerPreOne() | 33 | |
31 | if (serverPre!!.direccion.isNullOrEmpty()) { | 34 | serverPre = fetchServerPreOne() |
32 | val modalDialog = noServerConf() | 35 | if (serverPre!=null) { |
36 | btnConfirmarAct.isEnabled=true | ||
37 | if (serverPre!!.direccion.isNullOrEmpty()) { | ||
38 | val modalDialog = noServerConf() | ||
39 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | ||
40 | } else { | ||
41 | BASE_URL = serverPre!!.direccion.toString() + ":" + serverPre!!.puerto.toString() + "/" | ||
42 | tvServerConectado.text = "Conectado al servidor: ${serverPre!!.descripcion}" | ||
43 | } | ||
44 | }else{ | ||
45 | val modalDialog = serverNoConf() | ||
33 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 46 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") |
34 | } else { | 47 | |
35 | BASE_URL = serverPre.direccion.toString() + ":" + serverPre.puerto.toString() + "/" | 48 | btnConfirmarAct.isEnabled=false |
36 | tvServerConectado.text = "Conectado al servidor: ${serverPre.descripcion}" | 49 | |
37 | } | 50 | } |
38 | } | 51 | } |
39 | 52 | ||
40 | // mostrarArticulos() | 53 | // mostrarArticulos() |
41 | } | 54 | } |
42 | 55 | ||
43 | private suspend fun fetchServerPreOne(): ServeInv? { | 56 | private suspend fun fetchServerPreOne(): ServeInv? { |
44 | return GlobalScope.async(IO) { | 57 | return GlobalScope.async(IO) { |
45 | return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchServerPreOne() | 58 | return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchServerPreOne() |
46 | }.await() | 59 | }.await() |
47 | } | 60 | } |
48 | 61 | ||
49 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 62 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
50 | // Inflate the layout for this fragment | 63 | // Inflate the layout for this fragment |
51 | val v = inflater.inflate(R.layout.fragment_actua_maestros, container, false) | 64 | val v = inflater.inflate(R.layout.fragment_actua_maestros, container, false) |
52 | val bConfirmarAct = v.findViewById<Button>(R.id.btnConfirmarAct) | 65 | val bConfirmarAct = v.findViewById<Button>(R.id.btnConfirmarAct) |
53 | 66 | ||
54 | bConfirmarAct.setOnClickListener { | 67 | bConfirmarAct.setOnClickListener { |
55 | loading_view.visibility = View.VISIBLE | 68 | loading_view.visibility = View.VISIBLE |
56 | countriesList.text = "Obteniendo artículos del servidor, aguarde por favor." | 69 | countriesList.text = "Obteniendo artículos del servidor, aguarde por favor." |
57 | GlobalScope.launch(Main) { | 70 | GlobalScope.launch(Main) { |
58 | obtenerArticulos() | 71 | obtenerArticulos() |
59 | } | 72 | } |
60 | } | 73 | } |
61 | return v | 74 | return v |
62 | } | 75 | } |
63 | 76 | ||
64 | private suspend fun obtenerArticulos() { | 77 | private suspend fun obtenerArticulos() { |
65 | 78 | ||
66 | val productosService = ProductosService.getProductosService() | 79 | val productosService = ProductosService.getProductosService() |
67 | var index: Long = 1 | 80 | var index: Long = 1 |
68 | withContext(IO) { | 81 | withContext(IO) { |
69 | val job = CoroutineScope(IO).launch { | 82 | val job = CoroutineScope(IO).launch { |
70 | // TODO: BORRO TODO LOS ARTICULOS DE LA BASE PARA CARGARLOS DE NUEVO | 83 | // TODO: BORRO TODO LOS ARTICULOS DE LA BASE PARA CARGARLOS DE NUEVO |
71 | AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.deleteAllArticulos() | 84 | AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.deleteAllArticulos() |
72 | try { | 85 | try { |
73 | val response = productosService.getProductos() | 86 | val response = productosService.getProductos() |
74 | if (response.isSuccessful) { | 87 | if (response.isSuccessful) { |
75 | 88 | ||
76 | for (pro in response.body()!!) { | 89 | for (pro in response.body()!!) { |
77 | val artiAcargar = Articles( | 90 | val artiAcargar = Articles( |
78 | pro.sector, | 91 | pro.sector, |
79 | pro.codigo, | 92 | pro.codigo, |
80 | pro.descripcion, | 93 | pro.descripcion, |
81 | pro.codBar, | 94 | pro.codBar, |
82 | pro.codOrigen, | 95 | pro.codOrigen, |
83 | pro.precio, | 96 | pro.precio, |
84 | pro.costo, | 97 | pro.costo, |
85 | pro.exiVenta, | 98 | pro.exiVenta, |
86 | pro.exiDeposito, | 99 | pro.exiDeposito, |
87 | pro.de, | 100 | pro.de, |
88 | pro.balanza, | 101 | pro.balanza, |
89 | pro.depSn, | 102 | pro.depSn, |
90 | pro.imagen | 103 | pro.imagen |
91 | ) | 104 | ) |
92 | index += index | 105 | index += index |
93 | AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.insertArticulos(artiAcargar) | 106 | AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.insertArticulos(artiAcargar) |
94 | } | 107 | } |
95 | withContext(Main) { | 108 | withContext(Main) { |
96 | countriesList.visibility = View.VISIBLE | 109 | countriesList.visibility = View.VISIBLE |
97 | countriesList.text = "¡Datos Importados Correctamente!" | 110 | countriesList.text = "¡Datos Importados Correctamente!" |
98 | loading_view.visibility = View.GONE | 111 | loading_view.visibility = View.GONE |
99 | } | 112 | } |
100 | } else if (!response.isSuccessful) { | 113 | } else if (!response.isSuccessful) { |
101 | withContext(Main) { | 114 | withContext(Main) { |
102 | countriesList.visibility = View.VISIBLE | 115 | countriesList.visibility = View.VISIBLE |
103 | countriesList.text = "¡Sin servicio. No se puede conectar a la api o al servidor configurado en el BackEnd!" | 116 | countriesList.text = "¡Sin servicio. No se puede conectar a la api o al servidor configurado en el BackEnd!" |
104 | loading_view.visibility = View.GONE | 117 | loading_view.visibility = View.GONE |
105 | } | 118 | } |
106 | } | 119 | } |
107 | } catch (e: SocketTimeoutException) { | 120 | } catch (e: SocketTimeoutException) { |
108 | withContext(Main) { | 121 | withContext(Main) { |
109 | countriesList.visibility = View.VISIBLE | 122 | countriesList.visibility = View.VISIBLE |
110 | countriesList.text = "¡Sin conexión al Servidor!" | 123 | countriesList.text = "¡Sin conexión al Servidor!" |
111 | loading_view.visibility = View.GONE | 124 | loading_view.visibility = View.GONE |
112 | } | 125 | } |
113 | } | 126 | } |
114 | } | 127 | } |
115 | // if (job == null) { | 128 | // if (job == null) { |
116 | // withContext(Main) { | 129 | // withContext(Main) { |
117 | // countriesList.visibility = View.VISIBLE | 130 | // countriesList.visibility = View.VISIBLE |
118 | // countriesList.text = "No se puedo realizar la conexión al Servidor" | 131 | // countriesList.text = "No se puedo realizar la conexión al Servidor" |
119 | // loading_view.visibility = View.GONE | 132 | // loading_view.visibility = View.GONE |
120 | // } | 133 | // } |
121 | // } | 134 | // } |
122 | } | 135 | } |
123 | 136 | ||
124 | 137 | ||
125 | // withContext(Dispatchers.Main) { | 138 | // withContext(Dispatchers.Main) { |
126 | // if (response.isSuccessful) { | 139 | // if (response.isSuccessful) { |
127 | // val call = WebService | 140 | // val call = WebService |
128 | // .instance | 141 | // .instance |
129 | // ?.createService(WebServiceApi::class.java) | 142 | // ?.createService(WebServiceApi::class.java) |
130 | // ?.articulos | 143 | // ?.articulos |
131 | // call?.enqueue(object : Callback<List<productos?>?> { | 144 | // call?.enqueue(object : Callback<List<productos?>?> { |
132 | // override fun onResponse( | 145 | // override fun onResponse( |
133 | // call: Call<List<productos?>?>, | 146 | // call: Call<List<productos?>?>, |
134 | // response: Response<List<productos?>?> | 147 | // response: Response<List<productos?>?> |
135 | // ) { | 148 | // ) { |
136 | // if (response.code() == 200) { | 149 | // if (response.code() == 200) { |
137 | // for (i in response.body()!!.indices) { | 150 | // for (i in response.body()!!.indices) { |
138 | // //AppDb.getAppDb(requireActivity())!!.ArticulosDAO()?.insertArticulos(response.body()!![i]) | 151 | // //AppDb.getAppDb(requireActivity())!!.ArticulosDAO()?.insertArticulos(response.body()!![i]) |
139 | // cargarArticulos(2, 500, "sfas", "66666","2,2", "2,2", false, false, "") | 152 | // cargarArticulos(2, 500, "sfas", "66666","2,2", "2,2", false, false, "") |
140 | //// Log.d( | 153 | //// Log.d( |
141 | //// "TAG1", "Nombre Curso: " + response.body()!![i]?.sector | 154 | //// "TAG1", "Nombre Curso: " + response.body()!![i]?.sector |
142 | //// + "Codigo Profesor: " + response.body()!![i]?.descripcion | 155 | //// + "Codigo Profesor: " + response.body()!![i]?.descripcion |
143 | //// ) | 156 | //// ) |
144 | // mostrarArticulos() | 157 | // mostrarArticulos() |
145 | // } | 158 | // } |
146 | // } else if (response.code() == 404) { | 159 | // } else if (response.code() == 404) { |
147 | // Log.d("TAG1", "No hay cursos") | 160 | // Log.d("TAG1", "No hay cursos") |
148 | // } | 161 | // } |
149 | // | 162 | // |
150 | // } | 163 | // } |
151 | // | 164 | // |
152 | // override fun onFailure(call: Call<List<productos?>?>, t: Throwable) {} | 165 | // override fun onFailure(call: Call<List<productos?>?>, t: Throwable) {} |
153 | // }) | 166 | // }) |
154 | } | 167 | } |
155 | 168 | ||
156 | fun mostrarArticulos() { | 169 | fun mostrarArticulos() { |
157 | val Job = GlobalScope.launch { | 170 | val Job = GlobalScope.launch { |
158 | var listArticulos: List<Articles>? = null | 171 | var listArticulos: List<Articles>? = null |
159 | var temp: String = "" | 172 | var temp: String = "" |
160 | listArticulos = AppDb.getAppDb(requireActivity())?.ArticulosDAO()?.findAllArticulos() | 173 | listArticulos = AppDb.getAppDb(requireActivity())?.ArticulosDAO()?.findAllArticulos() |
161 | if (listArticulos != null) { | 174 | if (listArticulos != null) { |
162 | 175 | ||
163 | for (i in listArticulos.indices) temp += listArticulos[i].codigo.toString() | 176 | for (i in listArticulos.indices) temp += listArticulos[i].codigo.toString() |
164 | } | 177 | } |
165 | withContext(Dispatchers.Main) { | 178 | withContext(Dispatchers.Main) { |
166 | countriesList.visibility = View.VISIBLE | 179 | countriesList.visibility = View.VISIBLE |
167 | loading_view.visibility = View.GONE | 180 | loading_view.visibility = View.GONE |
168 | countriesList?.text = temp | 181 | countriesList?.text = temp |
169 | } | 182 | } |
170 | } | 183 | } |
171 | // for (professor in listArticulos!!) { | 184 | // for (professor in listArticulos!!) { |
172 | // editT.text= professor.id.toString() | 185 | // editT.text= professor.id.toString() |
173 | // } | 186 | // } |
174 | } | 187 | } |
175 | } | 188 | } |
176 | 189 | ||
177 | 190 |
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.fragment.app.FragmentActivity | 11 | import androidx.fragment.app.FragmentActivity |
12 | import androidx.lifecycle.lifecycleScope | 12 | import androidx.lifecycle.lifecycleScope |
13 | import androidx.navigation.NavController | 13 | import androidx.navigation.NavController |
14 | import androidx.navigation.Navigation | 14 | import androidx.navigation.Navigation |
15 | import androidx.navigation.fragment.findNavController | 15 | import androidx.navigation.fragment.findNavController |
16 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 16 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
17 | import com.focasoftware.deboinventariov20.Model.ServeInv | 17 | import com.focasoftware.deboinventariov20.Model.ServeInv |
18 | import com.focasoftware.deboinventariov20.R | 18 | import com.focasoftware.deboinventariov20.R |
19 | import com.focasoftware.deboinventariov20.UI.Utils.isConnectedToThisServer | 19 | import com.focasoftware.deboinventariov20.UI.Utils.isConnectedToThisServer |
20 | import com.focasoftware.deboinventariov20.UI.Utils.serverNoValido | 20 | import com.focasoftware.deboinventariov20.UI.Utils.serverNoValido |
21 | import com.focasoftware.deboinventariov20.UI.Utils.serverValido | 21 | import com.focasoftware.deboinventariov20.UI.Utils.serverValido |
22 | import kotlinx.android.synthetic.main.fragment_configuracion.* | 22 | import kotlinx.android.synthetic.main.fragment_configuracion.* |
23 | import kotlinx.coroutines.* | 23 | import kotlinx.coroutines.* |
24 | import kotlinx.coroutines.Dispatchers.Main | 24 | import kotlinx.coroutines.Dispatchers.Main |
25 | 25 | ||
26 | class ConfiguracionFragment : Fragment() { | 26 | class ConfiguracionFragment : Fragment() { |
27 | 27 | ||
28 | lateinit var sharedPreferences: SharedPreferences | 28 | lateinit var sharedPreferences: SharedPreferences |
29 | private lateinit var navController: NavController | 29 | private lateinit var navController: NavController |
30 | var itemSelect: Int = 0 | 30 | var itemSelect: Int = 0 |
31 | var indexSelect: Int = 0 | 31 | var indexSelect: Int = 0 |
32 | 32 | ||
33 | override fun onCreate(savedInstanceState: Bundle?) { | 33 | override fun onCreate(savedInstanceState: Bundle?) { |
34 | super.onCreate(savedInstanceState) | 34 | super.onCreate(savedInstanceState) |
35 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 35 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
36 | } | 36 | } |
37 | 37 | ||
38 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 38 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
39 | super.onViewCreated(view, savedInstanceState) | 39 | super.onViewCreated(view, savedInstanceState) |
40 | navController = Navigation.findNavController(view) | 40 | navController = Navigation.findNavController(view) |
41 | 41 | ||
42 | GlobalScope.launch(Main) { | 42 | GlobalScope.launch(Main) { |
43 | val listServer = mutableListOf<String>() | 43 | val listServer = mutableListOf<String>() |
44 | for (server in getDescServers()) { | 44 | for (server in getDescServers()) { |
45 | listServer.add((if (server.servNum < 9) "0" + server.servNum.toString() else server.servNum.toString()) + " - " + server.descripcion.toString()) | 45 | listServer.add((if (server.servNum < 9) "0" + server.servNum.toString() else server.servNum.toString()) + " - " + server.descripcion.toString()) |
46 | } | 46 | } |
47 | val adapterSpServer = ArrayAdapter( | 47 | val adapterSpServer = ArrayAdapter( |
48 | requireContext(), | 48 | requireContext(), |
49 | R.layout.support_simple_spinner_dropdown_item, | 49 | R.layout.support_simple_spinner_dropdown_item, |
50 | listServer | 50 | listServer |
51 | ) | 51 | ) |
52 | spServidor.adapter = adapterSpServer | 52 | spServidor.adapter = adapterSpServer |
53 | if (sharedPreferences.contains("ServerPredeterminado")) { | 53 | if (sharedPreferences.contains("ServerPredeterminado")) { |
54 | spServidor.setSelection( | 54 | spServidor.setSelection( |
55 | sharedPreferences.getString("ServerPredeterminado", "").toString().toInt() | 55 | sharedPreferences.getString("ServerPredeterminado", "").toString().toInt() |
56 | ) | 56 | ) |
57 | } else (spServidor.setSelection(0)) | 57 | } else (spServidor.setSelection(0)) |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 61 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
62 | 62 | ||
63 | val v = inflater.inflate(R.layout.fragment_configuracion, container, false) | 63 | val v = inflater.inflate(R.layout.fragment_configuracion, container, false) |
64 | val etRuta = v.findViewById<EditText>(R.id.etRuta) | 64 | val etRuta = v.findViewById<EditText>(R.id.etRuta) |
65 | val btnGuardar = v.findViewById<Button>(R.id.btnGuardar) | 65 | val btnGuardar = v.findViewById<Button>(R.id.btnGuardar) |
66 | val rbProInclu = v.findViewById<RadioButton>(R.id.rbProInclu) | 66 | val rbProInclu = v.findViewById<RadioButton>(R.id.rbProInclu) |
67 | val rbProNoInclu = v.findViewById<RadioButton>(R.id.rbProNoInclu) | 67 | val rbProNoInclu = v.findViewById<RadioButton>(R.id.rbProNoInclu) |
68 | val cbHabiLectura = v.findViewById<CheckBox>(R.id.cbHabiLectura) | 68 | val cbHabiLectura = v.findViewById<CheckBox>(R.id.cbHabiLectura) |
69 | val cbMostrarStock = v.findViewById<CheckBox>(R.id.cbMostrarStock) | 69 | val cbMostrarStock = v.findViewById<CheckBox>(R.id.cbMostrarStock) |
70 | val rbCodigoBarras = v.findViewById<RadioButton>(R.id.rbCodigoBarras) | 70 | val rbCodigoBarras = v.findViewById<RadioButton>(R.id.rbCodigoBarras) |
71 | val rbCodigoDebo = v.findViewById<RadioButton>(R.id.rbCodigoDebo) | 71 | val rbCodigoDebo = v.findViewById<RadioButton>(R.id.rbCodigoDebo) |
72 | val rbCodigoOrigen = v.findViewById<RadioButton>(R.id.rbCodigoOrigen) | 72 | val rbCodigoOrigen = v.findViewById<RadioButton>(R.id.rbCodigoOrigen) |
73 | val rbDeposito = v.findViewById<RadioButton>(R.id.rbDeposito) | 73 | val rbDeposito = v.findViewById<RadioButton>(R.id.rbDeposito) |
74 | val rbVentas = v.findViewById<RadioButton>(R.id.rbVentas) | 74 | val rbVentas = v.findViewById<RadioButton>(R.id.rbVentas) |
75 | val cbMostrarExistencia = v.findViewById<CheckBox>(R.id.cbMostrarExistencia) | 75 | val cbMostrarExistencia = v.findViewById<CheckBox>(R.id.cbMostrarExistencia) |
76 | val cbMostrarPrecio = v.findViewById<CheckBox>(R.id.cbMostrarPrecio) | 76 | val cbMostrarPrecio = v.findViewById<CheckBox>(R.id.cbMostrarPrecio) |
77 | val btnAgregarServidor = v.findViewById<Button>(R.id.btnAgregarServidor) | 77 | val btnAgregarServidor = v.findViewById<Button>(R.id.btnAgregarServidor) |
78 | val spServidor = v.findViewById<Spinner>(R.id.spServidor) | 78 | val spServidor = v.findViewById<Spinner>(R.id.spServidor) |
79 | val btnValidarServidor = v.findViewById<Button>(R.id.btnValidarServidor) | 79 | val btnValidarServidor = v.findViewById<Button>(R.id.btnValidarServidor) |
80 | 80 | ||
81 | if (sharedPreferences.contains("etRuta")) if (sharedPreferences.contains("rbProInclu")) { | 81 | if (sharedPreferences.contains("etRuta")) if (sharedPreferences.contains("rbProInclu")) { |
82 | if (sharedPreferences.getString("rbProInclu", "").toString() == "0") { | 82 | if (sharedPreferences.getString("rbProInclu", "").toString() == "0") { |
83 | rbProInclu.isChecked = false | 83 | rbProInclu.isChecked = false |
84 | rbProNoInclu.isChecked = true | 84 | rbProNoInclu.isChecked = true |
85 | } else if (sharedPreferences.getString("rbProInclu", "").toString() == "1") { | 85 | } else if (sharedPreferences.getString("rbProInclu", "").toString() == "1") { |
86 | rbProInclu.isChecked = true | 86 | rbProInclu.isChecked = true |
87 | rbProNoInclu.isChecked = false | 87 | rbProNoInclu.isChecked = false |
88 | } | 88 | } |
89 | } else (sharedPreferences.getString("rbProInclu", "").toString() == "") | 89 | } else (sharedPreferences.getString("rbProInclu", "").toString() == "") |
90 | 90 | ||
91 | if (sharedPreferences.contains("rbProNoInclu")) { | 91 | if (sharedPreferences.contains("rbProNoInclu")) { |
92 | if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") { | 92 | if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") { |
93 | rbProNoInclu.isChecked = false | 93 | rbProNoInclu.isChecked = false |
94 | rbProInclu.isChecked = true | 94 | rbProInclu.isChecked = true |
95 | } else if (sharedPreferences.getString("rbProNoInclu", "").toString() == "1") { | 95 | } else if (sharedPreferences.getString("rbProNoInclu", "").toString() == "1") { |
96 | rbProNoInclu.isChecked = true | 96 | rbProNoInclu.isChecked = true |
97 | rbProInclu.isChecked = false | 97 | rbProInclu.isChecked = false |
98 | } | 98 | } |
99 | } else (sharedPreferences.getString("rbProNoInclu", "").toString() == "") | 99 | } else (sharedPreferences.getString("rbProNoInclu", "").toString() == "") |
100 | 100 | ||
101 | if (sharedPreferences.contains("cbHabiLectura")) { | 101 | if (sharedPreferences.contains("cbHabiLectura")) { |
102 | if (sharedPreferences.getString("cbHabiLectura", "").toString() == "0") { | 102 | if (sharedPreferences.getString("cbHabiLectura", "").toString() == "0") { |
103 | cbHabiLectura.isChecked = false | 103 | cbHabiLectura.isChecked = false |
104 | } else if (sharedPreferences.getString("cbHabiLectura", "").toString() == "1") { | 104 | } else if (sharedPreferences.getString("cbHabiLectura", "").toString() == "1") { |
105 | cbHabiLectura.isChecked = true | 105 | cbHabiLectura.isChecked = true |
106 | } | 106 | } |
107 | } else (sharedPreferences.getString("cbHabiLectura", "").toString() == "") | 107 | } else (sharedPreferences.getString("cbHabiLectura", "").toString() == "") |
108 | 108 | ||
109 | if (sharedPreferences.contains("cbMostrarStock")) { | 109 | if (sharedPreferences.contains("cbMostrarStock")) { |
110 | if (sharedPreferences.getString("cbMostrarStock", "").toString() == "0") { | 110 | if (sharedPreferences.getString("cbMostrarStock", "").toString() == "0") { |
111 | cbMostrarStock.isChecked = false | 111 | cbMostrarStock.isChecked = false |
112 | } else if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") { | 112 | } else if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") { |
113 | cbMostrarStock.isChecked = true | 113 | cbMostrarStock.isChecked = true |
114 | } | 114 | } |
115 | } else (sharedPreferences.getString("cbMostrarStock", "").toString() == "") | 115 | } else (sharedPreferences.getString("cbMostrarStock", "").toString() == "") |
116 | 116 | ||
117 | if (sharedPreferences.contains("rbVentas")) { | 117 | if (sharedPreferences.contains("rbVentas")) { |
118 | if (sharedPreferences.getString("rbVentas", "").toString() == "0") { | 118 | if (sharedPreferences.getString("rbVentas", "").toString() == "0") { |
119 | rbVentas.isChecked = false | 119 | rbVentas.isChecked = false |
120 | rbDeposito.isChecked = true | 120 | rbDeposito.isChecked = true |
121 | } else if (sharedPreferences.getString("rbVentas", "").toString() == "1") { | 121 | } else if (sharedPreferences.getString("rbVentas", "").toString() == "1") { |
122 | rbVentas.isChecked = true | 122 | rbVentas.isChecked = true |
123 | rbDeposito.isChecked = false | 123 | rbDeposito.isChecked = false |
124 | } | 124 | } |
125 | } else (sharedPreferences.getString("rbVentas", "").toString() == "") | 125 | } else (sharedPreferences.getString("rbVentas", "").toString() == "") |
126 | 126 | ||
127 | if (sharedPreferences.contains("rbDeposito")) { | 127 | if (sharedPreferences.contains("rbDeposito")) { |
128 | if (sharedPreferences.getString("rbDeposito", "").toString() == "0") { | 128 | if (sharedPreferences.getString("rbDeposito", "").toString() == "0") { |
129 | rbDeposito.isChecked = false | 129 | rbDeposito.isChecked = false |
130 | rbVentas.isChecked = true | 130 | rbVentas.isChecked = true |
131 | } else if (sharedPreferences.getString("rbDeposito", "").toString() == "1") { | 131 | } else if (sharedPreferences.getString("rbDeposito", "").toString() == "1") { |
132 | rbDeposito.isChecked = true | 132 | rbDeposito.isChecked = true |
133 | rbVentas.isChecked = false | 133 | rbVentas.isChecked = false |
134 | } | 134 | } |
135 | } else (sharedPreferences.getString("rbDeposito", "").toString() == "") | 135 | } else (sharedPreferences.getString("rbDeposito", "").toString() == "") |
136 | 136 | ||
137 | if (sharedPreferences.contains("rbCodigoDebo")) { | 137 | if (sharedPreferences.contains("rbCodigoDebo")) { |
138 | if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "0") { | 138 | if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "0") { |
139 | rbCodigoDebo.isChecked = false | 139 | rbCodigoDebo.isChecked = false |
140 | rbCodigoOrigen.isChecked = false | 140 | rbCodigoOrigen.isChecked = false |
141 | rbCodigoBarras.isChecked = false | 141 | rbCodigoBarras.isChecked = false |
142 | } else if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "1") { | 142 | } else if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "1") { |
143 | rbCodigoDebo.isChecked = true | 143 | rbCodigoDebo.isChecked = true |
144 | rbCodigoOrigen.isChecked = false | 144 | rbCodigoOrigen.isChecked = false |
145 | rbCodigoBarras.isChecked = false | 145 | rbCodigoBarras.isChecked = false |
146 | } | 146 | } |
147 | } else (sharedPreferences.getString("rbCodigoDebo", "").toString() == "") | 147 | } else (sharedPreferences.getString("rbCodigoDebo", "").toString() == "") |
148 | 148 | ||
149 | if (sharedPreferences.contains("rbCodigoOrigen")) { | 149 | if (sharedPreferences.contains("rbCodigoOrigen")) { |
150 | if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "0") { | 150 | if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "0") { |
151 | rbCodigoOrigen.isChecked = false | 151 | rbCodigoOrigen.isChecked = false |
152 | } else if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "1") { | 152 | } else if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "1") { |
153 | rbCodigoOrigen.isChecked = true | 153 | rbCodigoOrigen.isChecked = true |
154 | } | 154 | } |
155 | } else (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "") | 155 | } else (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "") |
156 | 156 | ||
157 | if (sharedPreferences.contains("rbCodigoBarras")) { | 157 | if (sharedPreferences.contains("rbCodigoBarras")) { |
158 | if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "0") { | 158 | if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "0") { |
159 | rbCodigoBarras.isChecked = false | 159 | rbCodigoBarras.isChecked = false |
160 | } else if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "1") { | 160 | } else if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "1") { |
161 | rbCodigoBarras.isChecked = true | 161 | rbCodigoBarras.isChecked = true |
162 | } | 162 | } |
163 | } else (sharedPreferences.getString("rbCodigoBarras", "").toString() == "") | 163 | } else (sharedPreferences.getString("rbCodigoBarras", "").toString() == "") |
164 | 164 | ||
165 | if (sharedPreferences.contains("cbMostrarExistencia")) { | 165 | if (sharedPreferences.contains("cbMostrarExistencia")) { |
166 | if (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "0") { | 166 | if (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "0") { |
167 | cbMostrarExistencia.isChecked = false | 167 | cbMostrarExistencia.isChecked = false |
168 | } else if (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "1") { | 168 | } else if (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "1") { |
169 | cbMostrarExistencia.isChecked = true | 169 | cbMostrarExistencia.isChecked = true |
170 | } | 170 | } |
171 | } else (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "") | 171 | } else (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "") |
172 | 172 | ||
173 | if (sharedPreferences.contains("cbMostrarPrecio")) { | 173 | if (sharedPreferences.contains("cbMostrarPrecio")) { |
174 | if (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "0") { | 174 | if (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "0") { |
175 | cbMostrarPrecio.isChecked = false | 175 | cbMostrarPrecio.isChecked = false |
176 | } else if (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "1") { | 176 | } else if (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "1") { |
177 | cbMostrarPrecio.isChecked = true | 177 | cbMostrarPrecio.isChecked = true |
178 | } | 178 | } |
179 | } else (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "") | 179 | } else (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "") |
180 | 180 | ||
181 | btnGuardar.setOnClickListener { | 181 | btnGuardar.setOnClickListener { |
182 | guardarPreferencias() | 182 | guardarPreferencias() |
183 | Toast.makeText(v.context, "Los Datos se guardaron correctamente", Toast.LENGTH_LONG) | 183 | Toast.makeText(v.context, "Los Datos se guardaron correctamente", Toast.LENGTH_LONG) |
184 | .show() | 184 | .show() |
185 | navController.navigate(R.id.action_configuracionFragment_to_mainFragment2) | 185 | navController.navigate(R.id.action_configuracionFragment_to_mainFragment2) |
186 | } | 186 | } |
187 | btnAgregarServidor.setOnClickListener { findNavController().navigate(R.id.servidoresFragment) } | 187 | btnAgregarServidor.setOnClickListener { findNavController().navigate(R.id.servidoresFragment) } |
188 | 188 | ||
189 | spServidor.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { | 189 | spServidor.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { |
190 | override fun onNothingSelected(parent: AdapterView<*>?) {} | 190 | override fun onNothingSelected(parent: AdapterView<*>?) {} |
191 | override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { | 191 | override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { |
192 | itemSelect = parent!!.getItemAtPosition(position).toString().substring(0, 2).toInt() | 192 | itemSelect = parent!!.getItemAtPosition(position).toString().substring(0, 2).toInt() |
193 | indexSelect = position | 193 | indexSelect = position |
194 | } | 194 | } |
195 | } | 195 | } |
196 | 196 | ||
197 | btnValidarServidor.setOnClickListener { | 197 | btnValidarServidor.setOnClickListener { |
198 | GlobalScope.launch(Main) { | 198 | GlobalScope.launch(Main) { |
199 | 199 | ||
200 | val serverPre = fetchServer() | 200 | val serverPre = fetchServer() |
201 | if (serverPre != null) { | 201 | if (serverPre != null) { |
202 | if (isConnectedToThisServer(serverPre.direccion.toString().substring(7, serverPre.direccion.toString().length))) { | 202 | if (isConnectedToThisServer(serverPre.direccion.toString().substring(7, serverPre.direccion.toString().length))) { |
203 | val modalDialog = serverValido() | 203 | val modalDialog = serverValido() |
204 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 204 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") |
205 | } else { | 205 | } else { |
206 | val modalDialog = serverNoValido() | 206 | val modalDialog = serverNoValido() |
207 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 207 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") |
208 | } | 208 | } |
209 | } | 209 | } |
210 | } | 210 | } |
211 | } | 211 | } |
212 | 212 | ||
213 | return v | 213 | return v |
214 | } | 214 | } |
215 | 215 | ||
216 | private suspend fun fetchServer(): ServeInv? { | 216 | private suspend fun fetchServer(): ServeInv? { |
217 | return GlobalScope.async(Dispatchers.IO) { | 217 | return GlobalScope.async(Dispatchers.IO) { |
218 | return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchServer(itemSelect) | 218 | return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchServer(itemSelect) |
219 | }.await() | 219 | }.await() |
220 | } | 220 | } |
221 | 221 | ||
222 | suspend fun getDescServers(): List<ServeInv> { | 222 | suspend fun getDescServers(): List<ServeInv> { |
223 | return GlobalScope.async(Dispatchers.IO) { | 223 | return GlobalScope.async(Dispatchers.IO) { |
224 | return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchAllServers() | 224 | return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchAllServers() |
225 | }.await() | 225 | }.await() |
226 | } | 226 | } |
227 | 227 | ||
228 | fun guardarPreferencias() { | 228 | fun guardarPreferencias() { |
229 | try { | 229 | try { |
230 | val editor = sharedPreferences.edit() | 230 | val editor = sharedPreferences.edit() |
231 | 231 | ||
232 | if (etRuta.text.isNotEmpty()) editor?.putString("etRuta", etRuta.text.toString()) | 232 | if (etRuta.text.isNotEmpty()) editor?.putString("etRuta", etRuta.text.toString()) |
233 | 233 | ||
234 | if (rbProInclu.isChecked) editor?.putString( | 234 | if (rbProInclu.isChecked) editor?.putString("rbProInclu", "1") else editor?.putString("rbProInclu", "0") |
235 | "rbProInclu", | 235 | if (rbProNoInclu.isChecked) editor?.putString("rbProNoInclu", "1") else editor?.putString("rbProNoInclu", "0") |
236 | "1" | 236 | if (cbHabiLectura.isChecked) editor?.putString("cbHabiLectura", "1") else editor?.putString("cbHabiLectura", "0") |
237 | ) else editor?.putString("rbProInclu", "0") | 237 | if (cbMostrarStock.isChecked) editor?.putString("cbMostrarStock", "1") else editor?.putString("cbMostrarStock", "0") |
238 | if (rbProNoInclu.isChecked) editor?.putString( | 238 | if (rbVentas.isChecked) editor?.putString("rbVentas","1") else editor?.putString("rbVentas", "0") |
239 | "rbProNoInclu", | 239 | if (rbDeposito.isChecked) editor?.putString("rbDeposito","1") else editor?.putString("rbDeposito", "0") |
240 | "1" | 240 | // if (rbCodigoDebo.isChecked) editor?.putString("rbCodigoDebo", "1") else editor?.putString("rbCodigoDebo", "0") |
241 | ) else editor?.putString("rbProNoInclu", "0") | 241 | // if (rbCodigoOrigen.isChecked) editor?.putString("rbCodigoOrigen", "1") else editor?.putString("rbCodigoOrigen", "0") |
242 | 242 | // if (rbCodigoBarras.isChecked) editor?.putString("rbCodigoBarras", "1") else editor?.putString("rbCodigoBarras", "0") | |
243 | if (cbHabiLectura.isChecked) editor?.putString( | 243 | // if (cbMostrarExistencia.isChecked) editor?.putString("cbMostrarExistencia", "1") else editor?.putString("cbMostrarExistencia", "0") |
244 | "cbHabiLectura", | 244 | // if (cbMostrarPrecio.isChecked) editor?.putString("cbMostrarPrecio", "1") else editor?.putString("cbMostrarPrecio", "0") |
245 | "1" | ||
246 | ) else editor?.putString( | ||
247 | "cbHabiLectura", | ||
248 | "0" | ||
249 | ) | ||
250 | if (cbMostrarStock.isChecked) editor?.putString( | ||
251 | "cbMostrarStock", | ||
252 | "1" | ||
253 | ) else editor?.putString("cbMostrarStock", "0") | ||
254 | if (rbVentas.isChecked) editor?.putString( | ||
255 | "rbVentas", | ||
256 | "1" | ||
257 | ) else editor?.putString("rbVentas", "0") | ||
258 | if (rbDeposito.isChecked) editor?.putString( | ||
259 | "rbDeposito", | ||
260 | "1" | ||
261 | ) else editor?.putString("rbDeposito", "0") | ||
262 | if (rbCodigoDebo.isChecked) editor?.putString( | ||
263 | "rbCodigoDebo", | ||
264 | "1" | ||
265 | ) else editor?.putString("rbCodigoDebo", "0") | ||
266 | if (rbCodigoOrigen.isChecked) editor?.putString( | ||
267 | "rbCodigoOrigen", | ||
268 | "1" | ||
269 | ) else editor?.putString("rbCodigoOrigen", "0") | ||
270 | if (rbCodigoBarras.isChecked) editor?.putString( | ||
271 | "rbCodigoBarras", | ||
272 | "1" | ||
273 | ) else editor?.putString("rbCodigoBarras", "0") | ||
274 | if (cbMostrarExistencia.isChecked) editor?.putString( | ||
275 | "cbMostrarExistencia", | ||
276 | "1" | ||
277 | ) else editor?.putString("cbMostrarExistencia", "0") | ||
278 | if (cbMostrarPrecio.isChecked) editor?.putString( | ||
279 | "cbMostrarPrecio", | ||
280 | "1" | ||
281 | ) else editor?.putString("cbMostrarPrecio", "0") | ||
282 | editor?.putString("ServerPredeterminado", indexSelect.toString()) | 245 | editor?.putString("ServerPredeterminado", indexSelect.toString()) |
283 | updateServerPreInZero() | 246 | updateServerPreInZero() |
284 | updateServerPre(itemSelect) | 247 | updateServerPre(itemSelect) |
285 | 248 | ||
286 | editor?.apply() | 249 | editor?.apply() |
287 | editor.commit() | 250 | editor.commit() |
288 | 251 | ||
289 | } catch (e: Exception) { | 252 | } catch (e: Exception) { |
290 | Toast.makeText(requireContext(), "Error ", Toast.LENGTH_LONG).show() | 253 | Toast.makeText(requireContext(), "Error ", Toast.LENGTH_LONG).show() |
291 | e.printStackTrace() | 254 | e.printStackTrace() |
292 | } | 255 | } |
293 | } | 256 | } |
294 | 257 | ||
295 | private fun updateServerPreInZero() { | 258 | private fun updateServerPreInZero() { |
296 | lifecycleScope.launch { | 259 | lifecycleScope.launch { |
297 | withContext(Dispatchers.IO) { | 260 | withContext(Dispatchers.IO) { |
298 | val activity: FragmentActivity? = activity | 261 | val activity: FragmentActivity? = activity |
299 | if (activity != null && isAdded) { | 262 | if (activity != null && isAdded) { |
300 | AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.UpdateServerPreInZero() | 263 | AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.UpdateServerPreInZero() |
301 | } | 264 | } |
302 | } | 265 | } |
303 | } | 266 | } |
304 | } | 267 | } |
305 | 268 | ||
306 | private fun updateServerPre(server: Int) { | 269 | private fun updateServerPre(server: Int) { |
307 | lifecycleScope.launch { | 270 | lifecycleScope.launch { |
308 | withContext(Dispatchers.IO) { | 271 | withContext(Dispatchers.IO) { |
309 | val activity: FragmentActivity? = activity | 272 | val activity: FragmentActivity? = activity |
310 | if (activity != null) { | 273 | if (activity != null) { |
311 | AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.UpdateServerPre(server) | 274 | AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.UpdateServerPre(server) |
312 | } | 275 | } |
313 | } | 276 | } |
314 | } | 277 | } |
315 | } | 278 | } |
316 | 279 | ||
317 | private suspend fun fetchServerPreOne(): ServeInv? { | 280 | private suspend fun fetchServerPreOne(): ServeInv? { |
318 | return GlobalScope.async(Dispatchers.IO) { | 281 | return GlobalScope.async(Dispatchers.IO) { |
319 | return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchServerPreOne() | 282 | return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchServerPreOne() |
320 | }.await() | 283 | }.await() |
321 | } | 284 | } |
322 | } | 285 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/descripcionFragment/DescripcionFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.descripcionFragment | 1 | package com.focasoftware.deboinventariov20.UI.descripcionFragment |
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.SharedPreferences | 5 | import android.content.SharedPreferences |
6 | import android.graphics.Canvas | 6 | import android.graphics.Canvas |
7 | import android.graphics.Color | 7 | import android.graphics.Color |
8 | import android.graphics.drawable.ColorDrawable | 8 | import android.graphics.drawable.ColorDrawable |
9 | import android.os.Bundle | 9 | import android.os.Bundle |
10 | import android.text.Editable | 10 | import android.text.Editable |
11 | import android.text.InputType | 11 | import android.text.InputType |
12 | import android.text.TextWatcher | 12 | import android.text.TextWatcher |
13 | import android.view.LayoutInflater | 13 | import android.view.LayoutInflater |
14 | import android.view.View | 14 | import android.view.View |
15 | import android.view.ViewGroup | 15 | import android.view.ViewGroup |
16 | import android.view.WindowManager | 16 | import android.view.WindowManager |
17 | import android.view.inputmethod.InputMethodManager | 17 | import android.view.inputmethod.InputMethodManager |
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.lifecycle.lifecycleScope | 20 | import androidx.lifecycle.lifecycleScope |
21 | import androidx.navigation.NavController | 21 | import androidx.navigation.NavController |
22 | import androidx.navigation.Navigation | 22 | import androidx.navigation.Navigation |
23 | import androidx.recyclerview.widget.ItemTouchHelper | 23 | import androidx.recyclerview.widget.ItemTouchHelper |
24 | import androidx.recyclerview.widget.LinearLayoutManager | 24 | import androidx.recyclerview.widget.LinearLayoutManager |
25 | import androidx.recyclerview.widget.RecyclerView | 25 | import androidx.recyclerview.widget.RecyclerView |
26 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 26 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
27 | import com.focasoftware.deboinventariov20.Model.Articles | 27 | import com.focasoftware.deboinventariov20.Model.Articles |
28 | import com.focasoftware.deboinventariov20.Model.InvBody | 28 | import com.focasoftware.deboinventariov20.Model.InvBody |
29 | import com.focasoftware.deboinventariov20.R | 29 | import com.focasoftware.deboinventariov20.R |
30 | import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera | 30 | import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera |
31 | import com.focasoftware.deboinventariov20.UI.inventario.InventarioFragment | 31 | import com.focasoftware.deboinventariov20.UI.inventario.InventarioFragment |
32 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.* | 32 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.* |
33 | import kotlinx.android.synthetic.main.login_dialog.view.* | 33 | import kotlinx.android.synthetic.main.login_dialog.view.* |
34 | import kotlinx.android.synthetic.main.login_dialog.view.btnAceptar | 34 | import kotlinx.android.synthetic.main.login_dialog.view.btnAceptar |
35 | import kotlinx.coroutines.* | 35 | import kotlinx.coroutines.* |
36 | 36 | ||
37 | 37 | ||
38 | class DescripcionFragment : Fragment() { | 38 | class DescripcionFragment : Fragment() { |
39 | private var artAcargar2: List<Articles>? = null | 39 | private var artAcargar2: List<Articles>? = null |
40 | private var listArticulos2: List<Articles>? = null | 40 | private var listArticulos2: List<Articles>? = null |
41 | lateinit var viewAdapter2: RecyclerView.Adapter<*> | 41 | lateinit var viewAdapter2: RecyclerView.Adapter<*> |
42 | private lateinit var viewManager2: RecyclerView.LayoutManager | 42 | private lateinit var viewManager2: RecyclerView.LayoutManager |
43 | private lateinit var rcDescripcion: RecyclerView | 43 | private lateinit var rcDescripcion: RecyclerView |
44 | private var swipeBackground: ColorDrawable = ColorDrawable(Color.YELLOW) | 44 | private var swipeBackground: ColorDrawable = ColorDrawable(Color.YELLOW) |
45 | private var cantidad = 0F | 45 | private var cantidad = 0F |
46 | private var numeroInventario = 0 | 46 | private var numeroInventario = 0 |
47 | lateinit var navController: NavController | 47 | lateinit var navController: NavController |
48 | lateinit var sharedPreferences: SharedPreferences | 48 | lateinit var sharedPreferences: SharedPreferences |
49 | private var artCargadoEnBD: InvBody? = null | 49 | private var artCargadoEnBD: InvBody? = null |
50 | lateinit var mDialogViewM: View | 50 | lateinit var mDialogViewM: View |
51 | 51 | ||
52 | override fun onCreate(savedInstanceState: Bundle?) { | 52 | override fun onCreate(savedInstanceState: Bundle?) { |
53 | super.onCreate(savedInstanceState) | 53 | super.onCreate(savedInstanceState) |
54 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 54 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
55 | arguments.apply { | 55 | arguments.apply { |
56 | artAcargar2 = requireArguments().getSerializable("ArrayDesc") as List<Articles> | 56 | artAcargar2 = requireArguments().getSerializable("ArrayDesc") as List<Articles> |
57 | numeroInventario = requireArguments().getInt("numeroInv") | 57 | numeroInventario = requireArguments().getInt("numeroInv") |
58 | } | 58 | } |
59 | 59 | ||
60 | } | 60 | } |
61 | 61 | ||
62 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 62 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
63 | super.onViewCreated(view, savedInstanceState) | 63 | super.onViewCreated(view, savedInstanceState) |
64 | navController = Navigation.findNavController(view) | 64 | navController = Navigation.findNavController(view) |
65 | showSoftKeyboard(view) | 65 | showSoftKeyboard(view) |
66 | } | 66 | } |
67 | 67 | ||
68 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 68 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
69 | val v = inflater.inflate(R.layout.fragment_descripcion, container, false) | 69 | val v = inflater.inflate(R.layout.fragment_descripcion, container, false) |
70 | rcDescripcion = v.findViewById(R.id.rcDescripcion) | 70 | rcDescripcion = v.findViewById(R.id.rcDescripcion) |
71 | IngresarRecicler(artAcargar2) | 71 | IngresarRecicler(artAcargar2) |
72 | showSoftKeyboard(v) | 72 | showSoftKeyboard(v) |
73 | 73 | ||
74 | return v | 74 | return v |
75 | } | 75 | } |
76 | 76 | ||
77 | private fun showSoftKeyboard(view: View) { | 77 | private fun showSoftKeyboard(view: View) { |
78 | if (view.requestFocus()) { | 78 | if (view.requestFocus()) { |
79 | val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager | 79 | val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager |
80 | imm.showSoftInput(view, InputMethodManager.HIDE_IMPLICIT_ONLY) | 80 | imm.showSoftInput(view, InputMethodManager.HIDE_IMPLICIT_ONLY) |
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
84 | fun IngresarRecicler(articulos: List<Articles>?) { | 84 | fun IngresarRecicler(articulos: List<Articles>?) { |
85 | 85 | ||
86 | viewAdapter2 = DescripcionListAdapter(articulos) | 86 | viewAdapter2 = DescripcionListAdapter(articulos) |
87 | viewManager2 = LinearLayoutManager(requireContext()) | 87 | viewManager2 = LinearLayoutManager(requireContext()) |
88 | 88 | ||
89 | rcDescripcion.apply { | 89 | rcDescripcion.apply { |
90 | adapter = viewAdapter2 | 90 | adapter = viewAdapter2 |
91 | layoutManager = viewManager2 | 91 | layoutManager = viewManager2 |
92 | } | 92 | } |
93 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) { | 93 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) { |
94 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { | 94 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { |
95 | return false | 95 | return false |
96 | } | 96 | } |
97 | 97 | ||
98 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) { | 98 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) { |
99 | 99 | ||
100 | GlobalScope.launch(Dispatchers.Main) { | 100 | GlobalScope.launch(Dispatchers.Main) { |
101 | //TODO BUSCO EN BASE DE DATOS | 101 | //TODO BUSCO EN BASE DE DATOS |
102 | artCargadoEnBD = buscarCodigoDeboEnBD( | 102 | artCargadoEnBD = buscarCodigoDeboEnBD( |
103 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)?.sector.toString(), | 103 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)?.sector.toString(), |
104 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)?.codigo.toString(), numeroInventario.toString() | 104 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)?.codigo.toString(), numeroInventario.toString() |
105 | ) | 105 | ) |
106 | if (artCargadoEnBD == null) { | 106 | if (artCargadoEnBD == null) { |
107 | val mDialogView = LayoutInflater.from(context).inflate(R.layout.ingresar_cantidad, null) | 107 | val mDialogView = LayoutInflater.from(context).inflate(R.layout.ingresar_cantidad, null) |
108 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(false) | 108 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(false) |
109 | //TODO: DEPENDIENDO DEL TIPO DE ARTICULO PERMITER INGRESAR DECIMALES O NO | 109 | //TODO: DEPENDIENDO DEL TIPO DE ARTICULO PERMITER INGRESAR DECIMALES O NO |
110 | if ((viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza == 1 || (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza == 3 || (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza == 7) | 110 | if ((viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza == 1 || (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza == 3 || (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza == 7) |
111 | mDialogView.etCantidad.inputType = InputType.TYPE_CLASS_NUMBER | 111 | mDialogView.etCantidad.inputType = InputType.TYPE_CLASS_NUMBER |
112 | 112 | ||
113 | mDialogView.tvTitulo.text = "${(viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion}" | 113 | mDialogView.tvTitulo.text = "${(viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion}" |
114 | val mAlertDialog = mBuilder.show() | 114 | val mAlertDialog = mBuilder.show() |
115 | 115 | ||
116 | mDialogView.etCantidad.requestFocus() | 116 | mDialogView.etCantidad.requestFocus() |
117 | mAlertDialog.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 117 | mAlertDialog.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
118 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 118 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
119 | 119 | ||
120 | mDialogView.btnAceptar.setOnClickListener { | 120 | mDialogView.btnAceptar.setOnClickListener { |
121 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { | 121 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { |
122 | mDialogView.etCantidad.error = "No vacio" | 122 | mDialogView.etCantidad.error = "No vacio" |
123 | mDialogView.etCantidad.requestFocus() | 123 | mDialogView.etCantidad.requestFocus() |
124 | mDialogView.etCantidad.hint = "Ingrese un valor" | 124 | mDialogView.etCantidad.hint = "Ingrese un valor" |
125 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { | 125 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { |
126 | cantidad = String.format("%.2f", mDialogView.etCantidad.text.toString().toFloat()).toFloat() | 126 | |
127 | cantidad = String.format("%.2f",mDialogView.etCantidad.text.toString().toFloat()).toFloat() | ||
127 | val body = InvBody( | 128 | val body = InvBody( |
128 | numeroInventario, | 129 | numeroInventario, |
129 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.sector, | 130 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.sector, |
130 | // TODO: PREPARO PARA MANDAR A CARGAR EN LA BD | 131 | // TODO: PREPARO PARA MANDAR A CARGAR EN LA BD |
131 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo, | 132 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo, |
132 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion, | 133 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion, |
133 | cantidad.toString(), | 134 | cantidad.toString(), |
134 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codBar, | 135 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codBar, |
135 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codOrigen, | 136 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codOrigen, |
136 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, | 137 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, |
137 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, | 138 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, |
138 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza, | 139 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza, |
139 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.depSn, | 140 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.depSn, |
140 | InventarioFragment().ObtenerFechaActual(), | 141 | InventarioFragment().ObtenerFechaActual(), |
141 | InventarioFragment().ObtenerFechaActual() | 142 | InventarioFragment().ObtenerFechaActual() |
142 | ) | 143 | ) |
143 | InsertarArtEnDB(body)// TODO: MANDO A CARGAR A LA BASE DE DATOS | 144 | InsertarArtEnDB(body)// TODO: MANDO A CARGAR A LA BASE DE DATOS |
144 | modificarCantidadEnCabecera(numeroInventario, true, requireActivity()) | 145 | modificarCantidadEnCabecera(numeroInventario, true, requireActivity()) |
145 | // VolverAinventario() | 146 | // VolverAinventario() |
146 | activity?.onBackPressed() | 147 | activity?.onBackPressed() |
147 | mAlertDialog.dismiss() | 148 | mAlertDialog.dismiss() |
148 | } | 149 | } |
149 | } | 150 | } |
150 | } else if (artCargadoEnBD != null) { | 151 | } else if (artCargadoEnBD != null) { |
151 | 152 | ||
152 | mDialogViewM = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | 153 | mDialogViewM = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) |
153 | val mBuilder = AlertDialog.Builder(context).setView(mDialogViewM).setCancelable(false) | 154 | val mBuilder = AlertDialog.Builder(context).setView(mDialogViewM).setCancelable(false) |
154 | if (artCargadoEnBD!!.balanza.toString().contains("1") || artCargadoEnBD!!.balanza.toString().contains("3") || artCargadoEnBD!!.balanza.toString().contains("7") | 155 | if (artCargadoEnBD!!.balanza.toString().contains("1") || artCargadoEnBD!!.balanza.toString().contains("3") || artCargadoEnBD!!.balanza.toString().contains("7") |
155 | ) mDialogViewM.tvNuevaCantidad.inputType = InputType.TYPE_CLASS_NUMBER | 156 | ) mDialogViewM.tvNuevaCantidad.inputType = InputType.TYPE_CLASS_NUMBER |
156 | mDialogViewM.tvTitulo2.text="${artCargadoEnBD!!.descripcion}" | 157 | mDialogViewM.tvTitulo2.text="${artCargadoEnBD!!.descripcion}" |
157 | mDialogViewM.tvCantInicial.text = String.format("%.2f", artCargadoEnBD!!.cantTomada.toString().toFloat()) | 158 | mDialogViewM.tvCantInicial.text = String.format("%.2f", artCargadoEnBD!!.cantTomada.toString().toFloat()) |
158 | 159 | ||
159 | val mAlertDialog = mBuilder.show() | 160 | val mAlertDialog = mBuilder.show() |
160 | mDialogViewM.tvNuevaCantidad.requestFocus() | 161 | mDialogViewM.tvNuevaCantidad.requestFocus() |
161 | 162 | ||
162 | 163 | ||
163 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 164 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
164 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 165 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
165 | 166 | ||
166 | mDialogViewM.tvNuevaCantidad.addTextChangedListener(textWatcher) | 167 | mDialogViewM.tvNuevaCantidad.addTextChangedListener(textWatcher) |
167 | 168 | ||
168 | mDialogViewM.rbSumar.setOnClickListener { | 169 | mDialogViewM.rbSumar.setOnClickListener { |
169 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 170 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
170 | mDialogViewM.tvResultado.text = String.format("%.2f", (mDialogViewM.tvCantInicial.text.toString().toFloat() + mDialogViewM.tvNuevaCantidad.text.toString().toFloat())) | 171 | mDialogViewM.tvResultado.text = String.format("%.2f", (mDialogViewM.tvCantInicial.text.toString().toFloat() + mDialogViewM.tvNuevaCantidad.text.toString().toFloat())) |
171 | // mDialogViewM.tvNuevaCantidad.isEnabled = false | 172 | // mDialogViewM.tvNuevaCantidad.isEnabled = false |
172 | } | 173 | } |
173 | } | 174 | } |
174 | mDialogViewM.rbRestar.setOnClickListener { | 175 | mDialogViewM.rbRestar.setOnClickListener { |
175 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 176 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
176 | if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) { | 177 | if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) { |
177 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) | 178 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) |
178 | // mDialogViewM.tvNuevaCantidad.isEnabled = false | 179 | // mDialogViewM.tvNuevaCantidad.isEnabled = false |
179 | } else { | 180 | } else { |
180 | mDialogViewM.tvResultado.text = "" | 181 | mDialogViewM.tvResultado.text = "" |
181 | mDialogViewM.tvResultado.error = "Operación No Valida" | 182 | mDialogViewM.tvResultado.error = "Operación No Valida" |
182 | mDialogViewM.tvResultado.requestFocus() | 183 | mDialogViewM.tvResultado.requestFocus() |
183 | mDialogViewM.tvResultado.hint = "Error" | 184 | mDialogViewM.tvResultado.hint = "Error" |
184 | } | 185 | } |
185 | } | 186 | } |
186 | } | 187 | } |
187 | mDialogViewM.rbMdodificar.setOnClickListener { | 188 | mDialogViewM.rbMdodificar.setOnClickListener { |
188 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 189 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
189 | mDialogViewM.tvResultado.text = String.format("%.2f", (mDialogViewM.tvNuevaCantidad.text.toString().toFloat())) | 190 | mDialogViewM.tvResultado.text = String.format("%.2f", (mDialogViewM.tvNuevaCantidad.text.toString().toFloat())) |
190 | // mDialogViewM.tvNuevaCantidad.isEnabled = false | 191 | // mDialogViewM.tvNuevaCantidad.isEnabled = false |
191 | } | 192 | } |
192 | } | 193 | } |
193 | mDialogViewM.btnAceptar.setOnClickListener { | 194 | mDialogViewM.btnAceptar.setOnClickListener { |
194 | if (mDialogViewM.tvNuevaCantidad.text.isNotEmpty() || !mDialogViewM.tvNuevaCantidad.text.isBlank()) { | 195 | if (mDialogViewM.tvNuevaCantidad.text.isNotEmpty() || !mDialogViewM.tvNuevaCantidad.text.isBlank()) { |
195 | if (mDialogViewM.tvResultado.text.isNotEmpty() || !mDialogViewM.tvResultado.text.isBlank()) { | 196 | if (mDialogViewM.tvResultado.text.isNotEmpty() || !mDialogViewM.tvResultado.text.isBlank()) { |
196 | 197 | ||
197 | updateCantidad( | 198 | updateCantidad( |
198 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.sector.toString(), | 199 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.sector.toString(), |
199 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo.toString(), | 200 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo.toString(), |
200 | mDialogViewM.tvResultado.text.toString().toFloat() | 201 | mDialogViewM.tvResultado.text.toString().toFloat() |
201 | ) | 202 | ) |
202 | activity?.onBackPressed() | 203 | activity?.onBackPressed() |
203 | mAlertDialog.dismiss() | 204 | mAlertDialog.dismiss() |
204 | } else if (mDialogViewM.tvNuevaCantidad.text.isNotEmpty() || mDialogViewM.tvNuevaCantidad.text.isBlank()) { | 205 | } else if (mDialogViewM.tvNuevaCantidad.text.isNotEmpty() || mDialogViewM.tvNuevaCantidad.text.isBlank()) { |
205 | mDialogViewM.tvResultado.error = "Operación Requerida" | 206 | mDialogViewM.tvResultado.error = "Operación Requerida" |
206 | mDialogViewM.tvResultado.requestFocus() | 207 | mDialogViewM.tvResultado.requestFocus() |
207 | mDialogViewM.tvResultado.hint = "Seleccione Operación" | 208 | mDialogViewM.tvResultado.hint = "Seleccione Operación" |
208 | } | 209 | } |
209 | } else if (mDialogViewM.tvNuevaCantidad.text.isEmpty() || mDialogViewM.tvNuevaCantidad.text.isBlank()) { | 210 | } else if (mDialogViewM.tvNuevaCantidad.text.isEmpty() || mDialogViewM.tvNuevaCantidad.text.isBlank()) { |
210 | mDialogViewM.tvNuevaCantidad.error = "Completar" | 211 | mDialogViewM.tvNuevaCantidad.error = "Completar" |
211 | mDialogViewM.tvNuevaCantidad.requestFocus() | 212 | mDialogViewM.tvNuevaCantidad.requestFocus() |
212 | mDialogViewM.tvNuevaCantidad.hint = "Ingrese un valor" | 213 | mDialogViewM.tvNuevaCantidad.hint = "Ingrese un valor" |
213 | } | 214 | } |
214 | } | 215 | } |
215 | mDialogViewM.dialogCancelBtn.setOnClickListener { | 216 | mDialogViewM.dialogCancelBtn.setOnClickListener { |
216 | activity?.onBackPressed() | 217 | activity?.onBackPressed() |
217 | mAlertDialog.dismiss() | 218 | mAlertDialog.dismiss() |
218 | } | 219 | } |
219 | } | 220 | } |
220 | } | 221 | } |
221 | } | 222 | } |
222 | 223 | ||
223 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { | 224 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { |
224 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | 225 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) |
225 | val itemView = viewHolder.itemView | 226 | val itemView = viewHolder.itemView |
226 | 227 | ||
227 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) | 228 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) |
228 | 229 | ||
229 | if (dX > 0) { | 230 | if (dX > 0) { |
230 | 231 | ||
231 | c.drawColor(Color.RED) | 232 | c.drawColor(Color.RED) |
232 | } else if (dX < 0) { | 233 | } else if (dX < 0) { |
233 | // swipeBackground.setBounds(itemView.right+dX.toInt(),itemView.top,itemView.right,itemView.bottom) | 234 | // swipeBackground.setBounds(itemView.right+dX.toInt(),itemView.top,itemView.right,itemView.bottom) |
234 | c.drawColor(Color.YELLOW) | 235 | c.drawColor(Color.YELLOW) |
235 | } | 236 | } |
236 | swipeBackground.draw(c) | 237 | swipeBackground.draw(c) |
237 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | 238 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) |
238 | } | 239 | } |
239 | } | 240 | } |
240 | val itemTouchHelper2 = ItemTouchHelper(itemTouchHelperCallback) | 241 | val itemTouchHelper2 = ItemTouchHelper(itemTouchHelperCallback) |
241 | itemTouchHelper2.attachToRecyclerView(rcDescripcion) | 242 | itemTouchHelper2.attachToRecyclerView(rcDescripcion) |
242 | } | 243 | } |
243 | 244 | ||
244 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { | 245 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { |
245 | lifecycleScope.launch { | 246 | lifecycleScope.launch { |
246 | withContext(Dispatchers.IO) { | 247 | withContext(Dispatchers.IO) { |
247 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) | 248 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) |
248 | } | 249 | } |
249 | } | 250 | } |
250 | } | 251 | } |
251 | 252 | ||
252 | suspend fun buscarCodigoDeboEnBD(sector: String, codigo: String, numInventario: String): InvBody? { | 253 | suspend fun buscarCodigoDeboEnBD(sector: String, codigo: String, numInventario: String): InvBody? { |
253 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 254 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
254 | var busqueda: InvBody? = null | 255 | var busqueda: InvBody? = null |
255 | return GlobalScope.async(Dispatchers.IO) { | 256 | return GlobalScope.async(Dispatchers.IO) { |
256 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.fetchArtInInvBody(sector.toLong(), codigo.toLong(), numInventario.toLong()) | 257 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.fetchArtInInvBody(sector.toLong(), codigo.toLong(), numInventario.toLong()) |
257 | return@async busqueda | 258 | return@async busqueda |
258 | }.await() | 259 | }.await() |
259 | } | 260 | } |
260 | 261 | ||
261 | fun updateCantidad(sector: String, codigo: String, cantidad: Float) { | 262 | fun updateCantidad(sector: String, codigo: String, cantidad: Float) { |
262 | lifecycleScope.launch { | 263 | lifecycleScope.launch { |
263 | withContext(Dispatchers.IO) { | 264 | withContext(Dispatchers.IO) { |
264 | val activity: FragmentActivity? = activity | 265 | val activity: FragmentActivity? = activity |
265 | if (activity != null && isAdded) { | 266 | if (activity != null && isAdded) { |
266 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.UpdateInvBody(cantidad, sector.toLong(), codigo.toLong()) | 267 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.UpdateInvBody(cantidad, sector.toLong(), codigo.toLong()) |
267 | } | 268 | } |
268 | } | 269 | } |
269 | } | 270 | } |
270 | } | 271 | } |
271 | 272 | ||
272 | private val textWatcher = object : TextWatcher { | 273 | private val textWatcher = object : TextWatcher { |
273 | override fun afterTextChanged(s: Editable?) { | 274 | override fun afterTextChanged(s: Editable?) { |
274 | } | 275 | } |
275 | 276 | ||
276 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { | 277 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { |
277 | } | 278 | } |
278 | 279 | ||
279 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { | 280 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
280 | if (mDialogViewM.rbSumar.isChecked) { | 281 | if (mDialogViewM.rbSumar.isChecked) { |
281 | // mDialogView.tvNuevaCantidad.isEnabled=false | 282 | // mDialogView.tvNuevaCantidad.isEnabled=false |
282 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvNuevaCantidad.text.toString().toFloat() + mDialogViewM.tvCantInicial.text.toString().toFloat()) | 283 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvNuevaCantidad.text.toString().toFloat() + mDialogViewM.tvCantInicial.text.toString().toFloat()) |
283 | } | 284 | } |
284 | if (mDialogViewM.rbRestar.isChecked) { | 285 | if (mDialogViewM.rbRestar.isChecked) { |
285 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 286 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
286 | if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) { | 287 | if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) { |
287 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) | 288 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) |
288 | // mDialogView.tvNuevaCantidad.isEnabled = false | 289 | // mDialogView.tvNuevaCantidad.isEnabled = false |
289 | } else { | 290 | } else { |
290 | mDialogViewM.tvResultado.text = "" | 291 | mDialogViewM.tvResultado.text = "" |
291 | mDialogViewM.tvResultado.error = "Operación No Valida" | 292 | mDialogViewM.tvResultado.error = "Operación No Valida" |
292 | mDialogViewM.tvResultado.requestFocus() | 293 | mDialogViewM.tvResultado.requestFocus() |
293 | mDialogViewM.tvResultado.hint = "Error" | 294 | mDialogViewM.tvResultado.hint = "Error" |
294 | } | 295 | } |
295 | } | 296 | } |
296 | } | 297 | } |
297 | if (mDialogViewM.rbMdodificar.isChecked) { | 298 | if (mDialogViewM.rbMdodificar.isChecked) { |
298 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 299 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
299 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) | 300 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) |
300 | // mDialogView.tvNuevaCantidad.isEnabled = false | 301 | // mDialogView.tvNuevaCantidad.isEnabled = false |
301 | } | 302 | } |
302 | } | 303 | } |
303 | } | 304 | } |
304 | } | 305 | } |
305 | } | 306 | } |
306 | 307 | ||
307 | 308 | ||
308 | 309 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/InventarioFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.inventario | 1 | package com.focasoftware.deboinventariov20.UI.inventario |
2 | 2 | ||
3 | import android.annotation.SuppressLint | 3 | import android.annotation.SuppressLint |
4 | import android.app.AlertDialog | 4 | import android.app.AlertDialog |
5 | import android.app.Dialog | 5 | import android.app.Dialog |
6 | import android.content.Context | 6 | import android.content.Context |
7 | import android.content.Context.INPUT_METHOD_SERVICE | 7 | import android.content.Context.INPUT_METHOD_SERVICE |
8 | import android.content.DialogInterface | 8 | import android.content.DialogInterface |
9 | import android.content.SharedPreferences | 9 | import android.content.SharedPreferences |
10 | import android.graphics.Canvas | 10 | import android.graphics.Canvas |
11 | import android.graphics.Color | 11 | import android.graphics.Color |
12 | import android.graphics.drawable.Drawable | 12 | import android.graphics.drawable.Drawable |
13 | import android.os.Bundle | 13 | import android.os.Bundle |
14 | import android.text.Editable | 14 | import android.text.Editable |
15 | import android.text.InputType.TYPE_CLASS_NUMBER | 15 | import android.text.InputType.TYPE_CLASS_NUMBER |
16 | import android.text.TextWatcher | 16 | import android.text.TextWatcher |
17 | import android.view.* | 17 | import android.view.* |
18 | import android.view.inputmethod.InputMethodManager | 18 | import android.view.inputmethod.InputMethodManager |
19 | import android.widget.EditText | 19 | import android.widget.EditText |
20 | import android.widget.TextView | 20 | import android.widget.TextView |
21 | import android.widget.Toast | 21 | import android.widget.Toast |
22 | import androidx.core.content.ContextCompat | 22 | import androidx.core.content.ContextCompat |
23 | import androidx.core.os.bundleOf | 23 | import androidx.core.os.bundleOf |
24 | import androidx.fragment.app.Fragment | 24 | import androidx.fragment.app.Fragment |
25 | import androidx.lifecycle.ViewModel | ||
26 | import androidx.lifecycle.ViewModelProvider | ||
27 | import androidx.lifecycle.ViewModelProviders | ||
25 | import androidx.lifecycle.lifecycleScope | 28 | import androidx.lifecycle.lifecycleScope |
26 | import androidx.navigation.NavController | 29 | import androidx.navigation.NavController |
27 | import androidx.navigation.Navigation | 30 | import androidx.navigation.Navigation |
28 | import androidx.recyclerview.widget.ItemTouchHelper | 31 | import androidx.recyclerview.widget.ItemTouchHelper |
29 | import androidx.recyclerview.widget.LinearLayoutManager | 32 | import androidx.recyclerview.widget.LinearLayoutManager |
30 | import androidx.recyclerview.widget.RecyclerView | 33 | import androidx.recyclerview.widget.RecyclerView |
31 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 34 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
32 | import com.focasoftware.deboinventariov20.Model.Articles | 35 | import com.focasoftware.deboinventariov20.Model.Articles |
33 | import com.focasoftware.deboinventariov20.Model.InvBody | 36 | import com.focasoftware.deboinventariov20.Model.InvBody |
34 | import com.focasoftware.deboinventariov20.Model.InvHead | 37 | import com.focasoftware.deboinventariov20.Model.InvHead |
35 | import com.focasoftware.deboinventariov20.R | 38 | import com.focasoftware.deboinventariov20.R |
36 | import com.focasoftware.deboinventariov20.UI.Utils.NoEncontradoSimple | 39 | import com.focasoftware.deboinventariov20.UI.Utils.NoEncontradoSimple |
37 | import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera | 40 | import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera |
41 | import com.focasoftware.deboinventariov20.UI.inventario.viewModel.InventarioViewModel | ||
38 | import kotlinx.android.synthetic.main.fragment_inventario.* | 42 | import kotlinx.android.synthetic.main.fragment_inventario.* |
39 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.* | 43 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.* |
40 | import kotlinx.android.synthetic.main.login_dialog.view.* | 44 | import kotlinx.android.synthetic.main.login_dialog.view.* |
41 | import kotlinx.android.synthetic.main.login_dialog.view.btnAceptar | 45 | import kotlinx.android.synthetic.main.login_dialog.view.btnAceptar |
42 | import kotlinx.coroutines.* | 46 | import kotlinx.coroutines.* |
43 | import kotlinx.coroutines.Dispatchers.IO | 47 | import kotlinx.coroutines.Dispatchers.IO |
44 | import java.time.LocalDateTime | 48 | import java.time.LocalDateTime |
45 | import java.time.format.DateTimeFormatter | 49 | import java.time.format.DateTimeFormatter |
46 | import java.util.* | 50 | import java.util.* |
47 | 51 | ||
48 | class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickListener { | 52 | class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickListener { |
49 | 53 | ||
50 | private lateinit var sharedPreferences: SharedPreferences | 54 | private lateinit var sharedPreferences: SharedPreferences |
51 | private var iArea: Boolean = false | 55 | private var iArea: Boolean = false |
52 | private lateinit var invHead: InvHead | 56 | private lateinit var invHead: InvHead |
53 | private lateinit var rcInventarios: RecyclerView | 57 | private lateinit var rcInventarios: RecyclerView |
54 | private lateinit var viewAdapter: RecyclerView.Adapter<*> | 58 | private lateinit var viewAdapter: RecyclerView.Adapter<*> |
55 | private lateinit var viewManager: RecyclerView.LayoutManager | 59 | private lateinit var viewManager: RecyclerView.LayoutManager |
56 | private lateinit var sChangeUpper: String | 60 | private lateinit var sChangeUpper: String |
57 | private var listArticulos = ArrayList<ItemsRecycler>() | 61 | private var listArticulos = ArrayList<ItemsRecycler>() |
58 | private lateinit var navController: NavController | 62 | private lateinit var navController: NavController |
59 | var InventarioNuevo: Int = 0 | 63 | var InventarioNuevo: Int = 0 |
60 | private var iEstado = 0 | 64 | private var iEstado = 0 |
61 | private var iBusquedaPor = 0 | 65 | private var iBusquedaPor = 0 |
62 | private var fCant = 0F | 66 | private var fCant = 0F |
63 | private var bFirst = false | 67 | private var bFirst = false |
64 | private lateinit var deleteIcon: Drawable | 68 | private lateinit var deleteIcon: Drawable |
65 | lateinit var mDialogView: View | 69 | lateinit var mDialogView: View |
70 | lateinit var inventarioViewModel: ViewModel | ||
66 | 71 | ||
67 | @SuppressLint("MissingPermission") | 72 | @SuppressLint("MissingPermission") |
68 | override fun onCreate(savedInstanceState: Bundle?) { | 73 | override fun onCreate(savedInstanceState: Bundle?) { |
69 | super.onCreate(savedInstanceState) | 74 | super.onCreate(savedInstanceState) |
70 | 75 | inventarioViewModel= ViewModelProviders.of(this).get(InventarioViewModel::class.java) | |
76 | |||
71 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 77 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
72 | if (sharedPreferences.contains("Inventario")) if (sharedPreferences.getString("Inventario", "").toString() != "-1") { | 78 | if (sharedPreferences.contains("Inventario")) if (sharedPreferences.getString("Inventario", "").toString() != "-1") { |
73 | InventarioNuevo = sharedPreferences.getString("Inventario", "").toString().toInt() | 79 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = sharedPreferences.getString("Inventario", "").toString().toInt() |
74 | val editor = sharedPreferences.edit() | 80 | val editor = sharedPreferences.edit() |
75 | editor?.putString("Inventario", "-1") | 81 | editor?.putString("Inventario", "-1") |
76 | editor?.apply() | 82 | editor?.apply() |
77 | editor.commit() | 83 | editor.commit() |
78 | } | 84 | } |
79 | // val c = Calendar.getInstance() | 85 | // val c = Calendar.getInstance() |
80 | // c[2009, 9, 9, 12, 0] = 0 | 86 | // c[2009, 9, 9, 12, 0] = 0 |
81 | // val am: AlarmManager = requireActivity().getSystemService(Context.ALARM_SERVICE) as AlarmManager | 87 | // val am: AlarmManager = requireActivity().getSystemService(Context.ALARM_SERVICE) as AlarmManager |
82 | // am.setTime(c.timeInMillis) | 88 | // am.setTime(c.timeInMillis) |
83 | } | 89 | } |
84 | // private fun setupTimeZone(timeZoneName: String) { | 90 | // private fun setupTimeZone(timeZoneName: String) { |
85 | // val am = requireContext().getSystemService(Context.ALARM_SERVICE) as AlarmManager | 91 | // val am = requireContext().getSystemService(Context.ALARM_SERVICE) as AlarmManager |
86 | // am.setTimeZone("Europe/Madrid") | 92 | // am.setTimeZone("Europe/Madrid") |
87 | // } | 93 | // } |
88 | 94 | ||
89 | 95 | ||
90 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 96 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
91 | val v = inflater.inflate(R.layout.fragment_inventario, container, false) | 97 | val v = inflater.inflate(R.layout.fragment_inventario, container, false) |
92 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 98 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
93 | val tCodigoBarras = v.findViewById<EditText>(R.id.etCodigoBarras) | 99 | val tCodigoBarras = v.findViewById<EditText>(R.id.etCodigoBarras) |
94 | rcInventarios = v.findViewById(R.id.rcInventarios) | 100 | rcInventarios = v.findViewById(R.id.rcInventarios) |
95 | val tvTitulo = v.findViewById<TextView>(R.id.tvTitulo) | 101 | val tvTitulo = v.findViewById<TextView>(R.id.tvTitulo) |
96 | 102 | ||
97 | if (InventarioNuevo == 0) {// TODO: SI INVETNARIO NUEVO | 103 | if ((inventarioViewModel as InventarioViewModel).InventarioNuevo == 0) {// TODO: SI INVETNARIO NUEVO |
98 | GlobalScope.launch(Dispatchers.Main) { | 104 | GlobalScope.launch(Dispatchers.Main) { |
99 | //TODO: BUSCO EL ULTIMO INVENTARIO EN LA BD PARA PODER CREAR EL PROXIMO | 105 | //TODO: BUSCO EL ULTIMO INVENTARIO EN LA BD PARA PODER CREAR EL PROXIMO |
100 | InventarioNuevo = AppDb.getAppDb(requireActivity())?.InvHeadDAO()?.findLastInv()?.plus(1) ?: 1 | 106 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = AppDb.getAppDb(requireActivity())?.InvHeadDAO()?.findLastInv()?.plus(1) ?: 1 |
101 | //TODO: CREAMOS EL INVENTARIO EN LA CABECERA DEL INVENTARIO | 107 | //TODO: CREAMOS EL INVENTARIO EN LA CABECERA DEL INVENTARIO |
102 | invHead = InvHead(InventarioNuevo, if (!SerchArea()) "Ventas" else "Deposito", 1, ObtenerFechaActual(), ObtenerFechaActual(), 0L, SerchArea(), AjusteProductos(), ProdNoCont()) | 108 | invHead = InvHead((inventarioViewModel as InventarioViewModel).InventarioNuevo, if (!SerchArea()) "Ventas" else "Deposito", 1, ObtenerFechaActual(), ObtenerFechaActual(), 0L, SerchArea(), AjusteProductos(), ProdNoCont()) |
103 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.insertInvHead(invHead) | 109 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.insertInvHead(invHead) |
104 | tvTitulo.text = "Inventario " + " # $InventarioNuevo" | 110 | tvTitulo.text = "Inventario " + " # ${(inventarioViewModel as InventarioViewModel).InventarioNuevo}" |
105 | } | 111 | } |
106 | } else {// TODO (SI VENGO DE FRAGMENT DESCRIPCION) | 112 | } else {// TODO (SI VENGO DE FRAGMENT DESCRIPCION) |
107 | listArticulos.clear() | 113 | listArticulos.clear() |
108 | CargarDeBdInventario(InventarioNuevo) | 114 | CargarDeBdInventario((inventarioViewModel as InventarioViewModel).InventarioNuevo) |
109 | tvTitulo.text = "Inventario " + " # $InventarioNuevo" | 115 | tvTitulo.text = "Inventario " + " # ${(inventarioViewModel as InventarioViewModel).InventarioNuevo}" |
110 | } | 116 | } |
111 | 117 | ||
112 | tCodigoBarras.setOnKeyListener { _, keyCode, keyEvent -> | 118 | tCodigoBarras.setOnKeyListener { _, keyCode, keyEvent -> |
113 | if (keyCode == KeyEvent.KEYCODE_ENTER && keyEvent.action == KeyEvent.ACTION_UP) { | 119 | if (keyCode == KeyEvent.KEYCODE_ENTER && keyEvent.action == KeyEvent.ACTION_UP) { |
114 | sChangeUpper = tCodigoBarras.text.toString() | 120 | sChangeUpper = tCodigoBarras.text.toString() |
115 | var indiceDelArtEncontrado = 0 | 121 | var indiceDelArtEncontrado = 0 |
116 | 122 | ||
117 | if (tCodigoBarras.text.isNullOrBlank() ) { | 123 | if (tCodigoBarras.text.isNullOrBlank() ) { |
118 | tCodigoBarras.error = "No puede estar vacio" | 124 | tCodigoBarras.error = "No puede estar vacio" |
119 | tCodigoBarras.requestFocus() | 125 | tCodigoBarras.requestFocus() |
120 | tCodigoBarras.hint = "No puede estar vacio" | 126 | tCodigoBarras.hint = "No puede estar vacio" |
121 | }else if (tCodigoBarras.text.toString().length<4 && iEstado==2) { | 127 | }else if (tCodigoBarras.text.toString().length<4 && iEstado==2) { |
122 | tCodigoBarras.error = "Minimo 4 caracteres" | 128 | tCodigoBarras.error = "Minimo 4 caracteres" |
123 | tCodigoBarras.requestFocus() | 129 | tCodigoBarras.requestFocus() |
124 | tCodigoBarras.hint = "4 Minimo" | 130 | tCodigoBarras.hint = "4 Minimo" |
125 | 131 | ||
126 | } else { | 132 | } else { |
127 | 133 | ||
128 | //TODO COMIENZA LA BUSQUEDA POR CODIGO DE BARRAS | 134 | //TODO COMIENZA LA BUSQUEDA POR CODIGO DE BARRAS |
129 | when (iBusquedaPor) { | 135 | when (iBusquedaPor) { |
130 | 0 -> { | 136 | 0 -> { |
131 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 137 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
132 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 138 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
133 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 139 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
134 | 140 | ||
135 | GlobalScope.launch(Dispatchers.Main) { | 141 | GlobalScope.launch(Dispatchers.Main) { |
136 | indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 0)//TODO Si encuentra el articulo en el RV devuelve el indice | 142 | indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 0)//TODO Si encuentra el articulo en el RV devuelve el indice |
137 | //TODO (Si no lo encuentra devuelve -1) | 143 | //TODO (Si no lo encuentra devuelve -1) |
138 | if (indiceDelArtEncontrado != -1) { | 144 | if (indiceDelArtEncontrado != -1) { |
139 | if (swSumaUno!!.isChecked) { | 145 | if (swSumaUno!!.isChecked) { |
140 | // fCant = 0F | 146 | // fCant = 0F |
141 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 147 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
142 | // fCant += 1F | 148 | // fCant += 1F |
143 | //TODO ACTUALIZO LA CANTIDAD EN LA BD | 149 | //TODO ACTUALIZO LA CANTIDAD EN LA BD |
144 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), | 150 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), |
145 | listArticulos[indiceDelArtEncontrado].codigo.toString(), | 151 | listArticulos[indiceDelArtEncontrado].codigo.toString(), |
146 | listArticulos[indiceDelArtEncontrado].cantTomada + 1) | 152 | listArticulos[indiceDelArtEncontrado].cantTomada + 1) |
147 | //TODO ACTUALIZO LA CANTIDAD EN EL RV | 153 | //TODO ACTUALIZO LA CANTIDAD EN EL RV |
148 | listArticulos[indiceDelArtEncontrado].cantTomada = listArticulos[indiceDelArtEncontrado].cantTomada + 1 | 154 | listArticulos[indiceDelArtEncontrado].cantTomada = listArticulos[indiceDelArtEncontrado].cantTomada + 1 |
149 | viewAdapter.notifyDataSetChanged() | 155 | viewAdapter.notifyDataSetChanged() |
150 | } else { | 156 | } else { |
151 | dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) | 157 | dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) |
152 | } | 158 | } |
153 | 159 | ||
154 | } else if (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD | 160 | } else if (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD |
155 | //TODO BUSCO EN BASE DE DATOS | 161 | //TODO BUSCO EN BASE DE DATOS |
156 | val artEncontrado = buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | 162 | val artEncontrado = buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
157 | ContinuarCargaCB(artEncontrado)//TODO SE MANDA CERO POR QUE ES UN ARTICULO ESCANEADO NUEVO PARA QUE SEA COMPATIBLE | 163 | ContinuarCargaCB(artEncontrado)//TODO SE MANDA CERO POR QUE ES UN ARTICULO ESCANEADO NUEVO PARA QUE SEA COMPATIBLE |
158 | } | 164 | } |
159 | tCodigoBarras.focusable = View.FOCUSABLE | 165 | tCodigoBarras.focusable = View.FOCUSABLE |
160 | tCodigoBarras.setText("") | 166 | tCodigoBarras.setText("") |
161 | tCodigoBarras.selectAll() | 167 | tCodigoBarras.selectAll() |
162 | } | 168 | } |
163 | return@setOnKeyListener true | 169 | return@setOnKeyListener true |
164 | 170 | ||
165 | 171 | ||
166 | } | 172 | } |
167 | 1 -> {//TODO: BUSQUEDA POR DESCRIPCION************************************************************************** | 173 | 1 -> {//TODO: BUSQUEDA POR DESCRIPCION************************************************************************** |
168 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 174 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
169 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 175 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
170 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 176 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
171 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 1) //TODO :Si encuentra el articulo en el RV devuelve el indice | 177 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 1) //TODO :Si encuentra el articulo en el RV devuelve el indice |
172 | // //TODO Si no lo encuentra devuelve -1 | 178 | // //TODO Si no lo encuentra devuelve -1 |
173 | // if (indiceDelArtEncontrado != -1) { | 179 | // if (indiceDelArtEncontrado != -1) { |
174 | //// if (swSumaUno!!.isChecked) { | 180 | //// if (swSumaUno!!.isChecked) { |
175 | //// fCant = 0F | 181 | //// fCant = 0F |
176 | //// fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 182 | //// fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
177 | //// fCant += 1F | 183 | //// fCant += 1F |
178 | //// listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 184 | //// listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
179 | //// viewAdapter.notifyDataSetChanged() | 185 | //// viewAdapter.notifyDataSetChanged() |
180 | //// } else { | 186 | //// } else { |
181 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 187 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
182 | // MaterialDialog(requireContext()).show { | 188 | // MaterialDialog(requireContext()).show { |
183 | // title(R.string.sTituloNueva) | 189 | // title(R.string.sTituloNueva) |
184 | // message(R.string.sCantidadNueva) | 190 | // message(R.string.sCantidadNueva) |
185 | // input { materialDialog, charSequence -> | 191 | // input { materialDialog, charSequence -> |
186 | // fCant = 0F | 192 | // fCant = 0F |
187 | // fCant = charSequence.toString().toFloat() | 193 | // fCant = charSequence.toString().toFloat() |
188 | // } | 194 | // } |
189 | // positiveButton(R.string.btnOk) { | 195 | // positiveButton(R.string.btnOk) { |
190 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 196 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
191 | // viewAdapter.notifyDataSetChanged() | 197 | // viewAdapter.notifyDataSetChanged() |
192 | // dismiss() | 198 | // dismiss() |
193 | // } | 199 | // } |
194 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 200 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
195 | //// } | 201 | //// } |
196 | // | 202 | // |
197 | // } else if | 203 | // } else if |
198 | // (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD | 204 | // (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD |
199 | GlobalScope.launch(Dispatchers.Main) { | 205 | GlobalScope.launch(Dispatchers.Main) { |
200 | val artEncontrado = buscarDescEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | 206 | val artEncontrado = buscarDescEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
201 | ContinuarCargaDesc(artEncontrado as ArrayList<Articles>) | 207 | ContinuarCargaDesc(artEncontrado as ArrayList<Articles>) |
202 | } | 208 | } |
203 | 209 | ||
204 | iBusquedaPor = 0 | 210 | iBusquedaPor = 0 |
205 | // } | 211 | // } |
206 | 212 | ||
207 | return@setOnKeyListener true | 213 | return@setOnKeyListener true |
208 | } | 214 | } |
209 | 2 -> {//TODO: BUSQUEDA POR CODIGO DE ORIGEN************************************************************************** | 215 | 2 -> {//TODO: BUSQUEDA POR CODIGO DE ORIGEN************************************************************************** |
210 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 216 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
211 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 217 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
212 | 218 | ||
213 | // GlobalScope.launch(Dispatchers.Main) { | 219 | // GlobalScope.launch(Dispatchers.Main) { |
214 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 2)//TODO Si encuentra el articulo en el RV devuelve el indice | 220 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 2)//TODO Si encuentra el articulo en el RV devuelve el indice |
215 | //// //TODO Si no lo encuentra devuelve -1 | 221 | //// //TODO Si no lo encuentra devuelve -1 |
216 | // if (indiceDelArtEncontrado != -1) { | 222 | // if (indiceDelArtEncontrado != -1) { |
217 | // if (swSumaUno!!.isChecked) { | 223 | // if (swSumaUno!!.isChecked) { |
218 | // fCant = 0F | 224 | // fCant = 0F |
219 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 225 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
220 | // fCant += 1F | 226 | // fCant += 1F |
221 | // //TODO ACTUALIZO LA CANTIDAD EN LA BD | 227 | // //TODO ACTUALIZO LA CANTIDAD EN LA BD |
222 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 228 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
223 | // //TODO ACTUALIZO LA CANTIDAD EN EL RV | 229 | // //TODO ACTUALIZO LA CANTIDAD EN EL RV |
224 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 230 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
225 | // viewAdapter.notifyDataSetChanged() | 231 | // viewAdapter.notifyDataSetChanged() |
226 | // } else { | 232 | // } else { |
227 | // dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) | 233 | // dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) |
228 | // } | 234 | // } |
229 | // } else { | 235 | // } else { |
230 | // val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | 236 | // val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) |
231 | // val mBuilder = | 237 | // val mBuilder = |
232 | // AlertDialog.Builder(context).setView(mDialogView).setTitle("Producto '${listArticulos[indiceDelArtEncontrado].descripcion}', se encuentra cargado.") | 238 | // AlertDialog.Builder(context).setView(mDialogView).setTitle("Producto '${listArticulos[indiceDelArtEncontrado].descripcion}', se encuentra cargado.") |
233 | // .setCancelable(false) | 239 | // .setCancelable(false) |
234 | // mDialogView.tvCantInicial.text = listArticulos[indiceDelArtEncontrado].cantTomada.toString() | 240 | // mDialogView.tvCantInicial.text = listArticulos[indiceDelArtEncontrado].cantTomada.toString() |
235 | // val mAlertDialog = mBuilder.show() | 241 | // val mAlertDialog = mBuilder.show() |
236 | // mDialogView.rbSumar.setOnClickListener { | 242 | // mDialogView.rbSumar.setOnClickListener { |
237 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 243 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
238 | // mDialogView.tvgenerico4.text = (mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() | 244 | // mDialogView.tvgenerico4.text = (mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() |
239 | // } | 245 | // } |
240 | // } | 246 | // } |
241 | // mDialogView.rbRestar.setOnClickListener { | 247 | // mDialogView.rbRestar.setOnClickListener { |
242 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 248 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
243 | // if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | 249 | // if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { |
244 | // mDialogView.tvgenerico4.text = | 250 | // mDialogView.tvgenerico4.text = |
245 | // (mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() | 251 | // (mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() |
246 | // } | 252 | // } |
247 | // } | 253 | // } |
248 | // } | 254 | // } |
249 | // mDialogView.rbMdodificar.setOnClickListener { | 255 | // mDialogView.rbMdodificar.setOnClickListener { |
250 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 256 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
251 | // mDialogView.tvgenerico4.text = (mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() | 257 | // mDialogView.tvgenerico4.text = (mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() |
252 | // } | 258 | // } |
253 | // } | 259 | // } |
254 | // mDialogView.btnAceptar.setOnClickListener { | 260 | // mDialogView.btnAceptar.setOnClickListener { |
255 | // mAlertDialog.dismiss() | 261 | // mAlertDialog.dismiss() |
256 | // val name = mDialogView.tvgenerico4.text.toString().toFloat() | 262 | // val name = mDialogView.tvgenerico4.text.toString().toFloat() |
257 | // fCant = 0F | 263 | // fCant = 0F |
258 | // fCant = name | 264 | // fCant = name |
259 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 265 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
260 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 266 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
261 | // viewAdapter.notifyDataSetChanged() | 267 | // viewAdapter.notifyDataSetChanged() |
262 | // } | 268 | // } |
263 | // mDialogView.dialogCancelBtn.setOnClickListener { | 269 | // mDialogView.dialogCancelBtn.setOnClickListener { |
264 | // mAlertDialog.dismiss() | 270 | // mAlertDialog.dismiss() |
265 | // } | 271 | // } |
266 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 272 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
267 | // val type = InputType.TYPE_CLASS_NUMBER | 273 | // val type = InputType.TYPE_CLASS_NUMBER |
268 | // MaterialDialog(requireContext()).show { | 274 | // MaterialDialog(requireContext()).show { |
269 | // | 275 | // |
270 | // title(text = "Producto '$sChangeUpper', se encuentra cargado.") | 276 | // title(text = "Producto '$sChangeUpper', se encuentra cargado.") |
271 | // message(R.string.sCantidadNueva) | 277 | // message(R.string.sCantidadNueva) |
272 | // input(waitForPositiveButton = false, hint = "99.99", inputType = type) { materialDialog, charSequence -> | 278 | // input(waitForPositiveButton = false, hint = "99.99", inputType = type) { materialDialog, charSequence -> |
273 | // fCant = 0F | 279 | // fCant = 0F |
274 | // fCant = charSequence.toString().toFloat() | 280 | // fCant = charSequence.toString().toFloat() |
275 | // } | 281 | // } |
276 | // positiveButton(R.string.btnOk) { | 282 | // positiveButton(R.string.btnOk) { |
277 | // //TODO ACTUALIZO CANTIADAD EN BD | 283 | // //TODO ACTUALIZO CANTIADAD EN BD |
278 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 284 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
279 | // //TODO ACTUALIZO CANTIDAD EN RV | 285 | // //TODO ACTUALIZO CANTIDAD EN RV |
280 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 286 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
281 | // viewAdapter.notifyDataSetChanged() | 287 | // viewAdapter.notifyDataSetChanged() |
282 | // dismiss() | 288 | // dismiss() |
283 | // } | 289 | // } |
284 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 290 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
285 | // } | 291 | // } |
286 | // } else if (indiceDelArtEncontrado == -1) { | 292 | // } else if (indiceDelArtEncontrado == -1) { |
287 | // no lo encontro en el RV, lo va a buscar en al BD | 293 | // no lo encontro en el RV, lo va a buscar en al BD |
288 | 294 | ||
289 | GlobalScope.launch(Dispatchers.Main) { | 295 | GlobalScope.launch(Dispatchers.Main) { |
290 | //TODO BUSCO EN BASE DE DATOS | 296 | //TODO BUSCO EN BASE DE DATOS |
291 | val artEncontrado = buscarCodiogoOriEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | 297 | val artEncontrado = buscarCodiogoOriEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
292 | ContinuarCargaCodigoOri(artEncontrado ) | 298 | ContinuarCargaCodigoOri(artEncontrado ) |
293 | } | 299 | } |
294 | iBusquedaPor = 0 | 300 | iBusquedaPor = 0 |
295 | // } | 301 | // } |
296 | // } | 302 | // } |
297 | return@setOnKeyListener true | 303 | return@setOnKeyListener true |
298 | } | 304 | } |
299 | } | 305 | } |
300 | } | 306 | } |
301 | } | 307 | } |
302 | return@setOnKeyListener false | 308 | return@setOnKeyListener false |
303 | } | 309 | } |
304 | return v | 310 | return v |
305 | } | 311 | } |
306 | 312 | ||
307 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 313 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
308 | super.onViewCreated(view, savedInstanceState) | 314 | super.onViewCreated(view, savedInstanceState) |
309 | navController = Navigation.findNavController(view) | 315 | navController = Navigation.findNavController(view) |
310 | etCodigoBarras.requestFocus() | 316 | etCodigoBarras.requestFocus() |
311 | // val modalDialog = NoEncontradoSimple() | 317 | // val modalDialog = NoEncontradoSimple() |
312 | // modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 318 | // modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") |
313 | 319 | ||
314 | btnBorrarInv.setOnClickListener { | 320 | btnBorrarInv.setOnClickListener { |
315 | AlertDialog.Builder(requireContext()).setTitle("Eliminación de Inventarios").setMessage("¿Confirma que desea eliminar el inventario?") | 321 | AlertDialog.Builder(requireContext()).setTitle("Eliminación de Inventarios").setMessage("¿Confirma que desea eliminar el inventario?") |
316 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> | 322 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> |
317 | BorrarInvActual() | 323 | BorrarInvActual() |
318 | Toast.makeText(requireContext(), "El inventario $InventarioNuevo fue Borrado", Toast.LENGTH_LONG).show() | 324 | Toast.makeText(requireContext(), "El inventario $(inventarioViewModel as InventarioViewModel).InventarioNuevo fue Borrado", Toast.LENGTH_LONG).show() |
319 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) | 325 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) |
320 | InventarioNuevo = 0 | 326 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = 0 |
321 | 327 | ||
322 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> | 328 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> |
323 | //botón cancel pulsado | 329 | //botón cancel pulsado |
324 | }).show() | 330 | }).show() |
325 | } | 331 | } |
326 | 332 | ||
327 | btnExportarInv.setOnClickListener { | 333 | btnExportarInv.setOnClickListener { |
328 | AlertDialog.Builder(requireContext()).setTitle(R.string.sTituloExportar).setMessage(R.string.sMensajeExportar) | 334 | AlertDialog.Builder(requireContext()).setTitle(R.string.sTituloExportar).setMessage(R.string.sMensajeExportar) |
329 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> | 335 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> |
330 | BorrarInvActual() | 336 | BorrarInvActual() |
331 | Toast.makeText(requireContext(), "El inventario $InventarioNuevo fue Exportado al Servidor", Toast.LENGTH_LONG).show() | 337 | Toast.makeText(requireContext(), "El inventario $(inventarioViewModel as InventarioViewModel).InventarioNuevo fue Exportado al Servidor", Toast.LENGTH_LONG).show() |
332 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) | 338 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) |
333 | InventarioNuevo = 0 | 339 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = 0 |
334 | 340 | ||
335 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> }).show() | 341 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> }).show() |
336 | } | 342 | } |
337 | ivCamara.setOnClickListener { | 343 | ivCamara.setOnClickListener { |
338 | if (!bFirst) { | 344 | if (!bFirst) { |
339 | iEstado = 1 | 345 | iEstado = 1 |
340 | bFirst = true | 346 | bFirst = true |
341 | } | 347 | } |
342 | 348 | ||
343 | when (iEstado) { | 349 | when (iEstado) { |
344 | 0 -> { | 350 | 0 -> { |
345 | ivCamara.setImageResource(R.drawable.codbar) | 351 | ivCamara.setImageResource(R.drawable.codbar) |
346 | etCodigoBarras.hint = "Busqueda por C. Barras" | 352 | etCodigoBarras.hint = "Busqueda por Código de Barras" |
347 | swSumaUno.visibility = View.VISIBLE | 353 | swSumaUno.visibility = View.VISIBLE |
348 | iBusquedaPor = 0 | 354 | iBusquedaPor = 0 |
349 | iEstado = 1 | 355 | iEstado = 1 |
350 | } | 356 | } |
351 | 1 -> { | 357 | 1 -> { |
352 | ivCamara.setImageResource(R.drawable.desc) | 358 | ivCamara.setImageResource(R.drawable.desc) |
353 | etCodigoBarras.hint = "Busqueda por Descripción" | 359 | etCodigoBarras.hint = "Busqueda por Descripción" |
354 | swSumaUno.visibility = View.GONE | 360 | swSumaUno.visibility = View.GONE |
355 | iBusquedaPor = 1 | 361 | iBusquedaPor = 1 |
356 | iEstado = 2 | 362 | iEstado = 2 |
357 | } | 363 | } |
358 | 2 -> { | 364 | 2 -> { |
359 | ivCamara.setImageResource(R.drawable.cod_origen) | 365 | ivCamara.setImageResource(R.drawable.cod_origen) |
360 | etCodigoBarras.hint = "Busqueda por C. Origen" | 366 | etCodigoBarras.hint = "Busqueda por Código de Origen" |
361 | swSumaUno.visibility = View.GONE | 367 | swSumaUno.visibility = View.GONE |
362 | iBusquedaPor = 2 | 368 | iBusquedaPor = 2 |
363 | iEstado = 0 | 369 | iEstado = 0 |
364 | } | 370 | } |
365 | } | 371 | } |
366 | } | 372 | } |
367 | } | 373 | } |
368 | 374 | ||
369 | private fun BorrarInvActual() { | 375 | private fun BorrarInvActual() { |
370 | lifecycleScope.launch { | 376 | lifecycleScope.launch { |
371 | withContext(Dispatchers.IO) { | 377 | withContext(Dispatchers.IO) { |
372 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.deleteinvHead(InventarioNuevo.toLong()) | 378 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.deleteinvHead((inventarioViewModel as InventarioViewModel).InventarioNuevo.toLong()) |
373 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.deleteInvBody(InventarioNuevo.toLong()) | 379 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.deleteInvBody((inventarioViewModel as InventarioViewModel).InventarioNuevo.toLong()) |
374 | } | 380 | } |
375 | } | 381 | } |
376 | } | 382 | } |
377 | 383 | ||
378 | private fun CargarDeBdInventario(ultimoInv: Int) { | 384 | private fun CargarDeBdInventario(ultimoInv: Int) { |
379 | GlobalScope.launch(Dispatchers.Main) { | 385 | GlobalScope.launch(Dispatchers.Main) { |
380 | val invbody = cargarInventario(ultimoInv) | 386 | val invbody = cargarInventario(ultimoInv) |
381 | for ((i, _) in invbody!!.withIndex()) { | 387 | for ((i, _) in invbody!!.withIndex()) { |
382 | val art = Articles(invbody[i].sector, | 388 | val art = Articles(invbody[i].sector, |
383 | invbody[i].codigo, | 389 | invbody[i].codigo, |
384 | invbody[i].descripcion, | 390 | invbody[i].descripcion, |
385 | invbody[i].codBar, | 391 | invbody[i].codBar, |
386 | invbody[i].codOrigen, | 392 | invbody[i].codOrigen, |
387 | invbody[i].precio, | 393 | invbody[i].precio, |
388 | invbody[i].costo, | 394 | invbody[i].costo, |
389 | "", | 395 | "", |
390 | "", | 396 | "", |
391 | "", | 397 | "", |
392 | invbody[i].balanza, | 398 | invbody[i].balanza, |
393 | invbody[i].depSn, | 399 | invbody[i].depSn, |
394 | invbody[i].costo) | 400 | invbody[i].costo) |
395 | cargarRecicler(art, invbody[i].cantTomada!!.toFloat()) | 401 | cargarRecicler(art, invbody[i].cantTomada!!.toFloat()) |
396 | } | 402 | } |
397 | } | 403 | } |
398 | } | 404 | } |
399 | 405 | ||
400 | private fun ContinuarCargaCodigoOri(artAcargar:List<Articles>) { | 406 | private fun ContinuarCargaCodigoOri(artAcargar:List<Articles>) { |
401 | 407 | ||
402 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD | 408 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD |
403 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 409 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
404 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 410 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
405 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 411 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
406 | 412 | ||
407 | var bundle = Bundle() | 413 | var bundle = Bundle() |
408 | bundle = bundleOf("ArrayDesc" to artAcargar) | 414 | bundle = bundleOf("ArrayDesc" to artAcargar) |
409 | bundle.putInt("numeroInv", InventarioNuevo) | 415 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) |
410 | navController.navigate(R.id.action_inventarioFragment_to_codigoOriFragment, bundle) | 416 | navController.navigate(R.id.action_inventarioFragment_to_codigoOriFragment, bundle) |
411 | 417 | ||
412 | } else {//TODO si no lo encuentra en la BD | 418 | } else {//TODO si no lo encuentra en la BD |
413 | val modalDialog = NoEncontradoSimple() | 419 | val modalDialog = NoEncontradoSimple() |
414 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 420 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") |
415 | } | 421 | } |
416 | etCodigoBarras.focusable = View.FOCUSABLE | 422 | etCodigoBarras.focusable = View.FOCUSABLE |
417 | etCodigoBarras.setText("") | 423 | etCodigoBarras.setText("") |
418 | etCodigoBarras.selectAll() | 424 | etCodigoBarras.selectAll() |
419 | } | 425 | } |
420 | 426 | ||
421 | private fun ContinuarCargaDesc(artAcargar: ArrayList<Articles>) { | 427 | private fun ContinuarCargaDesc(artAcargar: ArrayList<Articles>) { |
422 | //TODO DESPUES DE INGRESAR LA DESCRIPCION Y DE BUSCAR LOS CAINCIDENCIAS EN LA BASE SE VA A MOSTRAR LAS MISMAS | 428 | //TODO DESPUES DE INGRESAR LA DESCRIPCION Y DE BUSCAR LOS CAINCIDENCIAS EN LA BASE SE VA A MOSTRAR LAS MISMAS |
423 | //TODO SI LA CANTIDAD ENCONTRADA ES UNO, LO CARGO DIRECTAMENTE EN EL RV | 429 | //TODO SI LA CANTIDAD ENCONTRADA ES UNO, LO CARGO DIRECTAMENTE EN EL RV |
424 | 430 | ||
425 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD | 431 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD |
426 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV | 432 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV |
427 | // fCant = 0F | 433 | // fCant = 0F |
428 | // fCant += 1F | 434 | // fCant += 1F |
429 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV | 435 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV |
430 | // val acargarPorDesc = Articles(artAcargar[0].sector, | 436 | // val acargarPorDesc = Articles(artAcargar[0].sector, |
431 | // artAcargar[0].codigo, | 437 | // artAcargar[0].codigo, |
432 | // artAcargar[0].descripcion, | 438 | // artAcargar[0].descripcion, |
433 | // artAcargar[0].codBar, | 439 | // artAcargar[0].codBar, |
434 | // artAcargar[0].codOrigen, | 440 | // artAcargar[0].codOrigen, |
435 | // artAcargar[0].precio, | 441 | // artAcargar[0].precio, |
436 | // artAcargar[0].costo, | 442 | // artAcargar[0].costo, |
437 | // "", | 443 | // "", |
438 | // "", | 444 | // "", |
439 | // "", | 445 | // "", |
440 | // artAcargar[0].balanza, | 446 | // artAcargar[0].balanza, |
441 | // artAcargar[0].depSn, | 447 | // artAcargar[0].depSn, |
442 | // "") | 448 | // "") |
443 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD | 449 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD |
444 | // cargarArtEnBd(acargarPorDesc, fCant) | 450 | // cargarArtEnBd(acargarPorDesc, fCant) |
445 | // cargarRecicler(acargarPorDesc, fCant) | 451 | // cargarRecicler(acargarPorDesc, fCant) |
446 | // } else { | 452 | // } else { |
447 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 453 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
448 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 454 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
449 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 455 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
450 | var bundle = Bundle() | 456 | var bundle = Bundle() |
451 | bundle = bundleOf("ArrayDesc" to artAcargar) | 457 | bundle = bundleOf("ArrayDesc" to artAcargar) |
452 | bundle.putInt("numeroInv", InventarioNuevo) | 458 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) |
453 | navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) | 459 | navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) |
454 | //navController.backStack.removeLast() | 460 | //navController.backStack.removeLast() |
455 | // } | 461 | // } |
456 | // } else {//SI NO ESTA +1 | 462 | // } else {//SI NO ESTA +1 |
457 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV | 463 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV |
458 | // fCant = listArticulos[0].cantTomada | 464 | // fCant = listArticulos[0].cantTomada |
459 | // MaterialDialog(requireContext()).show { | 465 | // MaterialDialog(requireContext()).show { |
460 | // title(R.string.sTituloNueva) | 466 | // title(R.string.sTituloNueva) |
461 | // message(R.string.sCantidadNueva) | 467 | // message(R.string.sCantidadNueva) |
462 | // input { materialDialog, charSequence -> | 468 | // input { materialDialog, charSequence -> |
463 | // fCant = 0F | 469 | // fCant = 0F |
464 | // fCant = charSequence.toString().toFloat() | 470 | // fCant = charSequence.toString().toFloat() |
465 | // } | 471 | // } |
466 | // positiveButton(R.string.btnOk) { | 472 | // positiveButton(R.string.btnOk) { |
467 | // listArticulos[0].cantTomada = fCant | 473 | // listArticulos[0].cantTomada = fCant |
468 | // viewAdapter.notifyDataSetChanged() | 474 | // viewAdapter.notifyDataSetChanged() |
469 | // dismiss() | 475 | // dismiss() |
470 | // } | 476 | // } |
471 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 477 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
472 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV | 478 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV |
473 | // val acargarPorDesc = Articles(artAcargar[0].sector, | 479 | // val acargarPorDesc = Articles(artAcargar[0].sector, |
474 | // artAcargar[0].codigo, | 480 | // artAcargar[0].codigo, |
475 | // artAcargar[0].descripcion, | 481 | // artAcargar[0].descripcion, |
476 | // artAcargar[0].codBar, | 482 | // artAcargar[0].codBar, |
477 | // artAcargar[0].cod_origen, | 483 | // artAcargar[0].cod_origen, |
478 | // artAcargar[0].precio, | 484 | // artAcargar[0].precio, |
479 | // artAcargar[0].costo, | 485 | // artAcargar[0].costo, |
480 | // artAcargar[0].balanza, | 486 | // artAcargar[0].balanza, |
481 | // artAcargar[0].depSn, | 487 | // artAcargar[0].depSn, |
482 | // "") | 488 | // "") |
483 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD | 489 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD |
484 | // cargarArtEnBd(acargarPorDesc, fCant) | 490 | // cargarArtEnBd(acargarPorDesc, fCant) |
485 | // cargarRecicler(acargarPorDesc, fCant) | 491 | // cargarRecicler(acargarPorDesc, fCant) |
486 | // } else { | 492 | // } else { |
487 | // var bundle = Bundle() | 493 | // var bundle = Bundle() |
488 | // bundle = bundleOf("ArrayDesc" to artAcargar) | 494 | // bundle = bundleOf("ArrayDesc" to artAcargar) |
489 | // bundle.putInt("numeroInv", InventarioNuevo) | 495 | // bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) |
490 | // navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) | 496 | // navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) |
491 | // } | 497 | // } |
492 | // } | 498 | // } |
493 | } else {//TODO si no lo encuentra en la BD | 499 | } else {//TODO si no lo encuentra en la BD |
494 | val modalDialog = NoEncontradoSimple() | 500 | val modalDialog = NoEncontradoSimple() |
495 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 501 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") |
496 | } | 502 | } |
497 | etCodigoBarras.focusable = View.FOCUSABLE | 503 | etCodigoBarras.focusable = View.FOCUSABLE |
498 | etCodigoBarras.setText("") | 504 | etCodigoBarras.setText("") |
499 | etCodigoBarras.selectAll() | 505 | etCodigoBarras.selectAll() |
500 | } | 506 | } |
501 | 507 | ||
502 | private fun ContinuarCargaCB(artAcargar: Articles?) { | 508 | private fun ContinuarCargaCB(artAcargar: Articles?) { |
503 | 509 | ||
504 | if (artAcargar != null) {// TODO: Si lo encuentra en la BD | 510 | if (artAcargar != null) {// TODO: Si lo encuentra en la BD |
505 | if (swSumaUno!!.isChecked) {//TODO: SI ESTA +1, PONE CANTIDAD 1 | 511 | if (swSumaUno!!.isChecked) {//TODO: SI ESTA +1, PONE CANTIDAD 1 |
506 | fCant = 0F | 512 | fCant = 0F |
507 | fCant += 1F | 513 | fCant += 1F |
508 | cargarArtEnBd(artAcargar, String.format("%.3f", fCant)) | 514 | cargarArtEnBd(artAcargar, String.format("%.3f", fCant)) |
509 | cargarRecicler(artAcargar, fCant) | 515 | cargarRecicler(artAcargar, fCant) |
510 | } else {//TODO: SI NO ESTA +1 PREGUNTA CANTIDAD | 516 | } else {//TODO: SI NO ESTA +1 PREGUNTA CANTIDAD |
511 | 517 | ||
512 | DialogingresarCantidad(requireContext(), artAcargar) | 518 | DialogingresarCantidad(requireContext(), artAcargar) |
513 | 519 | ||
514 | } | 520 | } |
515 | } else {// TODO si no lo encuentra en la BD | 521 | } else {// TODO si no lo encuentra en la BD |
516 | val modalDialog = NoEncontradoSimple() | 522 | val modalDialog = NoEncontradoSimple() |
517 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 523 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") |
518 | } | 524 | } |
519 | etCodigoBarras.focusable = View.FOCUSABLE | 525 | etCodigoBarras.focusable = View.FOCUSABLE |
520 | etCodigoBarras.setText("") | 526 | etCodigoBarras.setText("") |
521 | etCodigoBarras.selectAll() | 527 | etCodigoBarras.selectAll() |
522 | } | 528 | } |
523 | 529 | ||
524 | fun DialogingresarCantidad(cnxt: Context, artAcargar: Articles?): Float { | 530 | fun DialogingresarCantidad(cnxt: Context, artAcargar: Articles?): Float { |
525 | var cantidad = 0F | 531 | var cantidad = 0F |
526 | val mDialogView = LayoutInflater.from(cnxt).inflate(R.layout.ingresar_cantidad, null) | 532 | val mDialogView = LayoutInflater.from(cnxt).inflate(R.layout.ingresar_cantidad, null) |
527 | val mBuilder = AlertDialog.Builder(cnxt).setView(mDialogView).setCancelable(false) | 533 | val mBuilder = AlertDialog.Builder(cnxt).setView(mDialogView).setCancelable(false) |
528 | if (artAcargar!!.balanza!!.toInt() == 1 || artAcargar.balanza!!.toInt() == 3 || artAcargar.balanza!!.toInt() == 7) mDialogView.etCantidad.inputType = TYPE_CLASS_NUMBER | 534 | if (artAcargar!!.balanza!!.toInt() == 1 || artAcargar.balanza!!.toInt() == 3 || artAcargar.balanza!!.toInt() == 7) mDialogView.etCantidad.inputType = TYPE_CLASS_NUMBER |
529 | mDialogView.tvTitulo.text = artAcargar.descripcion.toString() | 535 | mDialogView.tvTitulo.text = artAcargar.descripcion.toString() |
530 | val mAlertDialog = mBuilder.show() | 536 | val mAlertDialog = mBuilder.show() |
531 | 537 | ||
532 | mDialogView.etCantidad.requestFocus() | 538 | mDialogView.etCantidad.requestFocus() |
533 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 539 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
534 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 540 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
535 | 541 | ||
536 | mDialogView.btnAceptar.setOnClickListener { | 542 | mDialogView.btnAceptar.setOnClickListener { |
537 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { | 543 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { |
538 | mDialogView.etCantidad.error = "No vacio" | 544 | mDialogView.etCantidad.error = "No vacio" |
539 | mDialogView.etCantidad.requestFocus() | 545 | mDialogView.etCantidad.requestFocus() |
540 | mDialogView.etCantidad.hint = "Ingrese un valor" | 546 | mDialogView.etCantidad.hint = "Ingrese un valor" |
541 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { | 547 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { |
542 | mAlertDialog.dismiss() | 548 | mAlertDialog.dismiss() |
543 | cantidad = mDialogView.etCantidad.text.toString().toFloat() | 549 | cantidad = mDialogView.etCantidad.text.toString().toFloat() |
544 | cargarArtEnBd(artAcargar, String.format("%.2f", cantidad)) | 550 | cargarArtEnBd(artAcargar, String.format("%.2f", cantidad)) |
545 | cargarRecicler(artAcargar, cantidad) | 551 | cargarRecicler(artAcargar, cantidad) |
546 | modificarCantidadEnCabecera(InventarioNuevo, true, requireContext()) | 552 | modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, true, requireContext()) |
547 | } | 553 | } |
548 | } | 554 | } |
549 | return cantidad | 555 | return cantidad |
550 | } | 556 | } |
551 | 557 | ||
552 | fun dialogoSumaResta(context: Context, indiceDelArtEncontrado: Int, univta: String, cancelable: Boolean) { | 558 | fun dialogoSumaResta(context: Context, indiceDelArtEncontrado: Int, univta: String, cancelable: Boolean) { |
553 | 559 | ||
554 | mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | 560 | mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) |
555 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(cancelable) | 561 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(cancelable) |
556 | // TODO: SI PERMITE QUE INGRESE DECIMALES | 562 | // TODO: SI PERMITE QUE INGRESE DECIMALES |
557 | if (univta.contains("1") || univta.contains("3") || univta.contains("7")) mDialogView.tvNuevaCantidad.inputType = TYPE_CLASS_NUMBER | 563 | if (univta.contains("1") || univta.contains("3") || univta.contains("7")) mDialogView.tvNuevaCantidad.inputType = TYPE_CLASS_NUMBER |
558 | mDialogView.tvTitulo2.text="${listArticulos[indiceDelArtEncontrado].descripcion}" | 564 | mDialogView.tvTitulo2.text="${listArticulos[indiceDelArtEncontrado].descripcion}" |
559 | mDialogView.tvCantInicial.text = String.format("%.2f", listArticulos[indiceDelArtEncontrado].cantTomada) | 565 | mDialogView.tvCantInicial.text = String.format("%.2f", listArticulos[indiceDelArtEncontrado].cantTomada) |
560 | val mAlertDialog = mBuilder.show() | 566 | val mAlertDialog = mBuilder.show() |
561 | mDialogView.tvNuevaCantidad.requestFocus() | 567 | mDialogView.tvNuevaCantidad.requestFocus() |
562 | 568 | ||
563 | 569 | ||
564 | 570 | ||
565 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 571 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
566 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 572 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
567 | 573 | ||
568 | mDialogView.tvNuevaCantidad.addTextChangedListener(textWatcher) | 574 | mDialogView.tvNuevaCantidad.addTextChangedListener(textWatcher) |
569 | 575 | ||
570 | mDialogView.rbSumar.setOnClickListener { | 576 | mDialogView.rbSumar.setOnClickListener { |
571 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 577 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
572 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()) | 578 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()) |
573 | // mDialogView.tvNuevaCantidad.isEnabled = false | 579 | // mDialogView.tvNuevaCantidad.isEnabled = false |
574 | } | 580 | } |
575 | } | 581 | } |
576 | mDialogView.rbRestar.setOnClickListener { | 582 | mDialogView.rbRestar.setOnClickListener { |
577 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 583 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
578 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | 584 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { |
579 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()) | 585 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()) |
580 | // mDialogView.tvNuevaCantidad.isEnabled = false | 586 | // mDialogView.tvNuevaCantidad.isEnabled = false |
581 | } else { | 587 | } else { |
582 | mDialogView.tvResultado.text = "" | 588 | mDialogView.tvResultado.text = "" |
583 | mDialogView.tvResultado.error = "Operación No Valida" | 589 | mDialogView.tvResultado.error = "Operación No Valida" |
584 | mDialogView.tvResultado.requestFocus() | 590 | mDialogView.tvResultado.requestFocus() |
585 | mDialogView.tvResultado.hint = "Error" | 591 | mDialogView.tvResultado.hint = "Error" |
586 | } | 592 | } |
587 | } | 593 | } |
588 | } | 594 | } |
589 | mDialogView.rbMdodificar.setOnClickListener { | 595 | mDialogView.rbMdodificar.setOnClickListener { |
590 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 596 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
591 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat()) | 597 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat()) |
592 | // mDialogView.tvNuevaCantidad.isEnabled = false | 598 | // mDialogView.tvNuevaCantidad.isEnabled = false |
593 | } | 599 | } |
594 | } | 600 | } |
595 | mDialogView.btnAceptar.setOnClickListener { | 601 | mDialogView.btnAceptar.setOnClickListener { |
596 | if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || !mDialogView.tvNuevaCantidad.text.isBlank()) { | 602 | if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || !mDialogView.tvNuevaCantidad.text.isBlank()) { |
597 | if (mDialogView.tvResultado.text.isNotEmpty() || !mDialogView.tvResultado.text.isBlank()) { | 603 | if (mDialogView.tvResultado.text.isNotEmpty() || !mDialogView.tvResultado.text.isBlank()) { |
598 | mAlertDialog.dismiss() | 604 | mAlertDialog.dismiss() |
599 | listArticulos[indiceDelArtEncontrado].cantTomada = String.format("%.2f", mDialogView.tvResultado.text.toString().toFloat()).toFloat() | 605 | listArticulos[indiceDelArtEncontrado].cantTomada = String.format("%.2f", mDialogView.tvResultado.text.toString().toFloat()).toFloat() |
600 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), | 606 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), |
601 | listArticulos[indiceDelArtEncontrado].codigo.toString(), | 607 | listArticulos[indiceDelArtEncontrado].codigo.toString(), |
602 | String.format("%.2f", mDialogView.tvResultado.text.toString().toFloat()).toFloat()) | 608 | String.format("%.2f", mDialogView.tvResultado.text.toString().toFloat()).toFloat()) |
603 | 609 | ||
604 | viewAdapter.notifyDataSetChanged() | 610 | viewAdapter.notifyDataSetChanged() |
605 | } else if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { | 611 | } else if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { |
606 | mDialogView.tvResultado.error = "Operación Requerida" | 612 | mDialogView.tvResultado.error = "Operación Requerida" |
607 | mDialogView.tvResultado.requestFocus() | 613 | mDialogView.tvResultado.requestFocus() |
608 | mDialogView.tvResultado.hint = "Seleccione Operación" | 614 | mDialogView.tvResultado.hint = "Seleccione Operación" |
609 | } | 615 | } |
610 | } else if (mDialogView.tvNuevaCantidad.text.isEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { | 616 | } else if (mDialogView.tvNuevaCantidad.text.isEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { |
611 | mDialogView.tvNuevaCantidad.error = "Completar" | 617 | mDialogView.tvNuevaCantidad.error = "Completar" |
612 | mDialogView.tvNuevaCantidad.requestFocus() | 618 | mDialogView.tvNuevaCantidad.requestFocus() |
613 | mDialogView.tvNuevaCantidad.hint = "Ingrese un valor" | 619 | mDialogView.tvNuevaCantidad.hint = "Ingrese un valor" |
614 | } | 620 | } |
615 | } | 621 | } |
616 | mDialogView.dialogCancelBtn.setOnClickListener { | 622 | mDialogView.dialogCancelBtn.setOnClickListener { |
617 | mAlertDialog.dismiss() | 623 | mAlertDialog.dismiss() |
618 | } | 624 | } |
619 | } | 625 | } |
620 | 626 | ||
621 | suspend fun buscarCodiogoOriEnBD(CodOri: String): List<Articles> { | 627 | suspend fun buscarCodiogoOriEnBD(CodOri: String): List<Articles> { |
622 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 628 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
623 | var busqueda: List<Articles> | 629 | var busqueda: List<Articles> |
624 | return GlobalScope.async(Dispatchers.IO) { | 630 | return GlobalScope.async(Dispatchers.IO) { |
625 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodOri(CodOri, SerchAreaInventario()) | 631 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodOri(CodOri, SerchAreaInventario()) |
626 | return@async busqueda | 632 | return@async busqueda |
627 | }.await() | 633 | }.await() |
628 | } | 634 | } |
629 | 635 | ||
630 | suspend fun buscarCBEnBD(CodigoBarras: String): Articles? { | 636 | suspend fun buscarCBEnBD(CodigoBarras: String): Articles? { |
631 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 637 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
632 | var busqueda: Articles? = null | 638 | var busqueda: Articles? = null |
633 | return GlobalScope.async(IO) { | 639 | return GlobalScope.async(IO) { |
634 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, SerchAreaInventario()) | 640 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, SerchAreaInventario()) |
635 | return@async busqueda | 641 | return@async busqueda |
636 | }.await() | 642 | }.await() |
637 | } | 643 | } |
638 | 644 | ||
639 | suspend fun buscarDescEnBD(descripcion: String): List<Articles>? { | 645 | suspend fun buscarDescEnBD(descripcion: String): List<Articles>? { |
640 | //TODO BUSQUEDA POR DESCRIPCION | 646 | //TODO BUSQUEDA POR DESCRIPCION |
641 | var busqueda: List<Articles>? = null | 647 | var busqueda: List<Articles>? = null |
642 | return GlobalScope.async(Dispatchers.IO) { | 648 | return GlobalScope.async(Dispatchers.IO) { |
643 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, SerchAreaInventario()) | 649 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, SerchAreaInventario()) |
644 | return@async busqueda | 650 | return@async busqueda |
645 | }.await() | 651 | }.await() |
646 | } | 652 | } |
647 | 653 | ||
648 | suspend fun borrarArticulo(sector: String, codigo: String, inventario: String): Int? { | 654 | suspend fun borrarArticulo(sector: String, codigo: String, inventario: String): Int? { |
649 | //TODO BUSQUEDA POR DESCRIPCION | 655 | //TODO BUSQUEDA POR DESCRIPCION |
650 | var result: Int | 656 | var result: Int |
651 | return GlobalScope.async(IO) { | 657 | return GlobalScope.async(IO) { |
652 | result = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.deleteItemFromInvBody(sector.toLong(), codigo.toLong(), inventario.toLong()) | 658 | result = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.deleteItemFromInvBody(sector.toLong(), codigo.toLong(), inventario.toLong()) |
653 | return@async result | 659 | return@async result |
654 | }.await() | 660 | }.await() |
655 | } | 661 | } |
656 | 662 | ||
657 | private suspend fun buscoArtEnRv(codigoBarras: String, sTipoBusqueda: Int): Int { | 663 | private suspend fun buscoArtEnRv(codigoBarras: String, sTipoBusqueda: Int): Int { |
658 | return GlobalScope.async(IO) { | 664 | return GlobalScope.async(IO) { |
659 | var indice = 0 | 665 | var indice = 0 |
660 | var bEncontrado = false | 666 | var bEncontrado = false |
661 | if (sTipoBusqueda == 0) {//TODO BUSQUEDA POR CODIGO DE BARRAS | 667 | if (sTipoBusqueda == 0) {//TODO BUSQUEDA POR CODIGO DE BARRAS |
662 | // TODO CAMBIO DE CB A CODIGO DEBO | 668 | // TODO CAMBIO DE CB A CODIGO DEBO |
663 | val any = cambioCBporCodigoDebo(codigoBarras) | 669 | val any = cambioCBporCodigoDebo(codigoBarras) |
664 | if (any != null) { | 670 | if (any != null) { |
665 | for (item in listArticulos) { | 671 | for (item in listArticulos) { |
666 | if (item.sector!!.toInt() == any.sector!!.toInt() && item.codigo!!.toInt() == any.codigo!!.toInt()) { | 672 | if (item.sector!!.toInt() == any.sector!!.toInt() && item.codigo!!.toInt() == any.codigo!!.toInt()) { |
667 | bEncontrado = true | 673 | bEncontrado = true |
668 | break | 674 | break |
669 | } | 675 | } |
670 | indice += 1 | 676 | indice += 1 |
671 | } | 677 | } |
672 | } | 678 | } |
673 | 679 | ||
674 | } else if (sTipoBusqueda == 1) {//TODO BUSQUEDA POR DESCRIPCION | 680 | } else if (sTipoBusqueda == 1) {//TODO BUSQUEDA POR DESCRIPCION |
675 | for (item in listArticulos) { | 681 | for (item in listArticulos) { |
676 | if (item.descripcion!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { | 682 | if (item.descripcion!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { |
677 | bEncontrado = true | 683 | bEncontrado = true |
678 | break | 684 | break |
679 | } | 685 | } |
680 | indice += 1 | 686 | indice += 1 |
681 | } | 687 | } |
682 | } else if (sTipoBusqueda == 2) {//TODO BUSQUEDA POR CODIGO DE ORIGEN | 688 | } else if (sTipoBusqueda == 2) {//TODO BUSQUEDA POR CODIGO DE ORIGEN |
683 | for (item in listArticulos) { | 689 | for (item in listArticulos) { |
684 | if (item.codigoOrigen!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { | 690 | if (item.codigoOrigen!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { |
685 | bEncontrado = true | 691 | bEncontrado = true |
686 | break | 692 | break |
687 | } | 693 | } |
688 | indice += 1 | 694 | indice += 1 |
689 | } | 695 | } |
690 | } | 696 | } |
691 | return@async if (bEncontrado) indice else -1 | 697 | return@async if (bEncontrado) indice else -1 |
692 | }.await() | 698 | }.await() |
693 | } | 699 | } |
694 | 700 | ||
695 | suspend fun cambioCBporCodigoDebo(codigoBarras: String): Articles? { | 701 | suspend fun cambioCBporCodigoDebo(codigoBarras: String): Articles? { |
696 | //TODO BUSQUEDA POR DESCRIPCION | 702 | //TODO BUSQUEDA POR DESCRIPCION |
697 | var busqueda: Articles? = null | 703 | var busqueda: Articles? = null |
698 | return GlobalScope.async(IO) { | 704 | return GlobalScope.async(IO) { |
699 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(codigoBarras, SerchAreaInventario()) | 705 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(codigoBarras, SerchAreaInventario()) |
700 | return@async busqueda | 706 | return@async busqueda |
701 | }.await() | 707 | }.await() |
702 | } | 708 | } |
703 | 709 | ||
704 | private fun cargarArtEnBd(articulos: Articles, cant: String) { | 710 | private fun cargarArtEnBd(articulos: Articles, cant: String) { |
705 | val body = InvBody(InventarioNuevo,// TODO PREPARO PARA MANDAR A CARGAR EN LA BD | 711 | val body = InvBody((inventarioViewModel as InventarioViewModel).InventarioNuevo,// TODO PREPARO PARA MANDAR A CARGAR EN LA BD |
706 | articulos.sector, | 712 | articulos.sector, |
707 | articulos.codigo, | 713 | articulos.codigo, |
708 | articulos.descripcion, | 714 | articulos.descripcion, |
709 | cant, | 715 | cant, |
710 | articulos.codBar, | 716 | articulos.codBar, |
711 | articulos.codOrigen, | 717 | articulos.codOrigen, |
712 | articulos.precio, | 718 | articulos.precio, |
713 | articulos.precio, | 719 | articulos.precio, |
714 | articulos.balanza, | 720 | articulos.balanza, |
715 | articulos.depSn, | 721 | articulos.depSn, |
716 | ObtenerFechaActual(), | 722 | ObtenerFechaActual(), |
717 | ObtenerFechaActual()) | 723 | ObtenerFechaActual()) |
718 | InsertarArtEnDB(body)// TODO MANDO A CARGAR A LA BASE DE DATOS | 724 | InsertarArtEnDB(body)// TODO MANDO A CARGAR A LA BASE DE DATOS |
719 | } | 725 | } |
720 | 726 | ||
721 | fun cargarRecicler(articulos: Articles, cant: Float) { | 727 | fun cargarRecicler(articulos: Articles, cant: Float) { |
722 | //TODO CARGO EN LE RV | 728 | //TODO CARGO EN LE RV |
723 | val item = ItemsRecycler(if (articulos.sector.toString().toInt()<9) "0${articulos.sector.toString()}" else articulos.sector.toString() | 729 | val item = ItemsRecycler(if (articulos.sector.toString().toInt()<9) "0${articulos.sector.toString()}" else articulos.sector.toString() |
724 | , articulos.codigo, articulos.descripcion, cant, articulos.codBar, articulos.codOrigen, articulos.balanza.toString(), articulos.de.toString()) | 730 | , articulos.codigo, articulos.descripcion, cant, articulos.codBar, articulos.codOrigen, articulos.balanza.toString(), articulos.de.toString()) |
725 | listArticulos.add(item) | 731 | listArticulos.add(item) |
726 | 732 | ||
727 | viewAdapter = ProductosListAdapter(requireContext(), listArticulos, this) | 733 | viewAdapter = ProductosListAdapter(requireContext(), listArticulos, this) |
728 | viewManager = LinearLayoutManager(requireContext()) | 734 | viewManager = LinearLayoutManager(requireContext()) |
729 | deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! | 735 | deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! |
730 | rcInventarios.apply { | 736 | rcInventarios.apply { |
731 | adapter = viewAdapter | 737 | adapter = viewAdapter |
732 | layoutManager = viewManager | 738 | layoutManager = viewManager |
733 | } | 739 | } |
734 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { | 740 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { |
735 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { | 741 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { |
736 | return false | 742 | return false |
737 | } | 743 | } |
738 | 744 | ||
739 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { | 745 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { |
740 | 746 | ||
741 | GlobalScope.launch(Dispatchers.Main) { | 747 | GlobalScope.launch(Dispatchers.Main) { |
742 | borrarArticulo(listArticulos[viewHolder.adapterPosition].sector.toString(), listArticulos[viewHolder.adapterPosition].codigo.toString(), InventarioNuevo.toString()) | 748 | borrarArticulo(listArticulos[viewHolder.adapterPosition].sector.toString(), listArticulos[viewHolder.adapterPosition].codigo.toString(), (inventarioViewModel as InventarioViewModel).InventarioNuevo.toString()) |
743 | (viewAdapter as ProductosListAdapter).removeItem(viewHolder) | 749 | (viewAdapter as ProductosListAdapter).removeItem(viewHolder) |
744 | viewAdapter.notifyDataSetChanged() | 750 | viewAdapter.notifyDataSetChanged() |
745 | modificarCantidadEnCabecera(InventarioNuevo, false, requireContext()) | 751 | modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, false, requireContext()) |
746 | } | 752 | } |
747 | } | 753 | } |
748 | 754 | ||
749 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { | 755 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { |
750 | val itemView = viewHolder.itemView | 756 | val itemView = viewHolder.itemView |
751 | val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2 | 757 | val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2 |
752 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) | 758 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) |
753 | 759 | ||
754 | if (dX > 0) { | 760 | if (dX > 0) { |
755 | 761 | ||
756 | if (dX < c.width / 2) c.drawColor(Color.GREEN) | 762 | if (dX < c.width / 2) c.drawColor(Color.GREEN) |
757 | else c.drawColor(Color.RED) | 763 | else c.drawColor(Color.RED) |
758 | deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom - iconMargin) | 764 | deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom - iconMargin) |
759 | } else { | 765 | } else { |
760 | } | 766 | } |
761 | 767 | ||
762 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | 768 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) |
763 | deleteIcon.draw(c) | 769 | deleteIcon.draw(c) |
764 | } | 770 | } |
765 | } | 771 | } |
766 | 772 | ||
767 | val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback) | 773 | val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback) |
768 | itemTouchHelper.attachToRecyclerView(rcInventarios) | 774 | itemTouchHelper.attachToRecyclerView(rcInventarios) |
769 | } | 775 | } |
770 | 776 | ||
771 | private fun ProdNoCont(): Int? { | 777 | private fun ProdNoCont(): Int? { |
772 | var mostrarStock = 0 | 778 | var mostrarStock = 0 |
773 | if (sharedPreferences.contains("cbMostrarStock")) if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") mostrarStock = 1 | 779 | if (sharedPreferences.contains("cbMostrarStock")) if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") mostrarStock = 1 |
774 | return mostrarStock | 780 | return mostrarStock |
775 | } | 781 | } |
776 | 782 | ||
777 | private fun AjusteProductos(): Int? { | 783 | private fun AjusteProductos(): Int? { |
778 | var prodInclu = 0 | 784 | var prodInclu = 0 |
779 | if (sharedPreferences.contains("rbProInclu")) if (sharedPreferences.getString("rbProInclu", "").toString() == "1") prodInclu = 1 | 785 | if (sharedPreferences.contains("rbProInclu")) if (sharedPreferences.getString("rbProInclu", "").toString() == "1") prodInclu = 1 |
780 | 786 | ||
781 | if (sharedPreferences.contains("rbProNoInclu")) if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") prodInclu = 0 | 787 | if (sharedPreferences.contains("rbProNoInclu")) if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") prodInclu = 0 |
782 | return prodInclu | 788 | return prodInclu |
783 | } | 789 | } |
784 | 790 | ||
785 | private fun SerchArea(): Boolean { | 791 | private fun SerchArea(): Boolean { |
786 | if (sharedPreferences.contains("rbVentas")) if (sharedPreferences.getString("rbVentas", "").toString() == "1") iArea =false | 792 | if (sharedPreferences.contains("rbVentas")) if (sharedPreferences.getString("rbVentas", "").toString() == "1") iArea =false |
787 | if (sharedPreferences.contains("rbDeposito")) if (sharedPreferences.getString("rbDeposito", "").toString() == "1") iArea = true | 793 | if (sharedPreferences.contains("rbDeposito")) if (sharedPreferences.getString("rbDeposito", "").toString() == "1") iArea = true |
788 | return iArea | 794 | return iArea |
789 | } | 795 | } |
790 | 796 | ||
791 | suspend fun SerchAreaInventario(): Boolean { | 797 | suspend fun SerchAreaInventario(): Boolean { |
792 | return GlobalScope.async(IO) { | 798 | return GlobalScope.async(IO) { |
793 | return@async AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.fetchAreaInvH(InventarioNuevo.toLong()) | 799 | return@async AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.fetchAreaInvH((inventarioViewModel as InventarioViewModel).InventarioNuevo.toLong()) |
794 | }.await() | 800 | }.await() |
795 | 801 | ||
796 | } | 802 | } |
797 | 803 | ||
798 | fun ObtenerFechaActual(): String? { | 804 | fun ObtenerFechaActual(): String? { |
799 | //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD | 805 | //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD |
800 | val current = LocalDateTime.now() | 806 | val current = LocalDateTime.now() |
801 | val formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy hh:mm:ss") | 807 | val formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy hh:mm:ss") |
802 | val dFechaHora = current.format(formatter) | 808 | val dFechaHora = current.format(formatter) |
803 | return dFechaHora.toString() | 809 | return dFechaHora.toString() |
804 | } | 810 | } |
805 | 811 | ||
806 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { | 812 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { |
807 | lifecycleScope.launch { | 813 | lifecycleScope.launch { |
808 | withContext(Dispatchers.IO) { | 814 | withContext(Dispatchers.IO) { |
809 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) | 815 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) |
810 | } | 816 | } |
811 | } | 817 | } |
812 | } | 818 | } |
813 | 819 | ||
814 | fun updateCantidad(sector: String, codigo: String, cantidad: Float) { | 820 | fun updateCantidad(sector: String, codigo: String, cantidad: Float) { |
815 | lifecycleScope.launch { | 821 | lifecycleScope.launch { |
816 | withContext(Dispatchers.IO) { | 822 | withContext(Dispatchers.IO) { |
817 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.UpdateInvBody(cantidad, sector.toLong(), codigo.toLong()) | 823 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.UpdateInvBody(cantidad, sector.toLong(), codigo.toLong()) |
818 | } | 824 | } |
819 | } | 825 | } |
820 | } | 826 | } |
821 | 827 | ||
822 | suspend fun cargarInventario(inventario: Int): List<InvBody>? { | 828 | suspend fun cargarInventario(inventario: Int): List<InvBody>? { |
823 | return GlobalScope.async(Dispatchers.IO) { | 829 | return GlobalScope.async(Dispatchers.IO) { |
824 | return@async AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.fetchAllInvBody(inventario) | 830 | return@async AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.fetchAllInvBody(inventario) |
825 | }.await() | 831 | }.await() |
826 | } | 832 | } |
827 | 833 | ||
828 | override fun onImageDotsClick(sector: String?, codigo: String?) { | 834 | override fun onImageDotsClick(sector: String?, codigo: String?) { |
829 | val bundle = Bundle() | 835 | val bundle = Bundle() |
830 | bundle.putString("sector", sector!!.toInt().toString()) | 836 | bundle.putString("sector", sector!!.toInt().toString()) |
831 | bundle.putString("codigo", codigo) | 837 | bundle.putString("codigo", codigo) |
832 | bundle.putInt("numeroInv", InventarioNuevo) | 838 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) |
833 | navController.navigate(R.id.action_inventarioFragment_to_detalleArtFragment, bundle) | 839 | navController.navigate(R.id.action_inventarioFragment_to_detalleArtFragment, bundle) |
834 | } | 840 | } |
835 | 841 | ||
836 | override fun onImagePenClick(sector: String?, codigo: String?, cantidad: String?, position: String) { | 842 | override fun onImagePenClick(sector: String?, codigo: String?, cantidad: String?, position: String) { |
837 | dialogoSumaResta(requireContext(), position.toInt(), listArticulos[position.toInt()].univta, true) | 843 | dialogoSumaResta(requireContext(), position.toInt(), listArticulos[position.toInt()].univta, true) |
838 | } | 844 | } |
839 | 845 | ||
840 | private val textWatcher = object : TextWatcher { | 846 | private val textWatcher = object : TextWatcher { |
841 | override fun afterTextChanged(s: Editable?) { | 847 | override fun afterTextChanged(s: Editable?) { |
842 | } | 848 | } |
843 | 849 | ||
844 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { | 850 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { |
845 | } | 851 | } |
846 | 852 | ||
847 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { | 853 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
848 | if(mDialogView.rbSumar.isChecked){ | 854 | if(mDialogView.rbSumar.isChecked){ |
849 | // mDialogView.tvNuevaCantidad.isEnabled=false | 855 | // mDialogView.tvNuevaCantidad.isEnabled=false |
850 | mDialogView.tvResultado.text=String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat()+ mDialogView.tvCantInicial.text.toString().toFloat()) | 856 | mDialogView.tvResultado.text=String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat()+ mDialogView.tvCantInicial.text.toString().toFloat()) |
851 | } | 857 | } |
852 | if(mDialogView.rbRestar.isChecked) { | 858 | if(mDialogView.rbRestar.isChecked) { |
853 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 859 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
854 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | 860 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { |
855 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()) | 861 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()) |
856 | // mDialogView.tvNuevaCantidad.isEnabled = false | 862 | // mDialogView.tvNuevaCantidad.isEnabled = false |
857 | } else { | 863 | } else { |
858 | mDialogView.tvResultado.text = "" | 864 | mDialogView.tvResultado.text = "" |
859 | mDialogView.tvResultado.error = "Operación No Valida" | 865 | mDialogView.tvResultado.error = "Operación No Valida" |
860 | mDialogView.tvResultado.requestFocus() | 866 | mDialogView.tvResultado.requestFocus() |
861 | mDialogView.tvResultado.hint = "Error" | 867 | mDialogView.tvResultado.hint = "Error" |
862 | } | 868 | } |
863 | } | 869 | } |
864 | } | 870 | } |
865 | if(mDialogView.rbMdodificar.isChecked) { | 871 | if(mDialogView.rbMdodificar.isChecked) { |
866 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 872 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
867 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat()) | 873 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat()) |
868 | // mDialogView.tvNuevaCantidad.isEnabled = false | 874 | // mDialogView.tvNuevaCantidad.isEnabled = false |
869 | } | 875 | } |
870 | } | 876 | } |
871 | 877 | ||
872 | } | 878 | } |
873 | } | 879 | } |
874 | } | 880 | } |
875 | 881 | ||
876 | 882 | ||
877 | 883 | ||
878 | 884 | ||
879 | 885 | ||
880 | 886 | ||
881 | 887 | ||
882 | 888 | ||
883 | 889 | ||
884 | 890 | ||
885 | 891 | ||
886 | 892 | ||
887 | 893 | ||
888 | 894 | ||
889 | 895 |
app/src/main/res/drawable-v24/inicio.xml
1 | <vector xmlns:android="http://schemas.android.com/apk/res/android" | File was deleted | |
2 | android:width="30dp" | ||
3 | android:height="30dp" | ||
4 | android:viewportWidth="30" | ||
5 | android:viewportHeight="30" | ||
6 | android:tint="?attr/colorControlNormal"> | ||
7 | <path | ||
8 | android:fillColor="@android:color/white" | ||
9 | android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"/> | ||
10 | </vector> | ||
11 | 1 | <vector xmlns:android="http://schemas.android.com/apk/res/android" |
app/src/main/res/drawable-xlarge/ic_sort19.xml
File was created | 1 | <vector android:height="40dp" android:viewportHeight="97.589" | |
2 | android:viewportWidth="97.589" android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | <path android:fillColor="#FF000000" android:pathData="M66.287,15.789c0.547,0.049 1.077,-0.121 1.489,-0.475l5.481,-4.705l-0.032,28.367c0,0.531 0.21,1.041 0.585,1.416s0.884,0.586 1.415,0.586h5.229c1.104,0 2,-0.895 2,-2V2.17c0,-1.104 -0.896,-2 -2,-2h-4.892c-0.453,0 -0.893,0.154 -1.246,0.436L63.079,9.553c-0.416,0.332 -0.683,0.814 -0.742,1.342c-0.059,0.529 0.096,1.059 0.428,1.475l2.146,2.68C65.251,15.471 65.747,15.738 66.287,15.789z"/> | ||
4 | <path android:fillColor="#FF000000" android:pathData="M90.684,64.143c-1.218,-2.703 -2.99,-4.797 -5.27,-6.223c-2.275,-1.424 -4.962,-2.145 -7.982,-2.145c-4.296,0 -7.746,1.301 -10.257,3.867c-2.506,2.562 -3.775,6.084 -3.775,10.465c0,4.063 1.051,7.297 3.123,9.604c2.086,2.322 4.968,3.5 8.566,3.5c2.141,0 3.956,-0.365 5.399,-1.086c1.161,-0.584 2.225,-1.515 3.161,-2.767c-0.219,2.402 -0.729,4.354 -1.51,5.795c-0.905,1.664 -2.229,2.9 -3.934,3.679c-1.746,0.793 -4.013,1.194 -6.738,1.194c-1.018,0 -2.023,-0.075 -2.989,-0.223c-0.578,-0.084 -1.162,0.08 -1.605,0.459c-0.441,0.381 -0.697,0.936 -0.697,1.518v3.638c0,1.021 0.769,1.877 1.782,1.987c1.101,0.121 2.475,0.183 4.082,0.183c6.82,0 11.996,-2.01 15.384,-5.974c3.367,-3.944 5.074,-9.963 5.074,-17.889C92.497,70.041 91.886,66.816 90.684,64.143zM81.473,74.219c-1.129,1.039 -2.45,1.543 -4.042,1.543c-1.671,0 -2.869,-0.49 -3.667,-1.502c-0.813,-1.025 -1.226,-2.459 -1.226,-4.262c0,-2.121 0.457,-3.756 1.358,-4.857c0.887,-1.084 2.096,-1.611 3.695,-1.611c1.609,0 2.9,0.664 3.943,2.031c1.063,1.396 1.601,3.137 1.601,5.174C83.139,72.053 82.594,73.193 81.473,74.219z"/> | ||
5 | <path android:fillColor="#FF000000" android:pathData="M43.243,65.596h-8.011V2c0,-1.105 -0.896,-2 -2,-2h-16.13c-1.104,0 -2,0.895 -2,2v63.596H7.091c-0.77,0 -1.472,0.443 -1.804,1.137c-0.333,0.695 -0.237,1.519 0.246,2.117l18.076,26.955c0.38,0.473 0.953,0.746 1.558,0.746s1.178,-0.273 1.558,-0.746L44.801,68.85c0.482,-0.6 0.578,-1.422 0.246,-2.117C44.715,66.039 44.013,65.596 43.243,65.596z"/> | ||
6 | </vector> | ||
7 |
app/src/main/res/drawable-xlarge/ic_sort91.xml
File was created | 1 | <vector android:height="40dp" android:viewportHeight="97.086" | |
2 | android:viewportWidth="97.086" android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | <path android:fillColor="#FF000000" android:pathData="M66.035,71.896c0.547,0.049 1.077,-0.121 1.489,-0.475l5.481,-4.705l-0.032,28.367c0,0.531 0.21,1.041 0.585,1.416s0.885,0.586 1.415,0.586h5.229c1.105,0 2,-0.895 2,-2V58.277c0,-1.104 -0.895,-2 -2,-2H75.31c-0.453,0 -0.893,0.154 -1.246,0.436L62.828,65.66c-0.416,0.332 -0.684,0.814 -0.742,1.342c-0.06,0.529 0.096,1.059 0.428,1.475l2.146,2.681C65,71.578 65.496,71.846 66.035,71.896z"/> | ||
4 | <path android:fillColor="#FF000000" android:pathData="M90.432,8.699c-1.218,-2.703 -2.99,-4.797 -5.271,-6.223C82.887,1.052 80.2,0.331 77.18,0.331c-4.297,0 -7.747,1.301 -10.258,3.867c-2.506,2.562 -3.775,6.084 -3.775,10.465c0,4.064 1.051,7.297 3.122,9.605c2.086,2.322 4.969,3.5 8.566,3.5c2.142,0 3.956,-0.365 5.399,-1.086c1.161,-0.584 2.225,-1.514 3.161,-2.766c-0.22,2.402 -0.729,4.354 -1.511,5.795c-0.904,1.664 -2.229,2.9 -3.934,3.678c-1.745,0.793 -4.013,1.195 -6.737,1.195c-1.018,0 -2.023,-0.076 -2.989,-0.223c-0.578,-0.084 -1.162,0.08 -1.605,0.459c-0.442,0.381 -0.696,0.936 -0.696,1.518v3.637c0,1.021 0.769,1.877 1.781,1.988c1.102,0.121 2.475,0.182 4.082,0.182c6.82,0 11.996,-2.01 15.385,-5.973c3.367,-3.945 5.074,-9.963 5.074,-17.889C92.246,14.598 91.634,11.373 90.432,8.699zM81.221,18.775c-1.129,1.039 -2.449,1.543 -4.041,1.543c-1.672,0 -2.869,-0.49 -3.668,-1.502c-0.813,-1.025 -1.226,-2.459 -1.226,-4.262c0,-2.121 0.457,-3.756 1.358,-4.857c0.887,-1.084 2.097,-1.611 3.695,-1.611c1.609,0 2.9,0.664 3.943,2.031c1.063,1.395 1.602,3.137 1.602,5.174C82.887,16.609 82.342,17.75 81.221,18.775z"/> | ||
5 | <path android:fillColor="#FF000000" android:pathData="M42.992,65.596h-8.011V2c0,-1.105 -0.896,-2 -2,-2h-16.13c-1.104,0 -2,0.895 -2,2v63.596H6.84c-0.77,0 -1.472,0.443 -1.804,1.137C4.704,67.428 4.8,68.251 5.282,68.85l18.076,26.955c0.38,0.473 0.952,0.746 1.558,0.746s1.179,-0.273 1.559,-0.746L44.55,68.85c0.482,-0.6 0.578,-1.422 0.246,-2.117C44.464,66.039 43.762,65.596 42.992,65.596z"/> | ||
6 | </vector> | ||
7 |
app/src/main/res/drawable-xlarge/inicio.xml
File was created | 1 | <vector android:height="80dp" android:tint="?attr/colorControlNormal" | |
2 | android:viewportHeight="24" android:viewportWidth="24" | ||
3 | android:width="80dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
4 | <path android:fillColor="@android:color/white" android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"/> | ||
5 | </vector> |
app/src/main/res/drawable/ic_inicio.xml
File was created | 1 | <vector xmlns:android="http://schemas.android.com/apk/res/android" | |
2 | android:width="24dp" | ||
3 | android:height="24dp" | ||
4 | android:viewportWidth="24" | ||
5 | android:viewportHeight="24" | ||
6 | android:tint="?attr/colorControlNormal"> | ||
7 | <path | ||
8 | android:fillColor="@android:color/white" | ||
9 | android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"/> | ||
10 | </vector> | ||
11 |
app/src/main/res/drawable/inicio.xml
File was created | 1 | ||
2 | |||
3 | <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
4 | android:width="24dp" | ||
5 | android:height="24dp" | ||
6 | android:viewportWidth="24" | ||
7 | android:viewportHeight="24" | ||
8 | android:tint="?attr/colorControlNormal"> | ||
9 | <path | ||
10 | android:fillColor="@android:color/white" | ||
11 | android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"/> | ||
12 | </vector> | ||
13 |
app/src/main/res/layout-large/item_spinner.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <LinearLayout | ||
3 | xmlns:android="http://schemas.android.com/apk/res/android" | ||
4 | android:layout_width="match_parent" | ||
5 | android:layout_height="match_parent"> | ||
6 | |||
7 | <TextView | ||
8 | android:layout_width="wrap_content" | ||
9 | android:layout_height="wrap_content" | ||
10 | android:textSize="40sp" | ||
11 | android:textStyle="bold" | ||
12 | android:id="@+id/tvServidorDesc"/> | ||
13 | </LinearLayout> | ||
14 |
app/src/main/res/layout-xlarge/activity_splash.xml
File was created | 1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="match_parent" | ||
7 | android:background="#E6E6E6" | ||
8 | |||
9 | tools:context=".UI.SplashActivity"> | ||
10 | |||
11 | |||
12 | <androidx.appcompat.widget.AppCompatTextView | ||
13 | android:id="@+id/textView2" | ||
14 | android:layout_width="match_parent" | ||
15 | android:layout_height="150dp" | ||
16 | android:layout_margin="20dp" | ||
17 | android:autoSizeMaxTextSize="1000sp" | ||
18 | android:autoSizeMinTextSize="30sp" | ||
19 | android:autoSizeStepGranularity="5sp" | ||
20 | android:autoSizeTextType="uniform" | ||
21 | android:gravity="center" | ||
22 | android:lines="1" | ||
23 | android:text="@string/bien" | ||
24 | android:textColor="@color/colorAccent" | ||
25 | app:fontFamily="sans-serif-condensed" | ||
26 | app:layout_constraintBottom_toTopOf="@+id/imageView" | ||
27 | app:layout_constraintEnd_toEndOf="parent" | ||
28 | app:layout_constraintStart_toStartOf="parent" | ||
29 | app:layout_constraintTop_toTopOf="parent" /> | ||
30 | |||
31 | <ImageView | ||
32 | android:id="@+id/imageView" | ||
33 | android:layout_width="541dp" | ||
34 | android:layout_height="388dp" | ||
35 | android:contentDescription="@string/todo" | ||
36 | android:src="@drawable/logo_splash" | ||
37 | app:layout_constraintBottom_toTopOf="@id/textView4" | ||
38 | app:layout_constraintEnd_toEndOf="parent" | ||
39 | app:layout_constraintStart_toStartOf="parent" | ||
40 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | ||
41 | |||
42 | <androidx.appcompat.widget.AppCompatTextView | ||
43 | android:id="@+id/textView4" | ||
44 | android:layout_width="match_parent" | ||
45 | android:layout_height="150dp" | ||
46 | android:layout_margin="20dp" | ||
47 | android:autoSizeMaxTextSize="1000sp" | ||
48 | android:autoSizeMinTextSize="30sp" | ||
49 | android:autoSizeStepGranularity="5sp" | ||
50 | android:autoSizeTextType="uniform" | ||
51 | android:gravity="center" | ||
52 | android:lines="1" | ||
53 | android:text="@string/inventario" | ||
54 | android:textColor="@color/colorAccent" | ||
55 | app:fontFamily="sans-serif-condensed" | ||
56 | app:layout_constraintBottom_toBottomOf="parent" | ||
57 | app:layout_constraintEnd_toEndOf="parent" | ||
58 | app:layout_constraintEnd_toStartOf="parent" | ||
59 | app:layout_constraintTop_toBottomOf="@id/imageView" /> | ||
60 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-xlarge/fragment_actua_maestros.xml
File was created | 1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="match_parent" | ||
7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> | ||
8 | |||
9 | |||
10 | <androidx.appcompat.widget.AppCompatTextView | ||
11 | android:id="@+id/tvActMaestros" | ||
12 | android:layout_width="match_parent" | ||
13 | android:layout_height="120dp" | ||
14 | android:layout_marginTop="15dp" | ||
15 | android:autoSizeMaxTextSize="100sp" | ||
16 | android:autoSizeMinTextSize="20sp" | ||
17 | android:autoSizeStepGranularity="5sp" | ||
18 | android:autoSizeTextType="uniform" | ||
19 | android:gravity="center" | ||
20 | android:lines="1" | ||
21 | android:text="@string/tvActMaestros" | ||
22 | android:textColor="@color/colorAccent" | ||
23 | |||
24 | app:fontFamily="sans-serif-condensed" | ||
25 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | ||
26 | app:layout_constraintEnd_toEndOf="parent" | ||
27 | app:layout_constraintStart_toStartOf="parent" | ||
28 | app:layout_constraintTop_toTopOf="parent" /> | ||
29 | |||
30 | <TextView | ||
31 | android:id="@+id/tvSeleccioneServidor" | ||
32 | android:layout_width="0dp" | ||
33 | android:layout_height="wrap_content" | ||
34 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
35 | android:layout_marginTop="20dp" | ||
36 | android:gravity="start" | ||
37 | android:lines="1" | ||
38 | android:text="@string/tvMedio" | ||
39 | android:textColor="@android:color/black" | ||
40 | android:textSize="@dimen/SubTitulos10" | ||
41 | app:fontFamily="sans-serif-condensed" | ||
42 | app:layout_constraintEnd_toEndOf="parent" | ||
43 | app:layout_constraintStart_toStartOf="parent" | ||
44 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> | ||
45 | |||
46 | <RadioGroup | ||
47 | android:id="@+id/rgTipoActualizacion" | ||
48 | android:layout_width="0dp" | ||
49 | android:layout_height="wrap_content" | ||
50 | android:layout_marginTop="20dp" | ||
51 | android:gravity="start" | ||
52 | android:orientation="vertical" | ||
53 | app:layout_constraintEnd_toEndOf="parent" | ||
54 | app:layout_constraintStart_toStartOf="parent" | ||
55 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> | ||
56 | |||
57 | <RadioButton | ||
58 | android:id="@+id/obPorWifi" | ||
59 | android:layout_width="wrap_content" | ||
60 | android:layout_height="wrap_content" | ||
61 | android:layout_margin="5dp" | ||
62 | android:checked="true" | ||
63 | android:padding="5dp" | ||
64 | android:text="@string/obPorWifi" | ||
65 | android:textSize="@dimen/SubTitulos10" /> | ||
66 | |||
67 | <RadioButton | ||
68 | android:id="@+id/obViaArchivo" | ||
69 | android:layout_width="wrap_content" | ||
70 | android:layout_height="wrap_content" | ||
71 | android:layout_margin="5dp" | ||
72 | android:checked="false" | ||
73 | android:padding="5dp" | ||
74 | android:text="@string/obViaArchivo" | ||
75 | android:textSize="@dimen/SubTitulos10"/> | ||
76 | </RadioGroup> | ||
77 | |||
78 | <TextView | ||
79 | android:id="@+id/tvServerConectado" | ||
80 | android:layout_width="match_parent" | ||
81 | android:layout_height="wrap_content" | ||
82 | android:layout_margin="30dp" | ||
83 | android:gravity="center" | ||
84 | android:lines="2" | ||
85 | android:text="" | ||
86 | android:textColor="@android:color/black" | ||
87 | android:textSize="@dimen/textCantidad10" | ||
88 | android:textStyle="bold" | ||
89 | app:fontFamily="sans-serif-condensed" | ||
90 | app:layout_constraintBottom_toTopOf="@+id/countriesList" | ||
91 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" /> | ||
92 | |||
93 | <TextView | ||
94 | android:id="@+id/countriesList" | ||
95 | android:layout_width="0dp" | ||
96 | android:layout_height="wrap_content" | ||
97 | android:layout_marginTop="@dimen/MarginTopTitulos" | ||
98 | android:gravity="center" | ||
99 | android:text="" | ||
100 | android:textColor="@android:color/black" | ||
101 | android:textSize="@dimen/SubTitulos10" | ||
102 | android:textStyle="bold" | ||
103 | android:visibility="visible" | ||
104 | app:fontFamily="sans-serif-condensed" | ||
105 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" | ||
106 | app:layout_constraintEnd_toEndOf="parent" | ||
107 | app:layout_constraintHorizontal_bias="0.0" | ||
108 | app:layout_constraintStart_toStartOf="parent" | ||
109 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" | ||
110 | app:layout_constraintVertical_bias="0.106" /> | ||
111 | |||
112 | <Button | ||
113 | android:id="@+id/btnConfirmarAct" | ||
114 | android:layout_width="0dp" | ||
115 | android:layout_height="wrap_content" | ||
116 | android:layout_margin="20dp" | ||
117 | android:background="@drawable/boton_borde_redondeado" | ||
118 | android:padding="10dp" | ||
119 | android:text="@string/btnConfirmarAct" | ||
120 | android:textColor="@android:color/white" | ||
121 | android:textSize="@dimen/SubTitulos10" | ||
122 | app:layout_constraintBottom_toBottomOf="parent" | ||
123 | app:layout_constraintEnd_toEndOf="parent" | ||
124 | app:layout_constraintStart_toStartOf="parent" /> | ||
125 | |||
126 | |||
127 | <ProgressBar | ||
128 | android:id="@+id/loading_view" | ||
129 | android:layout_width="wrap_content" | ||
130 | android:layout_height="wrap_content" | ||
131 | android:layout_marginStart="8dp" | ||
132 | android:layout_marginLeft="8dp" | ||
133 | android:layout_marginTop="8dp" | ||
134 | android:layout_marginEnd="8dp" | ||
135 | android:layout_marginRight="8dp" | ||
136 | android:layout_marginBottom="8dp" | ||
137 | android:visibility="gone" | ||
138 | app:layout_constraintBottom_toBottomOf="parent" | ||
139 | app:layout_constraintEnd_toEndOf="parent" | ||
140 | app:layout_constraintStart_toStartOf="parent" | ||
141 | app:layout_constraintTop_toTopOf="parent" /> | ||
142 | |||
143 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
144 |
app/src/main/res/layout-xlarge/fragment_codigo_ori.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | |||
3 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
4 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
5 | xmlns:tools="http://schemas.android.com/tools" | ||
6 | android:layout_width="match_parent" | ||
7 | android:layout_height="match_parent" | ||
8 | android:background="@android:color/darker_gray" | ||
9 | tools:context=".UI.descripcionFragment.DescripcionFragment"> | ||
10 | |||
11 | <ImageView | ||
12 | android:id="@+id/ivHolder" | ||
13 | android:layout_width="60dp" | ||
14 | android:layout_height="60dp" | ||
15 | android:src="@drawable/ic_izq" | ||
16 | android:visibility="visible" | ||
17 | app:layout_constraintBottom_toTopOf="@id/guideline4" | ||
18 | app:layout_constraintStart_toStartOf="parent" /> | ||
19 | |||
20 | |||
21 | <TextView | ||
22 | android:id="@+id/tvCodigo" | ||
23 | android:layout_width="0dp" | ||
24 | android:layout_height="wrap_content" | ||
25 | android:layout_marginStart="2dp" | ||
26 | android:gravity="center_horizontal" | ||
27 | android:orientation="vertical" | ||
28 | android:text="Deslizar a la izquierda para seleccionar" | ||
29 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
30 | android:textColor="@color/colorPrimaryDark" | ||
31 | android:textSize="30sp" | ||
32 | android:textStyle="bold" | ||
33 | |||
34 | app:layout_constraintBottom_toTopOf="@id/guideline4" | ||
35 | app:layout_constraintHorizontal_chainStyle="packed" | ||
36 | app:layout_constraintStart_toEndOf="@id/ivHolder" | ||
37 | app:layout_constraintTop_toTopOf="parent" /> | ||
38 | |||
39 | <androidx.recyclerview.widget.RecyclerView | ||
40 | android:id="@+id/rcCodigoOri" | ||
41 | android:layout_width="match_parent" | ||
42 | android:layout_height="0dp" | ||
43 | android:background="@android:color/darker_gray" | ||
44 | android:scrollbars="vertical" | ||
45 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | ||
46 | app:layout_constraintEnd_toEndOf="parent" | ||
47 | app:layout_constraintStart_toStartOf="parent" | ||
48 | app:layout_constraintTop_toBottomOf="@id/guideline4" | ||
49 | tools:listitem="@layout/item_codigo_origen" /> | ||
50 | |||
51 | <!-- <Button--> | ||
52 | <!-- android:id="@+id/btnSalir"--> | ||
53 | <!-- android:layout_width="0dp"--> | ||
54 | <!-- android:layout_height="wrap_content"--> | ||
55 | <!-- android:text="@string/btnCancelar"--> | ||
56 | <!-- android:textColor="@android:color/white"--> | ||
57 | <!-- android:padding="10dp"--> | ||
58 | <!-- android:background="@drawable/boton_borde_redondeado"--> | ||
59 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> | ||
60 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
61 | <!-- app:layout_constraintHorizontal_chainStyle="spread"--> | ||
62 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
63 | <!-- app:layout_constraintTop_toBottomOf="@+id/rcInventarios" />--> | ||
64 | |||
65 | <androidx.constraintlayout.widget.Guideline | ||
66 | android:id="@+id/guideline4" | ||
67 | android:layout_width="wrap_content" | ||
68 | android:layout_height="wrap_content" | ||
69 | android:orientation="horizontal" | ||
70 | app:layout_constraintGuide_percent="0.06" /> | ||
71 | |||
72 | <androidx.constraintlayout.widget.Guideline | ||
73 | android:id="@+id/guideline5" | ||
74 | android:layout_width="wrap_content" | ||
75 | android:layout_height="wrap_content" | ||
76 | android:orientation="horizontal" | ||
77 | app:layout_constraintGuide_percent="0.88" /> | ||
78 | |||
79 | <androidx.constraintlayout.widget.Guideline | ||
80 | android:id="@+id/guideline6" | ||
81 | android:layout_width="wrap_content" | ||
82 | android:layout_height="wrap_content" | ||
83 | android:orientation="horizontal" | ||
84 | app:layout_constraintGuide_percent="0.97" /> | ||
85 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-xlarge/fragment_configuracion.xml
File was created | 1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <ScrollView | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | tools:context=".UI.configuracion.ConfiguracionFragment" | ||
6 | xmlns:android="http://schemas.android.com/apk/res/android" | ||
7 | android:layout_width="match_parent" | ||
8 | android:layout_height="wrap_content"> | ||
9 | |||
10 | <androidx.constraintlayout.widget.ConstraintLayout | ||
11 | android:layout_width="match_parent" | ||
12 | android:layout_height="wrap_content" | ||
13 | tools:context=".UI.configuracion.ConfiguracionFragment"> | ||
14 | |||
15 | |||
16 | <androidx.appcompat.widget.AppCompatTextView | ||
17 | android:id="@+id/textView2" | ||
18 | android:layout_width="match_parent" | ||
19 | android:layout_height="100dp" | ||
20 | android:layout_marginStart="8dp" | ||
21 | android:layout_marginEnd="8dp" | ||
22 | android:autoSizeMaxTextSize="100sp" | ||
23 | android:autoSizeMinTextSize="20sp" | ||
24 | android:autoSizeStepGranularity="5sp" | ||
25 | android:autoSizeTextType="uniform" | ||
26 | android:gravity="center" | ||
27 | android:lines="1" | ||
28 | android:text="@string/tvTituloConf" | ||
29 | android:textColor="@color/colorAccent" | ||
30 | android:textSize="@dimen/Titulos" | ||
31 | app:fontFamily="sans-serif-condensed" | ||
32 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | ||
33 | app:layout_constraintEnd_toEndOf="parent" | ||
34 | app:layout_constraintStart_toStartOf="parent" | ||
35 | app:layout_constraintTop_toTopOf="parent" /> | ||
36 | |||
37 | <TextView | ||
38 | android:id="@+id/tvSeleccioneServidor" | ||
39 | android:layout_width="0dp" | ||
40 | android:layout_height="wrap_content" | ||
41 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
42 | android:layout_marginTop="15dp" | ||
43 | android:gravity="start" | ||
44 | android:lines="1" | ||
45 | android:text="@string/tvSeleccioneServidor" | ||
46 | android:textColor="@android:color/black" | ||
47 | android:textSize="@dimen/SubTitulos10" | ||
48 | app:fontFamily="sans-serif-condensed" | ||
49 | app:layout_constraintBottom_toTopOf="@+id/spServidor" | ||
50 | app:layout_constraintEnd_toEndOf="parent" | ||
51 | app:layout_constraintStart_toStartOf="parent" | ||
52 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | ||
53 | |||
54 | <Spinner | ||
55 | android:id="@+id/spServidor" | ||
56 | style="@android:style/Widget.Holo.Light.Spinner" | ||
57 | android:layout_width="0dp" | ||
58 | android:layout_height="wrap_content" | ||
59 | android:elevation="5dp" | ||
60 | android:textSize="@dimen/VentasDeposito10" | ||
61 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | ||
62 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" | ||
63 | app:layout_constraintHorizontal_chainStyle="packed" | ||
64 | app:layout_constraintStart_toStartOf="parent" | ||
65 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" | ||
66 | /> | ||
67 | |||
68 | <Button | ||
69 | android:id="@+id/btnValidarServidor" | ||
70 | android:layout_width="wrap_content" | ||
71 | android:layout_height="wrap_content" | ||
72 | android:textColor="@android:color/white" | ||
73 | android:padding="10dp" | ||
74 | android:background="@drawable/boton_borde_redondeado" | ||
75 | android:text="@string/btnValidarServidor" | ||
76 | android:textSize="@dimen/SubTitulos10" | ||
77 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | ||
78 | app:layout_constraintEnd_toEndOf="parent" | ||
79 | app:layout_constraintHorizontal_chainStyle="packed" | ||
80 | app:layout_constraintStart_toEndOf="@id/spServidor" | ||
81 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> | ||
82 | |||
83 | <Button | ||
84 | android:id="@+id/btnAgregarServidor" | ||
85 | android:layout_width="0dp" | ||
86 | android:layout_height="wrap_content" | ||
87 | android:layout_marginTop="10dp" | ||
88 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
89 | android:layout_marginEnd="@dimen/MarginBotAgreSer" | ||
90 | android:text="@string/btnAgregarServidor" | ||
91 | android:textSize="@dimen/SubTitulos10" | ||
92 | android:textColor="@android:color/white" | ||
93 | android:padding="10dp" | ||
94 | android:background="@drawable/boton_borde_redondeado" | ||
95 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" | ||
96 | app:layout_constraintEnd_toEndOf="parent" | ||
97 | app:layout_constraintStart_toStartOf="parent" | ||
98 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> | ||
99 | |||
100 | |||
101 | <TextView | ||
102 | android:id="@+id/tvUbicacionCarpetas" | ||
103 | android:layout_width="0dp" | ||
104 | android:layout_height="wrap_content" | ||
105 | android:visibility="gone" | ||
106 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
107 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | ||
108 | android:gravity="start" | ||
109 | android:lines="1" | ||
110 | android:text="@string/tvUbicacionCarpetas" | ||
111 | android:textColor="@android:color/black" | ||
112 | android:textSize="@dimen/SubTitulos" | ||
113 | app:fontFamily="sans-serif-condensed" | ||
114 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" | ||
115 | app:layout_constraintEnd_toEndOf="parent" | ||
116 | app:layout_constraintStart_toStartOf="parent" | ||
117 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> | ||
118 | |||
119 | <ImageButton | ||
120 | android:id="@+id/ibSearch" | ||
121 | android:layout_width="36dp" | ||
122 | android:layout_height="37dp" | ||
123 | android:layout_margin="10dp" | ||
124 | android:src="@drawable/search" | ||
125 | android:textColor="@android:color/white" | ||
126 | android:padding="10dp" | ||
127 | android:visibility="gone" | ||
128 | android:background="@drawable/boton_borde_redondeado" | ||
129 | app:layout_constraintEnd_toStartOf="@+id/etRuta" | ||
130 | app:layout_constraintStart_toStartOf="parent" | ||
131 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | ||
132 | |||
133 | <EditText | ||
134 | android:id="@+id/etRuta" | ||
135 | android:layout_width="0dp" | ||
136 | android:layout_height="wrap_content" | ||
137 | android:layout_marginTop="10dp" | ||
138 | android:layout_marginEnd="10dp" | ||
139 | android:clickable="true" | ||
140 | android:ems="10" | ||
141 | android:focusable="true" | ||
142 | android:visibility="gone" | ||
143 | android:inputType="textPersonName" | ||
144 | android:lines="1" | ||
145 | android:text="" | ||
146 | android:textSize="@dimen/NormalText" | ||
147 | app:layout_constraintEnd_toEndOf="parent" | ||
148 | app:layout_constraintStart_toEndOf="@id/ibSearch" | ||
149 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | ||
150 | |||
151 | <TextView | ||
152 | android:id="@+id/tvActuFecha" | ||
153 | android:layout_width="0dp" | ||
154 | android:layout_height="wrap_content" | ||
155 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
156 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | ||
157 | android:gravity="start" | ||
158 | android:lines="1" | ||
159 | android:text="@string/tvTituloArea" | ||
160 | android:textColor="@android:color/black" | ||
161 | android:textSize="@dimen/SubTitulos10" | ||
162 | app:fontFamily="sans-serif-condensed" | ||
163 | app:layout_constraintEnd_toEndOf="parent" | ||
164 | app:layout_constraintStart_toStartOf="parent" | ||
165 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> | ||
166 | |||
167 | <RadioGroup | ||
168 | android:id="@+id/rgFechaHora" | ||
169 | android:layout_width="0dp" | ||
170 | android:layout_height="wrap_content" | ||
171 | |||
172 | android:gravity="center" | ||
173 | android:orientation="horizontal" | ||
174 | app:layout_constraintEnd_toEndOf="parent" | ||
175 | app:layout_constraintStart_toStartOf="parent" | ||
176 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> | ||
177 | |||
178 | <RadioButton | ||
179 | android:id="@+id/rbVentas" | ||
180 | android:layout_width="wrap_content" | ||
181 | android:layout_height="wrap_content" | ||
182 | android:layout_margin="5dp" | ||
183 | android:checked="true" | ||
184 | android:padding="5dp" | ||
185 | android:text="@string/rbVentas" | ||
186 | android:textSize="@dimen/SubTitulos10" /> | ||
187 | |||
188 | <RadioButton | ||
189 | android:id="@+id/rbDeposito" | ||
190 | android:layout_width="wrap_content" | ||
191 | android:layout_height="wrap_content" | ||
192 | android:layout_margin="5dp" | ||
193 | android:checked="false" | ||
194 | android:padding="5dp" | ||
195 | android:text="@string/rbDeposito" | ||
196 | android:textSize="@dimen/SubTitulos10" /> | ||
197 | |||
198 | </RadioGroup> | ||
199 | |||
200 | <TextView | ||
201 | android:id="@+id/tvLosProductos" | ||
202 | android:layout_width="0dp" | ||
203 | android:layout_height="wrap_content" | ||
204 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
205 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | ||
206 | android:gravity="start" | ||
207 | android:lines="1" | ||
208 | android:text="@string/tvLosProductos" | ||
209 | android:textColor="@android:color/black" | ||
210 | android:textSize="@dimen/SubTitulos10" | ||
211 | app:fontFamily="sans-serif-condensed" | ||
212 | app:layout_constraintEnd_toEndOf="parent" | ||
213 | app:layout_constraintStart_toStartOf="parent" | ||
214 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | ||
215 | |||
216 | <RadioGroup | ||
217 | android:id="@+id/rgLosProductos" | ||
218 | android:layout_width="0dp" | ||
219 | android:layout_height="wrap_content" | ||
220 | |||
221 | android:gravity="center" | ||
222 | android:orientation="vertical" | ||
223 | app:layout_constraintEnd_toEndOf="parent" | ||
224 | app:layout_constraintStart_toStartOf="parent" | ||
225 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> | ||
226 | |||
227 | <RadioButton | ||
228 | android:id="@+id/rbProInclu" | ||
229 | android:layout_width="match_parent" | ||
230 | android:layout_height="wrap_content" | ||
231 | android:layout_margin="@dimen/PadingCbyRb" | ||
232 | android:checked="true" | ||
233 | android:padding="@dimen/PadingCbyRb" | ||
234 | android:text="@string/rbProInclu" | ||
235 | android:textSize="@dimen/SubTitulos10" /> | ||
236 | |||
237 | <RadioButton | ||
238 | android:id="@+id/rbProNoInclu" | ||
239 | android:layout_width="match_parent" | ||
240 | android:layout_height="wrap_content" | ||
241 | android:layout_margin="@dimen/PadingCbyRb" | ||
242 | android:checked="false" | ||
243 | android:padding="@dimen/PadingCbyRb" | ||
244 | android:text="@string/rbProNoInclu" | ||
245 | android:textSize="@dimen/SubTitulos10"/> | ||
246 | |||
247 | </RadioGroup> | ||
248 | |||
249 | <CheckBox | ||
250 | android:id="@+id/cbHabiLectura" | ||
251 | android:layout_width="0dp" | ||
252 | android:layout_height="wrap_content" | ||
253 | android:layout_margin="@dimen/PadingCbyRb" | ||
254 | android:padding="@dimen/PadingCbyRb" | ||
255 | android:text="@string/cbHabiLectura" | ||
256 | android:textSize="@dimen/SubTitulos10" | ||
257 | app:layout_constraintEnd_toEndOf="parent" | ||
258 | app:layout_constraintStart_toStartOf="parent" | ||
259 | app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" /> | ||
260 | |||
261 | <CheckBox | ||
262 | android:id="@+id/cbMostrarStock" | ||
263 | android:layout_width="0dp" | ||
264 | android:layout_height="wrap_content" | ||
265 | android:layout_margin="@dimen/PadingCbyRb" | ||
266 | android:padding="@dimen/PadingCbyRb" | ||
267 | android:text="@string/cbMostrarStock" | ||
268 | android:textSize="@dimen/SubTitulos10" | ||
269 | app:layout_constraintEnd_toEndOf="parent" | ||
270 | app:layout_constraintStart_toStartOf="parent" | ||
271 | app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" /> | ||
272 | |||
273 | <!-- <TextView--> | ||
274 | <!-- android:id="@+id/tvColumMostrar"--> | ||
275 | <!-- android:layout_width="0dp"--> | ||
276 | <!-- android:layout_height="wrap_content"--> | ||
277 | <!-- android:layout_marginStart="@dimen/MarginBotAgreSer"--> | ||
278 | <!-- android:layout_marginEnd="@dimen/MarginTopSubTitulos"--> | ||
279 | <!-- android:gravity="start"--> | ||
280 | <!-- android:lines="1"--> | ||
281 | <!-- android:text="@string/tvColumMostrar"--> | ||
282 | <!-- android:textColor="@android:color/black"--> | ||
283 | <!-- android:textSize="@dimen/VentasDeposito10"--> | ||
284 | <!-- app:fontFamily="sans-serif-condensed"--> | ||
285 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
286 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
287 | <!-- app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" />--> | ||
288 | |||
289 | <!-- <RadioGroup--> | ||
290 | <!-- android:id="@+id/rgCodigosMostrar"--> | ||
291 | <!-- android:layout_width="0dp"--> | ||
292 | <!-- android:layout_height="wrap_content"--> | ||
293 | |||
294 | <!-- android:gravity="center"--> | ||
295 | <!-- android:orientation="horizontal"--> | ||
296 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
297 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
298 | <!-- app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar">--> | ||
299 | |||
300 | <!-- <RadioButton--> | ||
301 | <!-- android:id="@+id/rbCodigoDebo"--> | ||
302 | <!-- android:layout_width="wrap_content"--> | ||
303 | <!-- android:layout_height="wrap_content"--> | ||
304 | <!-- android:layout_margin="5dp"--> | ||
305 | <!-- android:checked="true"--> | ||
306 | <!-- android:padding="5dp"--> | ||
307 | <!-- android:text="@string/rbCodigoDebo"--> | ||
308 | <!-- android:textSize="@dimen/NormalText" />--> | ||
309 | |||
310 | <!-- <RadioButton--> | ||
311 | <!-- android:id="@+id/rbCodigoOrigen"--> | ||
312 | <!-- android:layout_width="wrap_content"--> | ||
313 | <!-- android:layout_height="wrap_content"--> | ||
314 | <!-- android:layout_margin="5dp"--> | ||
315 | <!-- android:checked="false"--> | ||
316 | <!-- android:padding="5dp"--> | ||
317 | <!-- android:text="@string/rbCodigoOrigen"--> | ||
318 | <!-- android:textSize="@dimen/NormalText" />--> | ||
319 | |||
320 | <!-- <RadioButton--> | ||
321 | <!-- android:id="@+id/rbCodigoBarras"--> | ||
322 | <!-- android:layout_width="wrap_content"--> | ||
323 | <!-- android:layout_height="wrap_content"--> | ||
324 | <!-- android:layout_margin="5dp"--> | ||
325 | <!-- android:padding="5dp"--> | ||
326 | <!-- android:text="@string/rbCodigoBarras"--> | ||
327 | <!-- android:textSize="@dimen/NormalText" />--> | ||
328 | <!-- </RadioGroup>--> | ||
329 | |||
330 | <!-- <CheckBox--> | ||
331 | <!-- android:id="@+id/cbMostrarExistencia"--> | ||
332 | <!-- android:layout_width="wrap_content"--> | ||
333 | <!-- android:layout_height="wrap_content"--> | ||
334 | <!-- android:layout_margin="@dimen/PadingCbyRb"--> | ||
335 | <!-- android:padding="@dimen/PadingCbyRb"--> | ||
336 | <!-- android:text="@string/cbMostrarExistencia"--> | ||
337 | <!-- android:textSize="@dimen/NormalText"--> | ||
338 | <!-- android:checked="false"--> | ||
339 | <!-- app:layout_constraintEnd_toStartOf="@+id/cbMostrarPrecio"--> | ||
340 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
341 | <!-- app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" />--> | ||
342 | |||
343 | <!-- <CheckBox--> | ||
344 | <!-- android:id="@+id/cbMostrarPrecio"--> | ||
345 | <!-- android:layout_width="wrap_content"--> | ||
346 | <!-- android:layout_height="wrap_content"--> | ||
347 | <!-- android:layout_margin="@dimen/PadingCbyRb"--> | ||
348 | <!-- android:padding="@dimen/PadingCbyRb"--> | ||
349 | <!-- android:text="@string/cbMostrarPrecio"--> | ||
350 | <!-- android:textSize="@dimen/NormalText"--> | ||
351 | <!-- android:checked="false"--> | ||
352 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
353 | <!-- app:layout_constraintStart_toEndOf="@+id/cbMostrarExistencia"--> | ||
354 | <!-- app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" />--> | ||
355 | |||
356 | <Button | ||
357 | android:id="@+id/btnGuardar" | ||
358 | android:layout_width="wrap_content" | ||
359 | android:layout_height="wrap_content" | ||
360 | android:layout_marginTop="20dp" | ||
361 | android:text="@string/btnGuardar" | ||
362 | android:textSize="@dimen/SubTitulos10" | ||
363 | app:layout_constraintEnd_toEndOf="parent" | ||
364 | android:textColor="@android:color/white" | ||
365 | android:padding="10dp" | ||
366 | android:background="@drawable/boton_borde_redondeado" | ||
367 | app:layout_constraintStart_toStartOf="parent" | ||
368 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> | ||
369 | |||
370 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
371 | </ScrollView> | ||
372 | |||
373 |
app/src/main/res/layout-xlarge/fragment_descripcion.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | |||
3 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
4 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
5 | xmlns:tools="http://schemas.android.com/tools" | ||
6 | android:layout_width="match_parent" | ||
7 | android:layout_height="match_parent" | ||
8 | android:background="@android:color/darker_gray" | ||
9 | tools:context=".UI.descripcionFragment.DescripcionFragment"> | ||
10 | |||
11 | |||
12 | <ImageView | ||
13 | android:id="@+id/ivHolder" | ||
14 | android:layout_width="60dp" | ||
15 | android:layout_height="60dp" | ||
16 | android:src="@drawable/ic_izq" | ||
17 | android:visibility="visible" | ||
18 | app:layout_constraintBottom_toTopOf="@id/guideline4" | ||
19 | app:layout_constraintStart_toStartOf="parent" /> | ||
20 | |||
21 | |||
22 | <TextView | ||
23 | android:id="@+id/tvCodigo" | ||
24 | android:layout_width="0dp" | ||
25 | android:layout_height="wrap_content" | ||
26 | android:layout_marginStart="2dp" | ||
27 | android:gravity="center_horizontal" | ||
28 | android:orientation="vertical" | ||
29 | android:text="Deslizar a la izquierda para seleccionar" | ||
30 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
31 | android:textColor="@color/colorPrimaryDark" | ||
32 | android:textSize="30sp" | ||
33 | android:textStyle="bold" | ||
34 | |||
35 | app:layout_constraintBottom_toTopOf="@id/guideline4" | ||
36 | app:layout_constraintHorizontal_chainStyle="packed" | ||
37 | app:layout_constraintStart_toEndOf="@id/ivHolder" | ||
38 | app:layout_constraintTop_toTopOf="parent" /> | ||
39 | |||
40 | <androidx.recyclerview.widget.RecyclerView | ||
41 | android:id="@+id/rcDescripcion" | ||
42 | android:layout_width="match_parent" | ||
43 | android:layout_height="0dp" | ||
44 | android:background="@android:color/darker_gray" | ||
45 | android:scrollbars="vertical" | ||
46 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | ||
47 | app:layout_constraintEnd_toEndOf="parent" | ||
48 | app:layout_constraintStart_toStartOf="parent" | ||
49 | app:layout_constraintTop_toBottomOf="@id/guideline4" | ||
50 | tools:listitem="@layout/item" /> | ||
51 | |||
52 | <!-- <Button--> | ||
53 | <!-- android:id="@+id/btnSalir"--> | ||
54 | <!-- android:layout_width="0dp"--> | ||
55 | <!-- android:layout_height="wrap_content"--> | ||
56 | <!-- android:text="@string/btnCancelar"--> | ||
57 | <!-- android:textColor="@android:color/white"--> | ||
58 | <!-- android:padding="10dp"--> | ||
59 | <!-- android:background="@drawable/boton_borde_redondeado"--> | ||
60 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> | ||
61 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
62 | <!-- app:layout_constraintHorizontal_chainStyle="spread"--> | ||
63 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
64 | <!-- app:layout_constraintTop_toBottomOf="@+id/rcInventarios" />--> | ||
65 | |||
66 | <androidx.constraintlayout.widget.Guideline | ||
67 | android:id="@+id/guideline4" | ||
68 | android:layout_width="wrap_content" | ||
69 | android:layout_height="wrap_content" | ||
70 | android:orientation="horizontal" | ||
71 | app:layout_constraintGuide_percent="0.06" /> | ||
72 | |||
73 | <androidx.constraintlayout.widget.Guideline | ||
74 | android:id="@+id/guideline5" | ||
75 | android:layout_width="wrap_content" | ||
76 | android:layout_height="wrap_content" | ||
77 | android:orientation="horizontal" | ||
78 | app:layout_constraintGuide_percent="0.88" /> | ||
79 | |||
80 | <androidx.constraintlayout.widget.Guideline | ||
81 | android:id="@+id/guideline6" | ||
82 | android:layout_width="wrap_content" | ||
83 | android:layout_height="wrap_content" | ||
84 | android:orientation="horizontal" | ||
85 | app:layout_constraintGuide_percent="0.97" /> | ||
86 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
87 |
app/src/main/res/layout-xlarge/fragment_detalle_art.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | android:id="@+id/nsPedidosDatos" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="match_parent"> | ||
7 | |||
8 | <androidx.cardview.widget.CardView | ||
9 | android:id="@+id/cvItem1" | ||
10 | android:layout_width="match_parent" | ||
11 | android:layout_height="wrap_content" | ||
12 | android:layout_marginStart="5dp" | ||
13 | android:layout_marginTop="5dp" | ||
14 | android:layout_marginEnd="5dp" | ||
15 | app:cardBackgroundColor="@android:color/darker_gray" | ||
16 | app:cardCornerRadius="25dp" | ||
17 | app:cardElevation="10dp" | ||
18 | app:layout_constraintEnd_toEndOf="parent" | ||
19 | app:layout_constraintStart_toStartOf="parent" | ||
20 | app:layout_constraintTop_toTopOf="parent"> | ||
21 | |||
22 | <androidx.constraintlayout.widget.ConstraintLayout | ||
23 | android:id="@+id/clayout" | ||
24 | android:layout_width="match_parent" | ||
25 | android:layout_height="match_parent"> | ||
26 | |||
27 | <!-- <TextView--> | ||
28 | <!-- android:id="@+id/tvTime"--> | ||
29 | <!-- android:layout_width="0dp"--> | ||
30 | <!-- android:layout_height="wrap_content"--> | ||
31 | <!-- android:layout_marginTop="15dp"--> | ||
32 | <!-- android:gravity="center_horizontal"--> | ||
33 | <!-- android:orientation="horizontal"--> | ||
34 | <!-- android:text="Detalle del artículo"--> | ||
35 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
36 | <!-- android:textSize="@dimen/Titulos"--> | ||
37 | <!-- android:textStyle="bold"--> | ||
38 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
39 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
40 | <!-- app:layout_constraintTop_toTopOf="parent" />--> | ||
41 | |||
42 | <TextView | ||
43 | android:id="@+id/tvDescripcion" | ||
44 | android:layout_width="wrap_content" | ||
45 | android:layout_height="0dp" | ||
46 | android:layout_marginTop="10dp" | ||
47 | android:layout_marginBottom="30dp" | ||
48 | android:gravity="center_horizontal" | ||
49 | android:text="coaca" | ||
50 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
51 | android:textSize="30sp" | ||
52 | android:textStyle="bold" | ||
53 | app:layout_constraintEnd_toEndOf="parent" | ||
54 | app:layout_constraintStart_toStartOf="parent" | ||
55 | app:layout_constraintTop_toTopOf="parent" /> | ||
56 | |||
57 | |||
58 | <TextView | ||
59 | android:id="@+id/textView18" | ||
60 | android:layout_width="wrap_content" | ||
61 | android:layout_height="wrap_content" | ||
62 | android:layout_marginTop="10dp" | ||
63 | android:text="Códigos:" | ||
64 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
65 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
66 | app:layout_constraintStart_toStartOf="parent" | ||
67 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
68 | |||
69 | <TextView | ||
70 | android:id="@+id/textView19" | ||
71 | android:layout_width="wrap_content" | ||
72 | android:layout_height="wrap_content" | ||
73 | android:layout_marginStart="5dp" | ||
74 | android:text="DEBO:" | ||
75 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
76 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
77 | app:layout_constraintBaseline_toBaselineOf="@+id/textView18" | ||
78 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | ||
79 | |||
80 | <TextView | ||
81 | android:id="@+id/tvSector" | ||
82 | android:layout_width="0dp" | ||
83 | android:layout_height="wrap_content" | ||
84 | android:layout_marginStart="5dp" | ||
85 | android:text="99" | ||
86 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
87 | android:textSize="@dimen/SubTitulos10" | ||
88 | android:textStyle="bold" | ||
89 | app:layout_constraintBaseline_toBaselineOf="@+id/textView19" | ||
90 | app:layout_constraintStart_toEndOf="@+id/textView19" /> | ||
91 | |||
92 | <TextView | ||
93 | android:id="@+id/tvCodigo" | ||
94 | android:layout_width="0dp" | ||
95 | android:layout_height="wrap_content" | ||
96 | android:layout_marginTop="10dp" | ||
97 | android:text="999999" | ||
98 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
99 | android:textSize="@dimen/SubTitulos10" | ||
100 | android:textStyle="bold" | ||
101 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | ||
102 | app:layout_constraintStart_toEndOf="@id/tvSector" /> | ||
103 | |||
104 | |||
105 | <TextView | ||
106 | android:id="@+id/textView1" | ||
107 | android:layout_width="0dp" | ||
108 | android:layout_height="wrap_content" | ||
109 | android:layout_marginStart="5dp" | ||
110 | android:layout_marginTop="10dp" | ||
111 | android:text="barras:" | ||
112 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
113 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
114 | app:layout_constraintBaseline_toBaselineOf="@+id/tvCodigo" | ||
115 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | ||
116 | |||
117 | <TextView | ||
118 | android:id="@+id/tvCodigoBarras" | ||
119 | android:layout_width="wrap_content" | ||
120 | android:layout_height="wrap_content" | ||
121 | android:layout_marginStart="5dp" | ||
122 | android:text="12346579012345" | ||
123 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
124 | android:textSize="@dimen/SubTitulos10" | ||
125 | android:textStyle="bold" | ||
126 | app:layout_constraintBaseline_toBaselineOf="@+id/textView1" | ||
127 | app:layout_constraintStart_toEndOf="@id/textView1" /> | ||
128 | |||
129 | <TextView | ||
130 | android:id="@+id/textView2" | ||
131 | android:layout_width="wrap_content" | ||
132 | android:layout_height="wrap_content" | ||
133 | android:layout_marginStart="5dp" | ||
134 | android:layout_marginTop="10dp" | ||
135 | android:text="origen:" | ||
136 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
137 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
138 | app:layout_constraintStart_toEndOf="@+id/textView18" | ||
139 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> | ||
140 | |||
141 | |||
142 | <TextView | ||
143 | android:id="@+id/tvCodigoOrigen" | ||
144 | android:layout_width="wrap_content" | ||
145 | android:layout_height="wrap_content" | ||
146 | android:layout_marginStart="5dp" | ||
147 | android:layout_marginTop="10dp" | ||
148 | android:text="1234567890123" | ||
149 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
150 | android:textSize="@dimen/SubTitulos10" | ||
151 | android:textStyle="bold" | ||
152 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | ||
153 | app:layout_constraintStart_toEndOf="@+id/textView2" | ||
154 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> | ||
155 | |||
156 | <TextView | ||
157 | android:id="@+id/textView9" | ||
158 | android:layout_width="wrap_content" | ||
159 | android:layout_height="wrap_content" | ||
160 | android:layout_marginTop="10dp" | ||
161 | android:text="Precio:" | ||
162 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
163 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
164 | app:layout_constraintStart_toStartOf="parent" | ||
165 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | ||
166 | |||
167 | <TextView | ||
168 | android:id="@+id/textView12" | ||
169 | android:layout_width="wrap_content" | ||
170 | android:layout_height="wrap_content" | ||
171 | android:layout_marginStart="5dp" | ||
172 | android:layout_marginTop="10dp" | ||
173 | android:text="venta:" | ||
174 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
175 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
176 | app:layout_constraintBaseline_toBaselineOf="@+id/textView9" | ||
177 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | ||
178 | |||
179 | <TextView | ||
180 | android:id="@+id/tvPrecio" | ||
181 | android:layout_width="wrap_content" | ||
182 | android:layout_height="wrap_content" | ||
183 | android:layout_marginStart="5dp" | ||
184 | android:layout_marginTop="10dp" | ||
185 | android:text="99999.99" | ||
186 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
187 | android:textSize="@dimen/SubTitulos10" | ||
188 | android:textStyle="bold" | ||
189 | app:layout_constraintBaseline_toBaselineOf="@+id/textView12" | ||
190 | app:layout_constraintStart_toEndOf="@+id/textView12" /> | ||
191 | |||
192 | <TextView | ||
193 | android:id="@+id/textView8" | ||
194 | android:layout_width="wrap_content" | ||
195 | android:layout_height="wrap_content" | ||
196 | android:text="Costo:" | ||
197 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
198 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
199 | app:layout_constraintBaseline_toBaselineOf="@+id/tvPrecio" | ||
200 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | ||
201 | |||
202 | <TextView | ||
203 | android:id="@+id/tvCosto" | ||
204 | android:layout_width="wrap_content" | ||
205 | android:layout_height="wrap_content" | ||
206 | android:layout_marginStart="5dp" | ||
207 | android:layout_marginTop="10dp" | ||
208 | android:text="9999.99" | ||
209 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
210 | android:textSize="@dimen/SubTitulos10" | ||
211 | android:textStyle="bold" | ||
212 | app:layout_constraintBaseline_toBaselineOf="@+id/textView8" | ||
213 | app:layout_constraintStart_toEndOf="@+id/textView8" /> | ||
214 | |||
215 | <TextView | ||
216 | android:id="@+id/textView3" | ||
217 | android:layout_width="wrap_content" | ||
218 | android:layout_height="wrap_content" | ||
219 | android:layout_marginTop="10dp" | ||
220 | android:text="Depósito:" | ||
221 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
222 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
223 | app:layout_constraintStart_toStartOf="parent" | ||
224 | app:layout_constraintTop_toBottomOf="@+id/textView9" /> | ||
225 | |||
226 | <TextView | ||
227 | android:id="@+id/tvDeposito" | ||
228 | android:layout_width="wrap_content" | ||
229 | android:layout_height="wrap_content" | ||
230 | android:layout_marginStart="5dp" | ||
231 | android:text="Si" | ||
232 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
233 | android:textSize="@dimen/SubTitulos10" | ||
234 | android:textStyle="bold" | ||
235 | app:layout_constraintBaseline_toBaselineOf="@+id/textView3" | ||
236 | app:layout_constraintStart_toEndOf="@+id/textView3" /> | ||
237 | |||
238 | <TextView | ||
239 | android:id="@+id/textView5" | ||
240 | android:layout_width="wrap_content" | ||
241 | android:layout_height="wrap_content" | ||
242 | android:layout_marginTop="10dp" | ||
243 | android:text="Stock:" | ||
244 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
245 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
246 | app:layout_constraintStart_toStartOf="parent" | ||
247 | app:layout_constraintTop_toBottomOf="@+id/textView3" /> | ||
248 | |||
249 | |||
250 | <TextView | ||
251 | android:id="@+id/textView15" | ||
252 | android:layout_width="wrap_content" | ||
253 | android:layout_height="wrap_content" | ||
254 | android:layout_marginStart="5dp" | ||
255 | android:layout_marginTop="10dp" | ||
256 | android:text="venta:" | ||
257 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
258 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
259 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" | ||
260 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | ||
261 | |||
262 | <TextView | ||
263 | android:id="@+id/tvExiVenta" | ||
264 | android:layout_width="wrap_content" | ||
265 | android:layout_height="wrap_content" | ||
266 | android:layout_marginStart="5dp" | ||
267 | android:layout_marginTop="10dp" | ||
268 | android:text="99999.99" | ||
269 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
270 | android:textSize="@dimen/SubTitulos10" | ||
271 | android:textStyle="bold" | ||
272 | app:layout_constraintBaseline_toBaselineOf="@+id/textView15" | ||
273 | app:layout_constraintStart_toEndOf="@+id/textView15" /> | ||
274 | |||
275 | <TextView | ||
276 | android:id="@+id/textView7" | ||
277 | android:layout_width="wrap_content" | ||
278 | android:layout_height="wrap_content" | ||
279 | android:text="deposito:" | ||
280 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
281 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
282 | app:layout_constraintBaseline_toBaselineOf="@+id/tvExiVenta" | ||
283 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | ||
284 | |||
285 | <TextView | ||
286 | android:id="@+id/tvExiDeposito" | ||
287 | android:layout_width="wrap_content" | ||
288 | android:layout_height="wrap_content" | ||
289 | android:layout_marginStart="5dp" | ||
290 | android:layout_marginTop="10dp" | ||
291 | android:text="99999.99" | ||
292 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
293 | android:textSize="@dimen/SubTitulos10" | ||
294 | android:textStyle="bold" | ||
295 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" | ||
296 | app:layout_constraintStart_toEndOf="@+id/textView7" | ||
297 | app:layout_constraintTop_toBottomOf="@+id/tvCosto" /> | ||
298 | |||
299 | |||
300 | <TextView | ||
301 | android:id="@+id/textView10" | ||
302 | android:layout_width="wrap_content" | ||
303 | android:layout_height="wrap_content" | ||
304 | android:text="Unidad de venta:" | ||
305 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
306 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
307 | app:layout_constraintBaseline_toBaselineOf="@+id/tvDeposito" | ||
308 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | ||
309 | |||
310 | <TextView | ||
311 | android:id="@+id/tvBal" | ||
312 | android:layout_width="wrap_content" | ||
313 | android:layout_height="wrap_content" | ||
314 | android:layout_marginStart="5dp" | ||
315 | android:text="Unidades" | ||
316 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
317 | android:textSize="@dimen/SubTitulos10" | ||
318 | android:textStyle="bold" | ||
319 | app:layout_constraintBaseline_toBaselineOf="@+id/textView10" | ||
320 | app:layout_constraintStart_toEndOf="@+id/textView10" /> | ||
321 | |||
322 | |||
323 | <TextView | ||
324 | android:id="@+id/textView11" | ||
325 | android:layout_width="wrap_content" | ||
326 | android:layout_height="wrap_content" | ||
327 | android:layout_marginTop="10dp" | ||
328 | android:text="Imagen:" | ||
329 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
330 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
331 | app:layout_constraintStart_toStartOf="parent" | ||
332 | app:layout_constraintTop_toBottomOf="@+id/textView5" /> | ||
333 | |||
334 | <ImageView | ||
335 | android:id="@+id/ivImagen" | ||
336 | android:layout_width="400dp" | ||
337 | android:layout_height="400dp" | ||
338 | android:src="@drawable/no_imagen" | ||
339 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
340 | android:textSize="14sp" | ||
341 | app:layout_constraintEnd_toEndOf="parent" | ||
342 | app:layout_constraintStart_toStartOf="parent" | ||
343 | app:layout_constraintTop_toBottomOf="@+id/textView15" /> | ||
344 | |||
345 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
346 | </androidx.cardview.widget.CardView> | ||
347 | |||
348 | </ScrollView> | ||
349 |
app/src/main/res/layout-xlarge/fragment_inventario.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:id="@+id/frameLayout" | ||
6 | android:layout_width="match_parent" | ||
7 | android:layout_height="match_parent" | ||
8 | tools:context=".UI.inventario.InventarioFragment"> | ||
9 | |||
10 | |||
11 | <androidx.appcompat.widget.AppCompatTextView | ||
12 | android:id="@+id/tvTitulo" | ||
13 | android:layout_width="match_parent" | ||
14 | android:layout_height="90dp" | ||
15 | android:layout_marginStart="8dp" | ||
16 | android:layout_marginEnd="8dp" | ||
17 | android:autoSizeMaxTextSize="100sp" | ||
18 | android:autoSizeMinTextSize="20sp" | ||
19 | android:autoSizeStepGranularity="5sp" | ||
20 | android:autoSizeTextType="uniform" | ||
21 | android:gravity="center" | ||
22 | android:lines="1" | ||
23 | android:text="@string/invTitulo" | ||
24 | android:textColor="@color/colorAccent" | ||
25 | app:fontFamily="sans-serif-condensed" | ||
26 | app:layout_constraintBottom_toTopOf="@id/guideline2" | ||
27 | app:layout_constraintEnd_toEndOf="parent" | ||
28 | app:layout_constraintStart_toStartOf="parent" | ||
29 | app:layout_constraintTop_toTopOf="@id/guideline" /> | ||
30 | |||
31 | |||
32 | <ImageButton | ||
33 | android:id="@+id/ivCamara" | ||
34 | android:layout_width="@dimen/boton10" | ||
35 | android:layout_height="@dimen/boton10" | ||
36 | android:layout_marginTop="15dp" | ||
37 | android:clickable="true" | ||
38 | android:contentDescription="@string/ibBusCB" | ||
39 | android:elevation="5dp" | ||
40 | android:background="@drawable/boton_redondo" | ||
41 | android:layout_margin="10dp" | ||
42 | android:focusable="false" | ||
43 | android:scaleType="fitEnd" | ||
44 | app:layout_constraintCircleRadius="40dp" | ||
45 | android:src="@drawable/codbar" | ||
46 | app:layout_constraintBottom_toTopOf="@id/guideline3" | ||
47 | app:layout_constraintEnd_toStartOf="@+id/etCodigoBarras" | ||
48 | app:layout_constraintHorizontal_bias="0.0" | ||
49 | app:layout_constraintStart_toStartOf="parent" | ||
50 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | ||
51 | |||
52 | <EditText | ||
53 | android:id="@+id/etCodigoBarras" | ||
54 | android:layout_width="0dp" | ||
55 | android:layout_height="wrap_content" | ||
56 | android:autofillHints="" | ||
57 | android:clickable="true" | ||
58 | android:ems="10" | ||
59 | android:focusable="true" | ||
60 | android:hint="@string/ibBusCB" | ||
61 | android:inputType="textPersonName" | ||
62 | android:lines="1" | ||
63 | android:textAllCaps="true" | ||
64 | android:textSize="@dimen/textCantidad10" | ||
65 | app:layout_constraintBottom_toTopOf="@+id/guideline3" | ||
66 | app:layout_constraintEnd_toStartOf="@+id/swSumaUno" | ||
67 | app:layout_constraintHorizontal_bias="0.49" | ||
68 | app:layout_constraintHorizontal_chainStyle="packed" | ||
69 | app:layout_constraintStart_toEndOf="@+id/ivCamara" | ||
70 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | ||
71 | |||
72 | |||
73 | <Switch | ||
74 | android:id="@+id/swSumaUno" | ||
75 | android:layout_width="wrap_content" | ||
76 | android:layout_height="wrap_content" | ||
77 | android:text="@string/switch_1" | ||
78 | android:textSize="@dimen/SubTitulos10" | ||
79 | app:layout_constraintBaseline_toBaselineOf="@+id/etCodigoBarras" | ||
80 | app:layout_constraintEnd_toEndOf="parent" | ||
81 | app:layout_constraintStart_toEndOf="@id/etCodigoBarras" | ||
82 | tools:ignore="UseSwitchCompatOrMaterialXml" /> | ||
83 | |||
84 | <androidx.recyclerview.widget.RecyclerView | ||
85 | android:id="@+id/rcInventarios" | ||
86 | android:layout_width="match_parent" | ||
87 | android:layout_height="0dp" | ||
88 | android:background="@android:color/darker_gray" | ||
89 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" | ||
90 | app:layout_constraintEnd_toEndOf="parent" | ||
91 | app:layout_constraintStart_toStartOf="parent" | ||
92 | app:layout_constraintTop_toBottomOf="@+id/guideline4" | ||
93 | tools:listitem="@layout/item" /> | ||
94 | |||
95 | |||
96 | <Button | ||
97 | android:id="@+id/btnExportarInv" | ||
98 | android:layout_width="wrap_content" | ||
99 | android:layout_height="wrap_content" | ||
100 | android:text="@string/btnExportarInv" | ||
101 | android:textColor="@android:color/white" | ||
102 | android:layout_marginTop="7dp" | ||
103 | android:padding="10dp" | ||
104 | android:textSize="@dimen/SubTitulos10" | ||
105 | android:background="@drawable/boton_borde_redondeado" | ||
106 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | ||
107 | app:layout_constraintEnd_toEndOf="parent" | ||
108 | app:layout_constraintHorizontal_chainStyle="spread" | ||
109 | app:layout_constraintStart_toEndOf="@+id/btnBorrarInv" | ||
110 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | ||
111 | |||
112 | <Button | ||
113 | android:id="@+id/btnBorrarInv" | ||
114 | android:layout_width="wrap_content" | ||
115 | android:layout_height="wrap_content" | ||
116 | android:layout_marginTop="7dp" | ||
117 | android:background="@drawable/boton_borde_redondeado" | ||
118 | android:padding="10dp" | ||
119 | android:text="@string/btnBorrarInv" | ||
120 | android:textColor="@android:color/white" | ||
121 | android:textSize="@dimen/SubTitulos10" | ||
122 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | ||
123 | app:layout_constraintEnd_toStartOf="@id/btnExportarInv" | ||
124 | app:layout_constraintHorizontal_chainStyle="spread" | ||
125 | app:layout_constraintStart_toStartOf="parent" | ||
126 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | ||
127 | |||
128 | <androidx.constraintlayout.widget.Guideline | ||
129 | android:id="@+id/guideline" | ||
130 | android:layout_width="wrap_content" | ||
131 | android:layout_height="wrap_content" | ||
132 | android:orientation="horizontal" | ||
133 | app:layout_constraintGuide_percent="0.02" /> | ||
134 | |||
135 | <androidx.constraintlayout.widget.Guideline | ||
136 | android:id="@+id/guideline2" | ||
137 | android:layout_width="wrap_content" | ||
138 | android:layout_height="wrap_content" | ||
139 | android:orientation="horizontal" | ||
140 | app:layout_constraintGuide_percent="0.12029161" /> | ||
141 | |||
142 | <androidx.constraintlayout.widget.Guideline | ||
143 | android:id="@+id/guideline3" | ||
144 | android:layout_width="wrap_content" | ||
145 | android:layout_height="wrap_content" | ||
146 | android:orientation="horizontal" | ||
147 | app:layout_constraintGuide_percent="0.27" /> | ||
148 | |||
149 | <androidx.constraintlayout.widget.Guideline | ||
150 | android:id="@+id/guideline4" | ||
151 | android:layout_width="wrap_content" | ||
152 | android:layout_height="wrap_content" | ||
153 | android:orientation="horizontal" | ||
154 | app:layout_constraintGuide_percent="0.32" /> | ||
155 | |||
156 | <androidx.constraintlayout.widget.Guideline | ||
157 | android:id="@+id/guideline5" | ||
158 | android:layout_width="wrap_content" | ||
159 | android:layout_height="wrap_content" | ||
160 | android:orientation="horizontal" | ||
161 | app:layout_constraintGuide_percent="0.88" /> | ||
162 | |||
163 | <androidx.constraintlayout.widget.Guideline | ||
164 | android:id="@+id/guideline6" | ||
165 | android:layout_width="wrap_content" | ||
166 | android:layout_height="wrap_content" | ||
167 | android:orientation="horizontal" | ||
168 | app:layout_constraintGuide_percent="0.97" /> | ||
169 | |||
170 | |||
171 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-xlarge/fragment_main.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="match_parent"> | ||
7 | |||
8 | <androidx.appcompat.widget.AppCompatTextView | ||
9 | android:id="@+id/tvInvDinamicos" | ||
10 | android:layout_width="match_parent" | ||
11 | android:layout_height="110dp" | ||
12 | android:autoSizeMaxTextSize="150sp" | ||
13 | android:autoSizeMinTextSize="25sp" | ||
14 | android:autoSizeStepGranularity="5sp" | ||
15 | android:autoSizeTextType="uniform" | ||
16 | android:gravity="start" | ||
17 | android:lines="1" | ||
18 | android:padding="10dp" | ||
19 | android:text="@string/invDinamicoVenta" | ||
20 | android:textColor="@color/colorAccent" | ||
21 | android:visibility="visible" | ||
22 | app:fontFamily="sans-serif-condensed" | ||
23 | app:layout_constraintEnd_toEndOf="parent" | ||
24 | app:layout_constraintStart_toStartOf="parent" | ||
25 | app:layout_constraintTop_toTopOf="parent" /> | ||
26 | |||
27 | <androidx.appcompat.widget.AppCompatImageButton | ||
28 | android:id="@+id/ivSort19" | ||
29 | android:layout_width="@dimen/icon_dim10" | ||
30 | android:layout_height="@dimen/icon_dim10" | ||
31 | android:layout_marginStart="10dp" | ||
32 | android:padding="5dp" | ||
33 | android:src="@drawable/ic_sort19" | ||
34 | android:visibility="gone" | ||
35 | app:layout_constraintHorizontal_bias="0.0" | ||
36 | app:layout_constraintHorizontal_chainStyle="packed" | ||
37 | app:layout_constraintStart_toStartOf="parent" | ||
38 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | ||
39 | |||
40 | <androidx.appcompat.widget.AppCompatImageButton | ||
41 | android:id="@+id/ivSort91" | ||
42 | android:layout_width="@dimen/icon_dim10" | ||
43 | android:layout_height="@dimen/icon_dim10" | ||
44 | android:layout_marginStart="10dp" | ||
45 | android:padding="5dp" | ||
46 | android:src="@drawable/ic_sort91" | ||
47 | android:visibility="gone" | ||
48 | app:layout_constraintHorizontal_chainStyle="packed" | ||
49 | app:layout_constraintStart_toStartOf="parent" | ||
50 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | ||
51 | |||
52 | <TextView | ||
53 | android:id="@+id/tvTipo" | ||
54 | android:layout_width="wrap_content" | ||
55 | android:layout_height="wrap_content" | ||
56 | android:layout_margin="5dp" | ||
57 | android:text="Tipo:" | ||
58 | android:layout_marginTop="12dp" | ||
59 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
60 | android:visibility="gone" | ||
61 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" | ||
62 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> | ||
63 | |||
64 | <com.google.android.material.checkbox.MaterialCheckBox | ||
65 | android:id="@+id/cbVentas" | ||
66 | android:layout_width="wrap_content" | ||
67 | android:layout_height="wrap_content" | ||
68 | android:textSize="@dimen/SubTitulos10" | ||
69 | android:layout_margin="5dp" | ||
70 | android:checked="true" | ||
71 | android:text="Ventas" | ||
72 | android:layout_marginTop="12dp" | ||
73 | android:visibility="gone" | ||
74 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" | ||
75 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | ||
76 | |||
77 | <com.google.android.material.checkbox.MaterialCheckBox | ||
78 | android:id="@+id/cbDeposito" | ||
79 | android:layout_width="wrap_content" | ||
80 | android:layout_height="wrap_content" | ||
81 | android:textSize="@dimen/SubTitulos10" | ||
82 | android:layout_margin="5dp" | ||
83 | android:checked="true" | ||
84 | android:text="Deposito" | ||
85 | android:layout_marginTop="12dp" | ||
86 | android:visibility="gone" | ||
87 | app:layout_constraintEnd_toEndOf="parent" | ||
88 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | ||
89 | |||
90 | <androidx.recyclerview.widget.RecyclerView | ||
91 | android:id="@+id/rcInventario" | ||
92 | android:layout_width="match_parent" | ||
93 | android:layout_height="0dp" | ||
94 | android:background="@android:color/darker_gray" | ||
95 | android:scrollbars="vertical" | ||
96 | android:visibility="gone" | ||
97 | app:layout_constraintEnd_toEndOf="parent" | ||
98 | app:layout_constraintStart_toStartOf="parent" | ||
99 | app:layout_constraintTop_toBottomOf="@id/ivSort19" | ||
100 | tools:listitem="@layout/item_principal" | ||
101 | app:layout_constraintBottom_toTopOf="@+id/guideline6"/> | ||
102 | |||
103 | |||
104 | <androidx.appcompat.widget.AppCompatTextView | ||
105 | android:id="@+id/txtDeposito" | ||
106 | android:layout_width="match_parent" | ||
107 | android:layout_height="110dp" | ||
108 | android:autoSizeMaxTextSize="150sp" | ||
109 | android:autoSizeMinTextSize="25sp" | ||
110 | android:autoSizeStepGranularity="5sp" | ||
111 | android:autoSizeTextType="uniform" | ||
112 | android:gravity="start" | ||
113 | android:lines="1" | ||
114 | android:padding="10dp" | ||
115 | android:text="@string/invDinamicoCompra" | ||
116 | android:textColor="@color/colorAccent" | ||
117 | android:visibility="visible" | ||
118 | app:fontFamily="sans-serif-condensed" | ||
119 | app:layout_constraintBottom_toBottomOf="parent" | ||
120 | app:layout_constraintEnd_toEndOf="parent" | ||
121 | app:layout_constraintStart_toStartOf="parent" | ||
122 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" | ||
123 | app:layout_constraintVertical_bias="0.0" /> | ||
124 | |||
125 | <androidx.constraintlayout.widget.Guideline | ||
126 | android:id="@+id/guideline6" | ||
127 | android:layout_width="wrap_content" | ||
128 | android:layout_height="wrap_content" | ||
129 | android:orientation="horizontal" | ||
130 | app:layout_constraintGuide_percent="0.97" /> | ||
131 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-xlarge/fragment_servidores.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="match_parent" | ||
7 | tools:context=".UI.servidores.ServidoresFragment"> | ||
8 | |||
9 | <androidx.appcompat.widget.AppCompatTextView | ||
10 | android:id="@+id/tvTitutloServer" | ||
11 | android:layout_width="match_parent" | ||
12 | android:layout_height="120dp" | ||
13 | android:layout_marginStart="8dp" | ||
14 | android:layout_marginTop="15dp" | ||
15 | android:layout_marginEnd="8dp" | ||
16 | android:autoSizeMaxTextSize="100sp" | ||
17 | android:autoSizeMinTextSize="20sp" | ||
18 | android:autoSizeStepGranularity="5sp" | ||
19 | android:autoSizeTextType="uniform" | ||
20 | android:gravity="center" | ||
21 | android:lines="1" | ||
22 | android:text="@string/tvTitutloServer" | ||
23 | android:textColor="@color/colorAccent" | ||
24 | app:fontFamily="sans-serif-condensed" | ||
25 | app:layout_constraintEnd_toEndOf="parent" | ||
26 | app:layout_constraintStart_toStartOf="parent" | ||
27 | app:layout_constraintTop_toTopOf="parent" /> | ||
28 | |||
29 | |||
30 | <TextView | ||
31 | android:id="@+id/tvNomServer" | ||
32 | android:layout_width="match_parent" | ||
33 | android:layout_height="wrap_content" | ||
34 | android:layout_margin="10dp" | ||
35 | android:gravity="start" | ||
36 | android:lines="1" | ||
37 | android:text="@string/tvNomServer" | ||
38 | android:textColor="@android:color/black" | ||
39 | android:textSize="@dimen/SubTitulos10" | ||
40 | android:textStyle="bold|italic" | ||
41 | app:fontFamily="sans-serif-condensed" | ||
42 | app:layout_constraintEnd_toEndOf="parent" | ||
43 | app:layout_constraintStart_toStartOf="parent" | ||
44 | app:layout_constraintTop_toBottomOf="@id/tvTitutloServer" /> | ||
45 | |||
46 | <EditText | ||
47 | android:id="@+id/etNombreServidor" | ||
48 | android:layout_width="match_parent" | ||
49 | android:layout_height="wrap_content" | ||
50 | android:layout_margin="10dp" | ||
51 | android:autofillHints="" | ||
52 | android:clickable="true" | ||
53 | android:ems="10" | ||
54 | android:focusable="true" | ||
55 | android:hint="Servidor Local" | ||
56 | android:inputType="text" | ||
57 | android:lines="1" | ||
58 | android:textSize="@dimen/SubTitulos10" | ||
59 | app:layout_constraintEnd_toEndOf="parent" | ||
60 | app:layout_constraintStart_toStartOf="parent" | ||
61 | app:layout_constraintTop_toBottomOf="@+id/tvNomServer" /> | ||
62 | |||
63 | <TextView | ||
64 | android:id="@+id/tvDirServer" | ||
65 | android:layout_width="wrap_content" | ||
66 | android:layout_height="wrap_content" | ||
67 | android:layout_margin="10dp" | ||
68 | android:gravity="start" | ||
69 | android:lines="1" | ||
70 | android:text="@string/tvDirServer" | ||
71 | android:textColor="@android:color/black" | ||
72 | android:textSize="@dimen/SubTitulos10" | ||
73 | android:textStyle="bold|italic" | ||
74 | app:fontFamily="sans-serif-condensed" | ||
75 | app:layout_constraintStart_toStartOf="parent" | ||
76 | app:layout_constraintTop_toBottomOf="@+id/etNombreServidor" /> | ||
77 | |||
78 | <EditText | ||
79 | android:id="@+id/etDireccionServidor" | ||
80 | android:layout_width="wrap_content" | ||
81 | android:layout_height="wrap_content" | ||
82 | android:clickable="true" | ||
83 | android:ems="10" | ||
84 | android:focusable="true" | ||
85 | android:hint="192.168.100.100" | ||
86 | android:inputType="phone" | ||
87 | android:lines="1" | ||
88 | android:textSize="@dimen/SubTitulos10" | ||
89 | app:layout_constraintBaseline_toBaselineOf="@+id/tvDirServer" | ||
90 | app:layout_constraintStart_toEndOf="@+id/tvDirServer" /> | ||
91 | |||
92 | |||
93 | <EditText | ||
94 | android:id="@+id/etPuerto" | ||
95 | android:layout_width="wrap_content" | ||
96 | android:layout_height="wrap_content" | ||
97 | android:clickable="true" | ||
98 | android:ems="10" | ||
99 | android:focusable="true" | ||
100 | android:hint="Puerto" | ||
101 | android:inputType="number" | ||
102 | android:lines="1" | ||
103 | android:textSize="@dimen/SubTitulos10" | ||
104 | app:layout_constraintBaseline_toBaselineOf="@+id/etDireccionServidor" | ||
105 | app:layout_constraintStart_toEndOf="@+id/etDireccionServidor" | ||
106 | android:autofillHints="" /> | ||
107 | |||
108 | |||
109 | <androidx.recyclerview.widget.RecyclerView | ||
110 | android:id="@+id/rvServidores" | ||
111 | android:layout_width="match_parent" | ||
112 | android:layout_height="0dp" | ||
113 | android:layout_marginTop="10dp" | ||
114 | android:background="@android:color/darker_gray" | ||
115 | app:layout_constraintBottom_toTopOf="@+id/btnGuardarServidores" | ||
116 | app:layout_constraintEnd_toEndOf="parent" | ||
117 | app:layout_constraintStart_toStartOf="parent" | ||
118 | app:layout_constraintTop_toBottomOf="@+id/etPuerto" | ||
119 | app:layout_goneMarginEnd="10dp" | ||
120 | tools:listitem="@layout/item_servidores" /> | ||
121 | |||
122 | <Button | ||
123 | android:id="@+id/btnGuardarServidores" | ||
124 | android:layout_width="0dp" | ||
125 | android:layout_height="wrap_content" | ||
126 | android:layout_marginTop="10dp" | ||
127 | android:layout_marginEnd="10dp" | ||
128 | android:layout_marginBottom="10dp" | ||
129 | android:background="@drawable/boton_borde_redondeado" | ||
130 | android:padding="10dp" | ||
131 | android:text="@string/btnGuardarServidores" | ||
132 | android:textColor="@android:color/white" | ||
133 | android:textSize="@dimen/SubTitulos10" | ||
134 | app:layout_constraintBottom_toBottomOf="parent" | ||
135 | app:layout_constraintEnd_toEndOf="parent" | ||
136 | app:layout_constraintStart_toStartOf="parent" | ||
137 | app:layout_constraintTop_toBottomOf="@+id/rvServidores" /> | ||
138 | |||
139 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
140 |
app/src/main/res/layout-xlarge/ingresar_cantidad.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.cardview.widget.CardView | ||
3 | xmlns:android="http://schemas.android.com/apk/res/android" | ||
4 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
5 | xmlns:tools="http://schemas.android.com/tools" | ||
6 | android:layout_width="match_parent" | ||
7 | android:layout_height="wrap_content" | ||
8 | app:cardCornerRadius="10dp" | ||
9 | app:cardElevation="5dp" | ||
10 | |||
11 | tools:ignore="PrivateResource"> | ||
12 | <!-- android:background="@drawable/md_transparent"--> | ||
13 | |||
14 | <androidx.constraintlayout.widget.ConstraintLayout | ||
15 | android:layout_width="match_parent" | ||
16 | android:layout_height="match_parent"> | ||
17 | |||
18 | <LinearLayout | ||
19 | android:id="@+id/barraSuperior" | ||
20 | android:layout_width="0dp" | ||
21 | android:layout_height="wrap_content" | ||
22 | android:background="@color/colorPrimaryDark" | ||
23 | android:orientation="horizontal" | ||
24 | app:layout_constraintLeft_toLeftOf="parent" | ||
25 | app:layout_constraintRight_toRightOf="parent" | ||
26 | app:layout_constraintTop_toTopOf="parent" | ||
27 | app:layout_constraintTop_toBottomOf="@+id/lySegundo"> | ||
28 | |||
29 | <androidx.appcompat.widget.AppCompatTextView | ||
30 | android:id="@+id/tvTitulo" | ||
31 | android:layout_width="0dp" | ||
32 | android:layout_height="wrap_content" | ||
33 | android:layout_margin="10dp" | ||
34 | android:layout_marginStart="5dp" | ||
35 | android:layout_marginTop="10dp" | ||
36 | android:layout_weight="1" | ||
37 | android:text="@string/adv" | ||
38 | android:textAlignment="center" | ||
39 | android:textColor="@android:color/white" | ||
40 | android:textSize="25sp" /> | ||
41 | </LinearLayout> | ||
42 | |||
43 | |||
44 | <LinearLayout | ||
45 | android:id="@+id/lySegundo" | ||
46 | android:layout_width="match_parent" | ||
47 | android:layout_height="wrap_content" | ||
48 | android:orientation="vertical" | ||
49 | android:padding="12dp" | ||
50 | app:layout_constraintLeft_toLeftOf="parent" | ||
51 | app:layout_constraintRight_toRightOf="parent" | ||
52 | app:layout_constraintTop_toBottomOf="@id/barraSuperior"> | ||
53 | |||
54 | |||
55 | <EditText | ||
56 | android:id="@+id/etCantidad" | ||
57 | android:layout_width="match_parent" | ||
58 | android:layout_height="wrap_content" | ||
59 | android:clickable="true" | ||
60 | android:ems="10" | ||
61 | android:focusable="true" | ||
62 | android:gravity="center" | ||
63 | android:inputType="numberDecimal" | ||
64 | android:maxLength="8" | ||
65 | android:text="" | ||
66 | android:hint="Ingrese Cantidad" | ||
67 | android:textSize="20sp" /> | ||
68 | |||
69 | |||
70 | <androidx.appcompat.widget.AppCompatButton | ||
71 | android:id="@+id/btnAceptar" | ||
72 | android:layout_width="match_parent" | ||
73 | android:layout_height="wrap_content" | ||
74 | android:layout_margin="10dp" | ||
75 | android:layout_marginBottom="20dp" | ||
76 | android:clickable="true" | ||
77 | android:focusable="true" | ||
78 | android:textColor="@android:color/white" | ||
79 | android:padding="10dp" | ||
80 | android:background="@drawable/boton_borde_redondeado" | ||
81 | android:text="@string/btnConfirmar" | ||
82 | android:textAlignment="center" | ||
83 | android:textSize="25sp" | ||
84 | android:textStyle="bold" | ||
85 | app:cardBackgroundColor="@android:color/darker_gray" | ||
86 | app:cardUseCompatPadding="true" /> | ||
87 | |||
88 | |||
89 | </LinearLayout> | ||
90 | |||
91 | |||
92 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
93 | </androidx.cardview.widget.CardView> |
app/src/main/res/layout-xlarge/item.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="wrap_content" | ||
7 | android:layout_margin="5dp" | ||
8 | app:cardCornerRadius="15dp" | ||
9 | app:cardElevation="10dp" | ||
10 | app:contentPadding="5dp" | ||
11 | app:cardPreventCornerOverlap="false"> | ||
12 | |||
13 | <androidx.constraintlayout.widget.ConstraintLayout | ||
14 | android:layout_width="match_parent" | ||
15 | android:layout_height="wrap_content"> | ||
16 | |||
17 | <TextView | ||
18 | android:id="@+id/tvDescripcion" | ||
19 | android:layout_width="0dp" | ||
20 | android:layout_height="wrap_content" | ||
21 | android:layout_marginStart="3dp" | ||
22 | android:maxLines="2" | ||
23 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" | ||
24 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
25 | android:textSize="@dimen/SubTitulos10" | ||
26 | android:textStyle="bold" | ||
27 | app:layout_constraintStart_toStartOf="parent" | ||
28 | app:layout_constraintTop_toTopOf="parent" /> | ||
29 | |||
30 | <!-- <TextView--> | ||
31 | <!-- android:id="@+id/textView2"--> | ||
32 | <!-- android:layout_width="wrap_content"--> | ||
33 | <!-- android:layout_height="wrap_content"--> | ||
34 | <!-- android:layout_marginStart="5dp"--> | ||
35 | <!-- android:text="Código:"--> | ||
36 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> | ||
37 | <!-- android:textSize="14sp"--> | ||
38 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvSector"--> | ||
39 | <!-- app:layout_constraintHorizontal_bias="0.01"--> | ||
40 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
41 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
42 | <!-- app:layout_constraintTop_toTopOf="parent" />--> | ||
43 | |||
44 | |||
45 | <!-- <TextView--> | ||
46 | <!-- android:id="@+id/tvSector"--> | ||
47 | <!-- android:layout_width="wrap_content"--> | ||
48 | <!-- android:layout_height="match_parent"--> | ||
49 | <!-- android:layout_marginStart="8dp"--> | ||
50 | <!-- android:text="9999"--> | ||
51 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
52 | <!-- android:textColorHint="@android:color/black"--> | ||
53 | <!-- android:textSize="18sp"--> | ||
54 | <!-- android:textStyle="bold"--> | ||
55 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
56 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView2"--> | ||
57 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvCodigo"--> | ||
58 | <!-- app:layout_constraintStart_toEndOf="@+id/textView2" />--> | ||
59 | |||
60 | |||
61 | <!-- <TextView--> | ||
62 | <!-- android:id="@+id/tvCodigo"--> | ||
63 | <!-- android:layout_width="wrap_content"--> | ||
64 | <!-- android:layout_height="match_parent"--> | ||
65 | <!-- android:text="99999999"--> | ||
66 | <!-- android:layout_marginStart="8dp"--> | ||
67 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
68 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
69 | <!-- android:textColorHint="@android:color/black"--> | ||
70 | <!-- android:textSize="18sp"--> | ||
71 | <!-- android:textStyle="bold"--> | ||
72 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/tvSector"--> | ||
73 | <!-- app:layout_constraintEnd_toStartOf="@+id/textView5"--> | ||
74 | <!-- app:layout_constraintStart_toEndOf="@+id/tvSector" />--> | ||
75 | |||
76 | <TextView | ||
77 | android:id="@+id/textView5" | ||
78 | android:layout_width="wrap_content" | ||
79 | android:layout_height="wrap_content" | ||
80 | android:text="Cantidad:" | ||
81 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | ||
82 | android:textSize="@dimen/textView510" | ||
83 | android:layout_marginStart="5dp" | ||
84 | android:layout_marginTop="10dp" | ||
85 | app:layout_constraintStart_toStartOf="parent" | ||
86 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
87 | |||
88 | <TextView | ||
89 | android:id="@+id/tvCantidad" | ||
90 | android:layout_width="wrap_content" | ||
91 | android:layout_height="match_parent" | ||
92 | android:layout_marginTop="5dp" | ||
93 | android:text="12345.12" | ||
94 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
95 | android:textSize="@dimen/SubTitulos10" | ||
96 | android:textStyle="bold" | ||
97 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" | ||
98 | |||
99 | app:layout_constraintStart_toEndOf="@id/textView5" /> | ||
100 | |||
101 | <ImageView | ||
102 | android:id="@+id/ivPen" | ||
103 | android:layout_width="@dimen/iconosMedia10" | ||
104 | android:layout_height="@dimen/iconosMedia10" | ||
105 | android:layout_marginStart="3dp" | ||
106 | android:src="@drawable/pen" | ||
107 | android:visibility="visible" | ||
108 | app:layout_constraintStart_toEndOf="@+id/tvCantidad" | ||
109 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
110 | |||
111 | <ImageView | ||
112 | android:id="@+id/ivDots" | ||
113 | android:layout_width="@dimen/iconosMedia10" | ||
114 | android:layout_height="@dimen/iconosMedia10" | ||
115 | android:layout_marginEnd="3dp" | ||
116 | android:src="@drawable/more" | ||
117 | android:visibility="visible" | ||
118 | app:layout_constraintEnd_toEndOf="parent" | ||
119 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
120 | |||
121 | <!-- <TextView--> | ||
122 | <!-- android:id="@+id/textView85"--> | ||
123 | <!-- android:layout_width="wrap_content"--> | ||
124 | <!-- android:layout_height="wrap_content"--> | ||
125 | <!-- android:layout_marginStart="5dp"--> | ||
126 | <!-- android:layout_marginTop="8dp"--> | ||
127 | <!-- android:text="Desc:"--> | ||
128 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> | ||
129 | <!-- android:textSize="14sp"--> | ||
130 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvDescripcion"--> | ||
131 | <!-- app:layout_constraintHorizontal_bias="0.0"--> | ||
132 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
133 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
134 | <!-- app:layout_constraintTop_toBottomOf="@id/tvCodigo" />--> | ||
135 | |||
136 | |||
137 | <!-- <TextView--> | ||
138 | <!-- android:id="@+id/tvCodigoBarras"--> | ||
139 | <!-- android:layout_width="match_parent"--> | ||
140 | <!-- android:layout_height="wrap_content"--> | ||
141 | <!-- android:layout_marginStart="3dp"--> | ||
142 | <!-- android:layout_marginTop="8dp"--> | ||
143 | <!-- android:maxLines="2"--> | ||
144 | <!-- android:text=""--> | ||
145 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
146 | <!-- android:textSize="14sp"--> | ||
147 | <!-- android:visibility="gone"--> | ||
148 | <!-- android:textStyle="bold"--> | ||
149 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView85"--> | ||
150 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
151 | <!-- app:layout_constraintStart_toEndOf="@+id/textView85"--> | ||
152 | <!-- app:layout_constraintTop_toBottomOf="@+id/tvCodigo" />--> | ||
153 | <!-- <TextView--> | ||
154 | <!-- android:id="@+id/tvCodigoOrigen"--> | ||
155 | <!-- android:layout_width="match_parent"--> | ||
156 | <!-- android:layout_height="wrap_content"--> | ||
157 | <!-- android:layout_marginStart="3dp"--> | ||
158 | <!-- android:layout_marginTop="8dp"--> | ||
159 | <!-- android:maxLines="2"--> | ||
160 | <!-- android:text=""--> | ||
161 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
162 | <!-- android:textSize="14sp"--> | ||
163 | <!-- android:visibility="gone"--> | ||
164 | <!-- android:textStyle="bold"--> | ||
165 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView85"--> | ||
166 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
167 | <!-- app:layout_constraintStart_toEndOf="@+id/textView85"--> | ||
168 | <!-- app:layout_constraintTop_toBottomOf="@+id/tvCodigo" />--> | ||
169 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
170 | |||
171 | </androidx.cardview.widget.CardView> |
app/src/main/res/layout-xlarge/item_codigo_origen.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | android:layout_width="match_parent" | ||
5 | android:layout_height="wrap_content" | ||
6 | android:layout_margin="5dp" | ||
7 | app:cardCornerRadius="15dp" | ||
8 | app:cardElevation="10dp" | ||
9 | app:cardPreventCornerOverlap="false" | ||
10 | app:contentPadding="5dp"> | ||
11 | |||
12 | <androidx.constraintlayout.widget.ConstraintLayout | ||
13 | android:layout_width="match_parent" | ||
14 | android:layout_height="wrap_content"> | ||
15 | |||
16 | <TextView | ||
17 | android:id="@+id/tvDescripcion" | ||
18 | android:layout_width="0dp" | ||
19 | android:layout_height="wrap_content" | ||
20 | android:layout_marginStart="5dp" | ||
21 | android:maxLines="2" | ||
22 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" | ||
23 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
24 | android:textSize="@dimen/SubTitulos10" | ||
25 | android:textStyle="bold" | ||
26 | app:layout_constraintEnd_toEndOf="parent" | ||
27 | app:layout_constraintStart_toStartOf="parent" | ||
28 | app:layout_constraintTop_toTopOf="parent" /> | ||
29 | |||
30 | <TextView | ||
31 | android:id="@+id/textView2" | ||
32 | android:layout_width="wrap_content" | ||
33 | android:layout_height="wrap_content" | ||
34 | android:layout_marginStart="5dp" | ||
35 | android:layout_marginTop="10dp" | ||
36 | android:text="Código DEBO:" | ||
37 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | ||
38 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
39 | app:layout_constraintStart_toStartOf="parent" | ||
40 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
41 | |||
42 | |||
43 | <TextView | ||
44 | android:id="@+id/tvSector" | ||
45 | android:layout_width="wrap_content" | ||
46 | android:layout_height="match_parent" | ||
47 | android:layout_marginStart="5dp" | ||
48 | android:layout_marginTop="10dp" | ||
49 | android:text="9999" | ||
50 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
51 | android:textColorHint="@android:color/black" | ||
52 | android:textSize="@dimen/SubTitulos10" | ||
53 | android:textStyle="bold" | ||
54 | app:layout_constraintStart_toEndOf="@+id/textView2" | ||
55 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
56 | |||
57 | <TextView | ||
58 | android:id="@+id/tvCodigo" | ||
59 | android:layout_width="wrap_content" | ||
60 | android:layout_height="match_parent" | ||
61 | android:text="99999999" | ||
62 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
63 | android:textColorHint="@android:color/black" | ||
64 | android:textSize="@dimen/SubTitulos10" | ||
65 | android:textStyle="bold" | ||
66 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | ||
67 | app:layout_constraintHorizontal_chainStyle="packed" | ||
68 | app:layout_constraintStart_toEndOf="@+id/tvSector" /> | ||
69 | |||
70 | |||
71 | <TextView | ||
72 | android:id="@+id/tvCantidad" | ||
73 | android:layout_width="wrap_content" | ||
74 | android:layout_height="match_parent" | ||
75 | android:layout_marginStart="10dp" | ||
76 | android:text="Código Origen:" | ||
77 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
78 | android:textSize="@dimen/textCantidadDesc10" | ||
79 | app:layout_constraintBaseline_toBaselineOf="@+id/tvCodigo" | ||
80 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | ||
81 | |||
82 | <TextView | ||
83 | android:id="@+id/tvCodigoOrigen" | ||
84 | android:layout_width="wrap_content" | ||
85 | android:layout_height="match_parent" | ||
86 | android:layout_marginStart="5dp" | ||
87 | android:layout_marginTop="10dp" | ||
88 | android:maxLines="2" | ||
89 | android:text="987654" | ||
90 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
91 | android:textSize="@dimen/SubTitulos10" | ||
92 | android:textStyle="bold" | ||
93 | android:visibility="visible" | ||
94 | app:layout_constraintBaseline_toBaselineOf="@+id/tvCantidad" | ||
95 | app:layout_constraintStart_toEndOf="@+id/tvCantidad" /> | ||
96 | |||
97 | |||
98 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
99 | |||
100 | </androidx.cardview.widget.CardView> |
app/src/main/res/layout-xlarge/item_descripcion.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | android:layout_width="match_parent" | ||
5 | android:layout_height="wrap_content" | ||
6 | android:layout_margin="5dp" | ||
7 | app:cardCornerRadius="15dp" | ||
8 | app:cardElevation="10dp" | ||
9 | app:cardPreventCornerOverlap="false" | ||
10 | app:contentPadding="5dp"> | ||
11 | |||
12 | <androidx.constraintlayout.widget.ConstraintLayout | ||
13 | android:layout_width="match_parent" | ||
14 | android:layout_height="wrap_content"> | ||
15 | |||
16 | <TextView | ||
17 | android:id="@+id/tvDescripcion" | ||
18 | android:layout_width="0dp" | ||
19 | android:layout_height="wrap_content" | ||
20 | android:layout_marginStart="5dp" | ||
21 | android:maxLines="2" | ||
22 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" | ||
23 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
24 | android:textSize="@dimen/SubTitulos10" | ||
25 | android:textStyle="bold" | ||
26 | app:layout_constraintEnd_toEndOf="parent" | ||
27 | app:layout_constraintStart_toStartOf="parent" | ||
28 | app:layout_constraintTop_toTopOf="parent" /> | ||
29 | |||
30 | <TextView | ||
31 | android:id="@+id/textView2" | ||
32 | android:layout_width="wrap_content" | ||
33 | android:layout_height="wrap_content" | ||
34 | android:layout_marginStart="5dp" | ||
35 | android:text="Código DEBO:" | ||
36 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | ||
37 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
38 | app:layout_constraintHorizontal_chainStyle="packed" | ||
39 | app:layout_constraintStart_toStartOf="parent" | ||
40 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
41 | |||
42 | |||
43 | <TextView | ||
44 | android:id="@+id/tvSector" | ||
45 | android:layout_width="wrap_content" | ||
46 | android:layout_height="match_parent" | ||
47 | android:text="9999" | ||
48 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
49 | android:textColorHint="@android:color/black" | ||
50 | android:textSize="@dimen/SubTitulos10" | ||
51 | android:textStyle="bold" | ||
52 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | ||
53 | app:layout_constraintHorizontal_chainStyle="packed" | ||
54 | app:layout_constraintStart_toEndOf="@+id/textView2" | ||
55 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
56 | |||
57 | <TextView | ||
58 | android:id="@+id/tvCodigo" | ||
59 | android:layout_width="wrap_content" | ||
60 | android:layout_height="match_parent" | ||
61 | android:layout_marginStart="2dp" | ||
62 | android:text="99999999" | ||
63 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
64 | android:textColorHint="@android:color/black" | ||
65 | android:textSize="@dimen/SubTitulos10" | ||
66 | android:textStyle="bold" | ||
67 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | ||
68 | app:layout_constraintHorizontal_chainStyle="packed" | ||
69 | app:layout_constraintStart_toEndOf="@+id/tvSector" | ||
70 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
71 | |||
72 | <TextView | ||
73 | android:id="@+id/textView3" | ||
74 | android:layout_width="wrap_content" | ||
75 | android:layout_height="wrap_content" | ||
76 | android:layout_marginStart="5dp" | ||
77 | android:text="Código barras:" | ||
78 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | ||
79 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
80 | app:layout_constraintHorizontal_chainStyle="packed" | ||
81 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" | ||
82 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
83 | |||
84 | <TextView | ||
85 | android:id="@+id/tvCodigoBarras" | ||
86 | android:layout_width="wrap_content" | ||
87 | android:layout_height="wrap_content" | ||
88 | android:layout_marginStart="3dp" | ||
89 | android:maxLines="2" | ||
90 | android:text="1234567890123456" | ||
91 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
92 | android:textSize="@dimen/SubTitulos10" | ||
93 | android:textStyle="bold" | ||
94 | android:visibility="visible" | ||
95 | app:layout_constraintBaseline_toBaselineOf="@+id/textView3" | ||
96 | app:layout_constraintStart_toEndOf="@+id/textView3" | ||
97 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
98 | <!-- <TextView--> | ||
99 | <!-- android:id="@+id/textView5"--> | ||
100 | <!-- android:layout_width="wrap_content"--> | ||
101 | <!-- android:layout_height="wrap_content"--> | ||
102 | <!-- android:layout_marginStart="8dp"--> | ||
103 | <!-- android:text="Cantidad:"--> | ||
104 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> | ||
105 | <!-- android:textSize="14sp"--> | ||
106 | <!-- android:visibility="gone"--> | ||
107 | <!-- app:layout_constraintTop_toTopOf="parent"--> | ||
108 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras"--> | ||
109 | <!-- app:layout_constraintStart_toEndOf="@+id/tvCodigo" />--> | ||
110 | |||
111 | <!-- <TextView--> | ||
112 | <!-- android:id="@+id/tvCantidad"--> | ||
113 | <!-- android:layout_width="wrap_content"--> | ||
114 | <!-- android:layout_height="match_parent"--> | ||
115 | <!-- android:layout_marginStart="8dp"--> | ||
116 | <!-- android:text="Código Barras:"--> | ||
117 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
118 | <!-- android:textSize="14sp"--> | ||
119 | <!-- android:textStyle="bold"--> | ||
120 | <!-- android:visibility="visible"--> | ||
121 | <!-- app:layout_constraintEnd_toStartOf="@id/tvCodigoBarras"--> | ||
122 | <!-- app:layout_constraintStart_toEndOf="@id/textView5"--> | ||
123 | <!-- app:layout_constraintTop_toTopOf="parent" />--> | ||
124 | |||
125 | |||
126 | <!-- <ImageView--> | ||
127 | <!-- android:id="@+id/ivHolder"--> | ||
128 | <!-- android:layout_width="30dp"--> | ||
129 | <!-- android:layout_height="30dp"--> | ||
130 | <!-- android:visibility="gone"--> | ||
131 | <!-- android:src="@drawable/more"--> | ||
132 | <!-- app:layout_constraintBottom_toTopOf="@+id/tvDescripcion"--> | ||
133 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
134 | <!-- app:layout_constraintHorizontal_bias="0.968"--> | ||
135 | <!-- app:layout_constraintStart_toEndOf="@+id/tvCodigoBarras"--> | ||
136 | <!-- app:layout_constraintTop_toTopOf="parent"--> | ||
137 | <!-- app:layout_constraintVertical_bias="0.0" />--> | ||
138 | |||
139 | |||
140 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
141 | |||
142 | </androidx.cardview.widget.CardView> |
app/src/main/res/layout-xlarge/item_principal.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="wrap_content" | ||
7 | android:layout_margin="5dp" | ||
8 | app:cardCornerRadius="15dp" | ||
9 | app:cardElevation="10dp" | ||
10 | app:cardPreventCornerOverlap="false"> | ||
11 | |||
12 | <androidx.constraintlayout.widget.ConstraintLayout | ||
13 | android:layout_width="match_parent" | ||
14 | android:layout_height="wrap_content" | ||
15 | android:layout_gravity="center_horizontal|center_vertical" | ||
16 | android:orientation="vertical"> | ||
17 | |||
18 | <TextView | ||
19 | android:id="@+id/tvPrincipalinventario" | ||
20 | android:layout_width="@dimen/icon_dim10" | ||
21 | android:layout_height="@dimen/icon_dim10" | ||
22 | android:layout_margin="10dp" | ||
23 | android:background="@drawable/boton_redondo2" | ||
24 | android:gravity="center" | ||
25 | android:lines="2" | ||
26 | android:textColor="@android:color/black" | ||
27 | android:textSize="@dimen/TitulosMedios" | ||
28 | android:textStyle="bold" | ||
29 | app:layout_constraintBottom_toTopOf="@+id/ivFondo" | ||
30 | app:layout_constraintStart_toStartOf="parent" | ||
31 | app:layout_constraintTop_toTopOf="parent" | ||
32 | tools:text="99" /> | ||
33 | |||
34 | <TextView | ||
35 | android:id="@+id/textView6" | ||
36 | android:layout_width="wrap_content" | ||
37 | android:layout_height="wrap_content" | ||
38 | android:layout_marginTop="5dp" | ||
39 | android:text="Fecha Inicio" | ||
40 | android:textSize="@dimen/textView510" | ||
41 | android:textStyle="bold" | ||
42 | app:layout_constraintEnd_toEndOf="parent" | ||
43 | app:layout_constraintHorizontal_bias="0.217" | ||
44 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" | ||
45 | app:layout_constraintTop_toTopOf="parent" /> | ||
46 | |||
47 | <TextView | ||
48 | android:id="@+id/tvFecha" | ||
49 | android:layout_width="wrap_content" | ||
50 | android:layout_height="wrap_content" | ||
51 | android:layout_marginStart="5dp" | ||
52 | android:text="01/01/2020 12:20:20" | ||
53 | android:textSize="@dimen/textView510" | ||
54 | android:textStyle="bold" | ||
55 | app:layout_constraintBaseline_toBaselineOf="@+id/textView6" | ||
56 | app:layout_constraintEnd_toEndOf="parent" | ||
57 | app:layout_constraintHorizontal_bias="0.0" | ||
58 | app:layout_constraintStart_toEndOf="@id/textView6" /> | ||
59 | |||
60 | <TextView | ||
61 | android:id="@+id/textView7" | ||
62 | android:layout_width="wrap_content" | ||
63 | android:layout_height="wrap_content" | ||
64 | android:layout_marginTop="4dp" | ||
65 | android:text="Art. Contados" | ||
66 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
67 | android:textStyle="bold" | ||
68 | app:layout_constraintEnd_toEndOf="parent" | ||
69 | app:layout_constraintHorizontal_bias="0.23" | ||
70 | app:layout_constraintStart_toEndOf="@+id/tvPrincipalinventario" | ||
71 | app:layout_constraintTop_toBottomOf="@id/textView6" /> | ||
72 | |||
73 | <TextView | ||
74 | android:id="@+id/tvCantContada" | ||
75 | android:layout_width="wrap_content" | ||
76 | android:layout_height="wrap_content" | ||
77 | android:layout_marginTop="4dp" | ||
78 | android:layout_marginStart="5dp" | ||
79 | android:text="002" | ||
80 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
81 | android:textStyle="bold" | ||
82 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" | ||
83 | app:layout_constraintStart_toEndOf="@+id/textView7" | ||
84 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" /> | ||
85 | |||
86 | <TextView | ||
87 | android:id="@+id/tvDescription" | ||
88 | android:layout_width="wrap_content" | ||
89 | android:layout_height="wrap_content" | ||
90 | android:text="prueba" | ||
91 | android:textSize="@dimen/textView510" | ||
92 | app:layout_constraintBottom_toTopOf="@id/ivFondo" | ||
93 | app:layout_constraintEnd_toEndOf="parent" | ||
94 | app:layout_constraintHorizontal_bias="0.489" | ||
95 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" | ||
96 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" | ||
97 | app:layout_constraintVertical_bias="1.0" /> | ||
98 | |||
99 | |||
100 | <androidx.appcompat.widget.AppCompatImageView | ||
101 | android:id="@+id/ivFondo" | ||
102 | android:layout_width="0dp" | ||
103 | android:layout_height="10dp" | ||
104 | android:background="@android:drawable/progress_horizontal" | ||
105 | android:elevation="10dp" | ||
106 | app:layout_constraintBottom_toBottomOf="parent" | ||
107 | app:layout_constraintCircleRadius="5dp" | ||
108 | app:layout_constraintEnd_toEndOf="parent" | ||
109 | app:layout_constraintStart_toStartOf="parent" | ||
110 | tools:srcCompat="@android:drawable/progress_horizontal" /> | ||
111 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
112 | </androidx.cardview.widget.CardView> | ||
113 |
app/src/main/res/layout-xlarge/item_servidores.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="wrap_content" | ||
7 | android:layout_margin="5dp" | ||
8 | app:cardCornerRadius="15dp" | ||
9 | app:cardElevation="10dp" | ||
10 | app:contentPadding="5dp" | ||
11 | app:cardPreventCornerOverlap="false"> | ||
12 | |||
13 | <androidx.constraintlayout.widget.ConstraintLayout | ||
14 | android:layout_width="match_parent" | ||
15 | android:layout_height="wrap_content"> | ||
16 | |||
17 | <TextView | ||
18 | android:id="@+id/textView2" | ||
19 | android:layout_width="wrap_content" | ||
20 | android:layout_height="wrap_content" | ||
21 | android:layout_marginStart="5dp" | ||
22 | android:text="Descripción:" | ||
23 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | ||
24 | android:textSize="20sp" | ||
25 | app:layout_constraintEnd_toStartOf="@+id/tvCodigo" | ||
26 | app:layout_constraintHorizontal_bias="0.01" | ||
27 | app:layout_constraintHorizontal_chainStyle="packed" | ||
28 | app:layout_constraintStart_toStartOf="parent" | ||
29 | app:layout_constraintTop_toTopOf="parent" /> | ||
30 | |||
31 | <TextView | ||
32 | android:id="@+id/tvDescServidor" | ||
33 | android:layout_width="0dp" | ||
34 | android:layout_height="match_parent" | ||
35 | android:layout_marginStart="8dp" | ||
36 | android:text="Laboratorio Foca 1" | ||
37 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
38 | android:textColorHint="@android:color/black" | ||
39 | android:textSize="25sp" | ||
40 | android:textStyle="bold" | ||
41 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | ||
42 | app:layout_constraintEnd_toEndOf="parent" | ||
43 | app:layout_constraintStart_toEndOf="@+id/textView2" /> | ||
44 | |||
45 | <TextView | ||
46 | android:id="@+id/textView85" | ||
47 | android:layout_width="wrap_content" | ||
48 | android:layout_height="wrap_content" | ||
49 | android:layout_marginStart="5dp" | ||
50 | android:layout_marginTop="8dp" | ||
51 | android:text="Dirección:" | ||
52 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | ||
53 | android:textSize="20sp" | ||
54 | app:layout_constraintStart_toStartOf="parent" | ||
55 | app:layout_constraintTop_toBottomOf="@id/tvDescServidor" /> | ||
56 | |||
57 | <TextView | ||
58 | android:id="@+id/tvDireccionServidor" | ||
59 | android:layout_width="wrap_content" | ||
60 | android:layout_height="wrap_content" | ||
61 | android:layout_marginStart="5dp" | ||
62 | android:text="http://192.168.0.205" | ||
63 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
64 | android:textColorHint="@android:color/black" | ||
65 | android:textSize="25sp" | ||
66 | android:textStyle="bold" | ||
67 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" | ||
68 | app:layout_constraintStart_toEndOf="@+id/textView85" /> | ||
69 | |||
70 | <TextView | ||
71 | android:id="@+id/textView86" | ||
72 | android:layout_width="wrap_content" | ||
73 | android:layout_height="wrap_content" | ||
74 | android:layout_marginTop="8dp" | ||
75 | android:layout_marginStart="15dp" | ||
76 | android:text="Puerto:" | ||
77 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | ||
78 | android:textSize="20sp" | ||
79 | app:layout_constraintHorizontal_chainStyle="packed" | ||
80 | app:layout_constraintStart_toEndOf="@+id/tvDireccionServidor" | ||
81 | app:layout_constraintTop_toBottomOf="@id/tvDescServidor" /> | ||
82 | |||
83 | <TextView | ||
84 | android:id="@+id/tvPuertoServidor" | ||
85 | android:layout_width="wrap_content" | ||
86 | android:layout_height="wrap_content" | ||
87 | android:layout_marginTop="8dp" | ||
88 | android:layout_marginStart="5dp" | ||
89 | android:text="" | ||
90 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
91 | android:textColorHint="@android:color/black" | ||
92 | android:textSize="25sp" | ||
93 | android:textStyle="bold" | ||
94 | app:layout_constraintStart_toEndOf="@+id/textView86" | ||
95 | app:layout_constraintTop_toBottomOf="@+id/tvDescServidor" /> | ||
96 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
97 | |||
98 | </androidx.cardview.widget.CardView> |
app/src/main/res/layout-xlarge/item_spinner.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <LinearLayout | ||
3 | xmlns:android="http://schemas.android.com/apk/res/android" | ||
4 | android:layout_width="match_parent" | ||
5 | android:layout_height="match_parent"> | ||
6 | |||
7 | <TextView | ||
8 | android:layout_width="wrap_content" | ||
9 | android:layout_height="wrap_content" | ||
10 | android:textSize="40sp" | ||
11 | android:textStyle="bold" | ||
12 | android:id="@+id/tvServidorDesc"/> | ||
13 | </LinearLayout> | ||
14 |
app/src/main/res/layout-xlarge/login_dialog.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | android:layout_width="match_parent" | ||
5 | android:layout_height="wrap_content" | ||
6 | android:orientation="vertical" | ||
7 | android:padding="10dp"> | ||
8 | |||
9 | <LinearLayout | ||
10 | android:id="@+id/barraSuperior" | ||
11 | android:layout_width="0dp" | ||
12 | android:layout_height="wrap_content" | ||
13 | android:background="@color/colorPrimaryDark" | ||
14 | android:orientation="horizontal" | ||
15 | app:layout_constraintEnd_toEndOf="parent" | ||
16 | app:layout_constraintStart_toStartOf="parent" | ||
17 | app:layout_constraintTop_toTopOf="parent"> | ||
18 | |||
19 | <androidx.appcompat.widget.AppCompatTextView | ||
20 | android:id="@+id/tvTitulo2" | ||
21 | android:layout_width="0dp" | ||
22 | android:layout_height="wrap_content" | ||
23 | android:layout_margin="10dp" | ||
24 | android:layout_marginStart="5dp" | ||
25 | android:layout_marginTop="10dp" | ||
26 | android:layout_weight="1" | ||
27 | android:text="@string/adv" | ||
28 | android:background="@drawable/boton_borde_redondeado" | ||
29 | android:textAlignment="center" | ||
30 | android:textColor="@android:color/white" | ||
31 | android:textSize="25sp" /> | ||
32 | </LinearLayout> | ||
33 | |||
34 | <TextView | ||
35 | android:id="@+id/dialogNameEt" | ||
36 | android:layout_width="wrap_content" | ||
37 | android:layout_height="wrap_content" | ||
38 | android:layout_margin="5dp" | ||
39 | android:layout_marginTop="4dp" | ||
40 | android:text="Conteo actual :" | ||
41 | android:textSize="25sp" | ||
42 | app:layout_constraintEnd_toStartOf="@id/tvCantInicial" | ||
43 | app:layout_constraintHorizontal_bias="0.0" | ||
44 | app:layout_constraintHorizontal_chainStyle="packed" | ||
45 | app:layout_constraintStart_toStartOf="parent" | ||
46 | app:layout_constraintTop_toBottomOf="@id/barraSuperior" /> | ||
47 | |||
48 | <TextView | ||
49 | android:id="@+id/tvCantInicial" | ||
50 | android:layout_width="wrap_content" | ||
51 | android:layout_height="wrap_content" | ||
52 | android:layout_margin="5dp" | ||
53 | android:text="" | ||
54 | android:textSize="20sp" | ||
55 | app:layout_constraintBaseline_toBaselineOf="@+id/dialogNameEt" | ||
56 | app:layout_constraintEnd_toEndOf="parent" | ||
57 | app:layout_constraintHorizontal_chainStyle="packed" | ||
58 | app:layout_constraintStart_toEndOf="@id/dialogNameEt" /> | ||
59 | |||
60 | <TextView | ||
61 | android:id="@+id/tvgenerico" | ||
62 | android:layout_width="wrap_content" | ||
63 | android:layout_height="wrap_content" | ||
64 | android:layout_margin="5dp" | ||
65 | android:text="Nueva cantidad:" | ||
66 | android:textStyle="bold" | ||
67 | android:textSize="25sp" | ||
68 | app:layout_constraintStart_toStartOf="parent" | ||
69 | app:layout_constraintTop_toBottomOf="@+id/tvCantInicial" /> | ||
70 | |||
71 | <EditText | ||
72 | android:id="@+id/tvNuevaCantidad" | ||
73 | android:layout_width="0dp" | ||
74 | android:layout_height="wrap_content" | ||
75 | android:autofillHints="" | ||
76 | android:hint="" | ||
77 | android:textSize="20sp" | ||
78 | android:focusable="true" | ||
79 | android:clickable="true" | ||
80 | android:inputType="numberDecimal" | ||
81 | app:layout_constraintBaseline_toBaselineOf="@+id/tvgenerico" | ||
82 | app:layout_constraintEnd_toEndOf="parent" | ||
83 | app:layout_constraintStart_toEndOf="@id/tvgenerico" /> | ||
84 | |||
85 | <TextView | ||
86 | android:id="@+id/tvgenerico2" | ||
87 | android:layout_width="wrap_content" | ||
88 | android:layout_height="wrap_content" | ||
89 | android:layout_margin="5dp" | ||
90 | android:gravity="center" | ||
91 | android:text="@string/tvSeleccion" | ||
92 | android:textSize="20sp" | ||
93 | android:visibility="gone" | ||
94 | app:layout_constraintStart_toStartOf="parent" | ||
95 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico" /> | ||
96 | |||
97 | <RadioGroup | ||
98 | android:id="@+id/rgFechaHora" | ||
99 | android:layout_width="wrap_content" | ||
100 | android:layout_height="wrap_content" | ||
101 | android:gravity="start" | ||
102 | android:orientation="horizontal" | ||
103 | app:layout_constraintEnd_toEndOf="parent" | ||
104 | app:layout_constraintHorizontal_bias="0.0" | ||
105 | app:layout_constraintStart_toStartOf="parent" | ||
106 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico2"> | ||
107 | |||
108 | <RadioButton | ||
109 | android:id="@+id/rbSumar" | ||
110 | android:layout_width="wrap_content" | ||
111 | android:layout_height="wrap_content" | ||
112 | android:layout_margin="12dp" | ||
113 | android:checked="true" | ||
114 | android:text="@string/rbSumar" | ||
115 | android:textSize="@dimen/activity_vertical_margin10" /> | ||
116 | |||
117 | <RadioButton | ||
118 | android:id="@+id/rbMdodificar" | ||
119 | android:layout_width="wrap_content" | ||
120 | android:layout_height="wrap_content" | ||
121 | android:layout_margin="12dp" | ||
122 | android:checked="false" | ||
123 | android:text="@string/rbModificar" | ||
124 | android:textSize="@dimen/activity_vertical_margin10" /> | ||
125 | |||
126 | <RadioButton | ||
127 | android:id="@+id/rbRestar" | ||
128 | android:layout_width="wrap_content" | ||
129 | android:layout_height="wrap_content" | ||
130 | android:layout_margin="12dp" | ||
131 | android:checked="false" | ||
132 | android:text="@string/rbRestar" | ||
133 | android:textSize="@dimen/activity_vertical_margin10" /> | ||
134 | |||
135 | </RadioGroup> | ||
136 | |||
137 | <TextView | ||
138 | android:id="@+id/tvgenerico3" | ||
139 | android:layout_width="wrap_content" | ||
140 | android:layout_height="wrap_content" | ||
141 | android:layout_margin="5dp" | ||
142 | android:gravity="center" | ||
143 | android:text="Resultado :" | ||
144 | android:textStyle="bold" | ||
145 | android:textSize="25sp" | ||
146 | app:layout_constraintEnd_toEndOf="parent" | ||
147 | app:layout_constraintHorizontal_bias="0.0" | ||
148 | app:layout_constraintStart_toStartOf="parent" | ||
149 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | ||
150 | |||
151 | <TextView | ||
152 | android:id="@+id/tvResultado" | ||
153 | android:layout_width="wrap_content" | ||
154 | android:layout_height="wrap_content" | ||
155 | android:layout_margin="5dp" | ||
156 | android:gravity="center" | ||
157 | android:text="" | ||
158 | android:textSize="20sp" | ||
159 | app:layout_constraintEnd_toEndOf="parent" | ||
160 | app:layout_constraintHorizontal_bias="0.0" | ||
161 | app:layout_constraintStart_toEndOf="@+id/tvgenerico3" | ||
162 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | ||
163 | |||
164 | <LinearLayout | ||
165 | android:layout_width="match_parent" | ||
166 | android:layout_height="wrap_content" | ||
167 | android:layout_margin="10dp" | ||
168 | android:gravity="center" | ||
169 | android:orientation="horizontal" | ||
170 | app:layout_constraintEnd_toEndOf="parent" | ||
171 | app:layout_constraintStart_toStartOf="parent" | ||
172 | app:layout_constraintTop_toBottomOf="@+id/tvResultado"> | ||
173 | |||
174 | <Button | ||
175 | android:id="@+id/btnAceptar" | ||
176 | style="@style/Base.Widget.AppCompat.Button.Colored" | ||
177 | android:layout_width="wrap_content" | ||
178 | android:layout_height="wrap_content" | ||
179 | android:layout_margin="5dp" | ||
180 | android:background="@drawable/boton_borde_redondeado" | ||
181 | android:padding="20dp" | ||
182 | android:textSize="25sp" | ||
183 | android:text="@string/btnConfirmar" | ||
184 | android:textColor="@android:color/white" /> | ||
185 | |||
186 | <Button | ||
187 | android:id="@+id/dialogCancelBtn" | ||
188 | style="@style/Base.Widget.AppCompat.Button.Colored" | ||
189 | android:layout_width="wrap_content" | ||
190 | android:layout_height="wrap_content" | ||
191 | android:layout_margin="5dp" | ||
192 | android:background="@drawable/boton_borde_redondeado" | ||
193 | android:padding="20dp" | ||
194 | android:textSize="25sp" | ||
195 | android:text="@string/btnCancelar" | ||
196 | android:textColor="@android:color/white" /> | ||
197 | </LinearLayout> | ||
198 | |||
199 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-xlarge/nav_header_main.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | android:layout_width="match_parent" | ||
5 | android:layout_height="@dimen/nav_header_height10" | ||
6 | android:background="@drawable/side_nav_bar" | ||
7 | android:gravity="bottom" | ||
8 | android:orientation="vertical" | ||
9 | android:paddingLeft="@dimen/activity_horizontal_margin" | ||
10 | android:paddingTop="@dimen/activity_vertical_margin" | ||
11 | android:paddingRight="@dimen/activity_horizontal_margin" | ||
12 | android:paddingBottom="@dimen/activity_vertical_margin" | ||
13 | android:theme="@style/ThemeOverlay.AppCompat.Dark"> | ||
14 | |||
15 | <ImageView | ||
16 | android:id="@+id/imageView" | ||
17 | android:layout_width="246dp" | ||
18 | android:layout_height="136dp" | ||
19 | android:contentDescription=" " | ||
20 | android:paddingTop="@dimen/nav_header_vertical_spacing" | ||
21 | app:srcCompat="@drawable/logo" /> | ||
22 | |||
23 | <TextView | ||
24 | android:layout_width="match_parent" | ||
25 | android:layout_height="wrap_content" | ||
26 | android:paddingTop="@dimen/nav_header_vertical_spacing" | ||
27 | android:textSize="@dimen/SubTitulos10" | ||
28 | android:text="Debo Inventario" | ||
29 | android:textAppearance="@style/TextAppearance.AppCompat.Body1" /> | ||
30 | |||
31 | <TextView | ||
32 | android:id="@+id/textView1" | ||
33 | android:layout_width="wrap_content" | ||
34 | android:layout_height="wrap_content" | ||
35 | android:text="FocaSoftware SA" | ||
36 | android:textSize="@dimen/SubTitulos10"/> | ||
37 | </LinearLayout> |
app/src/main/res/layout/activity_splash.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 | android:background="#E6E6E6" | 7 | android:background="#E6E6E6" |
8 | 8 | ||
9 | tools:context=".UI.SplashActivity"> | 9 | tools:context=".UI.SplashActivity"> |
10 | 10 | ||
11 | 11 | ||
12 | <androidx.appcompat.widget.AppCompatTextView | 12 | <androidx.appcompat.widget.AppCompatTextView |
13 | android:id="@+id/textView2" | 13 | android:id="@+id/textView2" |
14 | android:layout_width="match_parent" | 14 | android:layout_width="match_parent" |
15 | android:layout_height="100dp" | 15 | android:layout_height="100dp" |
16 | android:layout_margin="20dp" | 16 | android:layout_margin="20dp" |
17 | android:autoSizeMaxTextSize="1000sp" | 17 | android:autoSizeMaxTextSize="1000sp" |
18 | android:autoSizeMinTextSize="30sp" | 18 | android:autoSizeMinTextSize="30sp" |
19 | android:autoSizeStepGranularity="5sp" | 19 | android:autoSizeStepGranularity="5sp" |
20 | android:autoSizeTextType="uniform" | 20 | android:autoSizeTextType="uniform" |
21 | android:gravity="center" | 21 | android:gravity="center" |
22 | android:lines="1" | 22 | android:lines="1" |
23 | android:text="@string/bien" | 23 | android:text="@string/bien" |
24 | android:textColor="@color/colorAccent" | 24 | android:textColor="@color/colorAccent" |
25 | app:fontFamily="sans-serif-condensed" | 25 | app:fontFamily="sans-serif-condensed" |
26 | app:layout_constraintBottom_toTopOf="@+id/imageView" | 26 | app:layout_constraintBottom_toTopOf="@+id/imageView" |
27 | app:layout_constraintEnd_toEndOf="parent" | 27 | app:layout_constraintEnd_toEndOf="parent" |
28 | app:layout_constraintStart_toStartOf="parent" | 28 | app:layout_constraintStart_toStartOf="parent" |
29 | app:layout_constraintTop_toTopOf="parent" /> | 29 | app:layout_constraintTop_toTopOf="parent" /> |
30 | 30 | ||
31 | <ImageView | 31 | <ImageView |
32 | android:id="@+id/imageView" | 32 | android:id="@+id/imageView" |
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 | 35 | ||
36 | android:contentDescription="@string/todo" | 36 | android:contentDescription="@string/todo" |
37 | android:src="@drawable/logo_splash" | 37 | android:src="@drawable/logo_splash" |
38 | app:layout_constraintBottom_toTopOf="@id/textView4" | 38 | app:layout_constraintBottom_toTopOf="@id/textView4" |
39 | app:layout_constraintEnd_toEndOf="parent" | 39 | app:layout_constraintEnd_toEndOf="parent" |
40 | app:layout_constraintStart_toStartOf="parent" | 40 | app:layout_constraintStart_toStartOf="parent" |
41 | app:layout_constraintTop_toBottomOf="@+id/textView2" | 41 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> |
42 | /> | ||
43 | |||
44 | |||
45 | |||
46 | |||
47 | 42 | ||
48 | <androidx.appcompat.widget.AppCompatTextView | 43 | <androidx.appcompat.widget.AppCompatTextView |
49 | android:id="@+id/textView4" | 44 | android:id="@+id/textView4" |
50 | android:layout_width="match_parent" | 45 | android:layout_width="match_parent" |
51 | android:layout_height="110dp" | 46 | android:layout_height="110dp" |
52 | android:layout_margin="20dp" | 47 | android:layout_margin="20dp" |
53 | android:autoSizeMaxTextSize="1000sp" | 48 | android:autoSizeMaxTextSize="1000sp" |
54 | android:autoSizeMinTextSize="30sp" | 49 | android:autoSizeMinTextSize="30sp" |
55 | android:autoSizeStepGranularity="5sp" | 50 | android:autoSizeStepGranularity="5sp" |
56 | android:autoSizeTextType="uniform" | 51 | android:autoSizeTextType="uniform" |
57 | android:gravity="center" | 52 | android:gravity="center" |
58 | android:lines="1" | 53 | android:lines="1" |
59 | android:text="@string/inventario" | 54 | android:text="@string/inventario" |
60 | android:textColor="@color/colorAccent" | 55 | android:textColor="@color/colorAccent" |
61 | app:fontFamily="sans-serif-condensed" | 56 | app:fontFamily="sans-serif-condensed" |
62 | app:layout_constraintBottom_toBottomOf="parent" | 57 | app:layout_constraintBottom_toBottomOf="parent" |
63 | app:layout_constraintEnd_toEndOf="parent" | 58 | app:layout_constraintEnd_toEndOf="parent" |
64 | app:layout_constraintEnd_toStartOf="parent" | 59 | app:layout_constraintEnd_toStartOf="parent" |
65 | app:layout_constraintTop_toBottomOf="@id/imageView" /> | 60 | app:layout_constraintTop_toBottomOf="@id/imageView" /> |
66 | </androidx.constraintlayout.widget.ConstraintLayout> | 61 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/content_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 | app:layout_behavior="@string/appbar_scrolling_view_behavior" | 7 | app:layout_behavior="@string/appbar_scrolling_view_behavior" |
8 | tools:showIn="@layout/app_bar_main"> | 8 | tools:showIn="@layout/app_bar_main"> |
9 | 9 | ||
10 | <fragment | 10 | <fragment |
11 | android:id="@+id/nav_host_fragment" | 11 | android:id="@+id/nav_host_fragment" |
12 | android:name="androidx.navigation.fragment.NavHostFragment" | 12 | android:name="androidx.navigation.fragment.NavHostFragment" |
13 | android:layout_width="match_parent" | 13 | android:layout_width="match_parent" |
14 | android:layout_height="match_parent" | 14 | android:layout_height="match_parent" |
15 | app:defaultNavHost="true" | 15 | app:defaultNavHost="true" |
16 | app:layout_constraintLeft_toLeftOf="parent" | 16 | app:layout_constraintLeft_toLeftOf="parent" |
17 | app:layout_constraintRight_toRightOf="parent" | 17 | app:layout_constraintRight_toRightOf="parent" |
18 | app:layout_constraintTop_toTopOf="parent" | 18 | app:layout_constraintTop_toTopOf="parent" |
19 | app:navGraph="@navigation/mobile_navigation" /> | 19 | app:navGraph="@navigation/mobile_navigation" /> |
20 | 20 | ||
21 | <!-- <fragment--> | ||
22 | <!-- android:id="@+id/fragmentoSecundario"--> | ||
23 | <!-- android:name="androidx.navigation.fragment.NavHostFragment"--> | ||
24 | <!-- android:layout_width="289dp"--> | ||
25 | <!-- android:layout_height="335dp"--> | ||
26 | <!-- app:layout_constraintBottom_toBottomOf="parent"--> | ||
27 | <!-- app:layout_constraintHorizontal_bias="0.497"--> | ||
28 | <!-- app:layout_constraintLeft_toLeftOf="parent"--> | ||
29 | <!-- app:layout_constraintRight_toRightOf="parent"--> | ||
30 | <!-- app:layout_constraintTop_toTopOf="parent"--> | ||
31 | <!-- app:layout_constraintVertical_bias="0.597" />--> | ||
32 | </androidx.constraintlayout.widget.ConstraintLayout> | 21 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/fragment_descripcion.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | 2 | ||
3 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 3 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
4 | xmlns:app="http://schemas.android.com/apk/res-auto" | 4 | xmlns:app="http://schemas.android.com/apk/res-auto" |
5 | xmlns:tools="http://schemas.android.com/tools" | 5 | xmlns:tools="http://schemas.android.com/tools" |
6 | android:layout_width="match_parent" | 6 | android:layout_width="match_parent" |
7 | android:layout_height="match_parent" | 7 | android:layout_height="match_parent" |
8 | android:background="@android:color/darker_gray" | 8 | android:background="@android:color/darker_gray" |
9 | tools:context=".UI.descripcionFragment.DescripcionFragment"> | 9 | tools:context=".UI.descripcionFragment.DescripcionFragment"> |
10 | 10 | ||
11 | 11 | ||
12 | <ImageView | 12 | <ImageView |
13 | android:id="@+id/ivHolder" | 13 | android:id="@+id/ivHolder" |
14 | android:layout_width="40dp" | 14 | android:layout_width="40dp" |
15 | android:layout_height="40dp" | 15 | android:layout_height="40dp" |
16 | android:src="@drawable/ic_izq" | 16 | android:src="@drawable/ic_izq" |
17 | android:visibility="visible" | 17 | android:visibility="visible" |
18 | app:layout_constraintBottom_toTopOf="@id/guideline4" | 18 | app:layout_constraintBottom_toTopOf="@id/guideline4" |
19 | app:layout_constraintStart_toStartOf="parent" /> | 19 | app:layout_constraintStart_toStartOf="parent" /> |
20 | 20 | ||
21 | 21 | ||
22 | <TextView | 22 | <TextView |
23 | android:id="@+id/tvCodigo" | 23 | android:id="@+id/tvCodigo" |
24 | android:layout_width="0dp" | 24 | android:layout_width="0dp" |
25 | android:layout_height="wrap_content" | 25 | android:layout_height="wrap_content" |
26 | android:layout_marginStart="2dp" | 26 | android:layout_marginStart="2dp" |
27 | android:gravity="center_horizontal" | 27 | android:gravity="center_horizontal" |
28 | android:orientation="vertical" | 28 | android:orientation="vertical" |
29 | android:text="Deslizar a la izquierda para seleccionar" | 29 | android:text="Deslizar a la izquierda para seleccionar" |
30 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 30 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
31 | android:textColor="@color/colorPrimaryDark" | 31 | android:textColor="@color/colorPrimaryDark" |
32 | android:textSize="16dp" | 32 | android:textSize="16sp" |
33 | android:textStyle="bold" | 33 | android:textStyle="bold" |
34 | 34 | ||
35 | app:layout_constraintBottom_toTopOf="@id/guideline4" | 35 | app:layout_constraintBottom_toTopOf="@id/guideline4" |
36 | app:layout_constraintHorizontal_chainStyle="packed" | 36 | app:layout_constraintHorizontal_chainStyle="packed" |
37 | app:layout_constraintStart_toEndOf="@id/ivHolder" | 37 | app:layout_constraintStart_toEndOf="@id/ivHolder" |
38 | app:layout_constraintTop_toTopOf="parent" /> | 38 | app:layout_constraintTop_toTopOf="parent" /> |
39 | 39 | ||
40 | <androidx.recyclerview.widget.RecyclerView | 40 | <androidx.recyclerview.widget.RecyclerView |
41 | android:id="@+id/rcDescripcion" | 41 | android:id="@+id/rcDescripcion" |
42 | android:layout_width="match_parent" | 42 | android:layout_width="match_parent" |
43 | android:layout_height="0dp" | 43 | android:layout_height="0dp" |
44 | android:background="@android:color/darker_gray" | 44 | android:background="@android:color/darker_gray" |
45 | android:scrollbars="vertical" | 45 | android:scrollbars="vertical" |
46 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | 46 | app:layout_constraintBottom_toTopOf="@+id/guideline6" |
47 | app:layout_constraintEnd_toEndOf="parent" | 47 | app:layout_constraintEnd_toEndOf="parent" |
48 | app:layout_constraintStart_toStartOf="parent" | 48 | app:layout_constraintStart_toStartOf="parent" |
49 | app:layout_constraintTop_toBottomOf="@id/guideline4" | 49 | app:layout_constraintTop_toBottomOf="@id/guideline4" |
50 | tools:listitem="@layout/item" /> | 50 | tools:listitem="@layout/item" /> |
51 | 51 | ||
52 | <!-- <Button--> | 52 | <!-- <Button--> |
53 | <!-- android:id="@+id/btnSalir"--> | 53 | <!-- android:id="@+id/btnSalir"--> |
54 | <!-- android:layout_width="0dp"--> | 54 | <!-- android:layout_width="0dp"--> |
55 | <!-- android:layout_height="wrap_content"--> | 55 | <!-- android:layout_height="wrap_content"--> |
56 | <!-- android:text="@string/btnCancelar"--> | 56 | <!-- android:text="@string/btnCancelar"--> |
57 | <!-- android:textColor="@android:color/white"--> | 57 | <!-- android:textColor="@android:color/white"--> |
58 | <!-- android:padding="10dp"--> | 58 | <!-- android:padding="10dp"--> |
59 | <!-- android:background="@drawable/boton_borde_redondeado"--> | 59 | <!-- android:background="@drawable/boton_borde_redondeado"--> |
60 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> | 60 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> |
61 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | 61 | <!-- app:layout_constraintEnd_toEndOf="parent"--> |
62 | <!-- app:layout_constraintHorizontal_chainStyle="spread"--> | 62 | <!-- app:layout_constraintHorizontal_chainStyle="spread"--> |
63 | <!-- app:layout_constraintStart_toStartOf="parent"--> | 63 | <!-- app:layout_constraintStart_toStartOf="parent"--> |
64 | <!-- app:layout_constraintTop_toBottomOf="@+id/rcInventarios" />--> | 64 | <!-- app:layout_constraintTop_toBottomOf="@+id/rcInventarios" />--> |
65 | 65 | ||
66 | <androidx.constraintlayout.widget.Guideline | 66 | <androidx.constraintlayout.widget.Guideline |
67 | android:id="@+id/guideline4" | 67 | android:id="@+id/guideline4" |
68 | android:layout_width="wrap_content" | 68 | android:layout_width="wrap_content" |
69 | android:layout_height="wrap_content" | 69 | android:layout_height="wrap_content" |
70 | android:orientation="horizontal" | 70 | android:orientation="horizontal" |
71 | app:layout_constraintGuide_percent="0.06" /> | 71 | app:layout_constraintGuide_percent="0.06" /> |
72 | 72 | ||
73 | <androidx.constraintlayout.widget.Guideline | 73 | <androidx.constraintlayout.widget.Guideline |
74 | android:id="@+id/guideline5" | 74 | android:id="@+id/guideline5" |
75 | android:layout_width="wrap_content" | 75 | android:layout_width="wrap_content" |
76 | android:layout_height="wrap_content" | 76 | android:layout_height="wrap_content" |
77 | android:orientation="horizontal" | 77 | android:orientation="horizontal" |
78 | app:layout_constraintGuide_percent="0.88" /> | 78 | app:layout_constraintGuide_percent="0.88" /> |
79 | 79 | ||
80 | <androidx.constraintlayout.widget.Guideline | 80 | <androidx.constraintlayout.widget.Guideline |
81 | android:id="@+id/guideline6" | 81 | android:id="@+id/guideline6" |
82 | android:layout_width="wrap_content" | 82 | android:layout_width="wrap_content" |
83 | android:layout_height="wrap_content" | 83 | android:layout_height="wrap_content" |
84 | android:orientation="horizontal" | 84 | android:orientation="horizontal" |
85 | app:layout_constraintGuide_percent="0.97" /> | 85 | app:layout_constraintGuide_percent="0.97" /> |
86 | </androidx.constraintlayout.widget.ConstraintLayout> | 86 | </androidx.constraintlayout.widget.ConstraintLayout> |
87 | 87 |
app/src/main/res/layout/fragment_detalle_art.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | android:id="@+id/nsPedidosDatos" | 4 | android:id="@+id/nsPedidosDatos" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent"> | 6 | android:layout_height="match_parent"> |
7 | 7 | ||
8 | <androidx.cardview.widget.CardView | 8 | <androidx.cardview.widget.CardView |
9 | android:id="@+id/cvItem1" | 9 | android:id="@+id/cvItem1" |
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
11 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
12 | android:layout_marginStart="5dp" | 12 | android:layout_marginStart="5dp" |
13 | android:layout_marginTop="5dp" | 13 | android:layout_marginTop="5dp" |
14 | android:layout_marginEnd="5dp" | 14 | android:layout_marginEnd="5dp" |
15 | app:cardBackgroundColor="@android:color/darker_gray" | 15 | app:cardBackgroundColor="@android:color/darker_gray" |
16 | app:cardCornerRadius="25dp" | 16 | app:cardCornerRadius="25dp" |
17 | app:cardElevation="10dp" | 17 | app:cardElevation="10dp" |
18 | app:layout_constraintEnd_toEndOf="parent" | 18 | app:layout_constraintEnd_toEndOf="parent" |
19 | app:layout_constraintStart_toStartOf="parent" | 19 | app:layout_constraintStart_toStartOf="parent" |
20 | app:layout_constraintTop_toTopOf="parent"> | 20 | app:layout_constraintTop_toTopOf="parent"> |
21 | 21 | ||
22 | <androidx.constraintlayout.widget.ConstraintLayout | 22 | <androidx.constraintlayout.widget.ConstraintLayout |
23 | android:id="@+id/clayout" | 23 | android:id="@+id/clayout" |
24 | android:layout_width="match_parent" | 24 | android:layout_width="match_parent" |
25 | android:layout_height="match_parent"> | 25 | android:layout_height="match_parent"> |
26 | 26 | ||
27 | <!-- <TextView--> | 27 | <!-- <TextView--> |
28 | <!-- android:id="@+id/tvTime"--> | 28 | <!-- android:id="@+id/tvTime"--> |
29 | <!-- android:layout_width="0dp"--> | 29 | <!-- android:layout_width="0dp"--> |
30 | <!-- android:layout_height="wrap_content"--> | 30 | <!-- android:layout_height="wrap_content"--> |
31 | <!-- android:layout_marginTop="15dp"--> | 31 | <!-- android:layout_marginTop="15dp"--> |
32 | <!-- android:gravity="center_horizontal"--> | 32 | <!-- android:gravity="center_horizontal"--> |
33 | <!-- android:orientation="horizontal"--> | 33 | <!-- android:orientation="horizontal"--> |
34 | <!-- android:text="Detalle del artículo"--> | 34 | <!-- android:text="Detalle del artículo"--> |
35 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | 35 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> |
36 | <!-- android:textSize="@dimen/Titulos"--> | 36 | <!-- android:textSize="@dimen/Titulos"--> |
37 | <!-- android:textStyle="bold"--> | 37 | <!-- android:textStyle="bold"--> |
38 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | 38 | <!-- app:layout_constraintEnd_toEndOf="parent"--> |
39 | <!-- app:layout_constraintStart_toStartOf="parent"--> | 39 | <!-- app:layout_constraintStart_toStartOf="parent"--> |
40 | <!-- app:layout_constraintTop_toTopOf="parent" />--> | 40 | <!-- app:layout_constraintTop_toTopOf="parent" />--> |
41 | 41 | ||
42 | <TextView | 42 | <TextView |
43 | android:id="@+id/tvDescripcion" | 43 | android:id="@+id/tvDescripcion" |
44 | android:layout_width="wrap_content" | 44 | android:layout_width="wrap_content" |
45 | android:layout_height="0dp" | 45 | android:layout_height="0dp" |
46 | android:layout_marginTop="10dp" | 46 | android:layout_marginTop="10dp" |
47 | android:gravity="center_horizontal" | 47 | android:gravity="center_horizontal" |
48 | 48 | ||
49 | android:text="coaca" | 49 | android:text="coaca" |
50 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 50 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
51 | android:textSize="30sp" | 51 | android:textSize="25sp" |
52 | android:textStyle="bold" | 52 | android:textStyle="bold" |
53 | app:layout_constraintEnd_toEndOf="parent" | 53 | app:layout_constraintEnd_toEndOf="parent" |
54 | app:layout_constraintStart_toStartOf="parent" | 54 | app:layout_constraintStart_toStartOf="parent" |
55 | app:layout_constraintTop_toTopOf="parent" /> | 55 | app:layout_constraintTop_toTopOf="parent" /> |
56 | 56 | ||
57 | 57 | ||
58 | <TextView | 58 | <TextView |
59 | android:id="@+id/textView18" | 59 | android:id="@+id/textView18" |
60 | android:layout_width="wrap_content" | 60 | android:layout_width="wrap_content" |
61 | android:layout_height="wrap_content" | 61 | android:layout_height="wrap_content" |
62 | android:layout_marginTop="10dp" | 62 | android:layout_marginTop="10dp" |
63 | android:text="Códigos:" | 63 | android:text="Códigos:" |
64 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 64 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
65 | android:textSize="15sp" | 65 | android:textSize="15sp" |
66 | app:layout_constraintStart_toStartOf="parent" | 66 | app:layout_constraintStart_toStartOf="parent" |
67 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | 67 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
68 | 68 | ||
69 | <TextView | 69 | <TextView |
70 | android:id="@+id/textView19" | 70 | android:id="@+id/textView19" |
71 | android:layout_width="wrap_content" | 71 | android:layout_width="wrap_content" |
72 | android:layout_height="wrap_content" | 72 | android:layout_height="wrap_content" |
73 | android:layout_marginStart="5dp" | 73 | android:layout_marginStart="5dp" |
74 | android:text="DEBO:" | 74 | android:text="DEBO:" |
75 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 75 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
76 | android:textSize="15sp" | 76 | android:textSize="15sp" |
77 | app:layout_constraintBaseline_toBaselineOf="@+id/textView18" | 77 | app:layout_constraintBaseline_toBaselineOf="@+id/textView18" |
78 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | 78 | app:layout_constraintStart_toEndOf="@+id/textView18" /> |
79 | 79 | ||
80 | <TextView | 80 | <TextView |
81 | android:id="@+id/tvSector" | 81 | android:id="@+id/tvSector" |
82 | android:layout_width="0dp" | 82 | android:layout_width="0dp" |
83 | android:layout_height="wrap_content" | 83 | android:layout_height="wrap_content" |
84 | android:layout_marginStart="5dp" | 84 | android:layout_marginStart="5dp" |
85 | android:text="99" | 85 | android:text="99" |
86 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 86 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
87 | android:textSize="18sp" | 87 | android:textSize="18sp" |
88 | android:textStyle="bold" | 88 | android:textStyle="bold" |
89 | app:layout_constraintBaseline_toBaselineOf="@+id/textView19" | 89 | app:layout_constraintBaseline_toBaselineOf="@+id/textView19" |
90 | app:layout_constraintStart_toEndOf="@+id/textView19" /> | 90 | app:layout_constraintStart_toEndOf="@+id/textView19" /> |
91 | 91 | ||
92 | <TextView | 92 | <TextView |
93 | android:id="@+id/tvCodigo" | 93 | android:id="@+id/tvCodigo" |
94 | android:layout_width="0dp" | 94 | android:layout_width="0dp" |
95 | android:layout_height="wrap_content" | 95 | android:layout_height="wrap_content" |
96 | android:layout_marginStart="3dp" | 96 | android:layout_marginStart="3dp" |
97 | android:layout_marginTop="10dp" | 97 | android:layout_marginTop="10dp" |
98 | android:text="999999" | 98 | android:text="999999" |
99 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 99 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
100 | android:textSize="18sp" | 100 | android:textSize="18sp" |
101 | android:textStyle="bold" | 101 | android:textStyle="bold" |
102 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | 102 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" |
103 | app:layout_constraintStart_toEndOf="@id/tvSector" /> | 103 | app:layout_constraintStart_toEndOf="@id/tvSector" /> |
104 | 104 | ||
105 | 105 | ||
106 | <TextView | 106 | <TextView |
107 | android:id="@+id/textView1" | 107 | android:id="@+id/textView1" |
108 | android:layout_width="0dp" | 108 | android:layout_width="0dp" |
109 | android:layout_height="wrap_content" | 109 | android:layout_height="wrap_content" |
110 | android:layout_marginStart="5dp" | 110 | android:layout_marginStart="5dp" |
111 | android:layout_marginTop="10dp" | 111 | android:layout_marginTop="10dp" |
112 | android:text="barras:" | 112 | android:text="barras:" |
113 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 113 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
114 | android:textSize="15sp" | 114 | android:textSize="15sp" |
115 | app:layout_constraintBaseline_toBaselineOf="@+id/tvCodigo" | 115 | app:layout_constraintBaseline_toBaselineOf="@+id/tvCodigo" |
116 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | 116 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> |
117 | 117 | ||
118 | <TextView | 118 | <TextView |
119 | android:id="@+id/tvCodigoBarras" | 119 | android:id="@+id/tvCodigoBarras" |
120 | android:layout_width="wrap_content" | 120 | android:layout_width="wrap_content" |
121 | android:layout_height="wrap_content" | 121 | android:layout_height="wrap_content" |
122 | android:layout_marginStart="5dp" | 122 | android:layout_marginStart="5dp" |
123 | android:text="12346579012345" | 123 | android:text="12346579012345" |
124 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 124 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
125 | android:textSize="18sp" | 125 | android:textSize="18sp" |
126 | android:textStyle="bold" | 126 | android:textStyle="bold" |
127 | app:layout_constraintBaseline_toBaselineOf="@+id/textView1" | 127 | app:layout_constraintBaseline_toBaselineOf="@+id/textView1" |
128 | app:layout_constraintStart_toEndOf="@id/textView1" /> | 128 | app:layout_constraintStart_toEndOf="@id/textView1" /> |
129 | 129 | ||
130 | <TextView | 130 | <TextView |
131 | android:id="@+id/textView2" | 131 | android:id="@+id/textView2" |
132 | android:layout_width="wrap_content" | 132 | android:layout_width="wrap_content" |
133 | android:layout_height="wrap_content" | 133 | android:layout_height="wrap_content" |
134 | android:layout_marginStart="5dp" | 134 | android:layout_marginStart="5dp" |
135 | android:layout_marginTop="10dp" | 135 | android:layout_marginTop="10dp" |
136 | android:text="origen:" | 136 | android:text="origen:" |
137 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 137 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
138 | android:textSize="15sp" | 138 | android:textSize="15sp" |
139 | app:layout_constraintStart_toEndOf="@+id/textView18" | 139 | app:layout_constraintStart_toEndOf="@+id/textView18" |
140 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> | 140 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> |
141 | 141 | ||
142 | 142 | ||
143 | <TextView | 143 | <TextView |
144 | android:id="@+id/tvCodigoOrigen" | 144 | android:id="@+id/tvCodigoOrigen" |
145 | android:layout_width="wrap_content" | 145 | android:layout_width="wrap_content" |
146 | android:layout_height="wrap_content" | 146 | android:layout_height="wrap_content" |
147 | android:layout_marginStart="5dp" | 147 | android:layout_marginStart="5dp" |
148 | android:layout_marginTop="10dp" | 148 | android:layout_marginTop="10dp" |
149 | android:text="1234567890123" | 149 | android:text="1234567890123" |
150 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 150 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
151 | android:textSize="18sp" | 151 | android:textSize="18sp" |
152 | android:textStyle="bold" | 152 | android:textStyle="bold" |
153 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | 153 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" |
154 | app:layout_constraintStart_toEndOf="@+id/textView2" | 154 | app:layout_constraintStart_toEndOf="@+id/textView2" |
155 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> | 155 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> |
156 | 156 | ||
157 | <TextView | 157 | <TextView |
158 | android:id="@+id/textView9" | 158 | android:id="@+id/textView9" |
159 | android:layout_width="wrap_content" | 159 | android:layout_width="wrap_content" |
160 | android:layout_height="wrap_content" | 160 | android:layout_height="wrap_content" |
161 | android:layout_marginTop="10dp" | 161 | android:layout_marginTop="10dp" |
162 | android:text="Precio:" | 162 | android:text="Precio:" |
163 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 163 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
164 | android:textSize="15sp" | 164 | android:textSize="15sp" |
165 | app:layout_constraintStart_toStartOf="parent" | 165 | app:layout_constraintStart_toStartOf="parent" |
166 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | 166 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> |
167 | 167 | ||
168 | <TextView | 168 | <TextView |
169 | android:id="@+id/textView12" | 169 | android:id="@+id/textView12" |
170 | android:layout_width="wrap_content" | 170 | android:layout_width="wrap_content" |
171 | android:layout_height="wrap_content" | 171 | android:layout_height="wrap_content" |
172 | android:layout_marginStart="5dp" | 172 | android:layout_marginStart="5dp" |
173 | android:layout_marginTop="10dp" | 173 | android:layout_marginTop="10dp" |
174 | android:text="venta:" | 174 | android:text="venta:" |
175 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 175 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
176 | android:textSize="15sp" | 176 | android:textSize="15sp" |
177 | app:layout_constraintBaseline_toBaselineOf="@+id/textView9" | 177 | app:layout_constraintBaseline_toBaselineOf="@+id/textView9" |
178 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | 178 | app:layout_constraintStart_toEndOf="@+id/textView18" /> |
179 | 179 | ||
180 | <TextView | 180 | <TextView |
181 | android:id="@+id/tvPrecio" | 181 | android:id="@+id/tvPrecio" |
182 | android:layout_width="wrap_content" | 182 | android:layout_width="wrap_content" |
183 | android:layout_height="wrap_content" | 183 | android:layout_height="wrap_content" |
184 | android:layout_marginStart="5dp" | 184 | android:layout_marginStart="5dp" |
185 | android:layout_marginTop="10dp" | 185 | android:layout_marginTop="10dp" |
186 | android:text="99999.99" | 186 | android:text="99999.99" |
187 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 187 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
188 | android:textSize="18sp" | 188 | android:textSize="18sp" |
189 | android:textStyle="bold" | 189 | android:textStyle="bold" |
190 | app:layout_constraintBaseline_toBaselineOf="@+id/textView12" | 190 | app:layout_constraintBaseline_toBaselineOf="@+id/textView12" |
191 | app:layout_constraintStart_toEndOf="@+id/textView12" /> | 191 | app:layout_constraintStart_toEndOf="@+id/textView12" /> |
192 | 192 | ||
193 | <TextView | 193 | <TextView |
194 | android:id="@+id/textView8" | 194 | android:id="@+id/textView8" |
195 | android:layout_width="wrap_content" | 195 | android:layout_width="wrap_content" |
196 | android:layout_height="wrap_content" | 196 | android:layout_height="wrap_content" |
197 | android:layout_marginStart="5dp" | 197 | android:layout_marginStart="5dp" |
198 | android:layout_marginTop="10dp" | 198 | android:layout_marginTop="10dp" |
199 | android:text="Costo:" | 199 | android:text="Costo:" |
200 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 200 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
201 | android:textSize="15sp" | 201 | android:textSize="15sp" |
202 | app:layout_constraintBaseline_toBaselineOf="@+id/tvPrecio" | 202 | app:layout_constraintBaseline_toBaselineOf="@+id/tvPrecio" |
203 | app:layout_constraintStart_toEndOf="@+id/tvPrecio" /> | 203 | app:layout_constraintStart_toEndOf="@+id/tvPrecio" /> |
204 | 204 | ||
205 | <TextView | 205 | <TextView |
206 | android:id="@+id/tvCosto" | 206 | android:id="@+id/tvCosto" |
207 | android:layout_width="wrap_content" | 207 | android:layout_width="wrap_content" |
208 | android:layout_height="wrap_content" | 208 | android:layout_height="wrap_content" |
209 | android:layout_marginStart="5dp" | 209 | android:layout_marginStart="5dp" |
210 | android:layout_marginTop="10dp" | 210 | android:layout_marginTop="10dp" |
211 | android:text="9999.99" | 211 | android:text="9999.99" |
212 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 212 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
213 | android:textSize="18sp" | 213 | android:textSize="18sp" |
214 | android:textStyle="bold" | 214 | android:textStyle="bold" |
215 | app:layout_constraintBaseline_toBaselineOf="@+id/textView8" | 215 | app:layout_constraintBaseline_toBaselineOf="@+id/textView8" |
216 | app:layout_constraintStart_toEndOf="@+id/textView8" /> | 216 | app:layout_constraintStart_toEndOf="@+id/textView8" /> |
217 | 217 | ||
218 | <TextView | 218 | <TextView |
219 | android:id="@+id/textView3" | 219 | android:id="@+id/textView3" |
220 | android:layout_width="wrap_content" | 220 | android:layout_width="wrap_content" |
221 | android:layout_height="wrap_content" | 221 | android:layout_height="wrap_content" |
222 | android:layout_marginTop="10dp" | 222 | android:layout_marginTop="10dp" |
223 | android:text="Depósito:" | 223 | android:text="Depósito:" |
224 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 224 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
225 | android:textSize="15sp" | 225 | android:textSize="15sp" |
226 | app:layout_constraintStart_toStartOf="parent" | 226 | app:layout_constraintStart_toStartOf="parent" |
227 | app:layout_constraintTop_toBottomOf="@+id/textView9" /> | 227 | app:layout_constraintTop_toBottomOf="@+id/textView9" /> |
228 | 228 | ||
229 | <TextView | 229 | <TextView |
230 | android:id="@+id/tvDeposito" | 230 | android:id="@+id/tvDeposito" |
231 | android:layout_width="wrap_content" | 231 | android:layout_width="wrap_content" |
232 | android:layout_height="wrap_content" | 232 | android:layout_height="wrap_content" |
233 | android:layout_marginStart="5dp" | 233 | android:layout_marginStart="5dp" |
234 | android:text="Si" | 234 | android:text="Si" |
235 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 235 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
236 | android:textSize="18sp" | 236 | android:textSize="18sp" |
237 | android:textStyle="bold" | 237 | android:textStyle="bold" |
238 | app:layout_constraintBaseline_toBaselineOf="@+id/textView3" | 238 | app:layout_constraintBaseline_toBaselineOf="@+id/textView3" |
239 | app:layout_constraintStart_toEndOf="@+id/textView3" /> | 239 | app:layout_constraintStart_toEndOf="@+id/textView3" /> |
240 | 240 | ||
241 | <TextView | 241 | <TextView |
242 | android:id="@+id/textView5" | 242 | android:id="@+id/textView5" |
243 | android:layout_width="wrap_content" | 243 | android:layout_width="wrap_content" |
244 | android:layout_height="wrap_content" | 244 | android:layout_height="wrap_content" |
245 | android:layout_marginTop="10dp" | 245 | android:layout_marginTop="10dp" |
246 | android:text="Stock:" | 246 | android:text="Stock:" |
247 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 247 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
248 | android:textSize="15sp" | 248 | android:textSize="15sp" |
249 | app:layout_constraintStart_toStartOf="parent" | 249 | app:layout_constraintStart_toStartOf="parent" |
250 | app:layout_constraintTop_toBottomOf="@+id/textView3" /> | 250 | app:layout_constraintTop_toBottomOf="@+id/textView3" /> |
251 | 251 | ||
252 | 252 | ||
253 | <TextView | 253 | <TextView |
254 | android:id="@+id/textView15" | 254 | android:id="@+id/textView15" |
255 | android:layout_width="wrap_content" | 255 | android:layout_width="wrap_content" |
256 | android:layout_height="wrap_content" | 256 | android:layout_height="wrap_content" |
257 | android:layout_marginStart="5dp" | 257 | android:layout_marginStart="5dp" |
258 | android:layout_marginTop="10dp" | 258 | android:layout_marginTop="10dp" |
259 | android:text="venta:" | 259 | android:text="venta:" |
260 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 260 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
261 | android:textSize="15sp" | 261 | android:textSize="15sp" |
262 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" | 262 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" |
263 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | 263 | app:layout_constraintStart_toEndOf="@+id/textView18" /> |
264 | 264 | ||
265 | <TextView | 265 | <TextView |
266 | android:id="@+id/tvExiVenta" | 266 | android:id="@+id/tvExiVenta" |
267 | android:layout_width="wrap_content" | 267 | android:layout_width="wrap_content" |
268 | android:layout_height="wrap_content" | 268 | android:layout_height="wrap_content" |
269 | android:layout_marginStart="5dp" | 269 | android:layout_marginStart="5dp" |
270 | android:layout_marginTop="10dp" | 270 | android:layout_marginTop="10dp" |
271 | android:text="99999.99" | 271 | android:text="99999.99" |
272 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 272 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
273 | android:textSize="18sp" | 273 | android:textSize="18sp" |
274 | android:textStyle="bold" | 274 | android:textStyle="bold" |
275 | app:layout_constraintBaseline_toBaselineOf="@+id/textView15" | 275 | app:layout_constraintBaseline_toBaselineOf="@+id/textView15" |
276 | app:layout_constraintStart_toEndOf="@+id/textView15" /> | 276 | app:layout_constraintStart_toEndOf="@+id/textView15" /> |
277 | 277 | ||
278 | <TextView | 278 | <TextView |
279 | android:id="@+id/textView7" | 279 | android:id="@+id/textView7" |
280 | android:layout_width="wrap_content" | 280 | android:layout_width="wrap_content" |
281 | android:layout_height="wrap_content" | 281 | android:layout_height="wrap_content" |
282 | android:layout_marginStart="5dp" | 282 | android:layout_marginStart="5dp" |
283 | android:text="deposito:" | 283 | android:text="deposito:" |
284 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 284 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
285 | android:textSize="15sp" | 285 | android:textSize="15sp" |
286 | app:layout_constraintBaseline_toBaselineOf="@+id/tvExiVenta" | 286 | app:layout_constraintBaseline_toBaselineOf="@+id/tvExiVenta" |
287 | app:layout_constraintStart_toEndOf="@+id/tvExiVenta" /> | 287 | app:layout_constraintStart_toEndOf="@+id/tvExiVenta" /> |
288 | 288 | ||
289 | <TextView | 289 | <TextView |
290 | android:id="@+id/tvExiDeposito" | 290 | android:id="@+id/tvExiDeposito" |
291 | android:layout_width="wrap_content" | 291 | android:layout_width="wrap_content" |
292 | android:layout_height="wrap_content" | 292 | android:layout_height="wrap_content" |
293 | android:layout_marginStart="5dp" | 293 | android:layout_marginStart="5dp" |
294 | android:layout_marginTop="10dp" | 294 | android:layout_marginTop="10dp" |
295 | android:text="99999.99" | 295 | android:text="99999.99" |
296 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 296 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
297 | android:textSize="18sp" | 297 | android:textSize="18sp" |
298 | android:textStyle="bold" | 298 | android:textStyle="bold" |
299 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" | 299 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" |
300 | app:layout_constraintStart_toEndOf="@+id/textView7" | 300 | app:layout_constraintStart_toEndOf="@+id/textView7" |
301 | app:layout_constraintTop_toBottomOf="@+id/tvCosto" /> | 301 | app:layout_constraintTop_toBottomOf="@+id/tvCosto" /> |
302 | 302 | ||
303 | 303 | ||
304 | <TextView | 304 | <TextView |
305 | android:id="@+id/textView10" | 305 | android:id="@+id/textView10" |
306 | android:layout_width="wrap_content" | 306 | android:layout_width="wrap_content" |
307 | android:layout_height="wrap_content" | 307 | android:layout_height="wrap_content" |
308 | android:layout_marginStart="5dp" | 308 | android:layout_marginStart="5dp" |
309 | android:layout_marginTop="10dp" | 309 | android:layout_marginTop="10dp" |
310 | android:text="Unidad de venta:" | 310 | android:text="Unidad de venta:" |
311 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 311 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
312 | android:textSize="15sp" | 312 | android:textSize="15sp" |
313 | app:layout_constraintBaseline_toBaselineOf="@+id/tvDeposito" | 313 | app:layout_constraintBaseline_toBaselineOf="@+id/tvDeposito" |
314 | app:layout_constraintStart_toEndOf="@+id/tvPrecio" /> | 314 | app:layout_constraintStart_toEndOf="@+id/tvPrecio" /> |
315 | 315 | ||
316 | <TextView | 316 | <TextView |
317 | android:id="@+id/tvBal" | 317 | android:id="@+id/tvBal" |
318 | android:layout_width="wrap_content" | 318 | android:layout_width="wrap_content" |
319 | android:layout_height="wrap_content" | 319 | android:layout_height="wrap_content" |
320 | android:layout_marginStart="5dp" | 320 | android:layout_marginStart="5dp" |
321 | android:text="Unidades" | 321 | android:text="Unidades" |
322 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 322 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
323 | android:textSize="15sp" | 323 | android:textSize="15sp" |
324 | app:layout_constraintBaseline_toBaselineOf="@+id/textView10" | 324 | app:layout_constraintBaseline_toBaselineOf="@+id/textView10" |
325 | app:layout_constraintStart_toEndOf="@+id/textView10" /> | 325 | app:layout_constraintStart_toEndOf="@+id/textView10" /> |
326 | 326 | ||
327 | 327 | ||
328 | <TextView | 328 | <TextView |
329 | android:id="@+id/textView11" | 329 | android:id="@+id/textView11" |
330 | android:layout_width="wrap_content" | 330 | android:layout_width="wrap_content" |
331 | android:layout_height="wrap_content" | 331 | android:layout_height="wrap_content" |
332 | android:layout_marginTop="10dp" | 332 | android:layout_marginTop="10dp" |
333 | android:text="Imagen:" | 333 | android:text="Imagen:" |
334 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 334 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
335 | android:textSize="14sp" | 335 | android:textSize="14sp" |
336 | app:layout_constraintStart_toStartOf="parent" | 336 | app:layout_constraintStart_toStartOf="parent" |
337 | app:layout_constraintTop_toBottomOf="@+id/textView5" /> | 337 | app:layout_constraintTop_toBottomOf="@+id/textView5" /> |
338 | 338 | ||
339 | <ImageView | 339 | <ImageView |
340 | android:id="@+id/ivImagen" | 340 | android:id="@+id/ivImagen" |
341 | android:layout_width="300dp" | 341 | android:layout_width="300dp" |
342 | android:layout_height="300dp" | 342 | android:layout_height="300dp" |
343 | android:layout_marginStart="5dp" | 343 | android:layout_marginStart="5dp" |
344 | android:src="@drawable/no_imagen" | 344 | android:src="@drawable/no_imagen" |
345 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 345 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
346 | android:textSize="14sp" | 346 | android:textSize="14sp" |
347 | app:layout_constraintStart_toEndOf="@+id/textView11" | 347 | app:layout_constraintStart_toEndOf="@+id/textView11" |
348 | app:layout_constraintTop_toBottomOf="@+id/textView15" /> | 348 | app:layout_constraintTop_toBottomOf="@+id/textView15" /> |
349 | 349 | ||
350 | </androidx.constraintlayout.widget.ConstraintLayout> | 350 | </androidx.constraintlayout.widget.ConstraintLayout> |
351 | </androidx.cardview.widget.CardView> | 351 | </androidx.cardview.widget.CardView> |
352 | 352 | ||
353 | </ScrollView> | 353 | </ScrollView> |
354 | 354 |
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/guideline6"/> | ||
99 | 100 | ||
100 | 101 | ||
101 | <androidx.appcompat.widget.AppCompatTextView | 102 | <androidx.appcompat.widget.AppCompatTextView |
102 | android:id="@+id/txtDeposito" | 103 | android:id="@+id/txtDeposito" |
103 | android:layout_width="match_parent" | 104 | android:layout_width="match_parent" |
104 | android:layout_height="90dp" | 105 | android:layout_height="90dp" |
105 | android:autoSizeMaxTextSize="150sp" | 106 | android:autoSizeMaxTextSize="150sp" |
106 | android:autoSizeMinTextSize="25sp" | 107 | android:autoSizeMinTextSize="25sp" |
107 | android:autoSizeStepGranularity="5sp" | 108 | android:autoSizeStepGranularity="5sp" |
108 | android:autoSizeTextType="uniform" | 109 | android:autoSizeTextType="uniform" |
109 | android:gravity="start" | 110 | android:gravity="start" |
110 | android:lines="1" | 111 | android:lines="1" |
111 | android:padding="10dp" | 112 | android:padding="10dp" |
112 | android:text="@string/invDinamicoCompra" | 113 | android:text="@string/invDinamicoCompra" |
113 | android:textColor="@color/colorAccent" | 114 | android:textColor="@color/colorAccent" |
114 | android:visibility="visible" | 115 | android:visibility="visible" |
115 | app:fontFamily="sans-serif-condensed" | 116 | app:fontFamily="sans-serif-condensed" |
116 | app:layout_constraintBottom_toBottomOf="parent" | 117 | app:layout_constraintBottom_toBottomOf="parent" |
117 | app:layout_constraintEnd_toEndOf="parent" | 118 | app:layout_constraintEnd_toEndOf="parent" |
118 | app:layout_constraintStart_toStartOf="parent" | 119 | app:layout_constraintStart_toStartOf="parent" |
119 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" | 120 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" |
120 | app:layout_constraintVertical_bias="0.0" /> | 121 | app:layout_constraintVertical_bias="0.0" /> |
121 | </androidx.constraintlayout.widget.ConstraintLayout> | 122 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/ingresar_cantidad.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.cardview.widget.CardView | 2 | <androidx.cardview.widget.CardView |
3 | xmlns:android="http://schemas.android.com/apk/res/android" | 3 | xmlns:android="http://schemas.android.com/apk/res/android" |
4 | xmlns:app="http://schemas.android.com/apk/res-auto" | 4 | xmlns:app="http://schemas.android.com/apk/res-auto" |
5 | xmlns:tools="http://schemas.android.com/tools" | 5 | xmlns:tools="http://schemas.android.com/tools" |
6 | android:layout_width="match_parent" | 6 | android:layout_width="match_parent" |
7 | android:layout_height="wrap_content" | 7 | android:layout_height="wrap_content" |
8 | app:cardCornerRadius="10dp" | 8 | app:cardCornerRadius="10dp" |
9 | app:cardElevation="5dp" | 9 | app:cardElevation="5dp" |
10 | 10 | ||
11 | tools:ignore="PrivateResource"> | 11 | tools:ignore="PrivateResource"> |
12 | <!-- android:background="@drawable/md_transparent"--> | 12 | <!-- android:background="@drawable/md_transparent"--> |
13 | 13 | ||
14 | <androidx.constraintlayout.widget.ConstraintLayout | 14 | <androidx.constraintlayout.widget.ConstraintLayout |
15 | android:layout_width="match_parent" | 15 | android:layout_width="match_parent" |
16 | android:layout_height="match_parent"> | 16 | android:layout_height="match_parent"> |
17 | 17 | ||
18 | <LinearLayout | 18 | <LinearLayout |
19 | android:id="@+id/barraSuperior" | 19 | android:id="@+id/barraSuperior" |
20 | android:layout_width="0dp" | 20 | android:layout_width="0dp" |
21 | android:layout_height="wrap_content" | 21 | android:layout_height="wrap_content" |
22 | android:background="@color/colorPrimaryDark" | 22 | android:background="@color/colorPrimaryDark" |
23 | android:orientation="horizontal" | 23 | android:orientation="horizontal" |
24 | app:layout_constraintLeft_toLeftOf="parent" | 24 | app:layout_constraintLeft_toLeftOf="parent" |
25 | app:layout_constraintRight_toRightOf="parent" | 25 | app:layout_constraintRight_toRightOf="parent" |
26 | app:layout_constraintTop_toTopOf="parent" | 26 | app:layout_constraintTop_toTopOf="parent" |
27 | app:layout_constraintTop_toBottomOf="@+id/lySegundo"> | 27 | app:layout_constraintTop_toBottomOf="@+id/lySegundo"> |
28 | 28 | ||
29 | <androidx.appcompat.widget.AppCompatTextView | 29 | <androidx.appcompat.widget.AppCompatTextView |
30 | android:id="@+id/tvTitulo" | 30 | android:id="@+id/tvTitulo" |
31 | android:layout_width="0dp" | 31 | android:layout_width="0dp" |
32 | android:layout_height="wrap_content" | 32 | android:layout_height="wrap_content" |
33 | android:layout_margin="10dp" | 33 | android:layout_margin="10dp" |
34 | android:layout_marginStart="5dp" | 34 | android:layout_marginStart="5dp" |
35 | android:layout_marginTop="10dp" | 35 | android:layout_marginTop="10dp" |
36 | android:layout_weight="1" | 36 | android:layout_weight="1" |
37 | android:text="@string/adv" | 37 | android:text="@string/adv" |
38 | android:textAlignment="center" | 38 | android:textAlignment="center" |
39 | android:textColor="@android:color/white" | 39 | android:textColor="@android:color/white" |
40 | android:textSize="25sp" /> | 40 | android:textSize="25sp" /> |
41 | </LinearLayout> | 41 | </LinearLayout> |
42 | 42 | ||
43 | 43 | ||
44 | <LinearLayout | 44 | <LinearLayout |
45 | android:id="@+id/lySegundo" | 45 | android:id="@+id/lySegundo" |
46 | android:layout_width="match_parent" | 46 | android:layout_width="match_parent" |
47 | android:layout_height="wrap_content" | 47 | android:layout_height="wrap_content" |
48 | android:orientation="vertical" | 48 | android:orientation="vertical" |
49 | android:padding="12dp" | 49 | android:padding="12dp" |
50 | app:layout_constraintLeft_toLeftOf="parent" | 50 | app:layout_constraintLeft_toLeftOf="parent" |
51 | app:layout_constraintRight_toRightOf="parent" | 51 | app:layout_constraintRight_toRightOf="parent" |
52 | app:layout_constraintTop_toBottomOf="@id/barraSuperior"> | 52 | app:layout_constraintTop_toBottomOf="@id/barraSuperior"> |
53 | 53 | ||
54 | 54 | ||
55 | <EditText | 55 | <EditText |
56 | android:id="@+id/etCantidad" | 56 | android:id="@+id/etCantidad" |
57 | android:layout_width="match_parent" | 57 | android:layout_width="match_parent" |
58 | android:layout_height="wrap_content" | 58 | android:layout_height="wrap_content" |
59 | android:clickable="true" | 59 | android:clickable="true" |
60 | android:ems="10" | 60 | android:ems="10" |
61 | android:focusable="true" | 61 | android:focusable="true" |
62 | android:gravity="center" | 62 | android:gravity="center" |
63 | android:inputType="numberDecimal" | 63 | android:inputType="numberDecimal" |
64 | android:maxLength="8" | 64 | android:maxLength="8" |
65 | android:text="" | 65 | android:text="" |
66 | android:hint="Ingrese Cantidad" | 66 | android:hint="Ingrese Cantidad" |
67 | android:textSize="20sp" /> | 67 | android:textSize="20sp" /> |
68 | 68 | ||
69 | 69 | ||
70 | <androidx.appcompat.widget.AppCompatButton | 70 | <androidx.appcompat.widget.AppCompatButton |
71 | android:id="@+id/btnAceptar" | 71 | android:id="@+id/btnAceptar" |
72 | android:layout_width="match_parent" | 72 | android:layout_width="match_parent" |
73 | android:layout_height="wrap_content" | 73 | android:layout_height="wrap_content" |
74 | android:layout_margin="10dp" | 74 | android:layout_margin="10dp" |
75 | android:layout_marginBottom="20dp" | 75 | android:layout_marginBottom="20dp" |
76 | android:clickable="true" | 76 | android:clickable="true" |
77 | android:focusable="true" | 77 | android:focusable="true" |
78 | android:textColor="@android:color/white" | 78 | android:textColor="@android:color/white" |
79 | android:padding="10dp" | 79 | android:padding="10dp" |
80 | android:background="@drawable/boton_borde_redondeado" | 80 | android:background="@drawable/boton_borde_redondeado" |
81 | android:text="@string/btnOk" | 81 | android:text="@string/btnConfirmar" |
82 | android:textAlignment="center" | 82 | android:textAlignment="center" |
83 | android:textSize="20sp" | 83 | android:textSize="20sp" |
84 | android:textStyle="bold" | 84 | android:textStyle="bold" |
85 | app:cardBackgroundColor="@android:color/darker_gray" | 85 | app:cardBackgroundColor="@android:color/darker_gray" |
86 | app:cardUseCompatPadding="true" /> | 86 | app:cardUseCompatPadding="true" /> |
87 | 87 | ||
88 | 88 | ||
89 | </LinearLayout> | 89 | </LinearLayout> |
90 | 90 | ||
91 | 91 | ||
92 | </androidx.constraintlayout.widget.ConstraintLayout> | 92 | </androidx.constraintlayout.widget.ConstraintLayout> |
93 | </androidx.cardview.widget.CardView> | 93 | </androidx.cardview.widget.CardView> |
app/src/main/res/layout/item_codigo_origen.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
5 | android:layout_height="wrap_content" | 5 | android:layout_height="wrap_content" |
6 | android:layout_margin="5dp" | 6 | android:layout_margin="5dp" |
7 | app:cardCornerRadius="15dp" | 7 | app:cardCornerRadius="15dp" |
8 | app:cardElevation="10dp" | 8 | app:cardElevation="10dp" |
9 | app:cardPreventCornerOverlap="false" | 9 | app:cardPreventCornerOverlap="false" |
10 | app:contentPadding="5dp"> | 10 | app:contentPadding="5dp"> |
11 | 11 | ||
12 | <androidx.constraintlayout.widget.ConstraintLayout | 12 | <androidx.constraintlayout.widget.ConstraintLayout |
13 | android:layout_width="match_parent" | 13 | android:layout_width="match_parent" |
14 | android:layout_height="wrap_content"> | 14 | android:layout_height="wrap_content"> |
15 | 15 | ||
16 | <TextView | 16 | <TextView |
17 | android:id="@+id/tvDescripcion" | 17 | android:id="@+id/tvDescripcion" |
18 | android:layout_width="0dp" | 18 | android:layout_width="0dp" |
19 | android:layout_height="wrap_content" | 19 | android:layout_height="wrap_content" |
20 | android:layout_marginStart="5dp" | 20 | android:layout_marginStart="5dp" |
21 | android:maxLines="2" | 21 | android:maxLines="2" |
22 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" | 22 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" |
23 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 23 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
24 | android:textSize="16sp" | 24 | android:textSize="16sp" |
25 | android:textStyle="bold" | 25 | android:textStyle="bold" |
26 | app:layout_constraintEnd_toEndOf="parent" | 26 | app:layout_constraintEnd_toEndOf="parent" |
27 | app:layout_constraintStart_toStartOf="parent" | 27 | app:layout_constraintStart_toStartOf="parent" |
28 | app:layout_constraintTop_toTopOf="parent" /> | 28 | app:layout_constraintTop_toTopOf="parent" /> |
29 | 29 | ||
30 | |||
31 | <TextView | ||
32 | android:id="@+id/tvCantidad" | ||
33 | android:layout_width="wrap_content" | ||
34 | android:layout_height="match_parent" | ||
35 | android:layout_marginStart="5dp" | ||
36 | android:text="Código Origen:" | ||
37 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
38 | android:textSize="14sp" | ||
39 | app:layout_constraintStart_toStartOf="parent" | ||
40 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
41 | |||
42 | <TextView | ||
43 | android:id="@+id/tvCodigoOrigen" | ||
44 | android:layout_width="wrap_content" | ||
45 | android:layout_height="match_parent" | ||
46 | android:maxLines="2" | ||
47 | android:text="987654" | ||
48 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
49 | android:textSize="14sp" | ||
50 | android:textStyle="bold" | ||
51 | android:visibility="visible" | ||
52 | app:layout_constraintStart_toEndOf="@+id/tvCantidad" | ||
53 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
54 | |||
55 | |||
56 | <TextView | 30 | <TextView |
57 | android:id="@+id/textView2" | 31 | android:id="@+id/textView2" |
58 | android:layout_width="wrap_content" | 32 | android:layout_width="wrap_content" |
59 | android:layout_height="wrap_content" | 33 | android:layout_height="wrap_content" |
60 | android:layout_marginStart="5dp" | 34 | android:layout_marginStart="5dp" |
35 | android:layout_marginTop="10dp" | ||
61 | android:text="Código DEBO:" | 36 | android:text="Código DEBO:" |
62 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 37 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
63 | android:textSize="14sp" | 38 | android:textSize="14sp" |
64 | app:layout_constraintStart_toEndOf="@+id/tvCodigoOrigen" | 39 | app:layout_constraintStart_toStartOf="parent" |
65 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | 40 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
66 | 41 | ||
67 | 42 | ||
68 | <TextView | 43 | <TextView |
69 | android:id="@+id/tvSector" | 44 | android:id="@+id/tvSector" |
70 | android:layout_width="wrap_content" | 45 | android:layout_width="wrap_content" |
71 | android:layout_height="match_parent" | 46 | android:layout_height="match_parent" |
47 | android:layout_marginStart="5dp" | ||
48 | android:layout_marginTop="10dp" | ||
72 | android:text="9999" | 49 | android:text="9999" |
73 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 50 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
74 | android:textColorHint="@android:color/black" | 51 | android:textColorHint="@android:color/black" |
75 | android:textSize="14sp" | 52 | android:textSize="14sp" |
76 | android:textStyle="bold" | 53 | android:textStyle="bold" |
77 | app:layout_constraintStart_toEndOf="@+id/textView2" | 54 | app:layout_constraintStart_toEndOf="@+id/textView2" |
78 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | 55 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
79 | 56 | ||
80 | <TextView | 57 | <TextView |
81 | android:id="@+id/tvCodigo" | 58 | android:id="@+id/tvCodigo" |
82 | android:layout_width="wrap_content" | 59 | android:layout_width="wrap_content" |
83 | android:layout_height="match_parent" | 60 | android:layout_height="match_parent" |
84 | android:layout_marginStart="2dp" | ||
85 | android:text="99999999" | 61 | android:text="99999999" |
86 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 62 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
87 | android:textColorHint="@android:color/black" | 63 | android:textColorHint="@android:color/black" |
88 | android:textSize="14sp" | 64 | android:textSize="14sp" |
89 | android:textStyle="bold" | 65 | android:textStyle="bold" |
66 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | ||
90 | app:layout_constraintHorizontal_chainStyle="packed" | 67 | app:layout_constraintHorizontal_chainStyle="packed" |
91 | app:layout_constraintStart_toEndOf="@+id/tvSector" | 68 | app:layout_constraintStart_toEndOf="@+id/tvSector" /> |
92 | app:layout_constraintTop_toTopOf="@+id/textView2" /> | ||
93 | 69 | ||
94 | <!-- <TextView--> | ||
95 | <!-- android:id="@+id/textView5"--> | ||
96 | <!-- android:layout_width="wrap_content"--> | ||
97 | <!-- android:layout_height="wrap_content"--> | ||
98 | <!-- android:layout_marginStart="8dp"--> | ||
99 | <!-- android:text="Cantidad:"--> | ||
100 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> | ||
101 | <!-- android:textSize="14sp"--> | ||
102 | <!-- android:visibility="gone"--> | ||
103 | <!-- app:layout_constraintTop_toTopOf="parent"--> | ||
104 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras"--> | ||
105 | <!-- app:layout_constraintStart_toEndOf="@+id/tvCodigo" />--> | ||
106 | 70 | ||
107 | <!-- <ImageView--> | 71 | <TextView |
108 | <!-- android:id="@+id/ivHolder"--> | 72 | android:id="@+id/tvCantidad" |
109 | <!-- android:layout_width="30dp"--> | 73 | android:layout_width="wrap_content" |
110 | <!-- android:layout_height="30dp"--> | 74 | android:layout_height="match_parent" |
111 | <!-- android:visibility="gone"--> | 75 | android:layout_marginStart="10dp" |
112 | <!-- android:src="@drawable/more"--> | 76 | android:text="Código Origen:" |
113 | <!-- app:layout_constraintBottom_toTopOf="@+id/tvDescripcion"--> | 77 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
114 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | 78 | android:textSize="14sp" |
115 | <!-- app:layout_constraintHorizontal_bias="0.968"--> | 79 | app:layout_constraintBaseline_toBaselineOf="@+id/tvCodigo" |
116 | <!-- app:layout_constraintStart_toEndOf="@+id/tvCodigoBarras"--> | 80 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> |
117 | <!-- app:layout_constraintTop_toTopOf="parent"--> | ||
118 | <!-- app:layout_constraintVertical_bias="0.0" />--> | ||
119 | 81 |
app/src/main/res/layout/login_dialog.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 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
5 | android:layout_height="wrap_content" | 5 | android:layout_height="wrap_content" |
6 | android:orientation="vertical" | 6 | android:orientation="vertical" |
7 | android:padding="10dp"> | 7 | android:padding="10dp"> |
8 | 8 | ||
9 | <LinearLayout | 9 | <LinearLayout |
10 | android:id="@+id/barraSuperior" | 10 | android:id="@+id/barraSuperior" |
11 | android:layout_width="0dp" | 11 | android:layout_width="0dp" |
12 | android:layout_height="wrap_content" | 12 | android:layout_height="wrap_content" |
13 | android:background="@color/colorPrimaryDark" | 13 | android:background="@color/colorPrimaryDark" |
14 | android:orientation="horizontal" | 14 | android:orientation="horizontal" |
15 | app:layout_constraintEnd_toEndOf="parent" | 15 | app:layout_constraintEnd_toEndOf="parent" |
16 | app:layout_constraintStart_toStartOf="parent" | 16 | app:layout_constraintStart_toStartOf="parent" |
17 | app:layout_constraintTop_toTopOf="parent"> | 17 | app:layout_constraintTop_toTopOf="parent"> |
18 | 18 | ||
19 | <androidx.appcompat.widget.AppCompatTextView | 19 | <androidx.appcompat.widget.AppCompatTextView |
20 | android:id="@+id/tvTitulo2" | 20 | android:id="@+id/tvTitulo2" |
21 | android:layout_width="0dp" | 21 | android:layout_width="0dp" |
22 | android:layout_height="wrap_content" | 22 | android:layout_height="wrap_content" |
23 | android:layout_margin="10dp" | 23 | android:layout_margin="10dp" |
24 | android:layout_marginStart="5dp" | 24 | android:layout_marginStart="5dp" |
25 | android:layout_marginTop="10dp" | 25 | android:layout_marginTop="10dp" |
26 | android:layout_weight="1" | 26 | android:layout_weight="1" |
27 | android:text="@string/adv" | 27 | android:text="@string/adv" |
28 | android:background="@drawable/boton_borde_redondeado" | 28 | android:background="@drawable/boton_borde_redondeado" |
29 | android:textAlignment="center" | 29 | android:textAlignment="center" |
30 | android:textColor="@android:color/white" | 30 | android:textColor="@android:color/white" |
31 | android:textSize="25sp" /> | 31 | android:textSize="25sp" /> |
32 | </LinearLayout> | 32 | </LinearLayout> |
33 | 33 | ||
34 | <TextView | 34 | <TextView |
35 | android:id="@+id/dialogNameEt" | 35 | android:id="@+id/dialogNameEt" |
36 | android:layout_width="wrap_content" | 36 | android:layout_width="wrap_content" |
37 | android:layout_height="wrap_content" | 37 | android:layout_height="wrap_content" |
38 | android:layout_margin="5dp" | 38 | android:layout_margin="5dp" |
39 | android:text="Conteo actual :" | 39 | android:text="Conteo actual :" |
40 | android:textSize="20sp" | 40 | android:textSize="20sp" |
41 | app:layout_constraintEnd_toStartOf="@id/tvCantInicial" | 41 | app:layout_constraintEnd_toStartOf="@id/tvCantInicial" |
42 | app:layout_constraintHorizontal_bias="0.0" | 42 | app:layout_constraintHorizontal_bias="0.0" |
43 | app:layout_constraintHorizontal_chainStyle="packed" | 43 | app:layout_constraintHorizontal_chainStyle="packed" |
44 | app:layout_constraintStart_toStartOf="parent" | 44 | app:layout_constraintStart_toStartOf="parent" |
45 | app:layout_constraintTop_toBottomOf="@id/barraSuperior"/> | 45 | app:layout_constraintTop_toBottomOf="@id/barraSuperior"/> |
46 | 46 | ||
47 | <TextView | 47 | <TextView |
48 | android:id="@+id/tvCantInicial" | 48 | android:id="@+id/tvCantInicial" |
49 | android:layout_width="wrap_content" | 49 | android:layout_width="wrap_content" |
50 | android:layout_height="wrap_content" | 50 | android:layout_height="wrap_content" |
51 | android:layout_margin="5dp" | 51 | android:layout_margin="5dp" |
52 | android:text="" | 52 | android:text="" |
53 | android:textSize="20sp" | 53 | android:textSize="20sp" |
54 | app:layout_constraintBaseline_toBaselineOf="@+id/dialogNameEt" | 54 | app:layout_constraintBaseline_toBaselineOf="@+id/dialogNameEt" |
55 | app:layout_constraintEnd_toEndOf="parent" | 55 | app:layout_constraintEnd_toEndOf="parent" |
56 | app:layout_constraintHorizontal_chainStyle="packed" | 56 | app:layout_constraintHorizontal_chainStyle="packed" |
57 | app:layout_constraintStart_toEndOf="@id/dialogNameEt" /> | 57 | app:layout_constraintStart_toEndOf="@id/dialogNameEt" /> |
58 | 58 | ||
59 | <TextView | 59 | <TextView |
60 | android:id="@+id/tvgenerico" | 60 | android:id="@+id/tvgenerico" |
61 | android:layout_width="wrap_content" | 61 | android:layout_width="wrap_content" |
62 | android:layout_height="wrap_content" | 62 | android:layout_height="wrap_content" |
63 | android:layout_margin="5dp" | 63 | android:layout_margin="5dp" |
64 | android:text="Nueva cantidad:" | 64 | android:text="Nueva cantidad:" |
65 | android:textStyle="bold" | 65 | android:textStyle="bold" |
66 | android:textSize="20sp" | 66 | android:textSize="20sp" |
67 | app:layout_constraintStart_toStartOf="parent" | 67 | app:layout_constraintStart_toStartOf="parent" |
68 | app:layout_constraintTop_toBottomOf="@+id/tvCantInicial" /> | 68 | app:layout_constraintTop_toBottomOf="@+id/tvCantInicial" /> |
69 | 69 | ||
70 | <EditText | 70 | <EditText |
71 | android:id="@+id/tvNuevaCantidad" | 71 | android:id="@+id/tvNuevaCantidad" |
72 | android:layout_width="0dp" | 72 | android:layout_width="0dp" |
73 | android:layout_height="wrap_content" | 73 | android:layout_height="wrap_content" |
74 | android:autofillHints="" | 74 | android:autofillHints="" |
75 | android:hint="" | 75 | android:hint="" |
76 | android:focusable="true" | 76 | android:focusable="true" |
77 | android:clickable="true" | 77 | android:clickable="true" |
78 | android:inputType="numberDecimal" | 78 | android:inputType="numberDecimal" |
79 | app:layout_constraintBaseline_toBaselineOf="@+id/tvgenerico" | 79 | app:layout_constraintBaseline_toBaselineOf="@+id/tvgenerico" |
80 | app:layout_constraintEnd_toEndOf="parent" | 80 | app:layout_constraintEnd_toEndOf="parent" |
81 | app:layout_constraintStart_toEndOf="@id/tvgenerico" /> | 81 | app:layout_constraintStart_toEndOf="@id/tvgenerico" /> |
82 | 82 | ||
83 | <TextView | 83 | <TextView |
84 | android:id="@+id/tvgenerico2" | 84 | android:id="@+id/tvgenerico2" |
85 | android:layout_width="wrap_content" | 85 | android:layout_width="wrap_content" |
86 | android:layout_height="wrap_content" | 86 | android:layout_height="wrap_content" |
87 | android:layout_margin="5dp" | 87 | android:layout_margin="5dp" |
88 | android:gravity="center" | 88 | android:gravity="center" |
89 | android:text="@string/tvSeleccion" | 89 | android:text="@string/tvSeleccion" |
90 | android:textSize="20sp" | 90 | android:textSize="20sp" |
91 | android:visibility="gone" | 91 | android:visibility="gone" |
92 | app:layout_constraintStart_toStartOf="parent" | 92 | app:layout_constraintStart_toStartOf="parent" |
93 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico" /> | 93 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico" /> |
94 | 94 | ||
95 | <RadioGroup | 95 | <RadioGroup |
96 | android:id="@+id/rgFechaHora" | 96 | android:id="@+id/rgFechaHora" |
97 | android:layout_width="wrap_content" | 97 | android:layout_width="wrap_content" |
98 | android:layout_height="wrap_content" | 98 | android:layout_height="wrap_content" |
99 | android:gravity="start" | 99 | android:gravity="start" |
100 | android:orientation="horizontal" | 100 | android:orientation="horizontal" |
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/tvgenerico2"> | 104 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico2"> |
105 | 105 | ||
106 | <RadioButton | 106 | <RadioButton |
107 | android:id="@+id/rbSumar" | 107 | android:id="@+id/rbSumar" |
108 | android:layout_width="wrap_content" | 108 | android:layout_width="wrap_content" |
109 | android:layout_height="wrap_content" | 109 | android:layout_height="wrap_content" |
110 | android:layout_margin="5dp" | 110 | android:layout_margin="5dp" |
111 | android:checked="true" | 111 | android:checked="true" |
112 | android:text="@string/rbSumar" | 112 | android:text="@string/rbSumar" |
113 | android:textSize="@dimen/text_size2" /> | 113 | android:textSize="@dimen/text_size2" /> |
114 | 114 | ||
115 | <RadioButton | 115 | <RadioButton |
116 | android:id="@+id/rbMdodificar" | 116 | android:id="@+id/rbMdodificar" |
117 | android:layout_width="wrap_content" | 117 | android:layout_width="wrap_content" |
118 | android:layout_height="wrap_content" | 118 | android:layout_height="wrap_content" |
119 | android:layout_margin="5dp" | 119 | android:layout_margin="5dp" |
120 | android:checked="false" | 120 | android:checked="false" |
121 | android:text="@string/rbModificar" | 121 | android:text="@string/rbModificar" |
122 | android:textSize="@dimen/text_size2" /> | 122 | android:textSize="@dimen/text_size2" /> |
123 | 123 | ||
124 | <RadioButton | 124 | <RadioButton |
125 | android:id="@+id/rbRestar" | 125 | android:id="@+id/rbRestar" |
126 | android:layout_width="wrap_content" | 126 | android:layout_width="wrap_content" |
127 | android:layout_height="wrap_content" | 127 | android:layout_height="wrap_content" |
128 | android:layout_margin="5dp" | 128 | android:layout_margin="5dp" |
129 | android:checked="false" | 129 | android:checked="false" |
130 | android:padding="5dp" | 130 | android:padding="5dp" |
131 | android:text="@string/rbRestar" | 131 | android:text="@string/rbRestar" |
132 | android:textSize="@dimen/text_size2" /> | 132 | android:textSize="@dimen/text_size2" /> |
133 | 133 | ||
134 | </RadioGroup> | 134 | </RadioGroup> |
135 | 135 | ||
136 | <TextView | 136 | <TextView |
137 | android:id="@+id/tvgenerico3" | 137 | android:id="@+id/tvgenerico3" |
138 | android:layout_width="wrap_content" | 138 | android:layout_width="wrap_content" |
139 | android:layout_height="wrap_content" | 139 | android:layout_height="wrap_content" |
140 | android:layout_margin="5dp" | 140 | android:layout_margin="5dp" |
141 | android:gravity="center" | 141 | android:gravity="center" |
142 | android:text="Resultado :" | 142 | android:text="Resultado :" |
143 | android:textStyle="bold" | 143 | android:textStyle="bold" |
144 | android:textSize="20sp" | 144 | android:textSize="20sp" |
145 | app:layout_constraintEnd_toEndOf="parent" | 145 | app:layout_constraintEnd_toEndOf="parent" |
146 | app:layout_constraintHorizontal_bias="0.0" | 146 | app:layout_constraintHorizontal_bias="0.0" |
147 | app:layout_constraintStart_toStartOf="parent" | 147 | app:layout_constraintStart_toStartOf="parent" |
148 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | 148 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> |
149 | 149 | ||
150 | <TextView | 150 | <TextView |
151 | android:id="@+id/tvResultado" | 151 | android:id="@+id/tvResultado" |
152 | android:layout_width="wrap_content" | 152 | android:layout_width="wrap_content" |
153 | android:layout_height="wrap_content" | 153 | android:layout_height="wrap_content" |
154 | android:layout_margin="5dp" | 154 | android:layout_margin="5dp" |
155 | android:gravity="center" | 155 | android:gravity="center" |
156 | android:text="" | 156 | android:text="" |
157 | android:textSize="20sp" | 157 | android:textSize="20sp" |
158 | app:layout_constraintEnd_toEndOf="parent" | 158 | app:layout_constraintEnd_toEndOf="parent" |
159 | app:layout_constraintHorizontal_bias="0.0" | 159 | app:layout_constraintHorizontal_bias="0.0" |
160 | app:layout_constraintStart_toEndOf="@+id/tvgenerico3" | 160 | app:layout_constraintStart_toEndOf="@+id/tvgenerico3" |
161 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | 161 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> |
162 | 162 | ||
163 | <LinearLayout | 163 | <LinearLayout |
164 | android:layout_width="match_parent" | 164 | android:layout_width="match_parent" |
165 | android:layout_height="wrap_content" | 165 | android:layout_height="wrap_content" |
166 | android:layout_margin="10dp" | 166 | android:layout_margin="10dp" |
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/tvResultado"> | 171 | app:layout_constraintTop_toBottomOf="@+id/tvResultado"> |
172 | 172 | ||
173 | <Button | 173 | <Button |
174 | android:id="@+id/btnAceptar" | 174 | android:id="@+id/btnAceptar" |
175 | style="@style/Base.Widget.AppCompat.Button.Colored" | 175 | style="@style/Base.Widget.AppCompat.Button.Colored" |
176 | android:layout_width="140dp" | 176 | android:layout_width="140dp" |
177 | android:layout_height="wrap_content" | 177 | android:layout_height="wrap_content" |
178 | android:layout_margin="5dp" | 178 | android:layout_margin="5dp" |
179 | android:background="@drawable/boton_borde_redondeado" | 179 | android:background="@drawable/boton_borde_redondeado" |
180 | android:padding="20dp" | 180 | android:padding="20dp" |
181 | android:text="@string/btnOk" | 181 | android:text="@string/btnConfirmar" |
182 | android:textColor="@android:color/white" /> | 182 | android:textColor="@android:color/white" /> |
183 | 183 | ||
184 | <Button | 184 | <Button |
185 | android:id="@+id/dialogCancelBtn" | 185 | android:id="@+id/dialogCancelBtn" |
186 | style="@style/Base.Widget.AppCompat.Button.Colored" | 186 | style="@style/Base.Widget.AppCompat.Button.Colored" |
187 | android:layout_width="140dp" | 187 | android:layout_width="140dp" |
188 | android:layout_height="wrap_content" | 188 | android:layout_height="wrap_content" |
189 | android:layout_margin="5dp" | 189 | android:layout_margin="5dp" |
190 | android:background="@drawable/boton_borde_redondeado" | 190 | android:background="@drawable/boton_borde_redondeado" |
191 | android:padding="20dp" | 191 | android:padding="20dp" |
192 | android:text="@string/btnCancelar" | 192 | android:text="@string/btnCancelar" |
193 | android:textColor="@android:color/white" /> | 193 | android:textColor="@android:color/white" /> |
194 | </LinearLayout> | 194 | </LinearLayout> |
195 | 195 | ||
196 | </androidx.constraintlayout.widget.ConstraintLayout> | 196 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/menu/activity_main_drawer.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <menu xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <menu xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:tools="http://schemas.android.com/tools" | 3 | xmlns:tools="http://schemas.android.com/tools" |
4 | tools:showIn="navigation_view"> | 4 | tools:showIn="navigation_view"> |
5 | 5 | ||
6 | <group android:checkableBehavior="single"> | 6 | <group android:checkableBehavior="single"> |
7 | <item | 7 | <item |
8 | android:id="@+id/mainFragment2" | 8 | android:id="@+id/mainFragment2" |
9 | android:checkable="true" | 9 | android:checkable="true" |
10 | android:checked="true" | 10 | android:checked="true" |
11 | android:icon="@drawable/inicio" | 11 | android:icon="@drawable/inicio" |
12 | android:title="@string/menuInicio" /> | 12 | android:title="@string/menuInicio" |
13 | /> | ||
13 | <item | 14 | <item |
14 | android:id="@+id/mnuInicio2" | 15 | android:id="@+id/mnuInicio2" |
15 | android:checkable="false" | 16 | android:checkable="false" |
16 | android:checked="false" | 17 | android:checked="false" |
17 | 18 | ||
18 | android:title="" /> | 19 | android:title="" /> |
19 | <item | 20 | <item |
20 | android:id="@+id/inventarioFragment" | 21 | android:id="@+id/inventarioFragment" |
21 | android:icon="@drawable/inventario" | 22 | android:icon="@drawable/inventario" |
22 | android:title="@string/menuNueInv" /> | 23 | android:title="@string/menuNueInv" /> |
23 | <item | 24 | <item |
24 | android:id="@+id/mnuInicio3" | 25 | android:id="@+id/mnuInicio3" |
25 | android:checkable="false" | 26 | android:checkable="false" |
26 | android:checked="false" | 27 | android:checked="false" |
27 | android:title="" /> | 28 | android:title="" /> |
28 | <item | 29 | <item |
29 | android:id="@+id/actuaMaestrosFragment" | 30 | android:id="@+id/actuaMaestrosFragment" |
30 | android:icon="@drawable/maestros" | 31 | android:icon="@drawable/maestros" |
31 | android:title="@string/menuActMae" /> | 32 | android:title="@string/menuActMae" /> |
32 | <item | 33 | <item |
33 | android:id="@+id/mnuInicio4" | 34 | android:id="@+id/mnuInicio4" |
34 | android:checkable="false" | 35 | android:checkable="false" |
35 | android:checked="false" | 36 | android:checked="false" |
36 | android:title="" /> | 37 | android:title="" /> |
37 | <item | 38 | <item |
38 | android:id="@+id/configuracionFragment" | 39 | android:id="@+id/configuracionFragment" |
39 | android:icon="@drawable/configuracion" | 40 | android:icon="@drawable/configuracion" |
40 | android:title="@string/menuConf" /> | 41 | android:title="@string/menuConf" /> |
41 | </group> | 42 | </group> |
42 | </menu> | 43 | </menu> |
app/src/main/res/values/dimens.xml
1 | <resources> | 1 | <resources> |
2 | <!-- Default screen margins, per the Android Design guidelines. --> | 2 | <!-- Default screen margins, per the Android Design guidelines. --> |
3 | <dimen name="activity_horizontal_margin">16dp</dimen> | 3 | <dimen name="activity_horizontal_margin">16dp</dimen> |
4 | <dimen name="activity_vertical_margin">16dp</dimen> | 4 | <dimen name="activity_vertical_margin">16dp</dimen> |
5 | <dimen name="nav_header_vertical_spacing">8dp</dimen> | 5 | <dimen name="nav_header_vertical_spacing">8dp</dimen> |
6 | <dimen name="nav_header_height">176dp</dimen> | 6 | <dimen name="nav_header_height">176dp</dimen> |
7 | <dimen name="fab_margin">16dp</dimen> | 7 | <dimen name="fab_margin">16dp</dimen> |
8 | 8 | ||
9 | <!-- // Tamaño de los iconos--> | 9 | <!-- // Tamaño de los iconos--> |
10 | <dimen name="icon_dim">80dp</dimen> | 10 | <dimen name="icon_dim">80dp</dimen> |
11 | <dimen name="icon_top">20dp</dimen> | 11 | <dimen name="icon_top">20dp</dimen> |
12 | <dimen name="text_size">12sp</dimen> | 12 | <dimen name="text_size">12sp</dimen> |
13 | 13 | ||
14 | <!-- //fragment inventario--> | 14 | <!-- //fragment inventario--> |
15 | <dimen name="subTitulos">20sp</dimen> | 15 | <dimen name="subTitulos">20sp</dimen> |
16 | 16 | ||
17 | <!-- //Normal Size--> | 17 | <!-- //Normal Size--> |
18 | <dimen name="Titulos">40sp</dimen> | 18 | <dimen name="Titulos">40sp</dimen> |
19 | <dimen name="TitulosMedios">25sp</dimen> | 19 | <dimen name="TitulosMedios">25sp</dimen> |
20 | <dimen name="SubTitulos">15sp</dimen> | 20 | <dimen name="SubTitulos">15sp</dimen> |
21 | 21 | ||
22 | <dimen name="MarginTopSubTitulos">5dp</dimen> | 22 | <dimen name="MarginTopSubTitulos">5dp</dimen> |
23 | <dimen name="MarginTopTitulos">30dp</dimen> | 23 | <dimen name="MarginTopTitulos">30dp</dimen> |
24 | 24 | ||
25 | <dimen name="MarginBotAgreSer">10dp</dimen> | 25 | <dimen name="MarginBotAgreSer">10dp</dimen> |
26 | <dimen name="NormalText">10sp</dimen> | 26 | <dimen name="NormalText">10sp</dimen> |
27 | 27 | ||
28 | <dimen name="PadingCbyRb">5dp</dimen> | 28 | <dimen name="PadingCbyRb">5dp</dimen> |
29 | 29 | ||
30 | <!-- //fragemnt Actualizacion de Maestros--> | 30 | <!-- //fragemnt Actualizacion de Maestros--> |
31 | <dimen name="TitulosActMa">20sp</dimen> | 31 | <dimen name="TitulosActMa">20sp</dimen> |
32 | 32 | ||
33 | 33 | ||
34 | <dimen name="md_message_textsize">20sp</dimen> | 34 | <dimen name="md_message_textsize">20sp</dimen> |
35 | <dimen name="text_size2">16sp</dimen> | 35 | <dimen name="text_size2">16sp</dimen> |
36 | <dimen name="list_item_spacing">16dp</dimen> | 36 | <dimen name="list_item_spacing">16dp</dimen> |
37 | <dimen name="list_item_spacing_half">8dp</dimen> | 37 | <dimen name="list_item_spacing_half">8dp</dimen> |
38 | |||
39 | //TODO: DIMENSIONES DE 10 PULGADAS | ||
40 | |||
41 | //FRAGMENT MAIN | ||
42 | <dimen name="icon_dim10">90dp</dimen> | ||
43 | <dimen name="SubTitulos10">25sp</dimen> | ||
44 | <dimen name="VentasDeposito10">30sp</dimen> | ||
45 | |||
46 | //TOOL BAR | ||
47 | <dimen name="activity_horizontal_margin10">26dp</dimen> | ||
48 | <dimen name="activity_vertical_margin10">26dp</dimen> | ||
49 | <dimen name="nav_header_vertical_spacing10">20dp</dimen> | ||
50 | <dimen name="nav_header_height10">276dp</dimen> | ||
51 | <dimen name="fab_margin10">26dp</dimen> | ||
52 | |||
53 | <dimen name="md_message_textsize10">30sp</dimen> | ||
54 | |||
55 | |||
56 | //INVENTARIO | ||
57 | <dimen name="boton10">120dp</dimen> | ||
58 | <dimen name="textCantidadDesc10">26sp</dimen> | ||
59 | <dimen name="textCantidad10">30sp</dimen> | ||
60 | <dimen name="iconos">60dp</dimen> | ||
61 | <dimen name="iconosMedia10">40dp</dimen> | ||
62 | <dimen name="tvServerConectado">35sp</dimen> | ||
63 | <dimen name="textView510">23sp</dimen> | ||
38 | </resources> | 64 | </resources> |
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 | <string name="todo">TODO</string> | 23 | <string name="todo">TODO</string> |
24 | <string name="hello_blank_fragment">Hello blank fragment</string> | 24 | <string name="hello_blank_fragment">Hello blank fragment</string> |
25 | 25 | ||
26 | <!-- inventarios dinamicos--> | 26 | <!-- inventarios dinamicos--> |
27 | <string name="invDinamicoVenta">Inventarios Dinamicos</string> | 27 | <string name="invDinamicoVenta">Inventarios Dinamicos</string> |
28 | <string name="invDinamicoCompra">Inventarios Importados(0) +</string> | 28 | <string name="invDinamicoCompra">Inventarios Importados(0) +</string> |
29 | 29 | ||
30 | <!-- ventana emergente--> | 30 | <!-- ventana emergente--> |
31 | <string name="adv">Ingrese la cantidad contada</string> | 31 | <string name="adv">Ingrese la cantidad contada</string> |
32 | <string name="invVentas">Inventarios Dinamicos de Ventas</string> | 32 | <string name="invVentas">Inventarios Dinamicos de Ventas</string> |
33 | <string name="btnCancela">Cancelar</string> | 33 | <string name="btnCancela">Cancelar</string> |
34 | 34 | ||
35 | 35 | ||
36 | <!-- Fragment Inventario--> | 36 | <!-- Fragment Inventario--> |
37 | <string name="invTitulo">Inventarios Dinámicos</string> | 37 | <string name="invTitulo">Inventarios Dinámicos</string> |
38 | <string name="invTituloV">Inventarios de Ventas</string> | 38 | <string name="invTituloV">Inventarios de Ventas</string> |
39 | <string name="invTituloD">Inventarios de Depositos</string> | 39 | <string name="invTituloD">Inventarios de Depositos</string> |
40 | <string name="invCodigoBarras">Código Barras:</string> | 40 | <string name="invCodigoBarras">Código Barras:</string> |
41 | <string name="btnExportarInv">Exportar Inventario</string> | 41 | <string name="btnExportarInv">Exportar Inventario</string> |
42 | <string name="btnBorrarInv">Borrar Inventario</string> | 42 | <string name="btnBorrarInv">Borrar Inventario</string> |
43 | <string name="ibBusDesc">Busqueda por Descripción</string> | 43 | <string name="ibBusDesc">Busqueda por Descripción</string> |
44 | <string name="ibBusCB">Busqueda por C. Barras</string> | 44 | <string name="ibBusCB">Busqueda por Código Barras</string> |
45 | <string name="ibBusCO">Busqueda por Código de Origen</string> | 45 | <string name="ibBusCO">Busqueda por Código de Origen</string> |
46 | <string name="switch_1">+ 1</string> | 46 | <string name="switch_1">+ 1</string> |
47 | 47 | ||
48 | <!-- Fragmento Configuraciones--> | 48 | <!-- Fragmento Configuraciones--> |
49 | <string name="tvTituloConf">Configuraciones</string> | 49 | <string name="tvTituloConf">Configuraciones</string> |
50 | <string name="tvSeleccioneServidor">Seleccione un Servidor</string> | 50 | <string name="tvSeleccioneServidor">Seleccione un Servidor</string> |
51 | <string name="btnValidarServidor">Validar</string> | 51 | <string name="btnValidarServidor">Validar</string> |
52 | <string name="btnAgregarServidor">Agregar un nuevo servidor</string> | 52 | <string name="btnAgregarServidor">Agregar un nuevo servidor</string> |
53 | <string name="tvUbicacionCarpetas">Ubicación de las carpetas de uso interno</string> | 53 | <string name="tvUbicacionCarpetas">Ubicación de las carpetas de uso interno</string> |
54 | <string name="tvTituloArea">Area de Invetnario</string> | 54 | <string name="tvTituloArea">Area de Invetnario</string> |
55 | <string name="rbVentas">Inventarios de Ventas</string> | 55 | <string name="rbVentas">Inventarios de Ventas</string> |
56 | <string name="rbDeposito">Inventarios de Depositos</string> | 56 | <string name="rbDeposito">Inventarios de Depositos</string> |
57 | <string name="tvLosProductos">Los productos no contabilizados en Inventarios</string> | 57 | <string name="tvLosProductos">Los productos no contabilizados en Inventarios</string> |
58 | <string name="tvColumnas">Columnas a Visualizar</string> | 58 | <string name="tvColumnas">Columnas a Visualizar</string> |
59 | 59 | ||
60 | <string name="rbProInclu">Solo se ajustan los productos incluidos en el conteo.</string> | 60 | <string name="rbProInclu">Solo se ajustan los productos incluidos en el conteo.</string> |
61 | <string name="rbProNoInclu">Ajusta productos no incluidos en el conteo con stock en cero.</string> | 61 | <string name="rbProNoInclu">Ajusta productos no incluidos en el conteo con stock en cero.</string> |
62 | 62 | ||
63 | <string name="cbMostrarStock">Mostror stock en el sistema al momento de la descarga del maestro.</string> | 63 | <string name="cbMostrarStock">Mostror stock en el sistema al momento de la descarga del maestro.</string> |
64 | <string name="cbHabiLectura">Habilitar Lectura de codigo de barras en balanza.</string> | 64 | <string name="cbHabiLectura">Habilitar Lectura de codigo de barras en balanza.</string> |
65 | 65 | ||
66 | <string name="tvColumMostrar">Columnas a mostrar en inventario</string> | 66 | <string name="tvColumMostrar">Columnas a mostrar en inventario</string> |
67 | 67 | ||
68 | <string name="rbCodigoDebo">Código DEBO</string> | 68 | <string name="rbCodigoDebo">Código DEBO</string> |
69 | <string name="rbCodigoOrigen">Código Origen</string> | 69 | <string name="rbCodigoOrigen">Código Origen</string> |
70 | <string name="rbCodigoBarras">Código de Barras</string> | 70 | <string name="rbCodigoBarras">Código de Barras</string> |
71 | 71 | ||
72 | 72 | ||
73 | <!-- Spinner servidor--> | 73 | <!-- Spinner servidor--> |
74 | <string-array name="spinnerServidor"> | 74 | <string-array name="spinnerServidor"> |
75 | <item>Servidor Laboratorio 1</item> | 75 | <item>Servidor Laboratorio 1</item> |
76 | <item>Servidor Laboratorio 2</item> | 76 | <item>Servidor Laboratorio 2</item> |
77 | <item>Servidor Laboratorio 3</item> | 77 | <item>Servidor Laboratorio 3</item> |
78 | </string-array> | 78 | </string-array> |
79 | <string name="leyendaSpinner">Seleccione Servidor Predeterminado</string> | 79 | <string name="leyendaSpinner">Seleccione Servidor Predeterminado</string> |
80 | 80 | ||
81 | <string name="cbMostrarExistencia">Existencia</string> | 81 | <string name="cbMostrarExistencia">Existencia</string> |
82 | <string name="cbMostrarPrecio">Precio</string> | 82 | <string name="cbMostrarPrecio">Precio</string> |
83 | 83 | ||
84 | <string name="btnGuardar">Guardar Cambios</string> | 84 | <string name="btnGuardar">Guardar Cambios</string> |
85 | 85 | ||
86 | <!-- fragment Actualizacion de Maestros--> | 86 | <!-- fragment Actualizacion de Maestros--> |
87 | <string name="tvActMaestros">Importaciones</string> | 87 | <string name="tvActMaestros">Importaciones</string> |
88 | <string name="tvMedio">Seleccione que tipo de importación desea realizar</string> | 88 | <string name="tvMedio">Seleccione que tipo de importación desea realizar</string> |
89 | <string name="obPorWifi">Importación de artículos</string> | 89 | <string name="obPorWifi">Importación de artículos</string> |
90 | <string name="obViaArchivo">Importación de inventarios</string> | 90 | <string name="obViaArchivo">Importación de inventarios</string> |
91 | 91 | ||
92 | <string name="btnConfirmarAct">Confirmar Importación</string> | 92 | <string name="btnConfirmarAct">Confirmar Importación</string> |
93 | 93 | ||
94 | <!-- Fragment Save--> | 94 | <!-- Fragment Save--> |
95 | <string name="tvConfServi">Configuración de Servidores</string> | 95 | <string name="tvConfServi">Configuración de Servidores</string> |
96 | <string name="server">Ingrese la direccion del servidor</string> | 96 | <string name="server">Ingrese la direccion del servidor</string> |
97 | <string name="etNomServer">Ingrese una descripción para la conexión</string> | 97 | <string name="etNomServer">Ingrese una descripción para la conexión</string> |
98 | <string name="btnGuardarConfServ">Guardar Conexión</string> | 98 | <string name="btnGuardarConfServ">Guardar Conexión</string> |
99 | 99 | ||
100 | <!-- Dialog--> | 100 | <!-- Dialog--> |
101 | <string name="sTitulo">Producto Buscado</string> | 101 | <string name="sTitulo">Producto Buscado</string> |
102 | <string name="btnOk">Aceptar</string> | 102 | <string name="btnOk">Aceptar</string> |
103 | <string name="btnConfirmar">Confirmar</string> | ||
103 | <string name="btnCancelar">Cancelar</string> | 104 | <string name="btnCancelar">Cancelar</string> |
104 | <string name="sMensaje">¡No se encontro el producto ingresado!</string> | 105 | <string name="sMensaje">¡No se encontro el producto ingresado!</string> |
105 | <string name="sMensajeEncontrado">¡Ingrese nueva cantidad!</string> | 106 | <string name="sMensajeEncontrado">¡Ingrese nueva cantidad!</string> |
106 | <string name="sTituloNueva">Producto ingresado esta cargado</string> | 107 | <string name="sTituloNueva">Producto ingresado esta cargado</string> |
107 | <string name="sCantidadNueva">¡Por favor ingrese la nueva Cantidad!</string> | 108 | <string name="sCantidadNueva">¡Por favor ingrese la nueva Cantidad!</string> |
108 | 109 | ||
109 | <string name="sMensajeExportar">¡Confirma que exporta el Inventario!</string> | 110 | <string name="sMensajeExportar">¡Confirma que exporta el Inventario!</string> |
110 | <string name="sTituloExportar">Exportación de Inventarios</string> | 111 | <string name="sTituloExportar">Exportación de Inventarios</string> |
111 | 112 | ||
112 | <!-- FRAGMENT SERVIDOR--> | 113 | <!-- FRAGMENT SERVIDOR--> |
113 | <string name="tvTitutloServer">Alta de Servidores</string> | 114 | <string name="tvTitutloServer">Alta de Servidores</string> |
114 | <string name="tvNomServer">Descripción para identificar al servidor</string> | 115 | <string name="tvNomServer">Descripción para identificar al servidor</string> |
115 | <string name="tvDirServer">Dirección del servidor</string> | 116 | <string name="tvDirServer">Dirección del servidor</string> |
116 | <string name="btnGuardarServidores">Guardar Servidor</string> | 117 | <string name="btnGuardarServidores">Guardar Servidor</string> |
117 | 118 | ||
118 | <string name="tvSeleccion">Toque sobre la operación que desea realizar</string> | 119 | <string name="tvSeleccion">Toque sobre la operación que desea realizar</string> |
119 | <string name="rbSumar">Sumar</string> | 120 | <string name="rbSumar">Sumar</string> |
120 | <string name="rbRestar">Restar</string> | 121 | <string name="rbRestar">Restar</string> |
121 | <string name="rbModificar">Reemplazar</string> | 122 | <string name="rbModificar">Reemplazar</string> |
122 | <string name="tvTotal">Cantidad Final</string>tvTotal | 123 | <string name="tvTotal">Cantidad Final</string>tvTotal |
123 | <string name="tvResultado">Resultado:</string>tvTotal | 124 | <string name="tvResultado">Resultado:</string>tvTotal |
124 | 125 | ||
125 | <string name="large_text"> | 126 | <string name="large_text"> |
126 | "Material is the metaphor.\n\n" | 127 | "Material is the metaphor.\n\n" |
127 | 128 | ||
128 | "A material metaphor is the unifying theory of a rationalized space and a system of motion." | 129 | "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 " | 130 | "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" | 131 | "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 " | 132 | "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 " | 133 | "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 " | 134 | "flexibility of the material creates new affordances that supercede those in the physical " |
134 | "world, without breaking the rules of physics.\n" | 135 | "world, without breaking the rules of physics.\n" |
135 | "The fundamentals of light, surface, and movement are key to conveying how objects move, " | 136 | "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 " | 137 | "interact, and exist in space and in relation to each other. Realistic lighting shows " |
137 | "seams, divides space, and indicates moving parts.\n\n" | 138 | "seams, divides space, and indicates moving parts.\n\n" |
138 | 139 | ||
139 | "Bold, graphic, intentional.\n\n" | 140 | "Bold, graphic, intentional.\n\n" |
140 | 141 | ||
141 | "The foundational elements of print based design typography, grids, space, scale, color, " | 142 | "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 " | 143 | "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 " | 144 | "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 " | 145 | "imagery, large scale typography, and intentional white space create a bold and graphic " |
145 | "interface that immerse the user in the experience.\n" | 146 | "interface that immerse the user in the experience.\n" |
146 | "An emphasis on user actions makes core functionality immediately apparent and provides " | 147 | "An emphasis on user actions makes core functionality immediately apparent and provides " |
147 | "waypoints for the user.\n\n" | 148 | "waypoints for the user.\n\n" |
148 | 149 | ||
149 | "Motion provides meaning.\n\n" | 150 | "Motion provides meaning.\n\n" |
150 | 151 | ||
151 | "Motion respects and reinforces the user as the prime mover. Primary user actions are " | 152 | "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" | 153 | "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 " | 154 | "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" | 155 | "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. " | 156 | "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" | 157 | "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n" |
157 | 158 | ||
158 | "3D world.\n\n" | 159 | "3D world.\n\n" |
159 | 160 | ||
160 | "The material environment is a 3D space, which means all objects have x, y, and z " | 161 | "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 " | 162 | "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 " | 163 | "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" | 164 | "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 " | 165 | "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" | 166 | "emulated by manipulating the y-axis.\n\n" |
166 | 167 | ||
167 | "Light and shadow.\n\n" | 168 | "Light and shadow.\n\n" |
168 | 169 | ||
169 | "Within the material environment, virtual lights illuminate the scene. Key lights create " | 170 | "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" | 171 | "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 " | 172 | "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 " | 173 | "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 " | 174 | "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" | 175 | "y-axis only. The following example shows the card with a height of 6dp.\n\n" |
175 | 176 | ||
176 | "Resting elevation.\n\n" | 177 | "Resting elevation.\n\n" |
177 | 178 | ||
178 | "All material objects, regardless of size, have a resting elevation, or default elevation " | 179 | "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 " | 180 | "that does not change. If an object changes elevation, it should return to its resting " |
180 | "elevation as soon as possible.\n\n" | 181 | "elevation as soon as possible.\n\n" |
181 | 182 | ||
182 | "Component elevations.\n\n" | 183 | "Component elevations.\n\n" |
183 | 184 | ||
184 | "The resting elevation for a component type is consistent across apps (e.g., FAB elevation " | 185 | "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" | 186 | "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 " | 187 | "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" | 188 | "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n" |
188 | 189 | ||
189 | "Responsive elevation and dynamic elevation offsets.\n\n" | 190 | "Responsive elevation and dynamic elevation offsets.\n\n" |
190 | 191 | ||
191 | "Some component types have responsive elevation, meaning they change elevation in response " | 192 | "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 " | 193 | "to user input (e.g., normal, focused, and pressed) or system events. These elevation " |
193 | "changes are consistently implemented using dynamic elevation offsets.\n" | 194 | "changes are consistently implemented using dynamic elevation offsets.\n" |
194 | "Dynamic elevation offsets are the goal elevation that a component moves towards, relative " | 195 | "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 " | 196 | "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 " | 197 | "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" | 198 | "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 " | 199 | "Once the input event is completed or cancelled, the component will return to its resting " |
199 | "elevation.\n\n" | 200 | "elevation.\n\n" |
200 | 201 | ||
201 | "Avoiding elevation interference.\n\n" | 202 | "Avoiding elevation interference.\n\n" |
202 | 203 | ||
203 | "Components with responsive elevations may encounter other components as they move between " | 204 | "Components with responsive elevations may encounter other components as they move between " |
204 | "their resting elevations and dynamic elevation offsets. Because material cannot pass " | 205 | "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, " | 206 | "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" | 207 | "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. " | 208 | "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 " | 209 | "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" | 210 | "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. " | 211 | "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 " | 212 | "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" | 213 | "when a user tries to pick up one of cards.\n\n" |
213 | </string> | 214 | </string> |
214 | </resources> | 215 | </resources> |