Commit 23f89b25e16d24bb2c1e6326896d073308794dc6
1 parent
d60eae7d0b
Exists in
master
21082020 2313
Showing
30 changed files
with
697 additions
and
458 deletions
Show diff stats
app/src/main/java/com/focasoftware/deboinventariov20/DB/DAO/ArticulosDAO.kt
| 1 | package com.focasoftware.deboinventariov20.DB.DAO | 1 | package com.focasoftware.deboinventariov20.DB.DAO |
| 2 | 2 | ||
| 3 | import androidx.room.* | 3 | import androidx.room.* |
| 4 | import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_ART | 4 | import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_ART |
| 5 | import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_INV_B | 5 | import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_INV_B |
| 6 | import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_INV_H | 6 | import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_INV_H |
| 7 | import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_SERV_INV | ||
| 7 | import com.focasoftware.deboinventariov20.Model.* | 8 | import com.focasoftware.deboinventariov20.Model.* |
| 8 | 9 | ||
| 9 | @Dao | 10 | @Dao |
| 10 | interface ArticulosDAO { | 11 | interface ArticulosDAO { |
| 11 | 12 | ||
| 12 | // TABLA ARTICULOS | 13 | // TABLA ARTICULOS |
| 13 | @Insert(onConflict = OnConflictStrategy.REPLACE) | 14 | @Insert(onConflict = OnConflictStrategy.REPLACE) |
| 14 | suspend fun insertArticulos(articulos: Articles?) | 15 | suspend fun insertArticulos(articulos: Articles?) |
| 15 | 16 | ||
| 16 | @Query("SELECT * FROM $TABLA_ART ORDER BY DES DESC") | 17 | @Query("SELECT * FROM $TABLA_ART ORDER BY DES DESC") |
| 17 | suspend fun findAllArticulos(): List<Articles> | 18 | suspend fun findAllArticulos(): List<Articles> |
| 18 | 19 | ||
| 19 | @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND DES LIKE '%' || :description || '%' GROUP BY DES ORDER BY SEC, COD") | 20 | @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND DES LIKE '%' || :description || '%' GROUP BY DES ORDER BY DES") |
| 20 | suspend fun findArticuloByDesc(description: String?, dep: Int): List<Articles> | 21 | suspend fun findArticuloByDesc(description: String?, dep: Int): List<Articles> |
| 21 | 22 | ||
| 22 | @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND CB LIKE :codBarra") | 23 | @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND CB LIKE :codBarra") |
| 23 | suspend fun findArticuloByCodBar(codBarra: String?, dep: Int): Articles? | 24 | suspend fun findArticuloByCodBar(codBarra: String?, dep: Int): Articles? |
| 24 | 25 | ||
| 25 | @Query("DELETE FROM $TABLA_ART") | 26 | @Query("DELETE FROM $TABLA_ART") |
| 26 | suspend fun deleteAllArticulos() | 27 | suspend fun deleteAllArticulos() |
| 27 | } | 28 | } |
| 28 | 29 | ||
| 29 | @Dao | 30 | @Dao |
| 30 | interface InvHeadDAO { | 31 | interface InvHeadDAO { |
| 31 | @Insert() | 32 | @Insert() |
| 32 | suspend fun insertInvHead(invHead: InvHead?) | 33 | suspend fun insertInvHead(invHead: InvHead?) |
| 33 | 34 | ||
| 34 | @Query("SELECT INV_NUM FROM $TABLA_INV_H ORDER BY INV_NUM DESC") | 35 | @Query("SELECT INV_NUM FROM $TABLA_INV_H ORDER BY INV_NUM DESC") |
| 35 | suspend fun findLastInv(): Int | 36 | suspend fun findLastInv(): Int |
| 36 | 37 | ||
| 37 | @Query("DELETE FROM $TABLA_INV_H") | 38 | @Query("DELETE FROM $TABLA_INV_H") |
| 38 | suspend fun deleteAllArticulos() | 39 | suspend fun deleteAllArticulos() |
| 39 | 40 | ||
| 40 | @Query("DELETE FROM $TABLA_INV_H WHERE INV_NUM=:inven") | 41 | @Query("DELETE FROM $TABLA_INV_H WHERE INV_NUM=:inven") |
| 41 | suspend fun deleteinvHead(inven: Int) | 42 | suspend fun deleteinvHead(inven: Int) |
| 42 | 43 | ||
| 43 | @Query("SELECT * FROM $TABLA_INV_H ORDER BY INV_FEI") | 44 | @Query("SELECT * FROM $TABLA_INV_H ORDER BY INV_FEI") |
| 44 | suspend fun fetchAllInvHead(): List<InvHead> | 45 | suspend fun fetchAllInvHead(): List<InvHead> |
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | @Dao | 48 | @Dao |
| 48 | interface InvBodyDAO { | 49 | interface InvBodyDAO { |
| 49 | @Insert() | 50 | @Insert() |
| 50 | suspend fun insertInvBody(invBody: InvBody?) | 51 | suspend fun insertInvBody(invBody: InvBody?) |
| 51 | 52 | ||
| 52 | @Query("DELETE FROM $TABLA_INV_B") | 53 | @Query("DELETE FROM $TABLA_INV_B") |
| 53 | suspend fun deleteAllInvBody() | 54 | suspend fun deleteAllInvBody() |
| 54 | 55 | ||
| 55 | @Query("DELETE FROM $TABLA_INV_B WHERE INV_NUM =:inven") | 56 | @Query("DELETE FROM $TABLA_INV_B WHERE INV_NUM =:inven") |
| 56 | suspend fun deleteInvBody(inven: Int) | 57 | suspend fun deleteInvBody(inven: Int) |
| 57 | 58 | ||
| 58 | @Query("UPDATE $TABLA_INV_B SET CANT=:cant WHERE SEC=:sec AND COD=:cod") | 59 | @Query("UPDATE $TABLA_INV_B SET CANT=:cant WHERE SEC=:sec AND COD=:cod") |
| 59 | suspend fun UpdateInvBody(cant: Float, sec: String, cod: String) | 60 | suspend fun UpdateInvBody(cant: Float, sec: String, cod: String) |
| 60 | 61 | ||
| 61 | @Query("SELECT * FROM $TABLA_INV_B WHERE INV_NUM =:inven ORDER BY INV_FEI DESC") | 62 | @Query("SELECT * FROM $TABLA_INV_B WHERE INV_NUM =:inven ORDER BY INV_FEI DESC") |
| 62 | suspend fun fetchAllInvBody(inven:Int): List<InvBody> | 63 | suspend fun fetchAllInvBody(inven:Int): List<InvBody> |
| 63 | } | 64 | } |
| 64 | @Dao | 65 | @Dao |
| 65 | interface ServeInvDao { | 66 | interface ServeInvDao { |
| 66 | @Insert(onConflict = OnConflictStrategy.REPLACE) | 67 | @Insert(onConflict = OnConflictStrategy.REPLACE) |
| 67 | fun insertServer(servidor: ServeInv) | 68 | fun insertServer(servidor: ServeInv) |
| 68 | 69 | ||
| 69 | @Query("SELECT SER_NUM,SER_DESC, SER_DIR FROM ServeInv") | 70 | @Query("SELECT SER_NUM,SER_DESC, SER_DIR FROM $TABLA_SERV_INV") |
| 70 | suspend fun findAllServers(): List<ServeInv> | 71 | suspend fun fetchAllServers(): List<ServeInv> |
| 72 | |||
| 73 | @Query("DELETE FROM ServeInv WHERE SER_NUM = :number") | ||
| 74 | suspend fun deleteServer(number: Long) | ||
| 71 | } | 75 | } |
app/src/main/java/com/focasoftware/deboinventariov20/ui/descripcionFragment/DescripcionFragment.kt
| File was created | 1 | package com.focasoftware.deboinventariov20.ui.descripcionFragment | |
| 2 | |||
| 3 | import android.content.Context | ||
| 4 | import android.content.SharedPreferences | ||
| 5 | import android.graphics.Canvas | ||
| 6 | import android.graphics.Color | ||
| 7 | import android.graphics.drawable.ColorDrawable | ||
| 8 | import android.os.Bundle | ||
| 9 | import android.view.LayoutInflater | ||
| 10 | import android.view.View | ||
| 11 | import android.view.ViewGroup | ||
| 12 | import android.widget.Button | ||
| 13 | import androidx.fragment.app.Fragment | ||
| 14 | import androidx.lifecycle.lifecycleScope | ||
| 15 | import androidx.navigation.NavController | ||
| 16 | import androidx.navigation.Navigation | ||
| 17 | import androidx.recyclerview.widget.ItemTouchHelper | ||
| 18 | import androidx.recyclerview.widget.LinearLayoutManager | ||
| 19 | import androidx.recyclerview.widget.RecyclerView | ||
| 20 | import com.afollestad.materialdialogs.MaterialDialog | ||
| 21 | import com.afollestad.materialdialogs.input.input | ||
| 22 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | ||
| 23 | import com.focasoftware.deboinventariov20.Model.Articles | ||
| 24 | import com.focasoftware.deboinventariov20.Model.InvBody | ||
| 25 | import com.focasoftware.deboinventariov20.R | ||
| 26 | import com.focasoftware.deboinventariov20.ui.inventario.InventarioFragment | ||
| 27 | import kotlinx.coroutines.Dispatchers | ||
| 28 | import kotlinx.coroutines.launch | ||
| 29 | import kotlinx.coroutines.withContext | ||
| 30 | |||
| 31 | class DescripcionFragment : Fragment() { | ||
| 32 | private var artAcargar2: List<Articles>? = null | ||
| 33 | private var listArticulos2: List<Articles>? = null | ||
| 34 | lateinit var viewAdapter2: RecyclerView.Adapter<*> | ||
| 35 | private lateinit var viewManager2: RecyclerView.LayoutManager | ||
| 36 | private lateinit var rcDescripcion: RecyclerView | ||
| 37 | private var swipeBackground: ColorDrawable = ColorDrawable(Color.YELLOW) | ||
| 38 | private var cantidad = 0F | ||
| 39 | private var numeroInventario = 0 | ||
| 40 | lateinit var navController: NavController | ||
| 41 | lateinit var sharedPreferences: SharedPreferences | ||
| 42 | |||
| 43 | override fun onCreate(savedInstanceState: Bundle?) { | ||
| 44 | super.onCreate(savedInstanceState) | ||
| 45 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | ||
| 46 | arguments.apply { | ||
| 47 | artAcargar2 = requireArguments().getSerializable("ArrayDesc") as List<Articles> | ||
| 48 | numeroInventario = requireArguments().getInt("numeroInv") | ||
| 49 | } | ||
| 50 | } | ||
| 51 | |||
| 52 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
| 53 | super.onViewCreated(view, savedInstanceState) | ||
| 54 | navController = Navigation.findNavController(view) | ||
| 55 | } | ||
| 56 | |||
| 57 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
| 58 | // Inflate the layout for this fragment | ||
| 59 | val v = inflater.inflate(R.layout.fragment_descripcion, container, false) | ||
| 60 | rcDescripcion = v.findViewById(R.id.rcDescripcion) | ||
| 61 | val btnSalir = v.findViewById<Button>(R.id.btnSalir) | ||
| 62 | |||
| 63 | IngresarRecicler(artAcargar2) | ||
| 64 | |||
| 65 | btnSalir.setOnClickListener { | ||
| 66 | VolverAinventario() | ||
| 67 | } | ||
| 68 | return v | ||
| 69 | } | ||
| 70 | |||
| 71 | fun IngresarRecicler(articulos: List<Articles>?) { | ||
| 72 | |||
| 73 | viewAdapter2 = DescripcionListAdapter(articulos) | ||
| 74 | viewManager2 = LinearLayoutManager(requireContext()) | ||
| 75 | |||
| 76 | rcDescripcion.apply { | ||
| 77 | adapter = viewAdapter2 | ||
| 78 | layoutManager = viewManager2 | ||
| 79 | } | ||
| 80 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT or ItemTouchHelper.RIGHT) { | ||
| 81 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { | ||
| 82 | return false | ||
| 83 | } | ||
| 84 | |||
| 85 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) { | ||
| 86 | MaterialDialog(requireContext()).show { | ||
| 87 | title(R.string.sTitulo) | ||
| 88 | message(R.string.sMensajeEncontrado) | ||
| 89 | input { materialDialog, charSequence -> | ||
| 90 | cantidad = 0F | ||
| 91 | cantidad = charSequence.toString().toFloat() | ||
| 92 | } | ||
| 93 | // .input("Cantidad",1,,1,0,InputType.TYPE_CLASS_NUMBER,0,waitForPositiveButton = true,false,positiveButton ()) | ||
| 94 | positiveButton(R.string.btnOk) { | ||
| 95 | dismiss() | ||
| 96 | var indice = 0 | ||
| 97 | indice=viewHolder.layoutPosition | ||
| 98 | |||
| 99 | val body = InvBody(numeroInventario, | ||
| 100 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.sector, | ||
| 101 | // TODO PREPARO PARA MANDAR A CARGAR EN LA BD | ||
| 102 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.codigo, | ||
| 103 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.descripcion, | ||
| 104 | cantidad.toString(), | ||
| 105 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.codBar, | ||
| 106 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.codOrigen, | ||
| 107 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.precio, | ||
| 108 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.precio, | ||
| 109 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.balanza, | ||
| 110 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.depSn, | ||
| 111 | InventarioFragment().ObtenerFechaActual(), | ||
| 112 | InventarioFragment().ObtenerFechaActual()) | ||
| 113 | InsertarArtEnDB(body)// TODO: MANDO A CARGAR A LA BASE DE DATOS | ||
| 114 | VolverAinventario() | ||
| 115 | } | ||
| 116 | }.cancelOnTouchOutside(false).cornerRadius(10F) | ||
| 117 | } | ||
| 118 | |||
| 119 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { | ||
| 120 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | ||
| 121 | val itemView = viewHolder.itemView | ||
| 122 | |||
| 123 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) | ||
| 124 | |||
| 125 | if (dX > 0) { | ||
| 126 | |||
| 127 | c.drawColor(Color.RED) | ||
| 128 | } else if (dX < 0) { | ||
| 129 | // swipeBackground.setBounds(itemView.right+dX.toInt(),itemView.top,itemView.right,itemView.bottom) | ||
| 130 | c.drawColor(Color.YELLOW) | ||
| 131 | } | ||
| 132 | swipeBackground.draw(c) | ||
| 133 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | ||
| 134 | } | ||
| 135 | } | ||
| 136 | val itemTouchHelper2 = ItemTouchHelper(itemTouchHelperCallback) | ||
| 137 | itemTouchHelper2.attachToRecyclerView(rcDescripcion) | ||
| 138 | |||
| 139 | } | ||
| 140 | |||
| 141 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { | ||
| 142 | lifecycleScope.launch { | ||
| 143 | withContext(Dispatchers.IO) { | ||
| 144 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) | ||
| 145 | } | ||
| 146 | } | ||
| 147 | } | ||
| 148 | fun VolverAinventario(){ | ||
| 149 | |||
| 150 | val editor = sharedPreferences.edit() | ||
| 151 | editor?.putString("Inventario", numeroInventario.toString()) | ||
| 152 | editor?.apply() | ||
| 153 | editor.commit() | ||
| 154 | navController.navigate(R.id.action_descripcionFragment_to_inventarioFragment) | ||
| 155 | } | ||
| 156 | } | ||
| 157 | |||
| 158 |
app/src/main/java/com/focasoftware/deboinventariov20/ui/descripcionFragment/DescripcionListAdapter.kt
| File was created | 1 | package com.focasoftware.deboinventariov20.ui.descripcionFragment | |
| 2 | |||
| 3 | import android.view.LayoutInflater | ||
| 4 | import android.view.View | ||
| 5 | import android.view.ViewGroup | ||
| 6 | import androidx.recyclerview.widget.RecyclerView | ||
| 7 | import com.focasoftware.deboinventariov20.Model.Articles | ||
| 8 | import com.focasoftware.deboinventariov20.R | ||
| 9 | import kotlinx.android.synthetic.main.item.view.* | ||
| 10 | |||
| 11 | class DescripcionListAdapter(private val productos: List<Articles>?) : | ||
| 12 | RecyclerView.Adapter<DescripcionListAdapter.ItemsViewHolder>() { | ||
| 13 | internal var items2: List<Articles>? = null | ||
| 14 | |||
| 15 | init { | ||
| 16 | this.items2 = productos | ||
| 17 | } | ||
| 18 | |||
| 19 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder( | ||
| 20 | LayoutInflater.from(parent.context).inflate(R.layout.item_descripcion, parent, false) | ||
| 21 | ) | ||
| 22 | |||
| 23 | override fun getItemCount() = productos!!.size | ||
| 24 | |||
| 25 | override fun onBindViewHolder(holder: ItemsViewHolder, position: Int) { | ||
| 26 | when (holder) { | ||
| 27 | is ItemsViewHolder -> { | ||
| 28 | holder.bind(items2!![position]) | ||
| 29 | } | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | |||
| 34 | class ItemsViewHolder constructor(view: View) : RecyclerView.ViewHolder(view) { | ||
| 35 | |||
| 36 | val sector = view.tvSector | ||
| 37 | val codigo = view.tvCodigo | ||
| 38 | val descripcion = view.tvDescripcion | ||
| 39 | val codigoBarras = view.tvCodigoBarras | ||
| 40 | |||
| 41 | fun bind(pro: Articles) { | ||
| 42 | sector.text = pro.sector | ||
| 43 | codigo.text = pro.codigo | ||
| 44 | descripcion.text = pro.descripcion | ||
| 45 | codigoBarras.text = pro.codBar | ||
| 46 | } | ||
| 47 | } | ||
| 48 | } |
app/src/main/java/com/focasoftware/deboinventariov20/ui/descripcionFragment/ItemDescripcion.kt
| File was created | 1 | package com.focasoftware.deboinventariov20.ui.descripcionFragment | |
| 2 | |||
| 3 | data class ItemDescripcion(val sector: String?,val codigo: String?, val descripcion: String?, val codigoBarras: String?) |
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/BaseFragment.kt
| 1 | package com.focasoftware.deboinventariov20.ui.inventario | File was deleted | |
| 2 | |||
| 3 | import android.os.Bundle | ||
| 4 | import androidx.fragment.app.Fragment | ||
| 5 | import kotlinx.coroutines.CoroutineScope | ||
| 6 | import kotlinx.coroutines.Dispatchers | ||
| 7 | import kotlinx.coroutines.Job | ||
| 8 | import kotlin.coroutines.CoroutineContext | ||
| 9 | |||
| 10 | abstract class BaseFragment : Fragment(), CoroutineScope { | ||
| 11 | |||
| 12 | |||
| 13 | lateinit var job: Job | ||
| 14 | |||
| 15 | override val coroutineContext: CoroutineContext | ||
| 16 | get() = job + Dispatchers.Main | ||
| 17 | |||
| 18 | override fun onCreate(savedInstanceState: Bundle?) { | ||
| 19 | super.onCreate(savedInstanceState) | ||
| 20 | job = Job() | ||
| 21 | } | ||
| 22 | |||
| 23 | override fun onDestroy() { | ||
| 24 | super.onDestroy() | ||
| 25 | job.cancel() | ||
| 26 | } | ||
| 27 | |||
| 28 | |||
| 29 | } |
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/DescripcionFragment.kt
| 1 | package com.focasoftware.deboinventariov20.ui.inventario | File was deleted | |
| 2 | |||
| 3 | import android.content.Context | ||
| 4 | import android.content.SharedPreferences | ||
| 5 | import android.graphics.Canvas | ||
| 6 | import android.graphics.Color | ||
| 7 | import android.graphics.drawable.ColorDrawable | ||
| 8 | import android.os.Bundle | ||
| 9 | import android.view.LayoutInflater | ||
| 10 | import android.view.View | ||
| 11 | import android.view.ViewGroup | ||
| 12 | import android.widget.Button | ||
| 13 | import androidx.fragment.app.Fragment | ||
| 14 | import androidx.lifecycle.lifecycleScope | ||
| 15 | import androidx.navigation.NavController | ||
| 16 | import androidx.navigation.Navigation | ||
| 17 | import androidx.recyclerview.widget.ItemTouchHelper | ||
| 18 | import androidx.recyclerview.widget.LinearLayoutManager | ||
| 19 | import androidx.recyclerview.widget.RecyclerView | ||
| 20 | import com.afollestad.materialdialogs.MaterialDialog | ||
| 21 | import com.afollestad.materialdialogs.input.input | ||
| 22 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | ||
| 23 | import com.focasoftware.deboinventariov20.Model.Articles | ||
| 24 | import com.focasoftware.deboinventariov20.Model.InvBody | ||
| 25 | import com.focasoftware.deboinventariov20.R | ||
| 26 | import kotlinx.coroutines.Dispatchers | ||
| 27 | import kotlinx.coroutines.launch | ||
| 28 | import kotlinx.coroutines.withContext | ||
| 29 | |||
| 30 | class DescripcionFragment : Fragment() { | ||
| 31 | private var artAcargar2: List<Articles>? = null | ||
| 32 | private var listArticulos2: List<Articles>? = null | ||
| 33 | lateinit var viewAdapter2: RecyclerView.Adapter<*> | ||
| 34 | private lateinit var viewManager2: RecyclerView.LayoutManager | ||
| 35 | private lateinit var rcDescripcion: RecyclerView | ||
| 36 | private var swipeBackground: ColorDrawable = ColorDrawable(Color.YELLOW) | ||
| 37 | private var cantidad = 0F | ||
| 38 | private var numeroInventario = 0 | ||
| 39 | lateinit var navController: NavController | ||
| 40 | lateinit var sharedPreferences: SharedPreferences | ||
| 41 | |||
| 42 | override fun onCreate(savedInstanceState: Bundle?) { | ||
| 43 | super.onCreate(savedInstanceState) | ||
| 44 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | ||
| 45 | arguments.apply { | ||
| 46 | artAcargar2 = requireArguments().getSerializable("ArrayDesc") as List<Articles> | ||
| 47 | numeroInventario = requireArguments().getInt("numeroInv") | ||
| 48 | } | ||
| 49 | } | ||
| 50 | |||
| 51 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
| 52 | super.onViewCreated(view, savedInstanceState) | ||
| 53 | navController = Navigation.findNavController(view) | ||
| 54 | } | ||
| 55 | |||
| 56 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
| 57 | // Inflate the layout for this fragment | ||
| 58 | val v = inflater.inflate(R.layout.fragment_descripcion, container, false) | ||
| 59 | rcDescripcion = v.findViewById(R.id.rcDescripcion) | ||
| 60 | val btnSalir = v.findViewById<Button>(R.id.btnSalir) | ||
| 61 | |||
| 62 | IngresarRecicler(artAcargar2) | ||
| 63 | |||
| 64 | btnSalir.setOnClickListener { | ||
| 65 | VolverAinventario() | ||
| 66 | } | ||
| 67 | return v | ||
| 68 | } | ||
| 69 | |||
| 70 | fun IngresarRecicler(articulos: List<Articles>?) { | ||
| 71 | |||
| 72 | viewAdapter2 = DescripcionListAdapter(articulos) | ||
| 73 | viewManager2 = LinearLayoutManager(requireContext()) | ||
| 74 | |||
| 75 | rcDescripcion.apply { | ||
| 76 | adapter = viewAdapter2 | ||
| 77 | layoutManager = viewManager2 | ||
| 78 | } | ||
| 79 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT or ItemTouchHelper.RIGHT) { | ||
| 80 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { | ||
| 81 | return false | ||
| 82 | } | ||
| 83 | |||
| 84 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) { | ||
| 85 | MaterialDialog(requireContext()).show { | ||
| 86 | title(R.string.sTitulo) | ||
| 87 | message(R.string.sMensajeEncontrado) | ||
| 88 | input { materialDialog, charSequence -> | ||
| 89 | cantidad = 0F | ||
| 90 | cantidad = charSequence.toString().toFloat() | ||
| 91 | } | ||
| 92 | // .input("Cantidad",1,,1,0,InputType.TYPE_CLASS_NUMBER,0,waitForPositiveButton = true,false,positiveButton ()) | ||
| 93 | positiveButton(R.string.btnOk) { | ||
| 94 | dismiss() | ||
| 95 | var indice = 0 | ||
| 96 | indice=viewHolder.layoutPosition | ||
| 97 | |||
| 98 | val body = InvBody(numeroInventario, | ||
| 99 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.sector, | ||
| 100 | // TODO PREPARO PARA MANDAR A CARGAR EN LA BD | ||
| 101 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.codigo, | ||
| 102 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.descripcion, | ||
| 103 | cantidad.toString(), | ||
| 104 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.codBar, | ||
| 105 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.codOrigen, | ||
| 106 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.precio, | ||
| 107 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.precio, | ||
| 108 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.balanza, | ||
| 109 | (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.depSn, | ||
| 110 | InventarioFragment().ObtenerFechaActual(), | ||
| 111 | InventarioFragment().ObtenerFechaActual()) | ||
| 112 | InsertarArtEnDB(body)// TODO: MANDO A CARGAR A LA BASE DE DATOS | ||
| 113 | VolverAinventario() | ||
| 114 | } | ||
| 115 | }.cancelOnTouchOutside(false).cornerRadius(10F) | ||
| 116 | } | ||
| 117 | |||
| 118 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { | ||
| 119 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | ||
| 120 | val itemView = viewHolder.itemView | ||
| 121 | |||
| 122 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) | ||
| 123 | |||
| 124 | if (dX > 0) { | ||
| 125 | |||
| 126 | c.drawColor(Color.RED) | ||
| 127 | } else if (dX < 0) { | ||
| 128 | // swipeBackground.setBounds(itemView.right+dX.toInt(),itemView.top,itemView.right,itemView.bottom) | ||
| 129 | c.drawColor(Color.YELLOW) | ||
| 130 | } | ||
| 131 | swipeBackground.draw(c) | ||
| 132 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | ||
| 133 | } | ||
| 134 | } | ||
| 135 | val itemTouchHelper2 = ItemTouchHelper(itemTouchHelperCallback) | ||
| 136 | itemTouchHelper2.attachToRecyclerView(rcDescripcion) | ||
| 137 | |||
| 138 | } | ||
| 139 | |||
| 140 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { | ||
| 141 | lifecycleScope.launch { | ||
| 142 | withContext(Dispatchers.IO) { | ||
| 143 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) | ||
| 144 | } | ||
| 145 | } | ||
| 146 | } | ||
| 147 | fun VolverAinventario(){ | ||
| 148 | |||
| 149 | val editor = sharedPreferences.edit() | ||
| 150 | editor?.putString("Inventario", numeroInventario.toString()) | ||
| 151 | editor?.apply() | ||
| 152 | editor.commit() | ||
| 153 | navController.navigate(R.id.action_descripcionFragment_to_inventarioFragment) | ||
| 154 | } | ||
| 155 | } | ||
| 156 | |||
| 157 | 1 | package com.focasoftware.deboinventariov20.ui.inventario |
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/DescripcionListAdapter.kt
| 1 | package com.focasoftware.deboinventariov20.ui.inventario | File was deleted | |
| 2 | |||
| 3 | import android.view.LayoutInflater | ||
| 4 | import android.view.View | ||
| 5 | import android.view.ViewGroup | ||
| 6 | import androidx.recyclerview.widget.RecyclerView | ||
| 7 | import com.focasoftware.deboinventariov20.Model.Articles | ||
| 8 | import com.focasoftware.deboinventariov20.R | ||
| 9 | import kotlinx.android.synthetic.main.item.view.* | ||
| 10 | |||
| 11 | class DescripcionListAdapter(private val productos: List<Articles>?) : | ||
| 12 | RecyclerView.Adapter<DescripcionListAdapter.ItemsViewHolder>() { | ||
| 13 | internal var items2: List<Articles>? = null | ||
| 14 | |||
| 15 | init { | ||
| 16 | this.items2 = productos | ||
| 17 | } | ||
| 18 | |||
| 19 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder( | ||
| 20 | LayoutInflater.from(parent.context).inflate(R.layout.item_descripcion, parent, false) | ||
| 21 | ) | ||
| 22 | |||
| 23 | override fun getItemCount() = productos!!.size | ||
| 24 | |||
| 25 | override fun onBindViewHolder(holder: ItemsViewHolder, position: Int) { | ||
| 26 | when (holder) { | ||
| 27 | is ItemsViewHolder -> { | ||
| 28 | holder.bind(items2!![position]) | ||
| 29 | } | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | |||
| 34 | class ItemsViewHolder constructor(view: View) : RecyclerView.ViewHolder(view) { | ||
| 35 | |||
| 36 | val sector = view.tvSector | ||
| 37 | val codigo = view.tvCodigo | ||
| 38 | val descripcion = view.tvDescripcion | ||
| 39 | val codigoBarras = view.tvCodigoBarras | ||
| 40 | |||
| 41 | fun bind(pro: Articles) { | ||
| 42 | sector.text = pro.sector | ||
| 43 | codigo.text = pro.codigo | ||
| 44 | descripcion.text = pro.descripcion | ||
| 45 | codigoBarras.text = pro.codBar | ||
| 46 | } | ||
| 47 | } | ||
| 48 | } |
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/InventarioFragment.kt
| 1 | package com.focasoftware.deboinventariov20.ui.inventario | 1 | package com.focasoftware.deboinventariov20.ui.inventario |
| 2 | 2 | ||
| 3 | import android.content.Context | 3 | import android.content.Context |
| 4 | import android.content.SharedPreferences | 4 | import android.content.SharedPreferences |
| 5 | import android.graphics.Canvas | 5 | import android.graphics.Canvas |
| 6 | import android.graphics.Color | 6 | import android.graphics.Color |
| 7 | import android.graphics.drawable.Drawable | 7 | import android.graphics.drawable.Drawable |
| 8 | import android.os.Bundle | 8 | import android.os.Bundle |
| 9 | import android.view.KeyEvent | 9 | import android.view.KeyEvent |
| 10 | import android.view.LayoutInflater | 10 | import android.view.LayoutInflater |
| 11 | import android.view.View | 11 | import android.view.View |
| 12 | import android.view.ViewGroup | 12 | import android.view.ViewGroup |
| 13 | import android.widget.EditText | 13 | import android.widget.EditText |
| 14 | import android.widget.TextView | 14 | import android.widget.TextView |
| 15 | import android.widget.Toast | 15 | import android.widget.Toast |
| 16 | import android.widget.ToggleButton | ||
| 17 | import androidx.core.content.ContextCompat | 16 | import androidx.core.content.ContextCompat |
| 18 | import androidx.core.os.bundleOf | 17 | import androidx.core.os.bundleOf |
| 19 | import androidx.fragment.app.Fragment | 18 | import androidx.fragment.app.Fragment |
| 20 | import androidx.lifecycle.lifecycleScope | 19 | import androidx.lifecycle.lifecycleScope |
| 21 | import androidx.navigation.NavController | 20 | import androidx.navigation.NavController |
| 22 | import androidx.navigation.Navigation | 21 | import androidx.navigation.Navigation |
| 23 | import androidx.recyclerview.widget.ItemTouchHelper | 22 | import androidx.recyclerview.widget.ItemTouchHelper |
| 24 | import androidx.recyclerview.widget.LinearLayoutManager | 23 | import androidx.recyclerview.widget.LinearLayoutManager |
| 25 | import androidx.recyclerview.widget.RecyclerView | 24 | import androidx.recyclerview.widget.RecyclerView |
| 26 | import com.afollestad.materialdialogs.MaterialDialog | 25 | import com.afollestad.materialdialogs.MaterialDialog |
| 27 | import com.afollestad.materialdialogs.input.input | 26 | import com.afollestad.materialdialogs.input.input |
| 28 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 27 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
| 29 | import com.focasoftware.deboinventariov20.Model.Articles | 28 | import com.focasoftware.deboinventariov20.Model.Articles |
| 30 | import com.focasoftware.deboinventariov20.Model.InvBody | 29 | import com.focasoftware.deboinventariov20.Model.InvBody |
| 31 | import com.focasoftware.deboinventariov20.Model.InvHead | 30 | import com.focasoftware.deboinventariov20.Model.InvHead |
| 32 | import com.focasoftware.deboinventariov20.R | 31 | import com.focasoftware.deboinventariov20.R |
| 33 | import kotlinx.android.synthetic.main.fragment_inventario.* | 32 | import kotlinx.android.synthetic.main.fragment_inventario.* |
| 34 | import kotlinx.coroutines.* | 33 | import kotlinx.coroutines.* |
| 35 | import java.time.LocalDateTime | 34 | import java.time.LocalDateTime |
| 36 | import java.time.format.DateTimeFormatter | 35 | import java.time.format.DateTimeFormatter |
| 37 | import java.util.* | 36 | import java.util.* |
| 38 | 37 | ||
| 39 | 38 | ||
| 40 | class InventarioFragment : Fragment() { | 39 | class InventarioFragment : Fragment() { |
| 41 | 40 | ||
| 42 | private lateinit var sharedPreferences: SharedPreferences | 41 | private lateinit var sharedPreferences: SharedPreferences |
| 43 | private var iArea: Int = 0 | 42 | private var iArea: Int = 0 |
| 44 | private lateinit var invHead: InvHead | 43 | private lateinit var invHead: InvHead |
| 45 | private lateinit var rcInventarios: RecyclerView | 44 | private lateinit var rcInventarios: RecyclerView |
| 46 | lateinit var viewAdapter: RecyclerView.Adapter<*> | 45 | private lateinit var viewAdapter: RecyclerView.Adapter<*> |
| 47 | private lateinit var viewManager: RecyclerView.LayoutManager | 46 | private lateinit var viewManager: RecyclerView.LayoutManager |
| 48 | private lateinit var sChangeUpper: String | 47 | private lateinit var sChangeUpper: String |
| 49 | private var listArticulos = ArrayList<ItemsRecycler>() | 48 | private var listArticulos = ArrayList<ItemsRecycler>() |
| 50 | lateinit var navController: NavController | 49 | private lateinit var navController: NavController |
| 51 | var InventarioNuevo: Int = 0 | 50 | private var InventarioNuevo: Int = 0 |
| 52 | var fCant = 0F | 51 | private var iEstado = 0 |
| 52 | private var fCant = 0F | ||
| 53 | private var bFirst = false | ||
| 53 | private lateinit var deleteIcon: Drawable | 54 | private lateinit var deleteIcon: Drawable |
| 54 | // private var editTT: EditText? = null | 55 | // private var editTT: EditText? = null |
| 55 | // private var dialogoModificacion: DialogPersoComplexCantidadModificacion? = null | 56 | // private var dialogoModificacion: DialogPersoComplexCantidadModificacion? = null |
| 56 | 57 | ||
| 57 | override fun onCreate(savedInstanceState: Bundle?) { | 58 | override fun onCreate(savedInstanceState: Bundle?) { |
| 58 | super.onCreate(savedInstanceState) | 59 | super.onCreate(savedInstanceState) |
| 59 | 60 | ||
| 60 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 61 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
| 61 | if (sharedPreferences.contains("Inventario")) if (sharedPreferences.getString("Inventario", "").toString() != "-1") { | 62 | if (sharedPreferences.contains("Inventario")) if (sharedPreferences.getString("Inventario", "").toString() != "-1") { |
| 62 | InventarioNuevo = sharedPreferences.getString("Inventario", "").toString().toInt() | 63 | InventarioNuevo = sharedPreferences.getString("Inventario", "").toString().toInt() |
| 63 | val editor = sharedPreferences.edit() | 64 | val editor = sharedPreferences.edit() |
| 64 | editor?.putString("Inventario", "-1") | 65 | editor?.putString("Inventario", "-1") |
| 65 | editor?.apply() | 66 | editor?.apply() |
| 66 | editor.commit() | 67 | editor.commit() |
| 67 | } | 68 | } |
| 68 | } | 69 | } |
| 69 | 70 | ||
| 70 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 71 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
| 71 | val v = inflater.inflate(R.layout.fragment_inventario, container, false) | 72 | val v = inflater.inflate(R.layout.fragment_inventario, container, false) |
| 72 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 73 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
| 73 | val tCodigoBarras = v.findViewById<EditText>(R.id.etCodigoBarras) | 74 | val tCodigoBarras = v.findViewById<EditText>(R.id.etCodigoBarras) |
| 74 | rcInventarios = v.findViewById(R.id.rcInventarios) | 75 | rcInventarios = v.findViewById(R.id.rcInventarios) |
| 75 | val tvTitulo = v.findViewById<TextView>(R.id.tvTitulo) | 76 | val tvTitulo = v.findViewById<TextView>(R.id.tvTitulo) |
| 76 | val toggleButton = v.findViewById<ToggleButton>(R.id.toggleButton) | ||
| 77 | 77 | ||
| 78 | 78 | ||
| 79 | if (InventarioNuevo == 0) {// TODO: SI INVETNARIO NUEVO | 79 | if (InventarioNuevo == 0) {// TODO: SI INVETNARIO NUEVO |
| 80 | GlobalScope.launch(Dispatchers.Main) { | 80 | GlobalScope.launch(Dispatchers.Main) { |
| 81 | //TODO: BUSCO EL ULTIMO INVENTARIO EN LA BD PARA PODER CREAR EL PROXIMO | 81 | //TODO: BUSCO EL ULTIMO INVENTARIO EN LA BD PARA PODER CREAR EL PROXIMO |
| 82 | InventarioNuevo = AppDb.getAppDb(requireActivity())?.InvHeadDAO()?.findLastInv()?.plus(1) ?: 1 | 82 | InventarioNuevo = AppDb.getAppDb(requireActivity())?.InvHeadDAO()?.findLastInv()?.plus(1) ?: 1 |
| 83 | SerchArea() | 83 | SerchArea() |
| 84 | val descripInv: String = if (iArea == 0) "Ventas" else "Deposito" | 84 | val descripInv: String = if (iArea == 0) "Ventas" else "Deposito" |
| 85 | //TODO: CREAMOS EL INVENTARIO EN LA CABECERA DEL INVENTARIO | 85 | //TODO: CREAMOS EL INVENTARIO EN LA CABECERA DEL INVENTARIO |
| 86 | invHead = InvHead(InventarioNuevo, descripInv, 1, ObtenerFechaActual(), ObtenerFechaActual(), 0L, iArea, AjusteProductos(), ProdNoCont()) | 86 | invHead = InvHead(InventarioNuevo, descripInv, 1, ObtenerFechaActual(), ObtenerFechaActual(), 0L, iArea, AjusteProductos(), ProdNoCont()) |
| 87 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.insertInvHead(invHead) | 87 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.insertInvHead(invHead) |
| 88 | tvTitulo.text = "Inventario Dinamico" + " N° $InventarioNuevo" | 88 | tvTitulo.text = "Inventario Dinamico" + " N° $InventarioNuevo" |
| 89 | } | 89 | } |
| 90 | } else {// TODO: SI VENGO DE FRAGMENT DESCRIPCION | 90 | } else {// TODO: SI VENGO DE FRAGMENT DESCRIPCION |
| 91 | CargarDeBdInventario(InventarioNuevo) | 91 | CargarDeBdInventario(InventarioNuevo) |
| 92 | tvTitulo.text = "Inventario Dinamico" + " N° $InventarioNuevo" | 92 | tvTitulo.text = "Inventario Dinamico" + " N° $InventarioNuevo" |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | tCodigoBarras.setOnKeyListener { _, keyCode, keyEvent -> | 95 | tCodigoBarras.setOnKeyListener { _, keyCode, keyEvent -> |
| 96 | if (keyCode == KeyEvent.KEYCODE_ENTER && keyEvent.action == KeyEvent.ACTION_UP) { | 96 | if (keyCode == KeyEvent.KEYCODE_ENTER && keyEvent.action == KeyEvent.ACTION_UP) { |
| 97 | sChangeUpper = tCodigoBarras.text.toString() | 97 | sChangeUpper = tCodigoBarras.text.toString() |
| 98 | 98 | ||
| 99 | var indiceDelArtEncontrado = 0 | 99 | var indiceDelArtEncontrado = 0 |
| 100 | 100 | ||
| 101 | //TODO COMIENZA LA BUSQUEDA POR CODIGO DE BARRAS | 101 | //TODO COMIENZA LA BUSQUEDA POR CODIGO DE BARRAS |
| 102 | if (toggleButton.isChecked) { | 102 | when (iEstado) { |
| 103 | indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 0)//TODO Si encuentra el articulo en el RV devuelve el indice | 103 | 0 -> { |
| 104 | //TODO Si no lo encuentra devuelve -1 | 104 | indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 0)//TODO Si encuentra el articulo en el RV devuelve el indice |
| 105 | if (indiceDelArtEncontrado != -1) { | 105 | //TODO Si no lo encuentra devuelve -1 |
| 106 | if (swSumaUno!!.isChecked) { | 106 | if (indiceDelArtEncontrado != -1) { |
| 107 | fCant = 0F | 107 | if (swSumaUno!!.isChecked) { |
| 108 | fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 108 | fCant = 0F |
| 109 | fCant += 1F | 109 | fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
| 110 | //TODO ACTUALIZO LA CANTIDAD EN LA BD | 110 | fCant += 1F |
| 111 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 111 | //TODO ACTUALIZO LA CANTIDAD EN LA BD |
| 112 | //TODO ACTUALIZO LA CANTIDAD EN EL RV | 112 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
| 113 | listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 113 | //TODO ACTUALIZO LA CANTIDAD EN EL RV |
| 114 | viewAdapter.notifyDataSetChanged() | 114 | listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
| 115 | } else { | 115 | viewAdapter.notifyDataSetChanged() |
| 116 | // val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | 116 | } else { |
| 117 | // val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setTitle("Login Form").setCancelable(false) | 117 | // val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) |
| 118 | // val mAlertDialog = mBuilder.show() | 118 | // val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setTitle("Login Form").setCancelable(false) |
| 119 | // mDialogView.dialogLoginBtn.setOnClickListener { | 119 | // val mAlertDialog = mBuilder.show() |
| 120 | // mAlertDialog.dismiss() | 120 | // mDialogView.dialogLoginBtn.setOnClickListener { |
| 121 | // //get text from EditTexts of custom layout | 121 | // mAlertDialog.dismiss() |
| 122 | // val name = mDialogView.dialogNameEt.text.toString() | 122 | // //get text from EditTexts of custom layout |
| 123 | // val email = mDialogView.dialogEmailEt.text.toString() | 123 | // val name = mDialogView.dialogNameEt.text.toString() |
| 124 | // val password = mDialogView.dialogPasswEt.text.toString() | 124 | // val email = mDialogView.dialogEmailEt.text.toString() |
| 125 | // fCant = 0F | 125 | // val password = mDialogView.dialogPasswEt.text.toString() |
| 126 | // fCant = name.toFloat() | 126 | // fCant = 0F |
| 127 | // } | 127 | // fCant = name.toFloat() |
| 128 | // mDialogView.dialogCancelBtn.setOnClickListener { | 128 | // } |
| 129 | // mAlertDialog.dismiss() | 129 | // mDialogView.dialogCancelBtn.setOnClickListener { |
| 130 | // } | 130 | // mAlertDialog.dismiss() |
| 131 | fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 131 | // } |
| 132 | MaterialDialog(requireContext()).show { | 132 | fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
| 133 | title(R.string.sTituloNueva) | 133 | MaterialDialog(requireContext()).show { |
| 134 | message(R.string.sCantidadNueva) | 134 | title(R.string.sTituloNueva) |
| 135 | input { materialDialog, charSequence -> | 135 | message(R.string.sCantidadNueva) |
| 136 | fCant = 0F | 136 | input { materialDialog, charSequence -> |
| 137 | fCant = charSequence.toString().toFloat() | 137 | fCant = 0F |
| 138 | } | 138 | fCant = charSequence.toString().toFloat() |
| 139 | positiveButton(R.string.btnOk) { | 139 | } |
| 140 | //TODO ACTUALIZO CANTIADAD EN BD | 140 | positiveButton(R.string.btnOk) { |
| 141 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 141 | //TODO ACTUALIZO CANTIADAD EN BD |
| 142 | //TODO ACTUALIZO CANTIDAD EN RV | 142 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
| 143 | listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 143 | //TODO ACTUALIZO CANTIDAD EN RV |
| 144 | viewAdapter.notifyDataSetChanged() | 144 | listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
| 145 | dismiss() | 145 | viewAdapter.notifyDataSetChanged() |
| 146 | } | 146 | dismiss() |
| 147 | }.cancelOnTouchOutside(false).cornerRadius(10F) | 147 | } |
| 148 | }.cancelOnTouchOutside(false).cornerRadius(10F) | ||
| 149 | } | ||
| 150 | |||
| 151 | } else if (indiceDelArtEncontrado == -1) {// no lo encontro en el RV, lo va a buscar en al BD | ||
| 152 | |||
| 153 | GlobalScope.launch(Dispatchers.Main) { | ||
| 154 | //TODO BUSCO EN BASE DE DATOS | ||
| 155 | val artEncontrado = buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | ||
| 156 | ContinuarCargaCB(artEncontrado) | ||
| 157 | } | ||
| 148 | } | 158 | } |
| 149 | 159 | ||
| 150 | } else if (indiceDelArtEncontrado == -1) {// no lo encontro en el RV, lo va a buscar en al BD | 160 | tCodigoBarras.focusable = View.FOCUSABLE |
| 161 | tCodigoBarras.setText("") | ||
| 162 | tCodigoBarras.selectAll() | ||
| 163 | return@setOnKeyListener true | ||
| 151 | 164 | ||
| 152 | GlobalScope.launch(Dispatchers.Main) { | ||
| 153 | //TODO BUSCO EN BASE DE DATOS | ||
| 154 | val artEncontrado = buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | ||
| 155 | ContinuarCargaCB(artEncontrado) | ||
| 156 | } | ||
| 157 | } | ||
| 158 | 165 | ||
| 159 | tCodigoBarras.focusable = View.FOCUSABLE | 166 | } |
| 160 | tCodigoBarras.setText("") | 167 | 1 -> {//TODO: BUSQUEDA POR DESCRIPCION************************************************************************** |
| 161 | tCodigoBarras.selectAll() | 168 | // |
| 162 | return@setOnKeyListener true | 169 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 1) //TODO :Si encuentra el articulo en el RV devuelve el indice |
| 163 | 170 | // //TODO Si no lo encuentra devuelve -1 | |
| 164 | 171 | // if (indiceDelArtEncontrado != -1) { | |
| 165 | } else {//TODO: BUSQUEDA POR DESCRIPCION************************************************************************** | 172 | //// if (swSumaUno!!.isChecked) { |
| 166 | // | 173 | //// fCant = 0F |
| 167 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 1) //TODO :Si encuentra el articulo en el RV devuelve el indice | 174 | //// fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
| 168 | // //TODO Si no lo encuentra devuelve -1 | 175 | //// fCant += 1F |
| 169 | // if (indiceDelArtEncontrado != -1) { | 176 | //// listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
| 170 | //// if (swSumaUno!!.isChecked) { | 177 | //// viewAdapter.notifyDataSetChanged() |
| 171 | //// fCant = 0F | 178 | //// } else { |
| 172 | //// fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 179 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
| 173 | //// fCant += 1F | 180 | // MaterialDialog(requireContext()).show { |
| 174 | //// listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 181 | // title(R.string.sTituloNueva) |
| 175 | //// viewAdapter.notifyDataSetChanged() | 182 | // message(R.string.sCantidadNueva) |
| 176 | //// } else { | 183 | // input { materialDialog, charSequence -> |
| 177 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 184 | // fCant = 0F |
| 178 | // MaterialDialog(requireContext()).show { | 185 | // fCant = charSequence.toString().toFloat() |
| 179 | // title(R.string.sTituloNueva) | 186 | // } |
| 180 | // message(R.string.sCantidadNueva) | 187 | // positiveButton(R.string.btnOk) { |
| 181 | // input { materialDialog, charSequence -> | 188 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
| 182 | // fCant = 0F | 189 | // viewAdapter.notifyDataSetChanged() |
| 183 | // fCant = charSequence.toString().toFloat() | 190 | // dismiss() |
| 184 | // } | 191 | // } |
| 185 | // positiveButton(R.string.btnOk) { | 192 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
| 186 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 193 | //// } |
| 187 | // viewAdapter.notifyDataSetChanged() | 194 | // |
| 188 | // dismiss() | 195 | // } else if |
| 189 | // } | 196 | // (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD |
| 190 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | ||
| 191 | //// } | ||
| 192 | // | ||
| 193 | // } else if | ||
| 194 | // (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD | ||
| 195 | GlobalScope.launch(Dispatchers.Main) { | 197 | GlobalScope.launch(Dispatchers.Main) { |
| 196 | val artEncontrado = buscarDescEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | 198 | val artEncontrado = buscarDescEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
| 197 | ContinuarCargaDesc(artEncontrado as ArrayList<Articles>) | 199 | ContinuarCargaDesc(artEncontrado as ArrayList<Articles>) |
| 198 | } | 200 | } |
| 199 | // } | 201 | // } |
| 200 | tCodigoBarras.focusable = View.FOCUSABLE | 202 | tCodigoBarras.focusable = View.FOCUSABLE |
| 201 | tCodigoBarras.setText("") | 203 | tCodigoBarras.setText("") |
| 202 | tCodigoBarras.selectAll() | 204 | tCodigoBarras.selectAll() |
| 203 | return@setOnKeyListener true | 205 | return@setOnKeyListener true |
| 206 | } | ||
| 207 | 2 -> {//TODO: BUSQUEDA POR CODIGO DE ORIGEN************************************************************************** | ||
| 208 | indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 3)//TODO Si encuentra el articulo en el RV devuelve el indice | ||
| 209 | //TODO Si no lo encuentra devuelve -1 | ||
| 210 | if (indiceDelArtEncontrado != -1) { | ||
| 211 | if (swSumaUno!!.isChecked) { | ||
| 212 | fCant = 0F | ||
| 213 | fCant = listArticulos[indiceDelArtEncontrado].cantTomada | ||
| 214 | fCant += 1F | ||
| 215 | //TODO ACTUALIZO LA CANTIDAD EN LA BD | ||
| 216 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | ||
| 217 | //TODO ACTUALIZO LA CANTIDAD EN EL RV | ||
| 218 | listArticulos[indiceDelArtEncontrado].cantTomada = fCant | ||
| 219 | viewAdapter.notifyDataSetChanged() | ||
| 220 | } else { | ||
| 221 | // val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | ||
| 222 | // val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setTitle("Login Form").setCancelable(false) | ||
| 223 | // val mAlertDialog = mBuilder.show() | ||
| 224 | // mDialogView.dialogLoginBtn.setOnClickListener { | ||
| 225 | // mAlertDialog.dismiss() | ||
| 226 | // //get text from EditTexts of custom layout | ||
| 227 | // val name = mDialogView.dialogNameEt.text.toString() | ||
| 228 | // val email = mDialogView.dialogEmailEt.text.toString() | ||
| 229 | // val password = mDialogView.dialogPasswEt.text.toString() | ||
| 230 | // fCant = 0F | ||
| 231 | // fCant = name.toFloat() | ||
| 232 | // } | ||
| 233 | // mDialogView.dialogCancelBtn.setOnClickListener { | ||
| 234 | // mAlertDialog.dismiss() | ||
| 235 | // } | ||
| 236 | fCant = listArticulos[indiceDelArtEncontrado].cantTomada | ||
| 237 | MaterialDialog(requireContext()).show { | ||
| 238 | title(R.string.sTituloNueva) | ||
| 239 | message(R.string.sCantidadNueva) | ||
| 240 | input { materialDialog, charSequence -> | ||
| 241 | fCant = 0F | ||
| 242 | fCant = charSequence.toString().toFloat() | ||
| 243 | } | ||
| 244 | positiveButton(R.string.btnOk) { | ||
| 245 | //TODO ACTUALIZO CANTIADAD EN BD | ||
| 246 | updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | ||
| 247 | //TODO ACTUALIZO CANTIDAD EN RV | ||
| 248 | listArticulos[indiceDelArtEncontrado].cantTomada = fCant | ||
| 249 | viewAdapter.notifyDataSetChanged() | ||
| 250 | dismiss() | ||
| 251 | } | ||
| 252 | }.cancelOnTouchOutside(false).cornerRadius(10F) | ||
| 253 | } | ||
| 254 | |||
| 255 | } else if (indiceDelArtEncontrado == -1) {// no lo encontro en el RV, lo va a buscar en al BD | ||
| 256 | |||
| 257 | GlobalScope.launch(Dispatchers.Main) { | ||
| 258 | //TODO BUSCO EN BASE DE DATOS | ||
| 259 | val artEncontrado = buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | ||
| 260 | ContinuarCargaCB(artEncontrado) | ||
| 261 | } | ||
| 262 | } | ||
| 263 | |||
| 264 | tCodigoBarras.focusable = View.FOCUSABLE | ||
| 265 | tCodigoBarras.setText("") | ||
| 266 | tCodigoBarras.selectAll() | ||
| 267 | return@setOnKeyListener true | ||
| 268 | |||
| 269 | |||
| 270 | } | ||
| 204 | } | 271 | } |
| 205 | } | 272 | } |
| 206 | return@setOnKeyListener false | 273 | return@setOnKeyListener false |
| 207 | } | 274 | } |
| 208 | return v | 275 | return v |
| 209 | } | 276 | } |
| 210 | 277 | ||
| 211 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 278 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
| 212 | super.onViewCreated(view, savedInstanceState) | 279 | super.onViewCreated(view, savedInstanceState) |
| 213 | navController = Navigation.findNavController(view) | 280 | navController = Navigation.findNavController(view) |
| 214 | etCodigoBarras.requestFocus() | 281 | etCodigoBarras.requestFocus() |
| 215 | 282 | ||
| 216 | btnBorrarInv.setOnClickListener { | 283 | btnBorrarInv.setOnClickListener { |
| 217 | MaterialDialog(requireContext()).show { | 284 | MaterialDialog(requireContext()).show { |
| 218 | title(R.string.sTituloBorrarInv) | 285 | title(R.string.sTituloBorrarInv) |
| 219 | message(R.string.sMensajeBorrarInv) | 286 | message(R.string.sMensajeBorrarInv) |
| 220 | positiveButton(R.string.btnOk) { | 287 | positiveButton(R.string.btnOk) { |
| 221 | BorrarInvActual() | 288 | BorrarInvActual() |
| 222 | Toast.makeText(requireContext(), "El inventario $InventarioNuevo fue Borrado", Toast.LENGTH_LONG).show() | 289 | Toast.makeText(requireContext(), "El inventario $InventarioNuevo fue Borrado", Toast.LENGTH_LONG).show() |
| 223 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) | 290 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) |
| 224 | InventarioNuevo = 0 | 291 | InventarioNuevo = 0 |
| 225 | dismiss() | 292 | dismiss() |
| 226 | } | 293 | } |
| 227 | negativeButton { | 294 | negativeButton { |
| 228 | dismiss() | 295 | dismiss() |
| 229 | } | 296 | } |
| 230 | }.cancelOnTouchOutside(false).cornerRadius(10F) | 297 | }.cancelOnTouchOutside(false).cornerRadius(10F) |
| 231 | } | 298 | } |
| 232 | 299 | ||
| 233 | btnExportarInv.setOnClickListener { | 300 | btnExportarInv.setOnClickListener { |
| 234 | MaterialDialog(requireContext()).show { | 301 | MaterialDialog(requireContext()).show { |
| 235 | title(R.string.sTituloExportar) | 302 | title(R.string.sTituloExportar) |
| 236 | message(R.string.sMensajeExportar) | 303 | message(R.string.sMensajeExportar) |
| 237 | positiveButton(R.string.btnOk) { | 304 | positiveButton(R.string.btnOk) { |
| 238 | BorrarInvActual() | 305 | BorrarInvActual() |
| 239 | Toast.makeText(requireContext(), "El inventario $InventarioNuevo fue Exportado al Servidor", Toast.LENGTH_LONG).show() | 306 | Toast.makeText(requireContext(), "El inventario $InventarioNuevo fue Exportado al Servidor", Toast.LENGTH_LONG).show() |
| 240 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) | 307 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) |
| 241 | InventarioNuevo = 0 | 308 | InventarioNuevo = 0 |
| 242 | dismiss() | 309 | dismiss() |
| 243 | } | 310 | } |
| 244 | negativeButton { | 311 | negativeButton { |
| 245 | dismiss() | 312 | dismiss() |
| 246 | } | 313 | } |
| 247 | }.cancelOnTouchOutside(false).cornerRadius(10F) | 314 | }.cancelOnTouchOutside(false).cornerRadius(10F) |
| 248 | } | 315 | } |
| 316 | ivCamara.setOnClickListener { | ||
| 317 | if (!bFirst) { | ||
| 318 | iEstado = 1 | ||
| 319 | bFirst = true | ||
| 320 | } | ||
| 321 | |||
| 322 | when (iEstado) { | ||
| 323 | 0 -> { | ||
| 324 | ivCamara.setImageResource(R.drawable.codbar) | ||
| 325 | etCodigoBarras.hint = "Busqueda por C. Barras" | ||
| 326 | swSumaUno.visibility = View.VISIBLE | ||
| 327 | iEstado = 1 | ||
| 328 | } | ||
| 329 | 1 -> { | ||
| 330 | ivCamara.setImageResource(R.drawable.desc) | ||
| 331 | etCodigoBarras.hint = "Busqueda por Descripción" | ||
| 332 | swSumaUno.visibility = View.GONE | ||
| 333 | iEstado = 2 | ||
| 334 | } | ||
| 335 | 2 -> { | ||
| 336 | ivCamara.setImageResource(R.drawable.cod_origen) | ||
| 337 | etCodigoBarras.hint = "Busqueda por C. Origen" | ||
| 338 | swSumaUno.visibility = View.GONE | ||
| 339 | iEstado = 0 | ||
| 340 | } | ||
| 341 | } | ||
| 342 | } | ||
| 249 | } | 343 | } |
| 250 | 344 | ||
| 251 | private fun BorrarInvActual() { | 345 | private fun BorrarInvActual() { |
| 252 | lifecycleScope.launch { | 346 | lifecycleScope.launch { |
| 253 | withContext(Dispatchers.IO) { | 347 | withContext(Dispatchers.IO) { |
| 254 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.deleteinvHead(InventarioNuevo) | 348 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.deleteinvHead(InventarioNuevo) |
| 255 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.deleteInvBody(InventarioNuevo) | 349 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.deleteInvBody(InventarioNuevo) |
| 256 | } | 350 | } |
| 257 | } | 351 | } |
| 258 | } | 352 | } |
| 259 | 353 | ||
| 260 | private fun CargarDeBdInventario(ultimoInv: Int) { | 354 | private fun CargarDeBdInventario(ultimoInv: Int) { |
| 261 | GlobalScope.launch(Dispatchers.Main) { | 355 | GlobalScope.launch(Dispatchers.Main) { |
| 262 | val invbody = cargarInventario(ultimoInv) | 356 | val invbody = cargarInventario(ultimoInv) |
| 263 | for ((i, item) in invbody!!.withIndex()) { | 357 | for ((i, item) in invbody!!.withIndex()) { |
| 264 | val art = Articles(invbody[i].sector, | 358 | val art = Articles(invbody[i].sector, |
| 265 | invbody[i].codigo, | 359 | invbody[i].codigo, |
| 266 | invbody[i].descripcion, | 360 | invbody[i].descripcion, |
| 267 | invbody[i].codBar, | 361 | invbody[i].codBar, |
| 268 | invbody[i].codOrigen, | 362 | invbody[i].codOrigen, |
| 269 | invbody[i].precio, | 363 | invbody[i].precio, |
| 270 | invbody[i].costo, | 364 | invbody[i].costo, |
| 271 | invbody[i].balanza, | 365 | invbody[i].balanza, |
| 272 | invbody[i].depSn, | 366 | invbody[i].depSn, |
| 273 | invbody[i].costo) | 367 | invbody[i].costo) |
| 274 | cargarRecicler(art, invbody[i].cantTomada!!.toFloat()) | 368 | cargarRecicler(art, invbody[i].cantTomada!!.toFloat()) |
| 275 | } | 369 | } |
| 276 | } | 370 | } |
| 277 | 371 | ||
| 278 | } | 372 | } |
| 279 | 373 | ||
| 280 | private fun ContinuarCargaDesc(artAcargar: ArrayList<Articles>) { | 374 | private fun ContinuarCargaDesc(artAcargar: ArrayList<Articles>) { |
| 281 | //TODO DESPUES DE INGRESAR LA DESCRIPCION Y DE BUSCAR LOS CAINCIDENCIAS EN LA BASE SE VA A MOSTRAR LAS MISMAS | 375 | //TODO DESPUES DE INGRESAR LA DESCRIPCION Y DE BUSCAR LOS CAINCIDENCIAS EN LA BASE SE VA A MOSTRAR LAS MISMAS |
| 282 | //TODO SI LA CANTIDAD ENCONTRADA ES UNO, LO CARGO DIRECTAMENTE EN EL RV | 376 | //TODO SI LA CANTIDAD ENCONTRADA ES UNO, LO CARGO DIRECTAMENTE EN EL RV |
| 283 | 377 | ||
| 284 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD | 378 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD |
| 285 | // if (swSumaUno!!.isChecked) {// TODO: SI ESTA +1, PONE CANTIDAD 1 | 379 | // if (swSumaUno!!.isChecked) {// TODO: SI ESTA +1, PONE CANTIDAD 1 |
| 286 | if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV | 380 | if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV |
| 287 | fCant = 0F | 381 | fCant = 0F |
| 288 | fCant += 1F | 382 | fCant += 1F |
| 289 | // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV | 383 | // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV |
| 290 | val acargarPorDesc = Articles(artAcargar[0].sector, | 384 | val acargarPorDesc = Articles(artAcargar[0].sector, |
| 291 | artAcargar[0].codigo, | 385 | artAcargar[0].codigo, |
| 292 | artAcargar[0].descripcion, | 386 | artAcargar[0].descripcion, |
| 293 | artAcargar[0].codBar, | 387 | artAcargar[0].codBar, |
| 294 | artAcargar[0].codOrigen, | 388 | artAcargar[0].codOrigen, |
| 295 | artAcargar[0].precio, | 389 | artAcargar[0].precio, |
| 296 | artAcargar[0].costo, | 390 | artAcargar[0].costo, |
| 297 | artAcargar[0].balanza, | 391 | artAcargar[0].balanza, |
| 298 | artAcargar[0].depSn, | 392 | artAcargar[0].depSn, |
| 299 | "") | 393 | "") |
| 300 | // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD | 394 | // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD |
| 301 | cargarArtEnBd(acargarPorDesc, fCant) | 395 | cargarArtEnBd(acargarPorDesc, fCant) |
| 302 | cargarRecicler(acargarPorDesc, fCant) | 396 | cargarRecicler(acargarPorDesc, fCant) |
| 303 | } else { | 397 | } else { |
| 304 | var bundle = Bundle() | 398 | var bundle = Bundle() |
| 305 | bundle = bundleOf("ArrayDesc" to artAcargar) | 399 | bundle = bundleOf("ArrayDesc" to artAcargar) |
| 306 | bundle.putInt("numeroInv", InventarioNuevo) | 400 | bundle.putInt("numeroInv", InventarioNuevo) |
| 307 | navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) | 401 | navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) |
| 308 | } | 402 | } |
| 309 | // } else {//SI NO ESTA +1 | 403 | // } else {//SI NO ESTA +1 |
| 310 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV | 404 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV |
| 311 | // fCant = listArticulos[0].cantTomada | 405 | // fCant = listArticulos[0].cantTomada |
| 312 | // MaterialDialog(requireContext()).show { | 406 | // MaterialDialog(requireContext()).show { |
| 313 | // title(R.string.sTituloNueva) | 407 | // title(R.string.sTituloNueva) |
| 314 | // message(R.string.sCantidadNueva) | 408 | // message(R.string.sCantidadNueva) |
| 315 | // input { materialDialog, charSequence -> | 409 | // input { materialDialog, charSequence -> |
| 316 | // fCant = 0F | 410 | // fCant = 0F |
| 317 | // fCant = charSequence.toString().toFloat() | 411 | // fCant = charSequence.toString().toFloat() |
| 318 | // } | 412 | // } |
| 319 | // positiveButton(R.string.btnOk) { | 413 | // positiveButton(R.string.btnOk) { |
| 320 | // listArticulos[0].cantTomada = fCant | 414 | // listArticulos[0].cantTomada = fCant |
| 321 | // viewAdapter.notifyDataSetChanged() | 415 | // viewAdapter.notifyDataSetChanged() |
| 322 | // dismiss() | 416 | // dismiss() |
| 323 | // } | 417 | // } |
| 324 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 418 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
| 325 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV | 419 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV |
| 326 | // val acargarPorDesc = Articles(artAcargar[0].sector, | 420 | // val acargarPorDesc = Articles(artAcargar[0].sector, |
| 327 | // artAcargar[0].codigo, | 421 | // artAcargar[0].codigo, |
| 328 | // artAcargar[0].descripcion, | 422 | // artAcargar[0].descripcion, |
| 329 | // artAcargar[0].codBar, | 423 | // artAcargar[0].codBar, |
| 330 | // artAcargar[0].codOrigen, | 424 | // artAcargar[0].cod_origen, |
| 331 | // artAcargar[0].precio, | 425 | // artAcargar[0].precio, |
| 332 | // artAcargar[0].costo, | 426 | // artAcargar[0].costo, |
| 333 | // artAcargar[0].balanza, | 427 | // artAcargar[0].balanza, |
| 334 | // artAcargar[0].depSn, | 428 | // artAcargar[0].depSn, |
| 335 | // "") | 429 | // "") |
| 336 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD | 430 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD |
| 337 | // cargarArtEnBd(acargarPorDesc, fCant) | 431 | // cargarArtEnBd(acargarPorDesc, fCant) |
| 338 | // cargarRecicler(acargarPorDesc, fCant) | 432 | // cargarRecicler(acargarPorDesc, fCant) |
| 339 | // } else { | 433 | // } else { |
| 340 | // var bundle = Bundle() | 434 | // var bundle = Bundle() |
| 341 | // bundle = bundleOf("ArrayDesc" to artAcargar) | 435 | // bundle = bundleOf("ArrayDesc" to artAcargar) |
| 342 | // bundle.putInt("numeroInv", InventarioNuevo) | 436 | // bundle.putInt("numeroInv", InventarioNuevo) |
| 343 | // navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) | 437 | // navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) |
| 344 | // } | 438 | // } |
| 345 | // } | 439 | // } |
| 346 | } else {//TODO si no lo encuentra en la BD | 440 | } else {//TODO si no lo encuentra en la BD |
| 347 | MaterialDialog(requireContext()).show { | 441 | MaterialDialog(requireContext()).show { |
| 348 | title(R.string.sTitulo) | 442 | title(R.string.sTitulo) |
| 349 | message(R.string.sMensaje) | 443 | message(R.string.sMensaje) |
| 350 | positiveButton(R.string.btnOk) { | 444 | positiveButton(R.string.btnOk) { |
| 351 | dismiss() | 445 | dismiss() |
| 352 | } | 446 | } |
| 353 | }.cornerRadius(10F) | 447 | }.cornerRadius(10F) |
| 354 | } | 448 | } |
| 355 | 449 | ||
| 356 | } | 450 | } |
| 357 | 451 | ||
| 358 | private fun ContinuarCargaCB(artAcargar: Articles?) { | 452 | private fun ContinuarCargaCB(artAcargar: Articles?) { |
| 359 | 453 | ||
| 360 | if (artAcargar != null) {//Si lo encuentra en la BD | 454 | if (artAcargar != null) {//Si lo encuentra en la BD |
| 361 | 455 | ||
| 362 | if (swSumaUno!!.isChecked) {// SI ESTA +1, PONE CANTIDAD 1 | 456 | if (swSumaUno!!.isChecked) {// SI ESTA +1, PONE CANTIDAD 1 |
| 363 | fCant = 0F | 457 | fCant = 0F |
| 364 | fCant += 1F | 458 | fCant += 1F |
| 365 | cargarArtEnBd(artAcargar, fCant) | 459 | cargarArtEnBd(artAcargar, fCant) |
| 366 | cargarRecicler(artAcargar, fCant) | 460 | cargarRecicler(artAcargar, fCant) |
| 367 | } else {//SI NO ESTA +1 PREGUNTA CANTIDAD | 461 | } else {//SI NO ESTA +1 PREGUNTA CANTIDAD |
| 368 | MaterialDialog(requireContext()).show { | 462 | MaterialDialog(requireContext()).show { |
| 369 | title(R.string.sTitulo) | 463 | title(R.string.sTitulo) |
| 370 | message(R.string.sMensajeEncontrado) | 464 | message(R.string.sMensajeEncontrado) |
| 371 | input { materialDialog, charSequence -> | 465 | input { materialDialog, charSequence -> |
| 372 | fCant = 0F | 466 | fCant = 0F |
| 373 | fCant = charSequence.toString().toFloat() | 467 | fCant = charSequence.toString().toFloat() |
| 374 | } | 468 | } |
| 375 | // .input("Cantidad",1,,1,0,InputType.TYPE_CLASS_NUMBER,0,waitForPositiveButton = true,false,positiveButton ()) | 469 | // .input("Cantidad",1,,1,0,InputType.TYPE_CLASS_NUMBER,0,waitForPositiveButton = true,false,positiveButton ()) |
| 376 | positiveButton(R.string.btnOk) { | 470 | positiveButton(R.string.btnOk) { |
| 377 | dismiss() | 471 | dismiss() |
| 378 | cargarArtEnBd(artAcargar, fCant) | 472 | cargarArtEnBd(artAcargar, fCant) |
| 379 | cargarRecicler(artAcargar, fCant) | 473 | cargarRecicler(artAcargar, fCant) |
| 380 | 474 | ||
| 381 | } | 475 | } |
| 382 | }.cancelOnTouchOutside(false).cornerRadius(10F) | 476 | }.cancelOnTouchOutside(false).cornerRadius(10F) |
| 383 | } | 477 | } |
| 384 | } else {// TODO si no lo encuentra en la BD | 478 | } else {// TODO si no lo encuentra en la BD |
| 385 | MaterialDialog(requireContext()).show { | 479 | MaterialDialog(requireContext()).show { |
| 386 | title(R.string.sTitulo) | 480 | title(R.string.sTitulo) |
| 387 | message(R.string.sMensaje) | 481 | message(R.string.sMensaje) |
| 388 | positiveButton(R.string.btnOk) { | 482 | positiveButton(R.string.btnOk) { |
| 389 | // if (this.swSumaUno.isChecked) { | 483 | // if (this.swSumaUno.isChecked) { |
| 390 | // swSumaUno.isChecked=false | 484 | // swSumaUno.isChecked=false |
| 391 | // } | 485 | // } |
| 392 | dismiss() | 486 | dismiss() |
| 393 | } | 487 | } |
| 394 | }.cornerRadius(10F) | 488 | }.cornerRadius(10F) |
| 395 | } | 489 | } |
| 396 | } | 490 | } |
| 397 | 491 | ||
| 398 | suspend fun buscarCBEnBD(CodigoBarras: String): Articles? { | 492 | suspend fun buscarCBEnBD(CodigoBarras: String): Articles? { |
| 399 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 493 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
| 400 | var busqueda: Articles? = null | 494 | var busqueda: Articles? = null |
| 401 | return GlobalScope.async(Dispatchers.IO) { | 495 | return GlobalScope.async(Dispatchers.IO) { |
| 402 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, iArea) | 496 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, iArea) |
| 403 | return@async busqueda | 497 | return@async busqueda |
| 404 | }.await() | 498 | }.await() |
| 405 | } | 499 | } |
| 406 | 500 | ||
| 407 | suspend fun buscarDescEnBD(descripcion: String): List<Articles>? { | 501 | suspend fun buscarDescEnBD(descripcion: String): List<Articles>? { |
| 408 | //TODO BUSQUEDA POR DESCRIPCION | 502 | //TODO BUSQUEDA POR DESCRIPCION |
| 409 | var busqueda: List<Articles>? = null | 503 | var busqueda: List<Articles>? = null |
| 410 | return GlobalScope.async(Dispatchers.IO) { | 504 | return GlobalScope.async(Dispatchers.IO) { |
| 411 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, iArea) | 505 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, iArea) |
| 412 | return@async busqueda | 506 | return@async busqueda |
| 413 | }.await() | 507 | }.await() |
| 414 | } | 508 | } |
| 415 | 509 | ||
| 416 | private fun buscoArtEnRv(codigoBarras: String, sTipoBusqueda: Int): Int { | 510 | private fun buscoArtEnRv(codigoBarras: String, sTipoBusqueda: Int): Int { |
| 417 | var indice = 0 | 511 | var indice = 0 |
| 418 | var bEncontrado = false | 512 | var bEncontrado = false |
| 419 | if (sTipoBusqueda == 0) {//TODO BUSQUEDA POR CODIGO DE BARRAS | 513 | if (sTipoBusqueda == 0) {//TODO BUSQUEDA POR CODIGO DE BARRAS |
| 420 | for (item in listArticulos) { | 514 | for (item in listArticulos) { |
| 421 | if (item.codigoBarras!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { | 515 | if (item.codigoBarras!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { |
| 422 | bEncontrado = true | 516 | bEncontrado = true |
| 423 | break | 517 | break |
| 424 | } | 518 | } |
| 425 | indice += 1 | 519 | indice += 1 |
| 426 | } | 520 | } |
| 427 | } else {//TODO BUSQUEDA POR DESCRIPCION | 521 | } else if (sTipoBusqueda == 1) {//TODO BUSQUEDA POR DESCRIPCION |
| 428 | for (item in listArticulos) { | 522 | for (item in listArticulos) { |
| 429 | if (item.descripcion!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { | 523 | if (item.descripcion!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { |
| 430 | bEncontrado = true | 524 | bEncontrado = true |
| 431 | break | 525 | break |
| 432 | } | 526 | } |
| 433 | indice += 1 | 527 | indice += 1 |
| 434 | } | 528 | } |
| 529 | }else if (sTipoBusqueda == 2) {//TODO BUSQUEDA POR CODIGO DE ORIGEN | ||
| 530 | for (item in listArticulos) { | ||
| 531 | if (item.codigoOrigen!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { | ||
| 532 | bEncontrado = true | ||
| 533 | break | ||
| 534 | } | ||
| 535 | indice += 1 | ||
| 536 | } | ||
| 435 | } | 537 | } |
| 436 | return if (bEncontrado) indice | 538 | return if (bEncontrado) indice |
| 437 | else -1 | 539 | else -1 |
| 438 | } | 540 | } |
| 439 | 541 | ||
| 440 | private fun cargarArtEnBd(articulos: Articles, cant: Float) { | 542 | private fun cargarArtEnBd(articulos: Articles, cant: Float) { |
| 441 | val body = InvBody(InventarioNuevo,// TODO PREPARO PARA MANDAR A CARGAR EN LA BD | 543 | val body = InvBody(InventarioNuevo,// TODO PREPARO PARA MANDAR A CARGAR EN LA BD |
| 442 | articulos.sector, | 544 | articulos.sector, |
| 443 | articulos.codigo, | 545 | articulos.codigo, |
| 444 | articulos.descripcion, | 546 | articulos.descripcion, |
| 445 | cant.toString(), | 547 | cant.toString(), |
| 446 | articulos.codBar, | 548 | articulos.codBar, |
| 447 | articulos.codOrigen, | 549 | articulos.codOrigen, |
| 448 | articulos.precio, | 550 | articulos.precio, |
| 449 | articulos.precio, | 551 | articulos.precio, |
| 450 | articulos.balanza, | 552 | articulos.balanza, |
| 451 | articulos.depSn, | 553 | articulos.depSn, |
| 452 | ObtenerFechaActual(), | 554 | ObtenerFechaActual(), |
| 453 | ObtenerFechaActual()) | 555 | ObtenerFechaActual()) |
| 454 | InsertarArtEnDB(body)// TODO MANDO A CARGAR A LA BASE DE DATOS | 556 | InsertarArtEnDB(body)// TODO MANDO A CARGAR A LA BASE DE DATOS |
| 455 | } | 557 | } |
| 456 | 558 | ||
| 457 | fun cargarRecicler(articulos: Articles, cant: Float) { | 559 | fun cargarRecicler(articulos: Articles, cant: Float) { |
| 458 | 560 | ||
| 459 | //TODO CARGO EN LE RV | 561 | //TODO CARGO EN LE RV |
| 460 | val item = ItemsRecycler(articulos.sector, articulos.codigo, articulos.descripcion, cant, articulos.codBar) | 562 | val item = ItemsRecycler(articulos.sector, articulos.codigo, articulos.descripcion, cant, articulos.codBar,articulos.codOrigen) |
| 461 | listArticulos.add(item) | 563 | listArticulos.add(item) |
| 462 | 564 | ||
| 463 | viewAdapter = ProductosListAdapter(listArticulos) | 565 | viewAdapter = ProductosListAdapter(listArticulos) |
| 464 | viewManager = LinearLayoutManager(requireContext()) | 566 | viewManager = LinearLayoutManager(requireContext()) |
| 465 | deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! | 567 | deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! |
| 466 | rcInventarios.apply { | 568 | rcInventarios.apply { |
| 467 | adapter = viewAdapter | 569 | adapter = viewAdapter |
| 468 | layoutManager = viewManager | 570 | layoutManager = viewManager |
| 469 | } | 571 | } |
| 470 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { | 572 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { |
| 471 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { | 573 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { |
| 472 | return false | 574 | return false |
| 473 | } | 575 | } |
| 474 | 576 | ||
| 475 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { | 577 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { |
| 476 | (viewAdapter as ProductosListAdapter).removeItem(viewHolder) | 578 | (viewAdapter as ProductosListAdapter).removeItem(viewHolder) |
| 477 | viewAdapter.notifyDataSetChanged() | 579 | viewAdapter.notifyDataSetChanged() |
| 478 | } | 580 | } |
| 479 | 581 | ||
| 480 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { | 582 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { |
| 481 | val itemView = viewHolder.itemView | 583 | val itemView = viewHolder.itemView |
| 482 | val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2 | 584 | val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2 |
| 483 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) | 585 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) |
| 484 | 586 | ||
| 485 | if (dX > 0) { | 587 | if (dX > 0) { |
| 486 | 588 | ||
| 487 | if (dX < c.width / 2) c.drawColor(Color.GREEN) | 589 | if (dX < c.width / 2) c.drawColor(Color.GREEN) |
| 488 | else c.drawColor(Color.RED) | 590 | else c.drawColor(Color.RED) |
| 489 | deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom - iconMargin) | 591 | deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom - iconMargin) |
| 490 | } else { | 592 | } else { |
| 491 | 593 | ||
| 492 | } | 594 | } |
| 493 | 595 | ||
| 494 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | 596 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) |
| 495 | deleteIcon.draw(c) | 597 | deleteIcon.draw(c) |
| 496 | } | 598 | } |
| 497 | } | 599 | } |
| 498 | 600 | ||
| 499 | val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback) | 601 | val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback) |
| 500 | itemTouchHelper.attachToRecyclerView(rcInventarios) | 602 | itemTouchHelper.attachToRecyclerView(rcInventarios) |
| 501 | } | 603 | } |
| 502 | 604 | ||
| 503 | private fun ProdNoCont(): Int? { | 605 | private fun ProdNoCont(): Int? { |
| 504 | var mostrarStock = 0 | 606 | var mostrarStock = 0 |
| 505 | if (sharedPreferences.contains("cbMostrarStock")) if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") mostrarStock = 1 | 607 | if (sharedPreferences.contains("cbMostrarStock")) if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") mostrarStock = 1 |
| 506 | return mostrarStock | 608 | return mostrarStock |
| 507 | } | 609 | } |
| 508 | 610 | ||
| 509 | private fun AjusteProductos(): Int? { | 611 | private fun AjusteProductos(): Int? { |
| 510 | var prodInclu = 0 | 612 | var prodInclu = 0 |
| 511 | if (sharedPreferences.contains("rbProInclu")) if (sharedPreferences.getString("rbProInclu", "").toString() == "1") prodInclu = 1 | 613 | if (sharedPreferences.contains("rbProInclu")) if (sharedPreferences.getString("rbProInclu", "").toString() == "1") prodInclu = 1 |
| 512 | 614 | ||
| 513 | if (sharedPreferences.contains("rbProNoInclu")) if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") prodInclu = 0 | 615 | if (sharedPreferences.contains("rbProNoInclu")) if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") prodInclu = 0 |
| 514 | return prodInclu | 616 | return prodInclu |
| 515 | } | 617 | } |
| 516 | 618 | ||
| 517 | private fun SerchArea() { | 619 | private fun SerchArea() { |
| 518 | 620 | ||
| 519 | if (sharedPreferences.contains("rbVentas")) if (sharedPreferences.getString("rbVentas", "").toString() == "1") iArea = 0 | 621 | if (sharedPreferences.contains("rbVentas")) if (sharedPreferences.getString("rbVentas", "").toString() == "1") iArea = 0 |
| 520 | if (sharedPreferences.contains("rbDeposito")) if (sharedPreferences.getString("rbDeposito", "").toString() == "1") iArea = 1 | 622 | if (sharedPreferences.contains("rbDeposito")) if (sharedPreferences.getString("rbDeposito", "").toString() == "1") iArea = 1 |
| 521 | } | 623 | } |
| 522 | 624 | ||
| 523 | fun ObtenerFechaActual(): String? { | 625 | fun ObtenerFechaActual(): String? { |
| 524 | //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD | 626 | //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD |
| 525 | val current = LocalDateTime.now() | 627 | val current = LocalDateTime.now() |
| 526 | val formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy hh:mm:ss") | 628 | val formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy hh:mm:ss") |
| 527 | val dFechaHora = current.format(formatter) | 629 | val dFechaHora = current.format(formatter) |
| 528 | return dFechaHora.toString() | 630 | return dFechaHora.toString() |
| 529 | } | 631 | } |
| 530 | 632 | ||
| 531 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { | 633 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { |
| 532 | lifecycleScope.launch { | 634 | lifecycleScope.launch { |
| 533 | withContext(Dispatchers.IO) { | 635 | withContext(Dispatchers.IO) { |
| 534 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) | 636 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) |
| 535 | } | 637 | } |
| 536 | } | 638 | } |
| 537 | } | 639 | } |
| 538 | 640 | ||
| 539 | fun updateCantidad(sector: String, codigo: String, cantidad: Float) { | 641 | fun updateCantidad(sector: String, codigo: String, cantidad: Float) { |
| 540 | lifecycleScope.launch { | 642 | lifecycleScope.launch { |
| 541 | withContext(Dispatchers.IO) { | 643 | withContext(Dispatchers.IO) { |
| 542 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.UpdateInvBody(cantidad, sector, codigo) | 644 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.UpdateInvBody(cantidad, sector, codigo) |
| 543 | } | 645 | } |
| 544 | } | 646 | } |
| 545 | } | 647 | } |
| 546 | 648 | ||
| 547 | suspend fun cargarInventario(inventario: Int): List<InvBody>? { | 649 | suspend fun cargarInventario(inventario: Int): List<InvBody>? { |
| 548 | // var inventarios: List<InvBody>? = null | 650 | // var inventarios: List<InvBody>? = null |
| 549 | return GlobalScope.async(Dispatchers.IO) { | 651 | return GlobalScope.async(Dispatchers.IO) { |
| 550 | return@async AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.fetchAllInvBody(inventario) | 652 | return@async AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.fetchAllInvBody(inventario) |
| 551 | }.await() | 653 | }.await() |
| 552 | } | 654 | } |
| 553 | } | 655 | } |
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/ItemDescripcion.kt
| 1 | package com.focasoftware.deboinventariov20.ui.inventario | File was deleted | |
| 2 | |||
| 3 | data class ItemDescripcion(val sector: String?,val codigo: String?, val descripcion: String?, val codigoBarras: String?) |
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/ItemsRecycler.kt
| 1 | package com.focasoftware.deboinventariov20.ui.inventario | 1 | package com.focasoftware.deboinventariov20.ui.inventario |
| 2 | 2 | ||
| 3 | data class ItemsRecycler(val sector: String?,val codigo: String?, val descripcion: String?, var cantTomada: Float, val codigoBarras: String?) |
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/ProductosListAdapter.kt
| 1 | package com.focasoftware.deboinventariov20.ui.inventario | 1 | package com.focasoftware.deboinventariov20.ui.inventario |
| 2 | 2 | ||
| 3 | import android.view.LayoutInflater | 3 | import android.view.LayoutInflater |
| 4 | import android.view.View | 4 | import android.view.View |
| 5 | import android.view.ViewGroup | 5 | import android.view.ViewGroup |
| 6 | import androidx.recyclerview.widget.RecyclerView | 6 | import androidx.recyclerview.widget.RecyclerView |
| 7 | import com.focasoftware.deboinventariov20.R | 7 | import com.focasoftware.deboinventariov20.R |
| 8 | import com.google.android.material.snackbar.Snackbar | 8 | import com.google.android.material.snackbar.Snackbar |
| 9 | import kotlinx.android.synthetic.main.item.view.* | 9 | import kotlinx.android.synthetic.main.item.view.* |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | class ProductosListAdapter(private val productos: ArrayList<ItemsRecycler>) : RecyclerView.Adapter<ProductosListAdapter.ItemsViewHolder>() { | 12 | class ProductosListAdapter(private val productos: ArrayList<ItemsRecycler>) : RecyclerView.Adapter<ProductosListAdapter.ItemsViewHolder>() { |
| 13 | private var removePosition: Int = 0 | 13 | private var removePosition: Int = 0 |
| 14 | private var removedItem: ItemsRecycler? = null | 14 | private var removedItem: ItemsRecycler? = null |
| 15 | internal var items2: ArrayList<ItemsRecycler>? = null | 15 | internal var items2: ArrayList<ItemsRecycler>? = null |
| 16 | 16 | ||
| 17 | init { | 17 | init { |
| 18 | this.items2 = productos | 18 | this.items2 = productos |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item, parent, false)) | 21 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item, parent, false)) |
| 22 | 22 | ||
| 23 | override fun getItemCount() = productos.size | 23 | override fun getItemCount() = productos.size |
| 24 | 24 | ||
| 25 | override fun onBindViewHolder(holder: ItemsViewHolder, position: Int) { | 25 | override fun onBindViewHolder(holder: ItemsViewHolder, position: Int) { |
| 26 | when (holder) { | 26 | when (holder) { |
| 27 | is ItemsViewHolder -> { | 27 | is ItemsViewHolder -> { |
| 28 | holder.bind(items2!![position]) | 28 | holder.bind(items2!![position]) |
| 29 | } | 29 | } |
| 30 | } | 30 | } |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | class ItemsViewHolder constructor(view: View) : RecyclerView.ViewHolder(view) { | 34 | class ItemsViewHolder constructor(view: View) : RecyclerView.ViewHolder(view) { |
| 35 | 35 | ||
| 36 | val sector = view.tvSector | 36 | val sector = view.tvSector |
| 37 | val codigo = view.tvCodigo | 37 | val codigo = view.tvCodigo |
| 38 | val descripcion = view.tvDescripcion | 38 | val descripcion = view.tvDescripcion |
| 39 | val cantCont = view.tvCantidad | 39 | val cantCont = view.tvCantidad |
| 40 | val codigoBarras = view.tvCodigoBarras | 40 | val codigoBarras = view.tvCodigoBarras |
| 41 | val codigoOrigen = view.tvCodigoOrigen | ||
| 41 | 42 | ||
| 42 | fun bind(pro: ItemsRecycler) { | 43 | fun bind(pro: ItemsRecycler) { |
| 43 | sector.text = pro.sector | 44 | sector.text = pro.sector |
| 44 | codigo.text = pro.codigo | 45 | codigo.text = pro.codigo |
| 45 | descripcion.text = pro.descripcion | 46 | descripcion.text = pro.descripcion |
| 46 | cantCont.text = pro.cantTomada.toString() | 47 | cantCont.text = pro.cantTomada.toString() |
| 47 | codigoBarras.text = pro.codigoBarras | 48 | codigoBarras.text = pro.codigoBarras |
| 49 | codigoOrigen.text = pro.codigoOrigen | ||
| 48 | } | 50 | } |
| 49 | } | 51 | } |
| 50 | 52 | ||
| 51 | fun removeItem(viewHolder: RecyclerView.ViewHolder) { | 53 | fun removeItem(viewHolder: RecyclerView.ViewHolder) { |
| 52 | removePosition = viewHolder.adapterPosition | 54 | removePosition = viewHolder.adapterPosition |
| 53 | removedItem = productos[viewHolder.adapterPosition] | 55 | removedItem = productos[viewHolder.adapterPosition] |
| 54 | 56 | ||
| 55 | productos.removeAt(viewHolder.adapterPosition) | 57 | productos.removeAt(viewHolder.adapterPosition) |
| 56 | notifyItemRemoved(viewHolder.adapterPosition) | 58 | notifyItemRemoved(viewHolder.adapterPosition) |
| 57 | 59 | ||
| 58 | Snackbar.make(viewHolder.itemView, "El articulo fue ${removedItem!!.descripcion} eliminado", Snackbar.LENGTH_LONG).setAction("Rehacer") { | 60 | Snackbar.make(viewHolder.itemView, "El articulo fue ${removedItem!!.descripcion} eliminado", Snackbar.LENGTH_LONG).setAction("Rehacer") { |
| 59 | productos.add(removePosition, removedItem!!) | 61 | productos.add(removePosition, removedItem!!) |
| 60 | notifyItemInserted(removePosition) | 62 | notifyItemInserted(removePosition) |
| 61 | }.show() | 63 | }.show() |
| 62 | } | 64 | } |
| 63 | // interface OnItemClickListener{ | ||
| 64 | // fun OnImageClick(position: Int) |
app/src/main/java/com/focasoftware/deboinventariov20/ui/main/MainFragment.kt
| 1 | package com.focasoftware.deboinventariov20.ui.main | 1 | package com.focasoftware.deboinventariov20.ui.main |
| 2 | 2 | ||
| 3 | import android.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 androidx.fragment.app.Fragment | 9 | import androidx.fragment.app.Fragment |
| 10 | import androidx.navigation.NavController | 10 | import androidx.navigation.NavController |
| 11 | import androidx.navigation.Navigation | 11 | import androidx.navigation.Navigation |
| 12 | import androidx.recyclerview.widget.LinearLayoutManager | 12 | import androidx.recyclerview.widget.LinearLayoutManager |
| 13 | import androidx.recyclerview.widget.RecyclerView | 13 | import androidx.recyclerview.widget.RecyclerView |
| 14 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 14 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
| 15 | import com.focasoftware.deboinventariov20.Model.InvHead | 15 | import com.focasoftware.deboinventariov20.Model.InvHead |
| 16 | import com.focasoftware.deboinventariov20.R | 16 | import com.focasoftware.deboinventariov20.R |
| 17 | import kotlinx.coroutines.Dispatchers | 17 | import kotlinx.coroutines.Dispatchers |
| 18 | import kotlinx.coroutines.GlobalScope | 18 | import kotlinx.coroutines.GlobalScope |
| 19 | import kotlinx.coroutines.async | 19 | import kotlinx.coroutines.async |
| 20 | import kotlinx.coroutines.launch | 20 | import kotlinx.coroutines.launch |
| 21 | import java.util.* | 21 | import java.util.* |
| 22 | 22 | ||
| 23 | class MainFragment : Fragment(), InventarioListAdapter.OnItemClickListener { | 23 | class MainFragment : Fragment(), InventarioListAdapter.OnItemClickListener { |
| 24 | private lateinit var inventarios: List<InvHead> | 24 | private lateinit var inventarios: List<InvHead> |
| 25 | private lateinit var rcInventario: RecyclerView | 25 | private lateinit var rcInventario: RecyclerView |
| 26 | private lateinit var viewAdapter: RecyclerView.Adapter<*> | 26 | private lateinit var viewAdapter: RecyclerView.Adapter<*> |
| 27 | private lateinit var viewManager: RecyclerView.LayoutManager | 27 | private lateinit var viewManager: RecyclerView.LayoutManager |
| 28 | private var listIvn = ArrayList<ItemInventario>() | 28 | private var listIvn = ArrayList<ItemInventario>() |
| 29 | private lateinit var navController: NavController | 29 | private lateinit var navController: NavController |
| 30 | private lateinit var sharedPreferences: SharedPreferences | 30 | private lateinit var sharedPreferences: SharedPreferences |
| 31 | 31 | ||
| 32 | override fun onCreate(savedInstanceState: Bundle?) { | 32 | override fun onCreate(savedInstanceState: Bundle?) { |
| 33 | super.onCreate(savedInstanceState) | 33 | super.onCreate(savedInstanceState) |
| 34 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 34 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 39 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
| 40 | val v = inflater.inflate(R.layout.fragment_main, container, false) | 40 | val v = inflater.inflate(R.layout.fragment_main, container, false) |
| 41 | GlobalScope.launch(Dispatchers.Main) { | 41 | GlobalScope.launch(Dispatchers.Main) { |
| 42 | inventarios = buscarEnBDInvHead() | 42 | inventarios = buscarEnBDInvHead() |
| 43 | for ((i, item) in inventarios.withIndex()) { | 43 | for ((i, item) in inventarios.withIndex()) { |
| 44 | val inv = InvHead(inventarios[i].invNum, | 44 | val inv = InvHead(inventarios[i].invNum, |
| 45 | inventarios[i].descripcion, | 45 | inventarios[i].descripcion, |
| 46 | inventarios[i].estado, | 46 | inventarios[i].estado, |
| 47 | inventarios[i].fechaInicio, | 47 | inventarios[i].fechaInicio, |
| 48 | inventarios[i].fechaFinal, | 48 | inventarios[i].fechaFinal, |
| 49 | inventarios[i].prodContados, | 49 | inventarios[i].prodContados, |
| 50 | inventarios[i].lugar, | 50 | inventarios[i].lugar, |
| 51 | inventarios[i].stDesc, | 51 | inventarios[i].stDesc, |
| 52 | inventarios[i].proNoCont) | 52 | inventarios[i].proNoCont) |
| 53 | cargarRecicler(inv) | 53 | cargarRecicler(inv) |
| 54 | } | 54 | } |
| 55 | } | 55 | } |
| 56 | rcInventario = v.findViewById(R.id.rcInventario) | 56 | rcInventario = v.findViewById(R.id.rcInventario) |
| 57 | return v | 57 | return v |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | suspend fun buscarEnBDInvHead(): List<InvHead> { | 60 | suspend fun buscarEnBDInvHead(): List<InvHead> { |
| 61 | //TODO BUSQUEDA POR DESCRIPCION | 61 | //TODO BUSQUEDA POR DESCRIPCION |
| 62 | var busqueda: List<InvHead> | 62 | var busqueda: List<InvHead> |
| 63 | return GlobalScope.async(Dispatchers.IO) { | 63 | return GlobalScope.async(Dispatchers.IO) { |
| 64 | busqueda = AppDb.getAppDb(requireContext())!!.InvHeadDAO()!!.fetchAllInvHead() | 64 | busqueda = AppDb.getAppDb(requireContext())!!.InvHeadDAO()!!.fetchAllInvHead() |
| 65 | return@async busqueda | 65 | return@async busqueda |
| 66 | }.await() | 66 | }.await() |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | fun cargarRecicler(inv: InvHead) { | 69 | fun cargarRecicler(inv: InvHead) { |
| 70 | //TODO CARGO EN LE RV | 70 | //TODO CARGO EN LE RV |
| 71 | 71 | ||
| 72 | val number = if (inv.invNum.toLong()<10) "0${inv.invNum.toLong()}" else inv.invNum.toString() | 72 | val number = if (inv.invNum.toLong()<10) "0${inv.invNum.toLong()}" else inv.invNum.toString() |
| 73 | val item = ItemInventario("N° $number ${inv.descripcion}. Fecha: ${inv.fechaFinal}") | 73 | val item = ItemInventario("N° $number ${inv.descripcion}. Fecha: ${inv.fechaFinal}") |
| 74 | //(articulos.sector, articulos.codigo, articulos.descripcion, cant, articulos.codBar) | 74 | //(articulos.sector, articulos.codigo, articulos.descripcion, cant, articulos.codBar) |
| 75 | listIvn.add(item) | 75 | listIvn.add(item) |
| 76 | 76 | ||
| 77 | viewAdapter = InventarioListAdapter(listIvn, this) | 77 | viewAdapter = InventarioListAdapter(listIvn, this) |
| 78 | viewManager = LinearLayoutManager(requireContext()) | 78 | viewManager = LinearLayoutManager(requireContext()) |
| 79 | 79 | ||
| 80 | rcInventario.apply { | 80 | rcInventario.apply { |
| 81 | adapter = viewAdapter | 81 | adapter = viewAdapter |
| 82 | layoutManager = viewManager | 82 | layoutManager = viewManager |
| 83 | } | 83 | } |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 86 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
| 87 | super.onViewCreated(view, savedInstanceState) | 87 | super.onViewCreated(view, savedInstanceState) |
| 88 | navController = Navigation.findNavController(view) | 88 | navController = Navigation.findNavController(view) |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | override fun OnItemClick(position: Int) { | 91 | override fun OnItemClick(position: Int) { |
| 92 | val editor = sharedPreferences.edit() | 92 | val editor = sharedPreferences.edit() |
| 93 | var invSel:String = listIvn[position].inventario.toString() | 93 | var invSel:String = listIvn[position].inventario.toString() |
| 94 | invSel=invSel.substring(13, 15) | 94 | invSel=invSel.substring(3, 5) |
| 95 | editor?.putString("Inventario", invSel) | 95 | editor?.putString("Inventario", invSel) |
| 96 | editor?.apply() | 96 | editor?.apply() |
| 97 | editor.commit() | 97 | editor.commit() |
| 98 | navController.navigate(R.id.action_mainFragment2_to_inventarioFragment) | 98 | navController.navigate(R.id.action_mainFragment2_to_inventarioFragment) |
| 99 | 99 | ||
| 100 | } | 100 | } |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | 103 |
app/src/main/java/com/focasoftware/deboinventariov20/ui/servidores/AdapterServidores.kt
| 1 | package com.focasoftware.deboinventariov20.ui.servidores | 1 | package com.focasoftware.deboinventariov20.ui.servidores |
| 2 | 2 | ||
| 3 | import android.content.Context | 3 | import android.content.Context |
| 4 | import android.view.LayoutInflater | 4 | import android.view.LayoutInflater |
| 5 | import android.view.View | 5 | import android.view.View |
| 6 | import android.view.ViewGroup | 6 | import android.view.ViewGroup |
| 7 | import androidx.recyclerview.widget.RecyclerView | 7 | import androidx.recyclerview.widget.RecyclerView |
| 8 | import com.focasoftware.deboinventariov20.R | 8 | import com.focasoftware.deboinventariov20.R |
| 9 | import com.focasoftware.deboinventariov20.ui.inventario.ItemsRecycler | ||
| 10 | import com.google.android.material.snackbar.Snackbar | ||
| 9 | import kotlinx.android.synthetic.main.item_servidores.view.* | 11 | import kotlinx.android.synthetic.main.item_servidores.view.* |
| 10 | 12 | ||
| 11 | class AdapterServidores( | 13 | class AdapterServidores(private val servidor: ArrayList<ItemsServidores>, private var contexto: Context) : |
| 12 | private val servidor: ArrayList<ItemsServidores>, | ||
| 13 | private var contexto: Context | ||
| 14 | ) : | ||
| 15 | RecyclerView.Adapter<AdapterServidores.ViewHolder>() { | 14 | RecyclerView.Adapter<AdapterServidores.ViewHolder>() { |
| 16 | 15 | private var removePosition: Int = 0 | |
| 16 | private var removedItem: ItemsServidores? = null | ||
| 17 | 17 | ||
| 18 | class ViewHolder(var vista: View) : RecyclerView.ViewHolder(vista) { | 18 | class ViewHolder(var vista: View) : RecyclerView.ViewHolder(vista) { |
| 19 | fun bind(itemsServidores: ItemsServidores) { | 19 | fun bind(itemsServidores: ItemsServidores) { |
| 20 | vista.tvDescServidor.text = itemsServidores.descripcion | 20 | vista.tvDescServidor.text = itemsServidores.descripcion |
| 21 | vista.tvDireccionServidor.text = itemsServidores.direccion | 21 | vista.tvDireccionServidor.text = itemsServidores.direccion |
| 22 | 22 | ||
| 23 | } | 23 | } |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | 26 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { |
| 27 | return ViewHolder( | 27 | return ViewHolder( |
| 28 | LayoutInflater.from(parent.context).inflate(R.layout.item_servidores, parent, false) | 28 | LayoutInflater.from(parent.context).inflate(R.layout.item_servidores, parent, false) |
| 29 | ) | 29 | ) |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | override fun getItemCount(): Int { | 32 | override fun getItemCount(): Int { |
| 33 | return servidor.size | 33 | return servidor.size |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | override fun onBindViewHolder(holder: ViewHolder, position: Int) { | 36 | override fun onBindViewHolder(holder: ViewHolder, position: Int) { |
| 37 | holder.bind(servidor[position]) | 37 | holder.bind(servidor[position]) |
| 38 | } | 38 | } |
| 39 | fun removeItem(viewHolder: RecyclerView.ViewHolder) { | ||
| 40 | removePosition = viewHolder.adapterPosition | ||
| 41 | removedItem = servidor[viewHolder.adapterPosition] | ||
| 42 | |||
| 43 | servidor.removeAt(viewHolder.adapterPosition) | ||
| 44 | notifyItemRemoved(viewHolder.adapterPosition) | ||
| 39 | 45 | ||
| 46 | Snackbar.make(viewHolder.itemView, "El articulo fue ${removedItem!!.descripcion} eliminado", Snackbar.LENGTH_LONG).setAction("Rehacer") { | ||
| 47 | servidor.add(removePosition, removedItem!!) | ||
| 48 | notifyItemInserted(removePosition) |
app/src/main/java/com/focasoftware/deboinventariov20/ui/servidores/ServidoresFragment.kt
| 1 | package com.focasoftware.deboinventariov20.ui.servidores | 1 | package com.focasoftware.deboinventariov20.ui.servidores |
| 2 | 2 | ||
| 3 | import android.graphics.Canvas | ||
| 4 | import android.graphics.Color | ||
| 5 | import android.graphics.drawable.Drawable | ||
| 3 | import android.os.Bundle | 6 | import android.os.Bundle |
| 4 | import androidx.fragment.app.Fragment | ||
| 5 | import android.view.LayoutInflater | 7 | import android.view.LayoutInflater |
| 6 | import android.view.View | 8 | import android.view.View |
| 7 | import android.view.ViewGroup | 9 | import android.view.ViewGroup |
| 8 | import android.widget.Button | 10 | import androidx.core.content.ContextCompat |
| 11 | import androidx.fragment.app.Fragment | ||
| 12 | import androidx.lifecycle.lifecycleScope | ||
| 9 | import androidx.recyclerview.widget.DefaultItemAnimator | 13 | import androidx.recyclerview.widget.DefaultItemAnimator |
| 14 | import androidx.recyclerview.widget.ItemTouchHelper | ||
| 10 | import androidx.recyclerview.widget.LinearLayoutManager | 15 | import androidx.recyclerview.widget.LinearLayoutManager |
| 11 | import androidx.recyclerview.widget.RecyclerView | 16 | import androidx.recyclerview.widget.RecyclerView |
| 12 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 17 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
| 13 | import com.focasoftware.deboinventariov20.Model.ServeInv | 18 | import com.focasoftware.deboinventariov20.Model.ServeInv |
| 14 | import com.focasoftware.deboinventariov20.R | 19 | import com.focasoftware.deboinventariov20.R |
| 20 | import com.focasoftware.deboinventariov20.ui.inventario.ProductosListAdapter | ||
| 15 | import kotlinx.android.synthetic.main.fragment_servidores.* | 21 | import kotlinx.android.synthetic.main.fragment_servidores.* |
| 16 | import kotlinx.coroutines.GlobalScope | 22 | import kotlinx.coroutines.* |
| 17 | import kotlinx.coroutines.launch | 23 | import java.text.FieldPosition |
| 18 | 24 | ||
| 19 | class ServidoresFragment : Fragment() { | 25 | class ServidoresFragment : Fragment() { |
| 20 | val servidorNuevo = ArrayList<ItemsServidores>() | 26 | private val servidorNuevo = ArrayList<ItemsServidores>() |
| 21 | var index=0 | 27 | private var index = 0 |
| 22 | 28 | private lateinit var rvServidores: RecyclerView | |
| 23 | override fun onCreateView( | 29 | private lateinit var viewAdapter: RecyclerView.Adapter<*> |
| 24 | inflater: LayoutInflater, | 30 | private lateinit var viewManager: RecyclerView.LayoutManager |
| 25 | container: ViewGroup?, | 31 | private var listIvn = java.util.ArrayList<ItemsServidores>() |
| 26 | savedInstanceState: Bundle? | 32 | private lateinit var servidores: List<ServeInv> |
| 27 | ): View? { | 33 | private lateinit var deleteIcon: Drawable |
| 28 | val v = inflater.inflate(R.layout.fragment_servidores, container, false) | 34 | |
| 35 | override fun onCreate(savedInstanceState: Bundle?) { | ||
| 36 | super.onCreate(savedInstanceState) | ||
| 37 | buscaEnBD() | ||
| 38 | } | ||
| 29 | 39 | ||
| 30 | val btnGuardarServidores = v.findViewById<Button>(R.id.btnGuardarServidores) | 40 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
| 31 | val rvServidores = v.findViewById<RecyclerView>(R.id.rvServidores) | 41 | super.onViewCreated(view, savedInstanceState) |
| 32 | 42 | ||
| 33 | rvServidores.layoutManager = LinearLayoutManager(context) | 43 | rvServidores.layoutManager = LinearLayoutManager(context) |
| 34 | rvServidores.itemAnimator = DefaultItemAnimator() | 44 | rvServidores.itemAnimator = DefaultItemAnimator() |
| 35 | 45 | ||
| 36 | btnGuardarServidores.setOnClickListener { | 46 | btnGuardarServidores.setOnClickListener { |
| 37 | rvServidores.adapter = AdapterServidores(ingregarDatos(), requireContext()) | 47 | if (etNombreServidor.text.isNullOrBlank()){ |
| 48 | etNombreServidor.error="Nombre no valido" | ||
| 49 | etNombreServidor.requestFocus() | ||
| 50 | etNombreServidor.hint="Nombre no valido" | ||
| 51 | } | ||
| 52 | if (etDireccionServidor.text.isNullOrBlank()){ | ||
| 53 | etDireccionServidor.error="Dirección no valida" | ||
| 54 | etDireccionServidor.requestFocus() | ||
| 55 | etDireccionServidor.hint="Dirección no valida" | ||
| 56 | } | ||
| 57 | if (!etDireccionServidor.text.isNullOrBlank() || !etNombreServidor.text.isNullOrBlank()){ | ||
| 58 | btnGuardarServidores.isEnabled=true | ||
| 59 | buscaEnBD() | ||
| 60 | rvServidores.adapter = AdapterServidores(ingresarDatos(), requireContext()) | ||
| 61 | btnGuardarServidores.isEnabled=false | ||
| 62 | } | ||
| 38 | } | 63 | } |
| 39 | return v | ||
| 40 | } | 64 | } |
| 65 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
| 66 | val v = inflater.inflate(R.layout.fragment_servidores, container, false) | ||
| 67 | rvServidores = v.findViewById(R.id.rvServidores) | ||
| 41 | 68 | ||
| 42 | fun ingregarDatos(): ArrayList<ItemsServidores> { | 69 | return v |
| 70 | } | ||
| 43 | 71 | ||
| 44 | val item=ItemsServidores(etNombreServidor.text.toString(),etDireccionServidor.text.toString(),"0") | 72 | fun ingresarDatos(): ArrayList<ItemsServidores> { |
| 45 | 73 | ||
| 46 | val servidor = ServeInv( | 74 | val item = ItemsServidores(etNombreServidor.text.toString(), etDireccionServidor.text.toString(), "0") |
| 47 | etNombreServidor.text.toString(), | 75 | val servidor = ServeInv(etNombreServidor.text.toString(), etDireccionServidor.text.toString(), "0") |
| 48 | etDireccionServidor.text.toString(), | 76 | index += index |
| 49 | "0") | ||
| 50 | index+=index | ||
| 51 | servidorNuevo.add(item) | 77 | servidorNuevo.add(item) |
| 52 | val Job = GlobalScope.launch { | 78 | val Job = GlobalScope.launch { |
| 53 | AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.insertServer(servidor) | 79 | AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.insertServer(servidor) |
| 54 | } | 80 | } |
| 55 | 81 | ||
| 56 | return servidorNuevo | 82 | return servidorNuevo |
| 57 | } | 83 | } |
| 58 | } | ||
| 84 | |||
| 85 | suspend fun buscarEnBD(): List<ServeInv> { | ||
| 86 | //TODO BUSQUEDA POR DESCRIPCION | ||
| 87 | var busqueda: List<ServeInv> | ||
| 88 | return GlobalScope.async(Dispatchers.IO) { | ||
| 89 | busqueda = AppDb.getAppDb(requireContext())!!.ServeInvDao()!!.fetchAllServers() | ||
| 90 | return@async busqueda | ||
| 91 | }.await() | ||
| 92 | } | ||
| 93 | |||
| 94 | fun buscaEnBD() { | ||
| 95 | GlobalScope.launch(Dispatchers.Main) { | ||
| 96 | servidores = buscarEnBD() | ||
| 97 | for ((i, item) in servidores.withIndex()) { | ||
| 98 | val ser = ServeInv(servidores[i].descripcion, servidores[i].direccion, servidores[i].predeterminado) | ||
| 99 | cargarRecicler(ser) | ||
| 100 | } | ||
| 101 | } | ||
| 102 | } | ||
| 103 | |||
| 104 | fun cargarRecicler(ser: ServeInv) { | ||
| 105 | //TODO CARGO EN LE RV | ||
| 106 | deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! | ||
| 107 | val item = ItemsServidores(ser.descripcion, ser.direccion, ser.predeterminado) | ||
| 108 | index += index | ||
| 109 | listIvn.add(item) | ||
| 110 | |||
| 111 | viewAdapter = AdapterServidores(listIvn, requireContext()) | ||
| 112 | viewManager = LinearLayoutManager(requireContext()) | ||
| 113 | |||
| 114 | rvServidores.apply { | ||
| 115 | adapter = viewAdapter | ||
| 116 | layoutManager = viewManager | ||
| 117 | } | ||
| 118 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { | ||
| 119 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { | ||
| 120 | return false | ||
| 121 | } | ||
| 122 | |||
| 123 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) { | ||
| 124 | BorrarInvActual(viewHolder.adapterPosition.toLong()) | ||
| 125 | |||
| 126 | (viewAdapter as AdapterServidores).removeItem(viewHolder) | ||
| 127 | viewAdapter.notifyDataSetChanged() | ||
| 128 | } | ||
| 129 | |||
| 130 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { | ||
| 131 | val itemView = viewHolder.itemView | ||
| 132 | val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2 | ||
| 133 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) | ||
| 134 | |||
| 135 | if (dX > 0) { | ||
| 136 | |||
| 137 | if (dX < c.width / 2) c.drawColor(Color.GREEN) | ||
| 138 | else c.drawColor(Color.RED) | ||
| 139 | deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom - iconMargin) | ||
| 140 | } else { } | ||
| 141 | |||
| 142 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | ||
| 143 | deleteIcon.draw(c) | ||
| 144 | |||
| 145 | } | ||
| 146 | } | ||
| 147 | |||
| 148 | val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback) | ||
| 149 | itemTouchHelper.attachToRecyclerView(rvServidores) | ||
| 150 | } | ||
| 151 | private fun BorrarInvActual(idServer: Long) { | ||
| 152 | lifecycleScope.launch { | ||
| 153 | withContext(Dispatchers.IO) { | ||
| 154 | AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.deleteServer(idServer) |
app/src/main/res/drawable-v24/boton_borde_redondeado.xml
| File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
| 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | <solid android:color="@color/colorPrimary"/> | ||
| 4 | <corners android:radius="40dp"/> | ||
| 5 | |||
| 6 | |||
| 7 | |||
| 8 | </shape> |
app/src/main/res/drawable/boton_redondo.xml
| File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
| 2 | <shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| 3 | <solid android:color="@color/colorAccent"/> | ||
| 4 | <corners android:radius="80dp"/> | ||
| 5 | |||
| 6 | |||
| 7 | |||
| 8 | </shape> |
app/src/main/res/drawable/cod_origen.png
2.17 KB
app/src/main/res/drawable/codbar.png
1.53 KB
app/src/main/res/drawable/desc.png
2.24 KB
app/src/main/res/layout/fragment_actua_maestros.xml
| 1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
| 5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
| 6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
| 7 | tools:context=".ui.actualizacionMaestros.ActuaMaestrosFragment"> | 7 | tools:context=".ui.actualizacionMaestros.ActuaMaestrosFragment"> |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | <androidx.appcompat.widget.AppCompatTextView | 10 | <androidx.appcompat.widget.AppCompatTextView |
| 11 | android:id="@+id/tvActMaestros" | 11 | android:id="@+id/tvActMaestros" |
| 12 | android:layout_width="match_parent" | 12 | android:layout_width="match_parent" |
| 13 | android:layout_height="wrap_content" | 13 | android:layout_height="wrap_content" |
| 14 | android:layout_marginTop="@dimen/MarginTopTitulos" | 14 | android:layout_marginTop="@dimen/MarginTopTitulos" |
| 15 | android:gravity="center" | 15 | android:gravity="center" |
| 16 | 16 | ||
| 17 | android:text="@string/tvActMaestros" | 17 | android:text="@string/tvActMaestros" |
| 18 | android:textColor="@color/colorAccent" | 18 | android:textColor="@color/colorAccent" |
| 19 | android:textSize="@dimen/Titulos" | 19 | android:textSize="@dimen/Titulos" |
| 20 | app:fontFamily="sans-serif-condensed" | 20 | app:fontFamily="sans-serif-condensed" |
| 21 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | 21 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" |
| 22 | app:layout_constraintEnd_toEndOf="parent" | 22 | app:layout_constraintEnd_toEndOf="parent" |
| 23 | app:layout_constraintStart_toStartOf="parent" | 23 | app:layout_constraintStart_toStartOf="parent" |
| 24 | app:layout_constraintTop_toTopOf="parent" /> | 24 | app:layout_constraintTop_toTopOf="parent" /> |
| 25 | 25 | ||
| 26 | <TextView | 26 | <TextView |
| 27 | android:id="@+id/tvSeleccioneServidor" | 27 | android:id="@+id/tvSeleccioneServidor" |
| 28 | android:layout_width="0dp" | 28 | android:layout_width="0dp" |
| 29 | android:layout_height="wrap_content" | 29 | android:layout_height="wrap_content" |
| 30 | android:layout_margin="30dp" | 30 | android:layout_margin="30dp" |
| 31 | android:gravity="center" | 31 | android:gravity="center" |
| 32 | android:lines="2" | 32 | android:lines="2" |
| 33 | android:text="@string/tvMedio" | 33 | android:text="@string/tvMedio" |
| 34 | android:textColor="@android:color/black" | 34 | android:textColor="@android:color/black" |
| 35 | android:textSize="@dimen/SubTitulos" | 35 | android:textSize="@dimen/SubTitulos" |
| 36 | app:fontFamily="sans-serif-condensed" | 36 | app:fontFamily="sans-serif-condensed" |
| 37 | app:layout_constraintEnd_toEndOf="parent" | 37 | app:layout_constraintEnd_toEndOf="parent" |
| 38 | app:layout_constraintStart_toStartOf="parent" | 38 | app:layout_constraintStart_toStartOf="parent" |
| 39 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> | 39 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> |
| 40 | 40 | ||
| 41 | <RadioGroup | 41 | <RadioGroup |
| 42 | android:id="@+id/rgTipoActualizacion" | 42 | android:id="@+id/rgTipoActualizacion" |
| 43 | android:layout_width="0dp" | 43 | android:layout_width="0dp" |
| 44 | android:layout_height="wrap_content" | 44 | android:layout_height="wrap_content" |
| 45 | android:layout_margin="25dp" | 45 | android:layout_margin="25dp" |
| 46 | android:gravity="center" | 46 | android:gravity="center" |
| 47 | android:orientation="horizontal" | 47 | android:orientation="horizontal" |
| 48 | app:layout_constraintEnd_toEndOf="parent" | 48 | app:layout_constraintEnd_toEndOf="parent" |
| 49 | app:layout_constraintStart_toStartOf="parent" | 49 | app:layout_constraintStart_toStartOf="parent" |
| 50 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> | 50 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> |
| 51 | 51 | ||
| 52 | <RadioButton | 52 | <RadioButton |
| 53 | android:id="@+id/obPorWifi" | 53 | android:id="@+id/obPorWifi" |
| 54 | android:layout_width="wrap_content" | 54 | android:layout_width="wrap_content" |
| 55 | android:layout_height="wrap_content" | 55 | android:layout_height="wrap_content" |
| 56 | android:layout_margin="5dp" | 56 | android:layout_margin="5dp" |
| 57 | android:checked="true" | 57 | android:checked="true" |
| 58 | android:padding="5dp" | 58 | android:padding="5dp" |
| 59 | android:text="@string/obPorWifi" | 59 | android:text="@string/obPorWifi" |
| 60 | android:textSize="@dimen/NormalText" /> | 60 | android:textSize="@dimen/NormalText" /> |
| 61 | 61 | ||
| 62 | <RadioButton | 62 | <RadioButton |
| 63 | android:id="@+id/obViaArchivo" | 63 | android:id="@+id/obViaArchivo" |
| 64 | android:layout_width="wrap_content" | 64 | android:layout_width="wrap_content" |
| 65 | android:layout_height="wrap_content" | 65 | android:layout_height="wrap_content" |
| 66 | android:layout_margin="5dp" | 66 | android:layout_margin="5dp" |
| 67 | android:checked="false" | 67 | android:checked="false" |
| 68 | android:padding="5dp" | 68 | android:padding="5dp" |
| 69 | android:text="@string/obViaArchivo" | 69 | android:text="@string/obViaArchivo" |
| 70 | android:textSize="@dimen/NormalText" /> | 70 | android:textSize="@dimen/NormalText" /> |
| 71 | 71 | ||
| 72 | 72 | ||
| 73 | </RadioGroup> | 73 | </RadioGroup> |
| 74 | 74 | ||
| 75 | 75 | ||
| 76 | <TextView | 76 | <TextView |
| 77 | android:id="@+id/countriesList" | 77 | android:id="@+id/countriesList" |
| 78 | android:layout_width="0dp" | 78 | android:layout_width="0dp" |
| 79 | android:layout_height="wrap_content" | 79 | android:layout_height="wrap_content" |
| 80 | android:layout_marginTop="@dimen/MarginTopTitulos" | 80 | android:layout_marginTop="@dimen/MarginTopTitulos" |
| 81 | android:gravity="center" | 81 | android:gravity="center" |
| 82 | android:text="" | 82 | android:text="" |
| 83 | android:textColor="@android:color/black" | 83 | android:textColor="@android:color/black" |
| 84 | android:textSize="@dimen/SubTitulos" | 84 | android:textSize="@dimen/SubTitulos" |
| 85 | android:visibility="visible" | 85 | android:visibility="visible" |
| 86 | app:fontFamily="sans-serif-condensed" | 86 | app:fontFamily="sans-serif-condensed" |
| 87 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" | 87 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" |
| 88 | app:layout_constraintEnd_toEndOf="parent" | 88 | app:layout_constraintEnd_toEndOf="parent" |
| 89 | app:layout_constraintHorizontal_bias="0.0" | 89 | app:layout_constraintHorizontal_bias="0.0" |
| 90 | app:layout_constraintStart_toStartOf="parent" | 90 | app:layout_constraintStart_toStartOf="parent" |
| 91 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" | 91 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" |
| 92 | app:layout_constraintVertical_bias="0.0" /> | 92 | app:layout_constraintVertical_bias="0.0" /> |
| 93 | 93 | ||
| 94 | <Button | 94 | <Button |
| 95 | android:id="@+id/btnConfirmarAct" | 95 | android:id="@+id/btnConfirmarAct" |
| 96 | android:layout_width="0dp" | 96 | android:layout_width="0dp" |
| 97 | android:layout_height="wrap_content" | 97 | android:layout_height="wrap_content" |
| 98 | android:layout_margin="20dp" | 98 | android:layout_margin="20dp" |
| 99 | android:text="@string/btnConfirmarAct" | 99 | android:text="@string/btnConfirmarAct" |
| 100 | android:textSize="@dimen/NormalText" | 100 | android:textSize="@dimen/NormalText" |
| 101 | android:textColor="@android:color/white" | ||
| 102 | android:padding="10dp" | ||
| 103 | android:background="@drawable/boton_borde_redondeado" | ||
| 101 | app:layout_constraintBottom_toBottomOf="parent" | 104 | app:layout_constraintBottom_toBottomOf="parent" |
| 102 | app:layout_constraintEnd_toEndOf="parent" | 105 | app:layout_constraintEnd_toEndOf="parent" |
| 103 | app:layout_constraintStart_toStartOf="parent" /> | 106 | app:layout_constraintStart_toStartOf="parent" /> |
| 104 | 107 | ||
| 105 | 108 | ||
| 106 | <ProgressBar | 109 | <ProgressBar |
| 107 | android:id="@+id/loading_view" | 110 | android:id="@+id/loading_view" |
| 108 | android:layout_width="wrap_content" | 111 | android:layout_width="wrap_content" |
| 109 | android:layout_height="wrap_content" | 112 | android:layout_height="wrap_content" |
| 110 | android:layout_marginStart="8dp" | 113 | android:layout_marginStart="8dp" |
| 111 | android:layout_marginLeft="8dp" | 114 | android:layout_marginLeft="8dp" |
| 112 | android:layout_marginTop="8dp" | 115 | android:layout_marginTop="8dp" |
| 113 | android:layout_marginEnd="8dp" | 116 | android:layout_marginEnd="8dp" |
| 114 | android:layout_marginRight="8dp" | 117 | android:layout_marginRight="8dp" |
| 115 | android:layout_marginBottom="8dp" | 118 | android:layout_marginBottom="8dp" |
| 116 | android:visibility="gone" | 119 | android:visibility="gone" |
| 117 | app:layout_constraintBottom_toBottomOf="parent" | 120 | app:layout_constraintBottom_toBottomOf="parent" |
| 118 | app:layout_constraintEnd_toEndOf="parent" | 121 | app:layout_constraintEnd_toEndOf="parent" |
| 119 | app:layout_constraintStart_toStartOf="parent" | 122 | app:layout_constraintStart_toStartOf="parent" |
| 120 | app:layout_constraintTop_toTopOf="parent" /> | 123 | app:layout_constraintTop_toTopOf="parent" /> |
| 124 | |||
| 121 | </androidx.constraintlayout.widget.ConstraintLayout> | 125 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 122 | 126 |
app/src/main/res/layout/fragment_configuracion.xml
| 1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
| 5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
| 6 | android:layout_height="wrap_content" | 6 | android:layout_height="wrap_content" |
| 7 | tools:context=".ui.configuracion.ConfiguracionFragment"> | 7 | tools:context=".ui.configuracion.ConfiguracionFragment"> |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | <androidx.appcompat.widget.AppCompatTextView | 10 | <androidx.appcompat.widget.AppCompatTextView |
| 11 | android:id="@+id/textView2" | 11 | android:id="@+id/textView2" |
| 12 | android:layout_width="match_parent" | 12 | android:layout_width="match_parent" |
| 13 | android:layout_height="wrap_content" | 13 | android:layout_height="wrap_content" |
| 14 | 14 | ||
| 15 | android:layout_marginTop="@dimen/MarginTopTitulos" | 15 | android:layout_marginTop="@dimen/MarginTopTitulos" |
| 16 | android:gravity="center" | 16 | android:gravity="center" |
| 17 | 17 | ||
| 18 | android:lines="1" | 18 | android:lines="1" |
| 19 | android:text="@string/tvTituloConf" | 19 | android:text="@string/tvTituloConf" |
| 20 | android:textColor="@color/colorAccent" | 20 | android:textColor="@color/colorAccent" |
| 21 | android:textSize="@dimen/Titulos" | 21 | android:textSize="@dimen/Titulos" |
| 22 | app:fontFamily="sans-serif-condensed" | 22 | app:fontFamily="sans-serif-condensed" |
| 23 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | 23 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" |
| 24 | app:layout_constraintEnd_toEndOf="parent" | 24 | app:layout_constraintEnd_toEndOf="parent" |
| 25 | app:layout_constraintStart_toStartOf="parent" | 25 | app:layout_constraintStart_toStartOf="parent" |
| 26 | app:layout_constraintTop_toTopOf="parent" /> | 26 | app:layout_constraintTop_toTopOf="parent" /> |
| 27 | 27 | ||
| 28 | <TextView | 28 | <TextView |
| 29 | android:id="@+id/tvSeleccioneServidor" | 29 | android:id="@+id/tvSeleccioneServidor" |
| 30 | android:layout_width="0dp" | 30 | android:layout_width="0dp" |
| 31 | android:layout_height="wrap_content" | 31 | android:layout_height="wrap_content" |
| 32 | 32 | ||
| 33 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 33 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
| 34 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 34 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
| 35 | android:gravity="start" | 35 | android:gravity="start" |
| 36 | android:lines="1" | 36 | android:lines="1" |
| 37 | android:text="@string/tvSeleccioneServidor" | 37 | android:text="@string/tvSeleccioneServidor" |
| 38 | android:textColor="@android:color/black" | 38 | android:textColor="@android:color/black" |
| 39 | android:textSize="@dimen/SubTitulos" | 39 | android:textSize="@dimen/SubTitulos" |
| 40 | app:fontFamily="sans-serif-condensed" | 40 | app:fontFamily="sans-serif-condensed" |
| 41 | app:layout_constraintBottom_toTopOf="@+id/spServidor" | 41 | app:layout_constraintBottom_toTopOf="@+id/spServidor" |
| 42 | app:layout_constraintEnd_toEndOf="parent" | 42 | app:layout_constraintEnd_toEndOf="parent" |
| 43 | app:layout_constraintStart_toStartOf="parent" | 43 | app:layout_constraintStart_toStartOf="parent" |
| 44 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | 44 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> |
| 45 | 45 | ||
| 46 | <Spinner | 46 | <Spinner |
| 47 | android:id="@+id/spServidor" | 47 | android:id="@+id/spServidor" |
| 48 | android:layout_width="0dp" | 48 | android:layout_width="0dp" |
| 49 | android:layout_height="wrap_content" | 49 | android:layout_height="wrap_content" |
| 50 | android:backgroundTint="@color/LightGray" | 50 | android:backgroundTint="@color/LightGray" |
| 51 | android:elevation="5dp" | 51 | android:elevation="5dp" |
| 52 | android:fadeScrollbars="true" | 52 | android:fadeScrollbars="true" |
| 53 | android:foregroundTint="@android:color/holo_orange_dark" | 53 | android:foregroundTint="@android:color/holo_orange_dark" |
| 54 | android:soundEffectsEnabled="true" | 54 | android:soundEffectsEnabled="true" |
| 55 | android:spinnerMode="dialog" | 55 | android:spinnerMode="dialog" |
| 56 | android:splitMotionEvents="false" | 56 | android:splitMotionEvents="false" |
| 57 | android:textAlignment="center" | 57 | android:textAlignment="center" |
| 58 | android:textSize="@dimen/NormalText" | 58 | android:textSize="@dimen/NormalText" |
| 59 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | 59 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" |
| 60 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" | 60 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" |
| 61 | app:layout_constraintHorizontal_chainStyle="packed" | 61 | app:layout_constraintHorizontal_chainStyle="packed" |
| 62 | app:layout_constraintStart_toStartOf="parent" | 62 | app:layout_constraintStart_toStartOf="parent" |
| 63 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" | 63 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" |
| 64 | android:entries="@array/spinnerServidor" | 64 | android:entries="@array/spinnerServidor" |
| 65 | android:prompt="@string/leyendaSpinner"/> | 65 | android:prompt="@string/leyendaSpinner"/> |
| 66 | 66 | ||
| 67 | <Button | 67 | <Button |
| 68 | android:id="@+id/btnValidarServidor" | 68 | android:id="@+id/btnValidarServidor" |
| 69 | android:layout_width="wrap_content" | 69 | android:layout_width="wrap_content" |
| 70 | android:layout_height="wrap_content" | 70 | android:layout_height="wrap_content" |
| 71 | 71 | android:textColor="@android:color/white" | |
| 72 | android:padding="10dp" | ||
| 73 | android:background="@drawable/boton_borde_redondeado" | ||
| 72 | android:text="@string/btnValidarServidor" | 74 | android:text="@string/btnValidarServidor" |
| 73 | android:textSize="@dimen/NormalText" | 75 | android:textSize="@dimen/NormalText" |
| 74 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | 76 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" |
| 75 | app:layout_constraintEnd_toEndOf="parent" | 77 | app:layout_constraintEnd_toEndOf="parent" |
| 76 | app:layout_constraintHorizontal_chainStyle="packed" | 78 | app:layout_constraintHorizontal_chainStyle="packed" |
| 77 | app:layout_constraintStart_toEndOf="@id/spServidor" | 79 | app:layout_constraintStart_toEndOf="@id/spServidor" |
| 78 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> | 80 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> |
| 79 | 81 | ||
| 80 | <Button | 82 | <Button |
| 81 | android:id="@+id/btnAgregarServidor" | 83 | android:id="@+id/btnAgregarServidor" |
| 82 | android:layout_width="0dp" | 84 | android:layout_width="0dp" |
| 83 | android:layout_height="wrap_content" | 85 | android:layout_height="wrap_content" |
| 84 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 86 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
| 85 | android:layout_marginEnd="@dimen/MarginBotAgreSer" | 87 | android:layout_marginEnd="@dimen/MarginBotAgreSer" |
| 86 | android:text="@string/btnAgregarServidor" | 88 | android:text="@string/btnAgregarServidor" |
| 87 | android:textSize="@dimen/NormalText" | 89 | android:textSize="@dimen/NormalText" |
| 90 | android:textColor="@android:color/white" | ||
| 91 | android:padding="10dp" | ||
| 92 | android:background="@drawable/boton_borde_redondeado" | ||
| 88 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" | 93 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" |
| 89 | app:layout_constraintEnd_toEndOf="parent" | 94 | app:layout_constraintEnd_toEndOf="parent" |
| 90 | app:layout_constraintStart_toStartOf="parent" | 95 | app:layout_constraintStart_toStartOf="parent" |
| 91 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> | 96 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> |
| 92 | 97 | ||
| 93 | 98 | ||
| 94 | <TextView | 99 | <TextView |
| 95 | android:id="@+id/tvUbicacionCarpetas" | 100 | android:id="@+id/tvUbicacionCarpetas" |
| 96 | android:layout_width="0dp" | 101 | android:layout_width="0dp" |
| 97 | android:layout_height="wrap_content" | 102 | android:layout_height="wrap_content" |
| 98 | 103 | ||
| 99 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 104 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
| 100 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 105 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
| 101 | android:gravity="start" | 106 | android:gravity="start" |
| 102 | android:lines="1" | 107 | android:lines="1" |
| 103 | android:text="@string/tvUbicacionCarpetas" | 108 | android:text="@string/tvUbicacionCarpetas" |
| 104 | android:textColor="@android:color/black" | 109 | android:textColor="@android:color/black" |
| 105 | android:textSize="@dimen/SubTitulos" | 110 | android:textSize="@dimen/SubTitulos" |
| 106 | app:fontFamily="sans-serif-condensed" | 111 | app:fontFamily="sans-serif-condensed" |
| 107 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" | 112 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" |
| 108 | app:layout_constraintEnd_toEndOf="parent" | 113 | app:layout_constraintEnd_toEndOf="parent" |
| 109 | app:layout_constraintStart_toStartOf="parent" | 114 | app:layout_constraintStart_toStartOf="parent" |
| 110 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> | 115 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> |
| 111 | 116 | ||
| 112 | <ImageButton | 117 | <ImageButton |
| 113 | android:id="@+id/ibSearch" | 118 | android:id="@+id/ibSearch" |
| 114 | android:layout_width="36dp" | 119 | android:layout_width="36dp" |
| 115 | android:layout_height="37dp" | 120 | android:layout_height="37dp" |
| 116 | android:layout_margin="10dp" | 121 | android:layout_margin="10dp" |
| 117 | android:src="@drawable/search" | 122 | android:src="@drawable/search" |
| 123 | android:textColor="@android:color/white" | ||
| 124 | android:padding="10dp" | ||
| 125 | android:background="@drawable/boton_borde_redondeado" | ||
| 118 | app:layout_constraintEnd_toStartOf="@+id/etRuta" | 126 | app:layout_constraintEnd_toStartOf="@+id/etRuta" |
| 119 | app:layout_constraintStart_toStartOf="parent" | 127 | app:layout_constraintStart_toStartOf="parent" |
| 120 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | 128 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> |
| 121 | 129 | ||
| 122 | <EditText | 130 | <EditText |
| 123 | android:id="@+id/etRuta" | 131 | android:id="@+id/etRuta" |
| 124 | android:layout_width="0dp" | 132 | android:layout_width="0dp" |
| 125 | android:layout_height="wrap_content" | 133 | android:layout_height="wrap_content" |
| 126 | android:layout_marginTop="10dp" | 134 | android:layout_marginTop="10dp" |
| 127 | android:layout_marginEnd="10dp" | 135 | android:layout_marginEnd="10dp" |
| 128 | android:clickable="true" | 136 | android:clickable="true" |
| 129 | android:ems="10" | 137 | android:ems="10" |
| 130 | android:focusable="true" | 138 | android:focusable="true" |
| 131 | android:inputType="textPersonName" | 139 | android:inputType="textPersonName" |
| 132 | android:lines="1" | 140 | android:lines="1" |
| 133 | android:text="" | 141 | android:text="" |
| 134 | android:textSize="@dimen/NormalText" | 142 | android:textSize="@dimen/NormalText" |
| 135 | app:layout_constraintEnd_toEndOf="parent" | 143 | app:layout_constraintEnd_toEndOf="parent" |
| 136 | app:layout_constraintStart_toEndOf="@id/ibSearch" | 144 | app:layout_constraintStart_toEndOf="@id/ibSearch" |
| 137 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | 145 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> |
| 138 | 146 | ||
| 139 | <TextView | 147 | <TextView |
| 140 | android:id="@+id/tvActuFecha" | 148 | android:id="@+id/tvActuFecha" |
| 141 | android:layout_width="0dp" | 149 | android:layout_width="0dp" |
| 142 | android:layout_height="wrap_content" | 150 | android:layout_height="wrap_content" |
| 143 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 151 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
| 144 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 152 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
| 145 | android:gravity="start" | 153 | android:gravity="start" |
| 146 | android:lines="1" | 154 | android:lines="1" |
| 147 | android:text="@string/tvTituloArea" | 155 | android:text="@string/tvTituloArea" |
| 148 | android:textColor="@android:color/black" | 156 | android:textColor="@android:color/black" |
| 149 | android:textSize="@dimen/SubTitulos" | 157 | android:textSize="@dimen/SubTitulos" |
| 150 | app:fontFamily="sans-serif-condensed" | 158 | app:fontFamily="sans-serif-condensed" |
| 151 | app:layout_constraintEnd_toEndOf="parent" | 159 | app:layout_constraintEnd_toEndOf="parent" |
| 152 | app:layout_constraintStart_toStartOf="parent" | 160 | app:layout_constraintStart_toStartOf="parent" |
| 153 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> | 161 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> |
| 154 | 162 | ||
| 155 | <RadioGroup | 163 | <RadioGroup |
| 156 | android:id="@+id/rgFechaHora" | 164 | android:id="@+id/rgFechaHora" |
| 157 | android:layout_width="0dp" | 165 | android:layout_width="0dp" |
| 158 | android:layout_height="wrap_content" | 166 | android:layout_height="wrap_content" |
| 159 | 167 | ||
| 160 | android:gravity="center" | 168 | android:gravity="center" |
| 161 | android:orientation="horizontal" | 169 | android:orientation="horizontal" |
| 162 | app:layout_constraintEnd_toEndOf="parent" | 170 | app:layout_constraintEnd_toEndOf="parent" |
| 163 | app:layout_constraintStart_toStartOf="parent" | 171 | app:layout_constraintStart_toStartOf="parent" |
| 164 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> | 172 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> |
| 165 | 173 | ||
| 166 | <RadioButton | 174 | <RadioButton |
| 167 | android:id="@+id/rbVentas" | 175 | android:id="@+id/rbVentas" |
| 168 | android:layout_width="wrap_content" | 176 | android:layout_width="wrap_content" |
| 169 | android:layout_height="wrap_content" | 177 | android:layout_height="wrap_content" |
| 170 | android:layout_margin="5dp" | 178 | android:layout_margin="5dp" |
| 171 | android:checked="true" | 179 | android:checked="true" |
| 172 | android:padding="5dp" | 180 | android:padding="5dp" |
| 173 | android:text="@string/rbVentas" | 181 | android:text="@string/rbVentas" |
| 174 | android:textSize="@dimen/NormalText" /> | 182 | android:textSize="@dimen/NormalText" /> |
| 175 | 183 | ||
| 176 | <RadioButton | 184 | <RadioButton |
| 177 | android:id="@+id/rbDeposito" | 185 | android:id="@+id/rbDeposito" |
| 178 | android:layout_width="wrap_content" | 186 | android:layout_width="wrap_content" |
| 179 | android:layout_height="wrap_content" | 187 | android:layout_height="wrap_content" |
| 180 | android:layout_margin="5dp" | 188 | android:layout_margin="5dp" |
| 181 | android:checked="false" | 189 | android:checked="false" |
| 182 | android:padding="5dp" | 190 | android:padding="5dp" |
| 183 | android:text="@string/rbDeposito" | 191 | android:text="@string/rbDeposito" |
| 184 | android:textSize="@dimen/NormalText" /> | 192 | android:textSize="@dimen/NormalText" /> |
| 185 | 193 | ||
| 186 | </RadioGroup> | 194 | </RadioGroup> |
| 187 | 195 | ||
| 188 | <TextView | 196 | <TextView |
| 189 | android:id="@+id/tvLosProductos" | 197 | android:id="@+id/tvLosProductos" |
| 190 | android:layout_width="0dp" | 198 | android:layout_width="0dp" |
| 191 | android:layout_height="wrap_content" | 199 | android:layout_height="wrap_content" |
| 192 | 200 | ||
| 193 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 201 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
| 194 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | 202 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" |
| 195 | android:gravity="start" | 203 | android:gravity="start" |
| 196 | android:lines="1" | 204 | android:lines="1" |
| 197 | android:text="@string/tvLosProductos" | 205 | android:text="@string/tvLosProductos" |
| 198 | android:textColor="@android:color/black" | 206 | android:textColor="@android:color/black" |
| 199 | android:textSize="@dimen/SubTitulos" | 207 | android:textSize="@dimen/SubTitulos" |
| 200 | app:fontFamily="sans-serif-condensed" | 208 | app:fontFamily="sans-serif-condensed" |
| 201 | app:layout_constraintEnd_toEndOf="parent" | 209 | app:layout_constraintEnd_toEndOf="parent" |
| 202 | app:layout_constraintStart_toStartOf="parent" | 210 | app:layout_constraintStart_toStartOf="parent" |
| 203 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | 211 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> |
| 204 | 212 | ||
| 205 | <RadioGroup | 213 | <RadioGroup |
| 206 | android:id="@+id/rgLosProductos" | 214 | android:id="@+id/rgLosProductos" |
| 207 | android:layout_width="0dp" | 215 | android:layout_width="0dp" |
| 208 | android:layout_height="wrap_content" | 216 | android:layout_height="wrap_content" |
| 209 | 217 | ||
| 210 | android:gravity="center" | 218 | android:gravity="center" |
| 211 | android:orientation="vertical" | 219 | android:orientation="vertical" |
| 212 | app:layout_constraintEnd_toEndOf="parent" | 220 | app:layout_constraintEnd_toEndOf="parent" |
| 213 | app:layout_constraintStart_toStartOf="parent" | 221 | app:layout_constraintStart_toStartOf="parent" |
| 214 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> | 222 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> |
| 215 | 223 | ||
| 216 | <RadioButton | 224 | <RadioButton |
| 217 | android:id="@+id/rbProInclu" | 225 | android:id="@+id/rbProInclu" |
| 218 | android:layout_width="match_parent" | 226 | android:layout_width="match_parent" |
| 219 | android:layout_height="wrap_content" | 227 | android:layout_height="wrap_content" |
| 220 | 228 | ||
| 221 | android:layout_margin="@dimen/PadingCbyRb" | 229 | android:layout_margin="@dimen/PadingCbyRb" |
| 222 | android:checked="true" | 230 | android:checked="true" |
| 223 | android:padding="@dimen/PadingCbyRb" | 231 | android:padding="@dimen/PadingCbyRb" |
| 224 | android:text="@string/rbProInclu" | 232 | android:text="@string/rbProInclu" |
| 225 | android:textSize="@dimen/NormalText" /> | 233 | android:textSize="@dimen/NormalText" /> |
| 226 | 234 | ||
| 227 | <RadioButton | 235 | <RadioButton |
| 228 | android:id="@+id/rbProNoInclu" | 236 | android:id="@+id/rbProNoInclu" |
| 229 | android:layout_width="match_parent" | 237 | android:layout_width="match_parent" |
| 230 | android:layout_height="wrap_content" | 238 | android:layout_height="wrap_content" |
| 231 | android:layout_margin="@dimen/PadingCbyRb" | 239 | android:layout_margin="@dimen/PadingCbyRb" |
| 232 | android:checked="false" | 240 | android:checked="false" |
| 233 | android:padding="@dimen/PadingCbyRb" | 241 | android:padding="@dimen/PadingCbyRb" |
| 234 | android:text="@string/rbProNoInclu" | 242 | android:text="@string/rbProNoInclu" |
| 235 | android:textSize="@dimen/NormalText" /> | 243 | android:textSize="@dimen/NormalText" /> |
| 236 | 244 | ||
| 237 | </RadioGroup> | 245 | </RadioGroup> |
| 238 | 246 | ||
| 239 | <CheckBox | 247 | <CheckBox |
| 240 | android:id="@+id/cbHabiLectura" | 248 | android:id="@+id/cbHabiLectura" |
| 241 | android:layout_width="0dp" | 249 | android:layout_width="0dp" |
| 242 | android:layout_height="wrap_content" | 250 | android:layout_height="wrap_content" |
| 243 | android:layout_margin="@dimen/PadingCbyRb" | 251 | android:layout_margin="@dimen/PadingCbyRb" |
| 244 | android:padding="@dimen/PadingCbyRb" | 252 | android:padding="@dimen/PadingCbyRb" |
| 245 | android:text="@string/cbHabiLectura" | 253 | android:text="@string/cbHabiLectura" |
| 246 | android:textSize="@dimen/NormalText" | 254 | android:textSize="@dimen/NormalText" |
| 247 | app:layout_constraintEnd_toEndOf="parent" | 255 | app:layout_constraintEnd_toEndOf="parent" |
| 248 | app:layout_constraintStart_toStartOf="parent" | 256 | app:layout_constraintStart_toStartOf="parent" |
| 249 | app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" /> | 257 | app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" /> |
| 250 | 258 | ||
| 251 | <CheckBox | 259 | <CheckBox |
| 252 | android:id="@+id/cbMostrarStock" | 260 | android:id="@+id/cbMostrarStock" |
| 253 | android:layout_width="0dp" | 261 | android:layout_width="0dp" |
| 254 | android:layout_height="wrap_content" | 262 | android:layout_height="wrap_content" |
| 255 | android:layout_margin="@dimen/PadingCbyRb" | 263 | android:layout_margin="@dimen/PadingCbyRb" |
| 256 | android:padding="@dimen/PadingCbyRb" | 264 | android:padding="@dimen/PadingCbyRb" |
| 257 | android:text="@string/cbMostrarStock" | 265 | android:text="@string/cbMostrarStock" |
| 258 | android:textSize="@dimen/NormalText" | 266 | android:textSize="@dimen/NormalText" |
| 259 | app:layout_constraintEnd_toEndOf="parent" | 267 | app:layout_constraintEnd_toEndOf="parent" |
| 260 | app:layout_constraintStart_toStartOf="parent" | 268 | app:layout_constraintStart_toStartOf="parent" |
| 261 | app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" /> | 269 | app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" /> |
| 262 | 270 | ||
| 263 | <TextView | 271 | <TextView |
| 264 | android:id="@+id/tvColumMostrar" | 272 | android:id="@+id/tvColumMostrar" |
| 265 | android:layout_width="0dp" | 273 | android:layout_width="0dp" |
| 266 | android:layout_height="wrap_content" | 274 | android:layout_height="wrap_content" |
| 267 | 275 | ||
| 268 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 276 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
| 269 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | 277 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" |
| 270 | android:gravity="start" | 278 | android:gravity="start" |
| 271 | android:lines="1" | 279 | android:lines="1" |
| 272 | android:text="@string/tvColumMostrar" | 280 | android:text="@string/tvColumMostrar" |
| 273 | android:textColor="@android:color/black" | 281 | android:textColor="@android:color/black" |
| 274 | android:textSize="@dimen/SubTitulos" | 282 | android:textSize="@dimen/SubTitulos" |
| 275 | app:fontFamily="sans-serif-condensed" | 283 | app:fontFamily="sans-serif-condensed" |
| 276 | app:layout_constraintEnd_toEndOf="parent" | 284 | app:layout_constraintEnd_toEndOf="parent" |
| 277 | app:layout_constraintStart_toStartOf="parent" | 285 | app:layout_constraintStart_toStartOf="parent" |
| 278 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> | 286 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> |
| 279 | 287 | ||
| 280 | <RadioGroup | 288 | <RadioGroup |
| 281 | android:id="@+id/rgCodigosMostrar" | 289 | android:id="@+id/rgCodigosMostrar" |
| 282 | android:layout_width="0dp" | 290 | android:layout_width="0dp" |
| 283 | android:layout_height="wrap_content" | 291 | android:layout_height="wrap_content" |
| 284 | 292 | ||
| 285 | android:gravity="center" | 293 | android:gravity="center" |
| 286 | android:orientation="horizontal" | 294 | android:orientation="horizontal" |
| 287 | app:layout_constraintEnd_toEndOf="parent" | 295 | app:layout_constraintEnd_toEndOf="parent" |
| 288 | app:layout_constraintStart_toStartOf="parent" | 296 | app:layout_constraintStart_toStartOf="parent" |
| 289 | app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar"> | 297 | app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar"> |
| 290 | 298 | ||
| 291 | <RadioButton | 299 | <RadioButton |
| 292 | android:id="@+id/rbCodigoDebo" | 300 | android:id="@+id/rbCodigoDebo" |
| 293 | android:layout_width="wrap_content" | 301 | android:layout_width="wrap_content" |
| 294 | android:layout_height="wrap_content" | 302 | android:layout_height="wrap_content" |
| 295 | android:layout_margin="5dp" | 303 | android:layout_margin="5dp" |
| 296 | android:checked="true" | 304 | android:checked="true" |
| 297 | android:padding="5dp" | 305 | android:padding="5dp" |
| 298 | android:text="@string/rbCodigoDebo" | 306 | android:text="@string/rbCodigoDebo" |
| 299 | android:textSize="@dimen/NormalText" /> | 307 | android:textSize="@dimen/NormalText" /> |
| 300 | 308 | ||
| 301 | <RadioButton | 309 | <RadioButton |
| 302 | android:id="@+id/rbCodigoOrigen" | 310 | android:id="@+id/rbCodigoOrigen" |
| 303 | android:layout_width="wrap_content" | 311 | android:layout_width="wrap_content" |
| 304 | android:layout_height="wrap_content" | 312 | android:layout_height="wrap_content" |
| 305 | android:layout_margin="5dp" | 313 | android:layout_margin="5dp" |
| 306 | android:checked="false" | 314 | android:checked="false" |
| 307 | android:padding="5dp" | 315 | android:padding="5dp" |
| 308 | android:text="@string/rbCodigoOrigen" | 316 | android:text="@string/rbCodigoOrigen" |
| 309 | android:textSize="@dimen/NormalText" /> | 317 | android:textSize="@dimen/NormalText" /> |
| 310 | 318 | ||
| 311 | <RadioButton | 319 | <RadioButton |
| 312 | android:id="@+id/rbCodigoBarras" | 320 | android:id="@+id/rbCodigoBarras" |
| 313 | android:layout_width="wrap_content" | 321 | android:layout_width="wrap_content" |
| 314 | android:layout_height="wrap_content" | 322 | android:layout_height="wrap_content" |
| 315 | android:layout_margin="5dp" | 323 | android:layout_margin="5dp" |
| 316 | android:padding="5dp" | 324 | android:padding="5dp" |
| 317 | android:text="@string/rbCodigoBarras" | 325 | android:text="@string/rbCodigoBarras" |
| 318 | android:textSize="@dimen/NormalText" /> | 326 | android:textSize="@dimen/NormalText" /> |
| 319 | </RadioGroup> | 327 | </RadioGroup> |
| 320 | 328 | ||
| 321 | <CheckBox | 329 | <CheckBox |
| 322 | android:id="@+id/cbMostrarExistencia" | 330 | android:id="@+id/cbMostrarExistencia" |
| 323 | android:layout_width="wrap_content" | 331 | android:layout_width="wrap_content" |
| 324 | android:layout_height="wrap_content" | 332 | android:layout_height="wrap_content" |
| 325 | android:layout_margin="@dimen/PadingCbyRb" | 333 | android:layout_margin="@dimen/PadingCbyRb" |
| 326 | android:padding="@dimen/PadingCbyRb" | 334 | android:padding="@dimen/PadingCbyRb" |
| 327 | android:text="@string/cbMostrarExistencia" | 335 | android:text="@string/cbMostrarExistencia" |
| 328 | android:textSize="@dimen/NormalText" | 336 | android:textSize="@dimen/NormalText" |
| 329 | android:checked="false" | 337 | android:checked="false" |
| 330 | app:layout_constraintEnd_toStartOf="@+id/cbMostrarPrecio" | 338 | app:layout_constraintEnd_toStartOf="@+id/cbMostrarPrecio" |
| 331 | app:layout_constraintStart_toStartOf="parent" | 339 | app:layout_constraintStart_toStartOf="parent" |
| 332 | app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" /> | 340 | app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" /> |
| 333 | 341 | ||
| 334 | <CheckBox | 342 | <CheckBox |
| 335 | android:id="@+id/cbMostrarPrecio" | 343 | android:id="@+id/cbMostrarPrecio" |
| 336 | android:layout_width="wrap_content" | 344 | android:layout_width="wrap_content" |
| 337 | android:layout_height="wrap_content" | 345 | android:layout_height="wrap_content" |
| 338 | android:layout_margin="@dimen/PadingCbyRb" | 346 | android:layout_margin="@dimen/PadingCbyRb" |
| 339 | android:padding="@dimen/PadingCbyRb" | 347 | android:padding="@dimen/PadingCbyRb" |
| 340 | android:text="@string/cbMostrarPrecio" | 348 | android:text="@string/cbMostrarPrecio" |
| 341 | android:textSize="@dimen/NormalText" | 349 | android:textSize="@dimen/NormalText" |
| 342 | android:checked="false" | 350 | android:checked="false" |
| 343 | app:layout_constraintEnd_toEndOf="parent" | 351 | app:layout_constraintEnd_toEndOf="parent" |
| 344 | app:layout_constraintStart_toEndOf="@+id/cbMostrarExistencia" | 352 | app:layout_constraintStart_toEndOf="@+id/cbMostrarExistencia" |
| 345 | app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" /> | 353 | app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" /> |
| 346 | 354 | ||
| 347 | <Button | 355 | <Button |
| 348 | android:id="@+id/btnGuardar" | 356 | android:id="@+id/btnGuardar" |
| 349 | android:layout_width="wrap_content" | 357 | android:layout_width="wrap_content" |
| 350 | android:layout_height="wrap_content" | 358 | android:layout_height="wrap_content" |
| 351 | android:text="@string/btnGuardar" | 359 | android:text="@string/btnGuardar" |
| 352 | android:textSize="@dimen/NormalText" | 360 | android:textSize="@dimen/NormalText" |
| 353 | app:layout_constraintEnd_toEndOf="parent" | 361 | app:layout_constraintEnd_toEndOf="parent" |
| 354 | 362 | android:textColor="@android:color/white" | |
| 363 | android:padding="10dp" | ||
| 364 | android:background="@drawable/boton_borde_redondeado" | ||
| 355 | app:layout_constraintStart_toStartOf="parent" | 365 | app:layout_constraintStart_toStartOf="parent" |
| 356 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarPrecio" /> | 366 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarPrecio" /> |
| 357 | </androidx.constraintlayout.widget.ConstraintLayout> | 367 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 358 | 368 | ||
| 359 | 369 |
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 | 3 | ||
| 4 | <androidx.constraintlayout.widget.ConstraintLayout | 4 | <androidx.constraintlayout.widget.ConstraintLayout |
| 5 | xmlns:android="http://schemas.android.com/apk/res/android" | 5 | xmlns:android="http://schemas.android.com/apk/res/android" |
| 6 | xmlns:app="http://schemas.android.com/apk/res-auto" | 6 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 7 | xmlns:tools="http://schemas.android.com/tools" | 7 | xmlns:tools="http://schemas.android.com/tools" |
| 8 | android:layout_width="match_parent" | 8 | android:layout_width="match_parent" |
| 9 | android:layout_height="match_parent" | 9 | android:layout_height="match_parent" |
| 10 | tools:context=".ui.inventario.DescripcionFragment"> | 10 | tools:context=".ui.descripcionFragment.DescripcionFragment"> |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | <androidx.recyclerview.widget.RecyclerView | 13 | <androidx.recyclerview.widget.RecyclerView |
| 14 | android:id="@+id/rcDescripcion" | 14 | android:id="@+id/rcDescripcion" |
| 15 | android:layout_width="match_parent" | 15 | android:layout_width="match_parent" |
| 16 | android:layout_height="0dp" | 16 | android:layout_height="0dp" |
| 17 | android:background="@android:color/darker_gray" | 17 | android:background="@android:color/darker_gray" |
| 18 | android:scrollbars="vertical" | 18 | android:scrollbars="vertical" |
| 19 | app:layout_constraintTop_toBottomOf="@id/guideline4" | 19 | app:layout_constraintTop_toBottomOf="@id/guideline4" |
| 20 | app:layout_constraintBottom_toTopOf="@+id/guideline5" | 20 | app:layout_constraintBottom_toTopOf="@+id/guideline5" |
| 21 | app:layout_constraintEnd_toEndOf="parent" | 21 | app:layout_constraintEnd_toEndOf="parent" |
| 22 | app:layout_constraintStart_toStartOf="parent" | 22 | app:layout_constraintStart_toStartOf="parent" |
| 23 | tools:listitem="@layout/item" /> | 23 | tools:listitem="@layout/item" /> |
| 24 | 24 | ||
| 25 | <Button | 25 | <Button |
| 26 | android:id="@+id/btnSalir" | 26 | android:id="@+id/btnSalir" |
| 27 | android:layout_width="0dp" | 27 | android:layout_width="0dp" |
| 28 | android:layout_height="wrap_content" | 28 | android:layout_height="wrap_content" |
| 29 | android:text="@string/btnCancelar" | 29 | android:text="@string/btnCancelar" |
| 30 | android:textColor="@android:color/white" | ||
| 31 | android:padding="10dp" | ||
| 32 | android:background="@drawable/boton_borde_redondeado" | ||
| 30 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | 33 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" |
| 31 | app:layout_constraintEnd_toEndOf="parent" | 34 | app:layout_constraintEnd_toEndOf="parent" |
| 32 | app:layout_constraintHorizontal_chainStyle="spread" | 35 | app:layout_constraintHorizontal_chainStyle="spread" |
| 33 | app:layout_constraintStart_toStartOf="parent" | 36 | app:layout_constraintStart_toStartOf="parent" |
| 34 | app:layout_constraintTop_toBottomOf="@+id/rcInventarios" /> | 37 | app:layout_constraintTop_toBottomOf="@+id/rcInventarios" /> |
| 35 | 38 | ||
| 36 | <androidx.constraintlayout.widget.Guideline | 39 | <androidx.constraintlayout.widget.Guideline |
| 37 | android:id="@+id/guideline4" | 40 | android:id="@+id/guideline4" |
| 38 | android:layout_width="wrap_content" | 41 | android:layout_width="wrap_content" |
| 39 | android:layout_height="wrap_content" | 42 | android:layout_height="wrap_content" |
| 40 | android:orientation="horizontal" | 43 | android:orientation="horizontal" |
| 41 | app:layout_constraintGuide_percent="0.06" /> | 44 | app:layout_constraintGuide_percent="0.06" /> |
| 42 | 45 | ||
| 43 | <androidx.constraintlayout.widget.Guideline | 46 | <androidx.constraintlayout.widget.Guideline |
| 44 | android:id="@+id/guideline5" | 47 | android:id="@+id/guideline5" |
| 45 | android:layout_width="wrap_content" | 48 | android:layout_width="wrap_content" |
| 46 | android:layout_height="wrap_content" | 49 | android:layout_height="wrap_content" |
| 47 | android:orientation="horizontal" | 50 | android:orientation="horizontal" |
| 48 | app:layout_constraintGuide_percent="0.88" /> | 51 | app:layout_constraintGuide_percent="0.88" /> |
| 49 | 52 | ||
| 50 | <androidx.constraintlayout.widget.Guideline | 53 | <androidx.constraintlayout.widget.Guideline |
| 51 | android:id="@+id/guideline6" | 54 | android:id="@+id/guideline6" |
| 52 | android:layout_width="wrap_content" | 55 | android:layout_width="wrap_content" |
| 53 | android:layout_height="wrap_content" | 56 | android:layout_height="wrap_content" |
| 54 | android:orientation="horizontal" | 57 | android:orientation="horizontal" |
| 55 | app:layout_constraintGuide_percent="0.97" /> | 58 | app:layout_constraintGuide_percent="0.97" /> |
| 56 | </androidx.constraintlayout.widget.ConstraintLayout> | 59 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 57 | 60 |
app/src/main/res/layout/fragment_inventario.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <androidx.constraintlayout.widget.ConstraintLayout | 2 | <androidx.constraintlayout.widget.ConstraintLayout 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" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 5 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
| 6 | android:id="@+id/frameLayout" | 5 | android:id="@+id/frameLayout" |
| 7 | android:layout_width="match_parent" | 6 | android:layout_width="match_parent" |
| 8 | android:layout_height="match_parent" | 7 | android:layout_height="match_parent" |
| 9 | tools:context=".ui.inventario.InventarioFragment"> | 8 | tools:context=".ui.inventario.InventarioFragment"> |
| 10 | 9 | ||
| 11 | 10 | ||
| 12 | <androidx.appcompat.widget.AppCompatTextView | 11 | <androidx.appcompat.widget.AppCompatTextView |
| 13 | android:id="@+id/tvTitulo" | 12 | android:id="@+id/tvTitulo" |
| 14 | android:layout_width="match_parent" | 13 | android:layout_width="match_parent" |
| 15 | android:layout_height="90dp" | 14 | android:layout_height="90dp" |
| 16 | android:layout_marginStart="8dp" | 15 | android:layout_marginStart="8dp" |
| 17 | android:layout_marginTop="15dp" | 16 | android:layout_marginTop="15dp" |
| 18 | android:layout_marginEnd="8dp" | 17 | android:layout_marginEnd="8dp" |
| 19 | android:autoSizeMaxTextSize="100sp" | 18 | android:autoSizeMaxTextSize="100sp" |
| 20 | android:autoSizeMinTextSize="20sp" | 19 | android:autoSizeMinTextSize="20sp" |
| 21 | android:autoSizeStepGranularity="5sp" | 20 | android:autoSizeStepGranularity="5sp" |
| 22 | android:autoSizeTextType="uniform" | 21 | android:autoSizeTextType="uniform" |
| 23 | android:gravity="center" | 22 | android:gravity="center" |
| 24 | android:lines="1" | 23 | android:lines="1" |
| 25 | android:text="@string/invTitulo" | 24 | android:text="@string/invTitulo" |
| 26 | android:textColor="@color/colorAccent" | 25 | android:textColor="@color/colorAccent" |
| 27 | app:fontFamily="sans-serif-condensed" | 26 | app:fontFamily="sans-serif-condensed" |
| 28 | app:layout_constraintBottom_toTopOf="@id/guideline2" | 27 | app:layout_constraintBottom_toTopOf="@id/guideline2" |
| 29 | app:layout_constraintEnd_toEndOf="parent" | 28 | app:layout_constraintEnd_toEndOf="parent" |
| 30 | app:layout_constraintStart_toStartOf="parent" | 29 | app:layout_constraintStart_toStartOf="parent" |
| 31 | app:layout_constraintTop_toTopOf="@id/guideline" /> | 30 | app:layout_constraintTop_toTopOf="@id/guideline" /> |
| 32 | 31 | ||
| 33 | 32 | ||
| 34 | <androidx.appcompat.widget.AppCompatTextView | 33 | <ImageButton |
| 35 | android:id="@+id/tvCodigoBarras" | 34 | android:id="@+id/ivCamara" |
| 36 | android:layout_width="wrap_content" | 35 | android:layout_width="80dp" |
| 37 | android:layout_height="wrap_content" | 36 | android:layout_height="80dp" |
| 38 | android:layout_marginStart="5dp" | 37 | |
| 39 | android:text="@string/invCodigoBarras" | 38 | android:clickable="true" |
| 40 | android:textColor="@color/colorAccent" | 39 | android:contentDescription="@string/ibBusCB" |
| 41 | android:textSize="@dimen/subTitulos" | 40 | android:elevation="5dp" |
| 42 | app:fontFamily="sans-serif-condensed" | 41 | android:background="@drawable/boton_redondo" |
| 43 | app:layout_constraintBottom_toTopOf="@+id/guideline3" | 42 | android:layout_margin="10dp" |
| 44 | app:layout_constraintEnd_toStartOf="@+id/etCodigoBarras" | 43 | android:focusable="false" |
| 45 | app:layout_constraintHorizontal_bias="0.0" | 44 | android:scaleType="fitEnd" |
| 46 | app:layout_constraintHorizontal_chainStyle="packed" | 45 | app:layout_constraintCircleRadius="40dp" |
| 47 | app:layout_constraintStart_toStartOf="parent" | 46 | android:src="@drawable/codbar" |
| 48 | app:layout_constraintTop_toTopOf="@id/guideline2" /> | 47 | app:layout_constraintBottom_toTopOf="@id/guideline3" |
| 48 | app:layout_constraintEnd_toStartOf="@+id/etCodigoBarras" | ||
| 49 | app:layout_constraintHorizontal_bias="0.0" | ||
| 50 | app:layout_constraintStart_toStartOf="parent" | ||
| 51 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | ||
| 49 | 52 | ||
| 50 | <EditText | 53 | <EditText |
| 51 | android:id="@+id/etCodigoBarras" | 54 | android:id="@+id/etCodigoBarras" |
| 52 | android:layout_width="wrap_content" | 55 | android:layout_width="0dp" |
| 53 | android:layout_height="wrap_content" | 56 | android:layout_height="wrap_content" |
| 57 | android:autofillHints="" | ||
| 54 | android:clickable="true" | 58 | android:clickable="true" |
| 55 | android:ems="10" | 59 | android:ems="10" |
| 56 | android:focusable="true" | 60 | android:focusable="true" |
| 57 | android:textAllCaps="true" | 61 | android:hint="@string/ibBusCB" |
| 58 | android:inputType="textPersonName" | 62 | android:inputType="textPersonName" |
| 59 | android:lines="1" | 63 | android:lines="1" |
| 60 | android:text="" | 64 | android:textAllCaps="true" |
| 61 | android:textSize="20sp" | 65 | android:textSize="20sp" |
| 62 | app:layout_constraintBaseline_toBaselineOf="@+id/tvCodigoBarras" | 66 | app:layout_constraintBottom_toTopOf="@+id/guideline3" |
| 63 | app:layout_constraintEnd_toEndOf="parent" | 67 | app:layout_constraintEnd_toStartOf="@+id/swSumaUno" |
| 68 | app:layout_constraintHorizontal_bias="0.49" | ||
| 64 | app:layout_constraintHorizontal_chainStyle="packed" | 69 | app:layout_constraintHorizontal_chainStyle="packed" |
| 65 | app:layout_constraintStart_toEndOf="@id/tvCodigoBarras" | 70 | app:layout_constraintStart_toEndOf="@+id/ivCamara" |
| 66 | android:autofillHints="" /> | 71 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> |
| 72 | |||
| 67 | 73 | ||
| 68 | <Switch | 74 | <Switch |
| 69 | android:id="@+id/swSumaUno" | 75 | android:id="@+id/swSumaUno" |
| 70 | android:layout_width="wrap_content" | 76 | android:layout_width="wrap_content" |
| 71 | android:layout_height="wrap_content" | 77 | android:layout_height="wrap_content" |
| 72 | android:layout_marginStart="5dp" | ||
| 73 | android:text="@string/switch_1" | 78 | android:text="@string/switch_1" |
| 74 | app:layout_constraintBottom_toTopOf="@+id/guideline3" | 79 | app:layout_constraintBottom_toTopOf="@+id/guideline3" |
| 75 | app:layout_constraintEnd_toEndOf="parent" | 80 | app:layout_constraintEnd_toEndOf="parent" |
| 76 | app:layout_constraintStart_toEndOf="@id/etCodigoBarras" | 81 | app:layout_constraintStart_toEndOf="@id/etCodigoBarras" |
| 77 | app:layout_constraintTop_toTopOf="@id/guideline2" | 82 | app:layout_constraintTop_toTopOf="@id/guideline2" |
| 83 | app:layout_constraintVertical_bias="1.0" | ||
| 78 | tools:ignore="UseSwitchCompatOrMaterialXml" /> | 84 | tools:ignore="UseSwitchCompatOrMaterialXml" /> |
| 79 | 85 | ||
| 80 | <ImageButton | ||
| 81 | android:id="@+id/ivCamara" | ||
| 82 | android:layout_width="74dp" | ||
| 83 | android:layout_height="wrap_content" | ||
| 84 | android:layout_margin="10dp" | ||
| 85 | android:clickable="true" | ||
| 86 | android:contentDescription="TODO" | ||
| 87 | android:src="@drawable/camera" | ||
| 88 | app:layout_constraintBottom_toTopOf="@+id/guideline4" | ||
| 89 | app:layout_constraintStart_toStartOf="parent" | ||
| 90 | app:layout_constraintTop_toTopOf="@id/guideline3" /> | ||
| 91 | |||
| 92 | <androidx.recyclerview.widget.RecyclerView | 86 | <androidx.recyclerview.widget.RecyclerView |
| 93 | android:id="@+id/rcInventarios" | 87 | android:id="@+id/rcInventarios" |
| 94 | android:layout_width="match_parent" | 88 | android:layout_width="match_parent" |
| 95 | android:layout_height="0dp" | 89 | android:layout_height="0dp" |
| 96 | android:background="@android:color/darker_gray" | 90 | android:background="@android:color/darker_gray" |
| 97 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" | 91 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" |
| 98 | app:layout_constraintEnd_toEndOf="parent" | 92 | app:layout_constraintEnd_toEndOf="parent" |
| 99 | app:layout_constraintStart_toStartOf="parent" | 93 | app:layout_constraintStart_toStartOf="parent" |
| 100 | tools:listitem="@layout/item" | 94 | app:layout_constraintTop_toBottomOf="@+id/guideline4" |
| 101 | app:layout_constraintTop_toBottomOf="@+id/guideline4" /> | 95 | tools:listitem="@layout/item" /> |
| 102 | 96 | ||
| 103 | 97 | ||
| 104 | <Button | 98 | <Button |
| 105 | android:id="@+id/btnExportarInv" | 99 | android:id="@+id/btnExportarInv" |
| 106 | android:layout_width="wrap_content" | 100 | android:layout_width="wrap_content" |
| 107 | android:layout_height="wrap_content" | 101 | android:layout_height="wrap_content" |
| 108 | android:text="@string/btnExportarInv" | 102 | android:text="@string/btnExportarInv" |
| 103 | android:textColor="@android:color/white" | ||
| 104 | android:padding="10dp" | ||
| 105 | android:background="@drawable/boton_borde_redondeado" | ||
| 109 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | 106 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" |
| 110 | app:layout_constraintEnd_toEndOf="parent" | 107 | app:layout_constraintEnd_toEndOf="parent" |
| 111 | app:layout_constraintHorizontal_chainStyle="spread" | 108 | app:layout_constraintHorizontal_chainStyle="spread" |
| 112 | app:layout_constraintStart_toEndOf="@+id/btnBorrarInv" | 109 | app:layout_constraintStart_toEndOf="@+id/btnBorrarInv" |
| 113 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | 110 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> |
| 114 | 111 | ||
| 115 | <Button | 112 | <Button |
| 116 | android:id="@+id/btnBorrarInv" | 113 | android:id="@+id/btnBorrarInv" |
| 117 | android:layout_width="wrap_content" | 114 | android:layout_width="wrap_content" |
| 118 | android:layout_height="wrap_content" | 115 | android:layout_height="wrap_content" |
| 119 | android:text="@string/btnBorrarInv" | 116 | android:text="@string/btnBorrarInv" |
| 120 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | 117 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" |
| 121 | app:layout_constraintEnd_toStartOf="@id/btnExportarInv" | 118 | app:layout_constraintEnd_toStartOf="@id/btnExportarInv" |
| 122 | app:layout_constraintHorizontal_chainStyle="spread" | 119 | app:layout_constraintHorizontal_chainStyle="spread" |
| 123 | app:layout_constraintStart_toStartOf="parent" | 120 | app:layout_constraintStart_toStartOf="parent" |
| 121 | android:textColor="@android:color/white" | ||
| 122 | android:padding="10dp" | ||
| 123 | android:background="@drawable/boton_borde_redondeado" | ||
| 124 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | 124 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> |
| 125 | 125 | ||
| 126 | <androidx.constraintlayout.widget.Guideline | 126 | <androidx.constraintlayout.widget.Guideline |
| 127 | android:id="@+id/guideline" | 127 | android:id="@+id/guideline" |
| 128 | android:layout_width="wrap_content" | 128 | android:layout_width="wrap_content" |
| 129 | android:layout_height="wrap_content" | 129 | android:layout_height="wrap_content" |
| 130 | android:orientation="horizontal" | 130 | android:orientation="horizontal" |
| 131 | app:layout_constraintGuide_percent="0.05" /> | 131 | app:layout_constraintGuide_percent="0.02" /> |
| 132 | 132 | ||
| 133 | <androidx.constraintlayout.widget.Guideline | 133 | <androidx.constraintlayout.widget.Guideline |
| 134 | android:id="@+id/guideline2" | 134 | android:id="@+id/guideline2" |
| 135 | android:layout_width="wrap_content" | 135 | android:layout_width="wrap_content" |
| 136 | android:layout_height="wrap_content" | 136 | android:layout_height="wrap_content" |
| 137 | android:orientation="horizontal" | 137 | android:orientation="horizontal" |
| 138 | app:layout_constraintGuide_percent="0.15" /> | 138 | app:layout_constraintGuide_percent="0.12" /> |
| 139 | 139 | ||
| 140 | <androidx.constraintlayout.widget.Guideline | 140 | <androidx.constraintlayout.widget.Guideline |
| 141 | android:id="@+id/guideline3" | 141 | android:id="@+id/guideline3" |
| 142 | android:layout_width="wrap_content" | 142 | android:layout_width="wrap_content" |
| 143 | android:layout_height="wrap_content" | 143 | android:layout_height="wrap_content" |
| 144 | android:orientation="horizontal" | 144 | android:orientation="horizontal" |
| 145 | app:layout_constraintGuide_percent="0.25" /> | 145 | app:layout_constraintGuide_percent="0.25" /> |
| 146 | 146 | ||
| 147 | <androidx.constraintlayout.widget.Guideline | 147 | <androidx.constraintlayout.widget.Guideline |
| 148 | android:id="@+id/guideline4" | 148 | android:id="@+id/guideline4" |
| 149 | android:layout_width="wrap_content" | 149 | android:layout_width="wrap_content" |
| 150 | android:layout_height="wrap_content" | 150 | android:layout_height="wrap_content" |
| 151 | android:orientation="horizontal" | 151 | android:orientation="horizontal" |
| 152 | app:layout_constraintGuide_percent="0.35" /> | 152 | app:layout_constraintGuide_percent="0.35" /> |
| 153 | 153 | ||
| 154 | <androidx.constraintlayout.widget.Guideline | 154 | <androidx.constraintlayout.widget.Guideline |
| 155 | android:id="@+id/guideline5" | 155 | android:id="@+id/guideline5" |
| 156 | android:layout_width="wrap_content" | 156 | android:layout_width="wrap_content" |
| 157 | android:layout_height="wrap_content" | 157 | android:layout_height="wrap_content" |
| 158 | android:orientation="horizontal" | 158 | android:orientation="horizontal" |
| 159 | app:layout_constraintGuide_percent="0.88" /> | 159 | app:layout_constraintGuide_percent="0.88" /> |
| 160 | 160 | ||
| 161 | <androidx.constraintlayout.widget.Guideline | 161 | <androidx.constraintlayout.widget.Guideline |
| 162 | android:id="@+id/guideline6" | 162 | android:id="@+id/guideline6" |
| 163 | android:layout_width="wrap_content" | 163 | android:layout_width="wrap_content" |
| 164 | android:layout_height="wrap_content" | 164 | android:layout_height="wrap_content" |
app/src/main/res/layout/fragment_servidores.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
| 5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
| 6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
| 7 | tools:context=".ui.servidores.ServidoresFragment"> | 7 | tools:context=".ui.servidores.ServidoresFragment"> |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | <androidx.appcompat.widget.AppCompatTextView | 10 | <androidx.appcompat.widget.AppCompatTextView |
| 11 | android:id="@+id/tvTitutloServer" | 11 | android:id="@+id/tvTitutloServer" |
| 12 | android:layout_width="match_parent" | 12 | android:layout_width="match_parent" |
| 13 | android:layout_height="90dp" | 13 | android:layout_height="90dp" |
| 14 | android:layout_marginStart="8dp" | 14 | android:layout_marginStart="8dp" |
| 15 | android:layout_marginTop="15dp" | 15 | android:layout_marginTop="15dp" |
| 16 | android:layout_marginEnd="8dp" | 16 | android:layout_marginEnd="8dp" |
| 17 | android:autoSizeMaxTextSize="100sp" | 17 | android:autoSizeMaxTextSize="100sp" |
| 18 | android:autoSizeMinTextSize="20sp" | 18 | android:autoSizeMinTextSize="20sp" |
| 19 | android:autoSizeStepGranularity="5sp" | 19 | android:autoSizeStepGranularity="5sp" |
| 20 | android:autoSizeTextType="uniform" | 20 | android:autoSizeTextType="uniform" |
| 21 | android:gravity="center" | 21 | android:gravity="center" |
| 22 | android:lines="1" | 22 | android:lines="1" |
| 23 | android:text="@string/tvTitutloServer" | 23 | android:text="@string/tvTitutloServer" |
| 24 | android:textColor="@color/colorAccent" | 24 | android:textColor="@color/colorAccent" |
| 25 | app:fontFamily="sans-serif-condensed" | 25 | app:fontFamily="sans-serif-condensed" |
| 26 | app:layout_constraintBottom_toTopOf="@id/guideline2" | 26 | app:layout_constraintBottom_toTopOf="@id/guideline2" |
| 27 | app:layout_constraintEnd_toEndOf="parent" | 27 | app:layout_constraintEnd_toEndOf="parent" |
| 28 | app:layout_constraintStart_toStartOf="parent" | 28 | app:layout_constraintStart_toStartOf="parent" |
| 29 | app:layout_constraintTop_toTopOf="parent" /> | 29 | app:layout_constraintTop_toTopOf="parent" /> |
| 30 | 30 | ||
| 31 | <TextView | 31 | <TextView |
| 32 | android:id="@+id/tvDirServer" | 32 | android:id="@+id/tvDirServer" |
| 33 | android:layout_width="match_parent" | 33 | android:layout_width="match_parent" |
| 34 | android:layout_height="wrap_content" | 34 | android:layout_height="wrap_content" |
| 35 | android:layout_marginStart="8dp" | 35 | android:layout_marginStart="8dp" |
| 36 | android:layout_marginEnd="8dp" | 36 | android:layout_marginEnd="8dp" |
| 37 | android:gravity="center" | 37 | android:gravity="center" |
| 38 | android:lines="1" | 38 | android:lines="1" |
| 39 | android:text="@string/tvDirServer" | 39 | android:text="@string/tvDirServer" |
| 40 | android:textColor="@android:color/black" | 40 | android:textColor="@android:color/black" |
| 41 | android:textSize="@dimen/TitulosMedios" | 41 | android:textSize="@dimen/TitulosMedios" |
| 42 | android:textStyle="bold|italic" | 42 | android:textStyle="bold|italic" |
| 43 | app:fontFamily="sans-serif-condensed" | 43 | app:fontFamily="sans-serif-condensed" |
| 44 | app:layout_constraintBottom_toTopOf="@+id/etDireccionServidor" | 44 | app:layout_constraintBottom_toTopOf="@+id/etDireccionServidor" |
| 45 | app:layout_constraintEnd_toEndOf="parent" | 45 | app:layout_constraintEnd_toEndOf="parent" |
| 46 | app:layout_constraintStart_toStartOf="parent" | 46 | app:layout_constraintStart_toStartOf="parent" |
| 47 | app:layout_constraintTop_toBottomOf="@id/guideline3" | 47 | app:layout_constraintTop_toBottomOf="@id/guideline3" |
| 48 | app:layout_constraintVertical_bias="0.451" /> | 48 | app:layout_constraintVertical_bias="0.451" /> |
| 49 | 49 | ||
| 50 | <TextView | 50 | <TextView |
| 51 | android:id="@+id/tvNomServer" | 51 | android:id="@+id/tvNomServer" |
| 52 | android:layout_width="match_parent" | 52 | android:layout_width="match_parent" |
| 53 | android:layout_height="wrap_content" | 53 | android:layout_height="wrap_content" |
| 54 | android:layout_marginStart="8dp" | 54 | android:layout_marginStart="8dp" |
| 55 | android:layout_marginEnd="8dp" | 55 | android:layout_marginEnd="8dp" |
| 56 | android:layout_marginTop="15dp" | 56 | android:layout_marginTop="15dp" |
| 57 | android:gravity="center" | 57 | android:gravity="center" |
| 58 | android:lines="2" | 58 | android:lines="2" |
| 59 | android:text="@string/tvNomServer" | 59 | android:text="@string/tvNomServer" |
| 60 | android:textColor="@android:color/black" | 60 | android:textColor="@android:color/black" |
| 61 | android:textSize="@dimen/TitulosMedios" | 61 | android:textSize="@dimen/TitulosMedios" |
| 62 | android:textStyle="bold|italic" | 62 | android:textStyle="bold|italic" |
| 63 | app:fontFamily="sans-serif-condensed" | 63 | app:fontFamily="sans-serif-condensed" |
| 64 | app:layout_constraintBottom_toTopOf="@+id/etNombreServidor" | 64 | app:layout_constraintBottom_toTopOf="@+id/etNombreServidor" |
| 65 | app:layout_constraintEnd_toEndOf="parent" | 65 | app:layout_constraintEnd_toEndOf="parent" |
| 66 | app:layout_constraintStart_toStartOf="parent" | 66 | app:layout_constraintStart_toStartOf="parent" |
| 67 | app:layout_constraintTop_toBottomOf="@id/guideline2" /> | 67 | app:layout_constraintTop_toBottomOf="@id/guideline2" /> |
| 68 | 68 | ||
| 69 | <EditText | 69 | <EditText |
| 70 | android:id="@+id/etNombreServidor" | 70 | android:id="@+id/etNombreServidor" |
| 71 | android:layout_width="match_parent" | 71 | android:layout_width="match_parent" |
| 72 | android:layout_height="wrap_content" | 72 | android:layout_height="wrap_content" |
| 73 | android:autofillHints="" | 73 | android:autofillHints="" |
| 74 | android:clickable="true" | 74 | android:clickable="true" |
| 75 | android:ems="10" | 75 | android:ems="10" |
| 76 | android:focusable="true" | 76 | android:focusable="true" |
| 77 | android:inputType="text" | 77 | android:inputType="text" |
| 78 | android:lines="1" | 78 | android:lines="1" |
| 79 | android:hint="Servidor Local" | 79 | android:hint="Servidor Local" |
| 80 | android:textSize="15sp" | 80 | android:textSize="15sp" |
| 81 | app:layout_constraintBottom_toTopOf="@id/guideline3" | 81 | app:layout_constraintBottom_toTopOf="@id/guideline3" |
| 82 | app:layout_constraintEnd_toEndOf="parent" | 82 | app:layout_constraintEnd_toEndOf="parent" |
| 83 | app:layout_constraintHorizontal_bias="0.0" | 83 | app:layout_constraintHorizontal_bias="0.0" |
| 84 | app:layout_constraintStart_toStartOf="parent" | 84 | app:layout_constraintStart_toStartOf="parent" |
| 85 | app:layout_constraintTop_toBottomOf="@+id/tvNomServer" /> | 85 | app:layout_constraintTop_toBottomOf="@+id/tvNomServer" /> |
| 86 | 86 | ||
| 87 | <EditText | 87 | <EditText |
| 88 | android:id="@+id/etDireccionServidor" | 88 | android:id="@+id/etDireccionServidor" |
| 89 | android:layout_width="0dp" | 89 | android:layout_width="0dp" |
| 90 | android:layout_height="wrap_content" | 90 | android:layout_height="wrap_content" |
| 91 | android:layout_marginStart="8dp" | 91 | android:layout_marginStart="8dp" |
| 92 | android:layout_marginEnd="8dp" | 92 | android:layout_marginEnd="8dp" |
| 93 | android:clickable="true" | 93 | android:clickable="true" |
| 94 | android:ems="10" | 94 | android:ems="10" |
| 95 | android:focusable="true" | 95 | android:focusable="true" |
| 96 | android:inputType="text" | 96 | android:inputType="text" |
| 97 | android:lines="1" | 97 | android:lines="1" |
| 98 | 98 | ||
| 99 | android:hint="192.168.10.1:9090" | 99 | android:hint="192.168.10.1:9090" |
| 100 | android:textSize="15sp" | 100 | android:textSize="15sp" |
| 101 | app:layout_constraintBottom_toTopOf="@id/guideline4" | 101 | app:layout_constraintBottom_toTopOf="@id/guideline4" |
| 102 | app:layout_constraintEnd_toEndOf="parent" | 102 | app:layout_constraintEnd_toEndOf="parent" |
| 103 | app:layout_constraintStart_toStartOf="parent" | 103 | app:layout_constraintStart_toStartOf="parent" |
| 104 | app:layout_constraintTop_toTopOf="@+id/tvDirServer" /> | 104 | app:layout_constraintTop_toTopOf="@+id/tvDirServer" /> |
| 105 | 105 | ||
| 106 | <androidx.recyclerview.widget.RecyclerView | 106 | <androidx.recyclerview.widget.RecyclerView |
| 107 | android:id="@+id/rvServidores" | 107 | android:id="@+id/rvServidores" |
| 108 | android:layout_width="match_parent" | 108 | android:layout_width="match_parent" |
| 109 | android:layout_height="0dp" | 109 | android:layout_height="0dp" |
| 110 | android:background="@android:color/darker_gray" | 110 | android:background="@android:color/darker_gray" |
| 111 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" | 111 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" |
| 112 | app:layout_constraintEnd_toEndOf="parent" | 112 | app:layout_constraintEnd_toEndOf="parent" |
| 113 | app:layout_constraintStart_toStartOf="parent" | 113 | app:layout_constraintStart_toStartOf="parent" |
| 114 | app:layout_constraintTop_toBottomOf="@+id/guideline4" | 114 | app:layout_constraintTop_toBottomOf="@+id/guideline4" |
| 115 | tools:listitem="@layout/item_servidores" /> | 115 | tools:listitem="@layout/item_servidores" /> |
| 116 | 116 | ||
| 117 | <Button | 117 | <Button |
| 118 | android:id="@+id/btnGuardarServidores" | 118 | android:id="@+id/btnGuardarServidores" |
| 119 | android:layout_width="0dp" | 119 | android:layout_width="0dp" |
| 120 | android:layout_height="wrap_content" | 120 | android:layout_height="wrap_content" |
| 121 | android:text="@string/btnGuardarServidores" | 121 | android:text="@string/btnGuardarServidores" |
| 122 | android:textColor="@android:color/white" | ||
| 123 | android:padding="10dp" | ||
| 124 | android:background="@drawable/boton_borde_redondeado" | ||
| 122 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | 125 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" |
| 123 | app:layout_constraintEnd_toEndOf="parent" | 126 | app:layout_constraintEnd_toEndOf="parent" |
| 124 | app:layout_constraintStart_toStartOf="parent" /> | 127 | app:layout_constraintStart_toStartOf="parent" /> |
| 125 | 128 | ||
| 126 | 129 | ||
| 127 | <androidx.constraintlayout.widget.Guideline | 130 | <androidx.constraintlayout.widget.Guideline |
| 128 | android:id="@+id/guideline2" | 131 | android:id="@+id/guideline2" |
| 129 | android:layout_width="wrap_content" | 132 | android:layout_width="wrap_content" |
| 130 | android:layout_height="wrap_content" | 133 | android:layout_height="wrap_content" |
| 131 | android:orientation="horizontal" | 134 | android:orientation="horizontal" |
| 132 | app:layout_constraintGuide_percent="0.15" /> | 135 | app:layout_constraintGuide_percent="0.15" /> |
| 133 | 136 | ||
| 134 | <androidx.constraintlayout.widget.Guideline | 137 | <androidx.constraintlayout.widget.Guideline |
| 135 | android:id="@+id/guideline3" | 138 | android:id="@+id/guideline3" |
| 136 | android:layout_width="wrap_content" | 139 | android:layout_width="wrap_content" |
| 137 | android:layout_height="wrap_content" | 140 | android:layout_height="wrap_content" |
| 138 | android:orientation="horizontal" | 141 | android:orientation="horizontal" |
| 139 | app:layout_constraintGuide_percent="0.25" /> | 142 | app:layout_constraintGuide_percent="0.25" /> |
| 140 | 143 | ||
| 141 | <androidx.constraintlayout.widget.Guideline | 144 | <androidx.constraintlayout.widget.Guideline |
| 142 | android:id="@+id/guideline4" | 145 | android:id="@+id/guideline4" |
| 143 | android:layout_width="wrap_content" | 146 | android:layout_width="wrap_content" |
| 144 | android:layout_height="wrap_content" | 147 | android:layout_height="wrap_content" |
| 145 | android:orientation="horizontal" | 148 | android:orientation="horizontal" |
| 146 | app:layout_constraintGuide_percent="0.5" /> | 149 | app:layout_constraintGuide_percent="0.5" /> |
| 147 | 150 | ||
| 148 | <androidx.constraintlayout.widget.Guideline | 151 | <androidx.constraintlayout.widget.Guideline |
| 149 | android:id="@+id/guideline5" | 152 | android:id="@+id/guideline5" |
| 150 | android:layout_width="wrap_content" | 153 | android:layout_width="wrap_content" |
| 151 | android:layout_height="wrap_content" | 154 | android:layout_height="wrap_content" |
| 152 | android:orientation="horizontal" | 155 | android:orientation="horizontal" |
| 153 | app:layout_constraintGuide_percent="0.80" /> | 156 | app:layout_constraintGuide_percent="0.80" /> |
| 154 | 157 | ||
| 155 | <androidx.constraintlayout.widget.Guideline | 158 | <androidx.constraintlayout.widget.Guideline |
| 156 | android:id="@+id/guideline6" | 159 | android:id="@+id/guideline6" |
| 157 | android:layout_width="wrap_content" | 160 | android:layout_width="wrap_content" |
| 158 | android:layout_height="wrap_content" | 161 | android:layout_height="wrap_content" |
| 159 | android:orientation="horizontal" | 162 | android:orientation="horizontal" |
| 160 | app:layout_constraintGuide_percent="0.88" /> | 163 | app:layout_constraintGuide_percent="0.88" /> |
| 161 | </androidx.constraintlayout.widget.ConstraintLayout> | 164 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 162 | 165 |
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 | android:background="@drawable/md_transparent" | 10 | android:background="@drawable/md_transparent" |
| 11 | tools:context=".ui.inventario.InsertCant" | 11 | tools:context=".ui.inventario.InsertCant" |
| 12 | tools:ignore="PrivateResource"> | 12 | tools:ignore="PrivateResource"> |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | <androidx.constraintlayout.widget.ConstraintLayout | 15 | <androidx.constraintlayout.widget.ConstraintLayout |
| 16 | android:layout_width="match_parent" | 16 | android:layout_width="match_parent" |
| 17 | android:layout_height="match_parent"> | 17 | android:layout_height="match_parent"> |
| 18 | 18 | ||
| 19 | <LinearLayout | 19 | <LinearLayout |
| 20 | android:id="@+id/barraSuperior" | 20 | android:id="@+id/barraSuperior" |
| 21 | android:layout_width="0dp" | 21 | android:layout_width="0dp" |
| 22 | android:layout_height="wrap_content" | 22 | android:layout_height="wrap_content" |
| 23 | android:background="@color/colorPrimaryDark" | 23 | android:background="@color/colorPrimaryDark" |
| 24 | android:orientation="horizontal" | 24 | android:orientation="horizontal" |
| 25 | app:layout_constraintLeft_toLeftOf="parent" | 25 | app:layout_constraintLeft_toLeftOf="parent" |
| 26 | app:layout_constraintRight_toRightOf="parent" | 26 | app:layout_constraintRight_toRightOf="parent" |
| 27 | app:layout_constraintTop_toTopOf="parent" | 27 | app:layout_constraintTop_toTopOf="parent" |
| 28 | app:layout_constraintTop_toBottomOf="@+id/lySegundo"> | 28 | app:layout_constraintTop_toBottomOf="@+id/lySegundo"> |
| 29 | 29 | ||
| 30 | <androidx.appcompat.widget.AppCompatTextView | 30 | <androidx.appcompat.widget.AppCompatTextView |
| 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 | android:textStyle="bold" /> | 41 | android:textStyle="bold" /> |
| 42 | </LinearLayout> | 42 | </LinearLayout> |
| 43 | 43 | ||
| 44 | 44 | ||
| 45 | <LinearLayout | 45 | <LinearLayout |
| 46 | android:id="@+id/lySegundo" | 46 | android:id="@+id/lySegundo" |
| 47 | android:layout_width="match_parent" | 47 | android:layout_width="match_parent" |
| 48 | android:layout_height="wrap_content" | 48 | android:layout_height="wrap_content" |
| 49 | android:orientation="vertical" | 49 | android:orientation="vertical" |
| 50 | android:padding="12dp" | 50 | android:padding="12dp" |
| 51 | app:layout_constraintLeft_toLeftOf="parent" | 51 | app:layout_constraintLeft_toLeftOf="parent" |
| 52 | app:layout_constraintRight_toRightOf="parent" | 52 | app:layout_constraintRight_toRightOf="parent" |
| 53 | app:layout_constraintTop_toBottomOf="@id/barraSuperior"> | 53 | app:layout_constraintTop_toBottomOf="@id/barraSuperior"> |
| 54 | 54 | ||
| 55 | 55 | ||
| 56 | 56 | ||
| 57 | <EditText | 57 | <EditText |
| 58 | android:id="@+id/etCantidad" | 58 | android:id="@+id/etCantidad" |
| 59 | android:layout_width="match_parent" | 59 | android:layout_width="match_parent" |
| 60 | android:layout_height="wrap_content" | 60 | android:layout_height="wrap_content" |
| 61 | android:ems="10" | 61 | android:ems="10" |
| 62 | android:gravity="center" | 62 | android:gravity="center" |
| 63 | android:textSize="20sp" | 63 | android:textSize="20sp" |
| 64 | android:focusable="true" | 64 | android:focusable="true" |
| 65 | android:clickable="true" | 65 | android:clickable="true" |
| 66 | android:inputType="numberDecimal" | 66 | android:inputType="numberDecimal" |
| 67 | android:text="" /> | 67 | android:text="" /> |
| 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" | ||
| 79 | android:padding="10dp" | ||
| 80 | android:background="@drawable/boton_borde_redondeado" | ||
| 78 | android:text="@string/btnConfirmar" | 81 | android:text="@string/btnConfirmar" |
| 79 | android:textAlignment="center" | 82 | android:textAlignment="center" |
| 80 | android:textColor="@android:color/black" | ||
| 81 | android:textSize="20sp" | 83 | android:textSize="20sp" |
| 82 | android:textStyle="bold" | 84 | android:textStyle="bold" |
| 83 | app:cardBackgroundColor="@android:color/darker_gray" | 85 | app:cardBackgroundColor="@android:color/darker_gray" |
| 84 | app:cardUseCompatPadding="true" /> | 86 | app:cardUseCompatPadding="true" /> |
| 85 | 87 | ||
| 86 | 88 | ||
| 87 | </LinearLayout> | 89 | </LinearLayout> |
| 88 | 90 | ||
| 89 | 91 | ||
| 90 | </androidx.constraintlayout.widget.ConstraintLayout> | 92 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/item.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
| 5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
| 6 | android:layout_height="wrap_content" | 6 | android:layout_height="wrap_content" |
| 7 | android:layout_margin="5dp" | 7 | android:layout_margin="5dp" |
| 8 | app:cardCornerRadius="2dp" | 8 | app:cardCornerRadius="2dp" |
| 9 | app:cardElevation="10dp" | 9 | app:cardElevation="10dp" |
| 10 | app:contentPadding="5dp" | 10 | app:contentPadding="5dp" |
| 11 | app:cardPreventCornerOverlap="false"> | 11 | app:cardPreventCornerOverlap="false"> |
| 12 | 12 | ||
| 13 | <androidx.constraintlayout.widget.ConstraintLayout | 13 | <androidx.constraintlayout.widget.ConstraintLayout |
| 14 | android:layout_width="match_parent" | 14 | android:layout_width="match_parent" |
| 15 | android:layout_height="wrap_content"> | 15 | android:layout_height="wrap_content"> |
| 16 | 16 | ||
| 17 | <TextView | 17 | <TextView |
| 18 | android:id="@+id/textView2" | 18 | android:id="@+id/textView2" |
| 19 | android:layout_width="wrap_content" | 19 | android:layout_width="wrap_content" |
| 20 | android:layout_height="wrap_content" | 20 | android:layout_height="wrap_content" |
| 21 | android:layout_marginStart="5dp" | 21 | android:layout_marginStart="5dp" |
| 22 | android:text="Código:" | 22 | android:text="Código:" |
| 23 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 23 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
| 24 | android:textSize="14sp" | 24 | android:textSize="14sp" |
| 25 | app:layout_constraintEnd_toStartOf="@+id/tvSector" | 25 | app:layout_constraintEnd_toStartOf="@+id/tvSector" |
| 26 | app:layout_constraintHorizontal_bias="0.01" | 26 | app:layout_constraintHorizontal_bias="0.01" |
| 27 | app:layout_constraintHorizontal_chainStyle="packed" | 27 | app:layout_constraintHorizontal_chainStyle="packed" |
| 28 | app:layout_constraintStart_toStartOf="parent" | 28 | app:layout_constraintStart_toStartOf="parent" |
| 29 | app:layout_constraintTop_toTopOf="parent" /> | 29 | app:layout_constraintTop_toTopOf="parent" /> |
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | <TextView | 32 | <TextView |
| 33 | android:id="@+id/tvSector" | 33 | android:id="@+id/tvSector" |
| 34 | android:layout_width="wrap_content" | 34 | android:layout_width="wrap_content" |
| 35 | android:layout_height="match_parent" | 35 | android:layout_height="match_parent" |
| 36 | android:layout_marginStart="8dp" | 36 | android:layout_marginStart="8dp" |
| 37 | android:text="9999" | 37 | android:text="9999" |
| 38 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 38 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
| 39 | android:textColorHint="@android:color/black" | 39 | android:textColorHint="@android:color/black" |
| 40 | android:textSize="14sp" | 40 | android:textSize="14sp" |
| 41 | android:textStyle="bold" | 41 | android:textStyle="bold" |
| 42 | app:layout_constraintHorizontal_chainStyle="packed" | 42 | app:layout_constraintHorizontal_chainStyle="packed" |
| 43 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | 43 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" |
| 44 | app:layout_constraintEnd_toStartOf="@+id/tvCodigo" | 44 | app:layout_constraintEnd_toStartOf="@+id/tvCodigo" |
| 45 | app:layout_constraintStart_toEndOf="@+id/textView2" /> | 45 | app:layout_constraintStart_toEndOf="@+id/textView2" /> |
| 46 | <TextView | 46 | <TextView |
| 47 | android:id="@+id/tvCodigo" | 47 | android:id="@+id/tvCodigo" |
| 48 | android:layout_width="wrap_content" | 48 | android:layout_width="wrap_content" |
| 49 | android:layout_height="match_parent" | 49 | android:layout_height="match_parent" |
| 50 | android:layout_marginStart="8dp" | 50 | android:layout_marginStart="8dp" |
| 51 | android:text="99999999" | 51 | android:text="99999999" |
| 52 | app:layout_constraintHorizontal_chainStyle="packed" | 52 | app:layout_constraintHorizontal_chainStyle="packed" |
| 53 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 53 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
| 54 | android:textColorHint="@android:color/black" | 54 | android:textColorHint="@android:color/black" |
| 55 | android:textSize="14sp" | 55 | android:textSize="14sp" |
| 56 | android:textStyle="bold" | 56 | android:textStyle="bold" |
| 57 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | 57 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" |
| 58 | app:layout_constraintEnd_toStartOf="@+id/textView5" | 58 | app:layout_constraintEnd_toStartOf="@+id/textView5" |
| 59 | app:layout_constraintStart_toEndOf="@+id/tvSector" /> | 59 | app:layout_constraintStart_toEndOf="@+id/tvSector" /> |
| 60 | 60 | ||
| 61 | <TextView | 61 | <TextView |
| 62 | android:id="@+id/textView5" | 62 | android:id="@+id/textView5" |
| 63 | android:layout_width="wrap_content" | 63 | android:layout_width="wrap_content" |
| 64 | android:layout_height="wrap_content" | 64 | android:layout_height="wrap_content" |
| 65 | android:layout_marginStart="8dp" | 65 | android:layout_marginStart="8dp" |
| 66 | android:text="Cantidad:" | 66 | android:text="Cantidad:" |
| 67 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 67 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
| 68 | android:textSize="14sp" | 68 | android:textSize="14sp" |
| 69 | app:layout_constraintTop_toTopOf="parent" | 69 | app:layout_constraintTop_toTopOf="parent" |
| 70 | app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras" | 70 | app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras" |
| 71 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | 71 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> |
| 72 | 72 | ||
| 73 | <TextView | 73 | <TextView |
| 74 | android:id="@+id/tvCantidad" | 74 | android:id="@+id/tvCantidad" |
| 75 | android:layout_width="wrap_content" | 75 | android:layout_width="wrap_content" |
| 76 | android:layout_height="match_parent" | 76 | android:layout_height="match_parent" |
| 77 | android:layout_margin="5dp" | 77 | android:layout_margin="5dp" |
| 78 | android:text="12345.12" | 78 | android:text="12345.12" |
| 79 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 79 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
| 80 | android:textSize="14sp" | 80 | android:textSize="14sp" |
| 81 | android:textStyle="bold" | 81 | android:textStyle="bold" |
| 82 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" | 82 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" |
| 83 | app:layout_constraintEnd_toEndOf="parent" | 83 | app:layout_constraintEnd_toEndOf="parent" |
| 84 | app:layout_constraintHorizontal_bias="0.0" | 84 | app:layout_constraintHorizontal_bias="0.0" |
| 85 | app:layout_constraintStart_toEndOf="@id/textView5" | 85 | app:layout_constraintStart_toEndOf="@id/textView5" |
| 86 | app:layout_constraintTop_toTopOf="parent" /> | 86 | app:layout_constraintTop_toTopOf="parent" /> |
| 87 | 87 | ||
| 88 | <ImageView | 88 | <ImageView |
| 89 | android:id="@+id/ivHolder" | 89 | android:id="@+id/ivHolder" |
| 90 | android:layout_width="30dp" | 90 | android:layout_width="30dp" |
| 91 | android:layout_height="30dp" | 91 | android:layout_height="30dp" |
| 92 | android:visibility="visible" | 92 | android:visibility="visible" |
| 93 | android:src="@drawable/more" | 93 | android:src="@drawable/more" |
| 94 | app:layout_constraintBottom_toTopOf="@+id/tvDescripcion" | 94 | app:layout_constraintBottom_toTopOf="@+id/tvDescripcion" |
| 95 | app:layout_constraintEnd_toEndOf="parent" | 95 | app:layout_constraintEnd_toEndOf="parent" |
| 96 | app:layout_constraintHorizontal_bias="0.968" | 96 | app:layout_constraintHorizontal_bias="0.968" |
| 97 | app:layout_constraintStart_toEndOf="@+id/tvCodigoBarras" | 97 | app:layout_constraintStart_toEndOf="@+id/tvCodigoBarras" |
| 98 | app:layout_constraintTop_toTopOf="parent" | 98 | app:layout_constraintTop_toTopOf="parent" |
| 99 | app:layout_constraintVertical_bias="0.0" /> | 99 | app:layout_constraintVertical_bias="0.0" /> |
| 100 | 100 | ||
| 101 | <TextView | 101 | <TextView |
| 102 | android:id="@+id/textView85" | 102 | android:id="@+id/textView85" |
| 103 | android:layout_width="wrap_content" | 103 | android:layout_width="wrap_content" |
| 104 | android:layout_height="wrap_content" | 104 | android:layout_height="wrap_content" |
| 105 | android:layout_marginStart="5dp" | 105 | android:layout_marginStart="5dp" |
| 106 | android:layout_marginTop="8dp" | 106 | android:layout_marginTop="8dp" |
| 107 | android:text="Desc:" | 107 | android:text="Desc:" |
| 108 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 108 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
| 109 | android:textSize="14sp" | 109 | android:textSize="14sp" |
| 110 | app:layout_constraintEnd_toStartOf="@+id/tvDescripcion" | 110 | app:layout_constraintEnd_toStartOf="@+id/tvDescripcion" |
| 111 | app:layout_constraintHorizontal_bias="0.0" | 111 | app:layout_constraintHorizontal_bias="0.0" |
| 112 | app:layout_constraintHorizontal_chainStyle="packed" | 112 | app:layout_constraintHorizontal_chainStyle="packed" |
| 113 | app:layout_constraintStart_toStartOf="parent" | 113 | app:layout_constraintStart_toStartOf="parent" |
| 114 | app:layout_constraintTop_toBottomOf="@id/tvCodigo" /> | 114 | app:layout_constraintTop_toBottomOf="@id/tvCodigo" /> |
| 115 | 115 | ||
| 116 | <TextView | 116 | <TextView |
| 117 | android:id="@+id/tvDescripcion" | 117 | android:id="@+id/tvDescripcion" |
| 118 | android:layout_width="0dp" | 118 | android:layout_width="0dp" |
| 119 | android:layout_height="wrap_content" | 119 | android:layout_height="wrap_content" |
| 120 | android:layout_marginStart="3dp" | 120 | android:layout_marginStart="3dp" |
| 121 | android:layout_marginTop="8dp" | 121 | android:layout_marginTop="8dp" |
| 122 | android:maxLines="2" | 122 | android:maxLines="2" |
| 123 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" | 123 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" |
| 124 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 124 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
| 125 | android:textSize="14sp" | 125 | android:textSize="14sp" |
| 126 | android:textStyle="bold" | 126 | android:textStyle="bold" |
| 127 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" | 127 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" |
| 128 | app:layout_constraintEnd_toEndOf="parent" | 128 | app:layout_constraintEnd_toEndOf="parent" |
| 129 | app:layout_constraintStart_toEndOf="@+id/textView85" | 129 | app:layout_constraintStart_toEndOf="@+id/textView85" |
| 130 | app:layout_constraintTop_toBottomOf="@+id/tvCodigo" /> | 130 | app:layout_constraintTop_toBottomOf="@+id/tvCodigo" /> |
| 131 | 131 | ||
| 132 | <TextView | 132 | <TextView |
| 133 | android:id="@+id/tvCodigoBarras" | 133 | android:id="@+id/tvCodigoBarras" |
| 134 | android:layout_width="match_parent" | 134 | android:layout_width="match_parent" |
| 135 | android:layout_height="wrap_content" | 135 | android:layout_height="wrap_content" |
| 136 | android:layout_marginStart="3dp" | 136 | android:layout_marginStart="3dp" |
| 137 | android:layout_marginTop="8dp" | 137 | android:layout_marginTop="8dp" |
| 138 | android:maxLines="2" | 138 | android:maxLines="2" |
| 139 | android:text="" | 139 | android:text="" |
| 140 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 140 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
| 141 | android:textSize="14sp" | 141 | android:textSize="14sp" |
| 142 | android:visibility="gone" | 142 | android:visibility="gone" |
| 143 | android:textStyle="bold" | 143 | android:textStyle="bold" |
| 144 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" | 144 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" |
| 145 | app:layout_constraintEnd_toEndOf="parent" | 145 | app:layout_constraintEnd_toEndOf="parent" |
| 146 | app:layout_constraintStart_toEndOf="@+id/textView85" | 146 | app:layout_constraintStart_toEndOf="@+id/textView85" |
| 147 | app:layout_constraintTop_toBottomOf="@+id/tvCodigo" /> | 147 | app:layout_constraintTop_toBottomOf="@+id/tvCodigo" /> |
| 148 | 148 | <TextView | |
| 149 | android:id="@+id/tvCodigoOrigen" | ||
| 150 | android:layout_width="match_parent" | ||
| 151 | android:layout_height="wrap_content" | ||
| 152 | android:layout_marginStart="3dp" | ||
| 153 | android:layout_marginTop="8dp" | ||
| 154 | android:maxLines="2" | ||
| 155 | android:text="" | ||
| 156 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
| 157 | android:textSize="14sp" | ||
| 158 | android:visibility="gone" | ||
| 159 | android:textStyle="bold" | ||
| 160 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" | ||
| 161 | app:layout_constraintEnd_toEndOf="parent" | ||
| 162 | app:layout_constraintStart_toEndOf="@+id/textView85" | ||
| 163 | app:layout_constraintTop_toBottomOf="@+id/tvCodigo" /> | ||
| 149 | </androidx.constraintlayout.widget.ConstraintLayout> | 164 | </androidx.constraintlayout.widget.ConstraintLayout> |
| 150 | 165 | ||
| 151 | </androidx.cardview.widget.CardView> | 166 | </androidx.cardview.widget.CardView> |
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 | <TextView | 9 | <TextView |
| 10 | android:id="@+id/dialogNameEt" | 10 | android:id="@+id/dialogNameEt" |
| 11 | android:layout_width="wrap_content" | 11 | android:layout_width="wrap_content" |
| 12 | android:layout_height="wrap_content" | 12 | android:layout_height="wrap_content" |
| 13 | android:layout_margin="5dp" | 13 | android:layout_margin="5dp" |
| 14 | android:text="La cantidad actual es:" | 14 | android:text="La cantidad actual es:" |
| 15 | android:textSize="20sp" | 15 | android:textSize="20sp" |
| 16 | app:layout_constraintEnd_toStartOf="@id/tvCantInicial" | 16 | app:layout_constraintEnd_toStartOf="@id/tvCantInicial" |
| 17 | app:layout_constraintHorizontal_bias="0.0" | 17 | app:layout_constraintHorizontal_bias="0.0" |
| 18 | app:layout_constraintHorizontal_chainStyle="packed" | 18 | app:layout_constraintHorizontal_chainStyle="packed" |
| 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 | <TextView | 22 | <TextView |
| 23 | android:id="@+id/tvCantInicial" | 23 | android:id="@+id/tvCantInicial" |
| 24 | android:layout_width="wrap_content" | 24 | android:layout_width="wrap_content" |
| 25 | android:layout_height="wrap_content" | 25 | android:layout_height="wrap_content" |
| 26 | android:layout_margin="5dp" | 26 | android:layout_margin="5dp" |
| 27 | android:text="20" | 27 | android:text="20" |
| 28 | android:textSize="20sp" | 28 | android:textSize="20sp" |
| 29 | app:layout_constraintBaseline_toBaselineOf="@+id/dialogNameEt" | 29 | app:layout_constraintBaseline_toBaselineOf="@+id/dialogNameEt" |
| 30 | app:layout_constraintEnd_toEndOf="parent" | 30 | app:layout_constraintEnd_toEndOf="parent" |
| 31 | app:layout_constraintHorizontal_chainStyle="packed" | 31 | app:layout_constraintHorizontal_chainStyle="packed" |
| 32 | app:layout_constraintStart_toEndOf="@id/dialogNameEt" /> | 32 | app:layout_constraintStart_toEndOf="@id/dialogNameEt" /> |
| 33 | 33 | ||
| 34 | <TextView | 34 | <TextView |
| 35 | android:id="@+id/tvgenerico" | 35 | android:id="@+id/tvgenerico" |
| 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="Ingrese la nueva cantidad:" | 39 | android:text="Ingrese la nueva cantidad:" |
| 40 | android:textSize="20sp" | 40 | android:textSize="20sp" |
| 41 | app:layout_constraintStart_toStartOf="parent" | 41 | app:layout_constraintStart_toStartOf="parent" |
| 42 | app:layout_constraintTop_toBottomOf="@+id/tvCantInicial" /> | 42 | app:layout_constraintTop_toBottomOf="@+id/tvCantInicial" /> |
| 43 | 43 | ||
| 44 | <EditText | 44 | <EditText |
| 45 | android:id="@+id/tvNuevaCantidad" | 45 | android:id="@+id/tvNuevaCantidad" |
| 46 | android:layout_width="0dp" | 46 | android:layout_width="0dp" |
| 47 | android:layout_height="wrap_content" | 47 | android:layout_height="wrap_content" |
| 48 | android:hint="Nueva Cacntidad" | 48 | android:hint="Nueva Cacntidad" |
| 49 | android:inputType="numberDecimal" | 49 | android:inputType="numberDecimal" |
| 50 | app:layout_constraintBaseline_toBaselineOf="@+id/tvgenerico" | 50 | app:layout_constraintBaseline_toBaselineOf="@+id/tvgenerico" |
| 51 | app:layout_constraintEnd_toEndOf="parent" | 51 | app:layout_constraintEnd_toEndOf="parent" |
| 52 | app:layout_constraintStart_toEndOf="@id/tvgenerico" /> | 52 | app:layout_constraintStart_toEndOf="@id/tvgenerico" /> |
| 53 | 53 | ||
| 54 | <TextView | 54 | <TextView |
| 55 | android:id="@+id/tvgenerico2" | 55 | android:id="@+id/tvgenerico2" |
| 56 | android:layout_width="wrap_content" | 56 | android:layout_width="wrap_content" |
| 57 | android:layout_height="wrap_content" | 57 | android:layout_height="wrap_content" |
| 58 | android:layout_margin="5dp" | 58 | android:layout_margin="5dp" |
| 59 | android:visibility="gone" | 59 | android:visibility="gone" |
| 60 | android:gravity="center" | 60 | android:gravity="center" |
| 61 | android:text="@string/tvSeleccion" | 61 | android:text="@string/tvSeleccion" |
| 62 | android:textSize="20sp" | 62 | android:textSize="20sp" |
| 63 | app:layout_constraintStart_toStartOf="parent" | 63 | app:layout_constraintStart_toStartOf="parent" |
| 64 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico" /> | 64 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico" /> |
| 65 | 65 | ||
| 66 | <RadioGroup | 66 | <RadioGroup |
| 67 | android:id="@+id/rgFechaHora" | 67 | android:id="@+id/rgFechaHora" |
| 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:layout_margin="5dp" | 70 | android:layout_margin="5dp" |
| 71 | android:gravity="start" | 71 | android:gravity="start" |
| 72 | android:orientation="horizontal" | 72 | android:orientation="horizontal" |
| 73 | app:layout_constraintEnd_toEndOf="parent" | 73 | app:layout_constraintEnd_toEndOf="parent" |
| 74 | app:layout_constraintHorizontal_bias="0.0" | 74 | app:layout_constraintHorizontal_bias="0.0" |
| 75 | app:layout_constraintStart_toStartOf="parent" | 75 | app:layout_constraintStart_toStartOf="parent" |
| 76 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico2"> | 76 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico2"> |
| 77 | 77 | ||
| 78 | <RadioButton | 78 | <RadioButton |
| 79 | android:id="@+id/rbSumar" | 79 | android:id="@+id/rbSumar" |
| 80 | android:layout_width="wrap_content" | 80 | android:layout_width="wrap_content" |
| 81 | android:layout_height="wrap_content" | 81 | android:layout_height="wrap_content" |
| 82 | android:layout_margin="5dp" | 82 | android:layout_margin="5dp" |
| 83 | android:checked="true" | 83 | android:checked="true" |
| 84 | android:padding="5dp" | 84 | android:padding="5dp" |
| 85 | android:text="@string/rbSumar" | 85 | android:text="@string/rbSumar" |
| 86 | android:textSize="@dimen/text_size2" /> | 86 | android:textSize="@dimen/text_size2" /> |
| 87 | 87 | ||
| 88 | <RadioButton | 88 | <RadioButton |
| 89 | android:id="@+id/rbRestar" | 89 | android:id="@+id/rbRestar" |
| 90 | android:layout_width="wrap_content" | 90 | android:layout_width="wrap_content" |
| 91 | android:layout_height="wrap_content" | 91 | android:layout_height="wrap_content" |
| 92 | android:layout_margin="5dp" | 92 | android:layout_margin="5dp" |
| 93 | android:checked="false" | 93 | android:checked="false" |
| 94 | android:padding="5dp" | 94 | android:padding="5dp" |
| 95 | android:text="@string/rbRestar" | 95 | android:text="@string/rbRestar" |
| 96 | android:textSize="@dimen/text_size2" /> | 96 | android:textSize="@dimen/text_size2" /> |
| 97 | 97 | ||
| 98 | <RadioButton | 98 | <RadioButton |
| 99 | android:id="@+id/rbMdodificar" | 99 | android:id="@+id/rbMdodificar" |
| 100 | android:layout_width="wrap_content" | 100 | android:layout_width="wrap_content" |
| 101 | android:layout_height="wrap_content" | 101 | android:layout_height="wrap_content" |
| 102 | android:layout_margin="5dp" | 102 | android:layout_margin="5dp" |
| 103 | android:checked="false" | 103 | android:checked="false" |
| 104 | android:padding="5dp" | 104 | android:padding="5dp" |
| 105 | android:text="@string/rbModificar" | 105 | android:text="@string/rbModificar" |
| 106 | android:textSize="@dimen/text_size2" /> | 106 | android:textSize="@dimen/text_size2" /> |
| 107 | </RadioGroup> | 107 | </RadioGroup> |
| 108 | 108 | ||
| 109 | <TextView | 109 | <TextView |
| 110 | android:id="@+id/tvgenerico3" | 110 | android:id="@+id/tvgenerico3" |
| 111 | android:layout_width="wrap_content" | 111 | android:layout_width="wrap_content" |
| 112 | android:layout_height="wrap_content" | 112 | android:layout_height="wrap_content" |
| 113 | android:layout_margin="5dp" | 113 | android:layout_margin="5dp" |
| 114 | android:gravity="center" | 114 | android:gravity="center" |
| 115 | android:text="@string/tvResultado" | 115 | android:text="@string/tvResultado" |
| 116 | android:textSize="20sp" | 116 | android:textSize="20sp" |
| 117 | app:layout_constraintEnd_toEndOf="parent" | 117 | app:layout_constraintEnd_toEndOf="parent" |
| 118 | app:layout_constraintHorizontal_bias="0.0" | 118 | app:layout_constraintHorizontal_bias="0.0" |
| 119 | app:layout_constraintStart_toStartOf="parent" | 119 | app:layout_constraintStart_toStartOf="parent" |
| 120 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | 120 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> |
| 121 | 121 | ||
| 122 | <TextView | 122 | <TextView |
| 123 | android:id="@+id/tvgenerico4" | 123 | android:id="@+id/tvgenerico4" |
| 124 | android:layout_width="wrap_content" | 124 | android:layout_width="wrap_content" |
| 125 | android:layout_height="wrap_content" | 125 | android:layout_height="wrap_content" |
| 126 | android:layout_margin="5dp" | 126 | android:layout_margin="5dp" |
| 127 | android:gravity="center" | 127 | android:gravity="center" |
| 128 | android:text="50" | 128 | android:text="50" |
| 129 | android:textSize="20sp" | 129 | android:textSize="20sp" |
| 130 | app:layout_constraintEnd_toEndOf="parent" | 130 | app:layout_constraintEnd_toEndOf="parent" |
| 131 | app:layout_constraintHorizontal_bias="0.0" | 131 | app:layout_constraintHorizontal_bias="0.0" |
| 132 | app:layout_constraintStart_toEndOf="@+id/tvgenerico3" | 132 | app:layout_constraintStart_toEndOf="@+id/tvgenerico3" |
| 133 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | 133 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> |
| 134 | 134 | ||
| 135 | <LinearLayout | 135 | <LinearLayout |
| 136 | android:layout_width="match_parent" | 136 | android:layout_width="match_parent" |
| 137 | android:layout_height="wrap_content" | 137 | android:layout_height="wrap_content" |
| 138 | android:orientation="horizontal" | 138 | android:orientation="horizontal" |
| 139 | android:gravity="center" | 139 | android:gravity="center" |
| 140 | app:layout_constraintStart_toStartOf="parent" | 140 | app:layout_constraintStart_toStartOf="parent" |
| 141 | app:layout_constraintEnd_toEndOf="parent" | 141 | app:layout_constraintEnd_toEndOf="parent" |
| 142 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico4"> | 142 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico4"> |
| 143 | 143 | ||
| 144 | <Button | 144 | <Button |
| 145 | android:id="@+id/dialogLoginBtn" | 145 | android:id="@+id/dialogLoginBtn" |
| 146 | style="@style/Base.Widget.AppCompat.Button.Colored" | 146 | style="@style/Base.Widget.AppCompat.Button.Colored" |
| 147 | android:layout_width="wrap_content" | 147 | android:layout_width="wrap_content" |
| 148 | android:textColor="@android:color/white" | ||
| 148 | android:padding="20dp" | 149 | android:padding="20dp" |
| 150 | android:background="@drawable/boton_borde_redondeado" | ||
| 149 | android:layout_margin="5dp" | 151 | android:layout_margin="5dp" |
| 150 | android:layout_height="wrap_content" | 152 | android:layout_height="wrap_content" |
| 151 | android:text="@string/btnOk" /> | 153 | android:text="@string/btnOk" /> |
| 152 | 154 | ||
| 153 | <Button | 155 | <Button |
| 154 | android:id="@+id/dialogCancelBtn" | 156 | android:id="@+id/dialogCancelBtn" |
| 155 | style="@style/Base.Widget.AppCompat.Button.Colored" | 157 | style="@style/Base.Widget.AppCompat.Button.Colored" |
| 158 | android:textColor="@android:color/white" | ||
| 156 | android:padding="20dp" | 159 | android:padding="20dp" |
| 160 | android:background="@drawable/boton_borde_redondeado" | ||
| 157 | android:layout_margin="5dp" | 161 | android:layout_margin="5dp" |
| 158 | android:layout_width="wrap_content" | 162 | android:layout_width="wrap_content" |
| 159 | android:layout_height="wrap_content" | 163 | android:layout_height="wrap_content" |
| 160 | android:text="@string/btnCancelar" /> | 164 | android:text="@string/btnCancelar" /> |
| 161 | </LinearLayout> | 165 | </LinearLayout> |
| 162 | 166 | ||
| 163 | </androidx.constraintlayout.widget.ConstraintLayout> | 167 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/navigation/mobile_navigation.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <navigation xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <navigation xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
| 4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
| 5 | android:id="@+id/mobile_navigation" | 5 | android:id="@+id/mobile_navigation" |
| 6 | app:startDestination="@id/mainFragment2"> | 6 | app:startDestination="@id/mainFragment2"> |
| 7 | 7 | ||
| 8 | <activity | 8 | <activity |
| 9 | android:id="@+id/mainActivity" | 9 | android:id="@+id/mainActivity" |
| 10 | android:name="com.focasoftware.deboinventariov20.MainActivity" | 10 | android:name="com.focasoftware.deboinventariov20.MainActivity" |
| 11 | android:label="app_bar_main" | 11 | android:label="app_bar_main" |
| 12 | tools:layout="@layout/app_bar_main" /> | 12 | tools:layout="@layout/app_bar_main" /> |
| 13 | <fragment | 13 | <fragment |
| 14 | android:id="@+id/mainFragment2" | 14 | android:id="@+id/mainFragment2" |
| 15 | android:name="com.focasoftware.deboinventariov20.ui.main.MainFragment" | 15 | android:name="com.focasoftware.deboinventariov20.ui.main.MainFragment" |
| 16 | android:label="Principal" | 16 | android:label="Principal" |
| 17 | tools:layout="@layout/fragment_main" > | 17 | tools:layout="@layout/fragment_main" > |
| 18 | <action | 18 | <action |
| 19 | android:id="@+id/action_mainFragment2_to_configuracionFragment" | 19 | android:id="@+id/action_mainFragment2_to_configuracionFragment" |
| 20 | app:destination="@id/configuracionFragment" | 20 | app:destination="@id/configuracionFragment" |
| 21 | app:popEnterAnim="@anim/slide_in_left" | 21 | app:popEnterAnim="@anim/slide_in_left" |
| 22 | app:popExitAnim="@anim/slide_out_right" | 22 | app:popExitAnim="@anim/slide_out_right" |
| 23 | app:enterAnim="@anim/slide_in_right" | 23 | app:enterAnim="@anim/slide_in_right" |
| 24 | app:exitAnim="@anim/slide_out_left" /> | 24 | app:exitAnim="@anim/slide_out_left" /> |
| 25 | <action | 25 | <action |
| 26 | android:id="@+id/action_mainFragment2_to_actuaMaestrosFragment" | 26 | android:id="@+id/action_mainFragment2_to_actuaMaestrosFragment" |
| 27 | app:destination="@id/actuaMaestrosFragment" | 27 | app:destination="@id/actuaMaestrosFragment" |
| 28 | app:popEnterAnim="@anim/slide_in_left" | 28 | app:popEnterAnim="@anim/slide_in_left" |
| 29 | app:popExitAnim="@anim/slide_out_right" | 29 | app:popExitAnim="@anim/slide_out_right" |
| 30 | app:enterAnim="@anim/slide_in_right" | 30 | app:enterAnim="@anim/slide_in_right" |
| 31 | app:exitAnim="@anim/slide_out_left" /> | 31 | app:exitAnim="@anim/slide_out_left" /> |
| 32 | <action | 32 | <action |
| 33 | android:id="@+id/action_mainFragment2_to_inventarioFragment" | 33 | android:id="@+id/action_mainFragment2_to_inventarioFragment" |
| 34 | app:destination="@id/inventarioFragment" | 34 | app:destination="@id/inventarioFragment" |
| 35 | app:popEnterAnim="@anim/slide_in_left" | 35 | app:popEnterAnim="@anim/slide_in_left" |
| 36 | app:popExitAnim="@anim/slide_out_right" | 36 | app:popExitAnim="@anim/slide_out_right" |
| 37 | app:enterAnim="@anim/slide_in_right" | 37 | app:enterAnim="@anim/slide_in_right" |
| 38 | app:exitAnim="@anim/slide_out_left" /> | 38 | app:exitAnim="@anim/slide_out_left" /> |
| 39 | </fragment> | 39 | </fragment> |
| 40 | <fragment | 40 | <fragment |
| 41 | android:id="@+id/actuaMaestrosFragment" | 41 | android:id="@+id/actuaMaestrosFragment" |
| 42 | android:name="com.focasoftware.deboinventariov20.ui.actualizacionMaestros.ActuaMaestrosFragment" | 42 | android:name="com.focasoftware.deboinventariov20.ui.actualizacionMaestros.ActuaMaestrosFragment" |
| 43 | android:label="Actualización de Maestros" | 43 | android:label="Actualización de Maestros" |
| 44 | tools:layout="@layout/fragment_actua_maestros" /> | 44 | tools:layout="@layout/fragment_actua_maestros" /> |
| 45 | <fragment | 45 | <fragment |
| 46 | android:id="@+id/servidoresFragment" | 46 | android:id="@+id/servidoresFragment" |
| 47 | android:name="com.focasoftware.deboinventariov20.ui.servidores.ServidoresFragment" | 47 | android:name="com.focasoftware.deboinventariov20.ui.servidores.ServidoresFragment" |
| 48 | android:label="Alta Servidores" | 48 | android:label="Alta Servidores" |
| 49 | tools:layout="@layout/fragment_servidores"> | 49 | tools:layout="@layout/fragment_servidores"> |
| 50 | <action | 50 | <action |
| 51 | android:id="@+id/action_servidoresFragment_to_configuracionFragment" | 51 | android:id="@+id/action_servidoresFragment_to_configuracionFragment" |
| 52 | app:destination="@id/configuracionFragment" | 52 | app:destination="@id/configuracionFragment" |
| 53 | app:enterAnim="@anim/slide_in_right" | 53 | app:enterAnim="@anim/slide_in_right" |
| 54 | app:exitAnim="@anim/slide_out_left" | 54 | app:exitAnim="@anim/slide_out_left" |
| 55 | app:popEnterAnim="@anim/slide_in_left" | 55 | app:popEnterAnim="@anim/slide_in_left" |
| 56 | app:popExitAnim="@anim/slide_out_right" /> | 56 | app:popExitAnim="@anim/slide_out_right" /> |
| 57 | </fragment> | 57 | </fragment> |
| 58 | <fragment | 58 | <fragment |
| 59 | android:id="@+id/inventarioFragment" | 59 | android:id="@+id/inventarioFragment" |
| 60 | android:name="com.focasoftware.deboinventariov20.ui.inventario.InventarioFragment" | 60 | android:name="com.focasoftware.deboinventariov20.ui.inventario.InventarioFragment" |
| 61 | android:label="Inventario Dinamico" | 61 | android:label="Inventario Dinamico" |
| 62 | tools:layout="@layout/fragment_inventario" > | 62 | tools:layout="@layout/fragment_inventario" > |
| 63 | <action | 63 | <action |
| 64 | android:id="@+id/action_inventarioFragment_to_descripcionFragment" | 64 | android:id="@+id/action_inventarioFragment_to_descripcionFragment" |
| 65 | app:destination="@id/descripcionFragment" | 65 | app:destination="@id/descripcionFragment" |
| 66 | app:popEnterAnim="@anim/slide_in_left" | 66 | app:popEnterAnim="@anim/slide_in_left" |
| 67 | app:popExitAnim="@anim/slide_out_right" | 67 | app:popExitAnim="@anim/slide_out_right" |
| 68 | app:enterAnim="@anim/slide_in_right" | 68 | app:enterAnim="@anim/slide_in_right" |
| 69 | app:exitAnim="@anim/slide_out_left" /> | 69 | app:exitAnim="@anim/slide_out_left" /> |
| 70 | <action | 70 | <action |
| 71 | android:id="@+id/action_inventarioFragment_to_mainFragment2" | 71 | android:id="@+id/action_inventarioFragment_to_mainFragment2" |
| 72 | app:destination="@id/mainFragment2" | 72 | app:destination="@id/mainFragment2" |
| 73 | app:popEnterAnim="@anim/slide_in_left" | 73 | app:popEnterAnim="@anim/slide_in_left" |
| 74 | app:popExitAnim="@anim/slide_out_right" | 74 | app:popExitAnim="@anim/slide_out_right" |
| 75 | app:enterAnim="@anim/slide_in_right" | 75 | app:enterAnim="@anim/slide_in_right" |
| 76 | app:exitAnim="@anim/slide_out_left"/> | 76 | app:exitAnim="@anim/slide_out_left"/> |
| 77 | 77 | ||
| 78 | </fragment> | 78 | </fragment> |
| 79 | <fragment | 79 | <fragment |
| 80 | android:id="@+id/configuracionFragment" | 80 | android:id="@+id/configuracionFragment" |
| 81 | android:name="com.focasoftware.deboinventariov20.ui.configuracion.ConfiguracionFragment" | 81 | android:name="com.focasoftware.deboinventariov20.ui.configuracion.ConfiguracionFragment" |
| 82 | android:label="Configuraciones" | 82 | android:label="Configuraciones" |
| 83 | tools:layout="@layout/fragment_configuracion" > | 83 | tools:layout="@layout/fragment_configuracion" > |
| 84 | <action | 84 | <action |
| 85 | android:id="@+id/action_configuracionFragment_to_servidoresFragment" | 85 | android:id="@+id/action_configuracionFragment_to_servidoresFragment" |
| 86 | app:destination="@id/servidoresFragment" | 86 | app:destination="@id/servidoresFragment" |
| 87 | app:popEnterAnim="@anim/slide_in_left" | 87 | app:popEnterAnim="@anim/slide_in_left" |
| 88 | app:popExitAnim="@anim/slide_out_right" | 88 | app:popExitAnim="@anim/slide_out_right" |
| 89 | app:enterAnim="@anim/slide_in_right" | 89 | app:enterAnim="@anim/slide_in_right" |
| 90 | app:exitAnim="@anim/slide_out_left" /> | 90 | app:exitAnim="@anim/slide_out_left" /> |
| 91 | </fragment> | 91 | </fragment> |
| 92 | <fragment | 92 | <fragment |
| 93 | android:id="@+id/descripcionFragment" | 93 | android:id="@+id/descripcionFragment" |
| 94 | android:name="com.focasoftware.deboinventariov20.ui.inventario.DescripcionFragment" | 94 | android:name="com.focasoftware.deboinventariov20.ui.descripcionFragment.DescripcionFragment" |
| 95 | android:label="Productos Encontrados"> | 95 | android:label="Productos Encontrados"> |
| 96 | 96 | ||
| 97 | <action | 97 | <action |
| 98 | android:id="@+id/action_descripcionFragment_to_inventarioFragment" | 98 | android:id="@+id/action_descripcionFragment_to_inventarioFragment" |
| 99 | app:destination="@id/inventarioFragment" | 99 | app:destination="@id/inventarioFragment" |
| 100 | app:popEnterAnim="@anim/slide_in_left" | 100 | app:popEnterAnim="@anim/slide_in_left" |
| 101 | app:popExitAnim="@anim/slide_out_right" | 101 | app:popExitAnim="@anim/slide_out_right" |
| 102 | app:enterAnim="@anim/slide_in_right" | 102 | app:enterAnim="@anim/slide_in_right" |
| 103 | app:exitAnim="@anim/slide_out_left" | 103 | app:exitAnim="@anim/slide_out_left" |
| 104 | app:popUpTo="@+id/descripcionFragment" | 104 | app:popUpTo="@+id/descripcionFragment" |
| 105 | app:popUpToInclusive="true"/> | 105 | app:popUpToInclusive="true"/> |
| 106 | </fragment> | 106 | </fragment> |
| 107 | </navigation> | 107 | </navigation> |
app/src/main/res/values/colors.xml
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <resources> | 2 | <resources> |
| 3 | <color name="colorPrimaryDark">#3700B3</color> | 3 | <color name="colorPrimaryDark">#085394</color> |
| 4 | <color name="colorAccent">#03DAC5</color> | 4 | <color name="colorAccent">#3F51B5</color> |
| 5 | <color name="colorPrimary">#085394</color> | 5 | <color name="colorPrimary">#085394</color> |
| 6 | <color name="backMenu">#dddddd</color> | 6 | <color name="backMenu">#dddddd</color> |
| 7 | <color name="LightGray">#E0E0E0</color> | 7 | <color name="LightGray">#E0E0E0</color> |
| 8 | </resources> | 8 | </resources> |
app/src/main/res/values/strings.xml
| 1 | <resources> | 1 | <resources> |
| 2 | 2 | ||
| 3 | <string name="nav_header_title">Android Studio</string> | 3 | <string name="nav_header_title">Android Studio</string> |
| 4 | <string name="nav_header_subtitle">android.studio@android.com</string> | 4 | <string name="nav_header_subtitle">android.studio@android.com</string> |
| 5 | <string name="nav_header_desc">Navigation header</string> | 5 | <string name="nav_header_desc">Navigation header</string> |
| 6 | <string name="action_settings">Settings</string> | 6 | <string name="action_settings">Settings</string> |
| 7 | 7 | ||
| 8 | <string name="menu_home">Home</string> | 8 | <string name="menu_home">Home</string> |
| 9 | <string name="menu_gallery">Gallery</string> | 9 | <string name="menu_gallery">Gallery</string> |
| 10 | <string name="menu_slideshow">Slideshow</string> | 10 | <string name="menu_slideshow">Slideshow</string> |
| 11 | 11 | ||
| 12 | <string name="app_name">Inventario Dinamicos</string> | 12 | <string name="app_name">Inventario Dinamicos</string> |
| 13 | 13 | ||
| 14 | <!-- menu--> | 14 | <!-- menu--> |
| 15 | <string name="menuInicio">Inicio</string> | 15 | <string name="menuInicio">Inicio</string> |
| 16 | <string name="menuNueInv">Nuevo Inventario</string> | 16 | <string name="menuNueInv">Nuevo Inventario</string> |
| 17 | <string name="menuActMae">Actualizar Maestros</string> | 17 | <string name="menuActMae">Actualizar Maestros</string> |
| 18 | <string name="menuConf">Configuraciones</string> | 18 | <string name="menuConf">Configuraciones</string> |
| 19 | <string name="menuSal">Salir</string> | 19 | <string name="menuSal">Salir</string> |
| 20 | 20 | ||
| 21 | <!-- Menu header--> | 21 | <!-- Menu header--> |
| 22 | <string name="menuLeyenda">Debo Inventario</string> | 22 | <string name="menuLeyenda">Debo Inventario</string> |
| 23 | 23 | ||
| 24 | <string name="navigation_drawer_open">Open navigation drawer</string> | 24 | <string name="navigation_drawer_open">Open navigation drawer</string> |
| 25 | <string name="navigation_drawer_close">Close navigation drawer</string> | 25 | <string name="navigation_drawer_close">Close navigation drawer</string> |
| 26 | 26 | ||
| 27 | <!-- Pantalla de inicio--> | 27 | <!-- Pantalla de inicio--> |
| 28 | <string name="bien">Bienvenido</string> | 28 | <string name="bien">Bienvenido</string> |
| 29 | <string name="debo">DEBO®</string> | 29 | <string name="debo">DEBO®</string> |
| 30 | <string name="inventario">Inventario</string> | 30 | <string name="inventario">Inventario</string> |
| 31 | <string name="todo">TODO</string> | 31 | <string name="todo">TODO</string> |
| 32 | <string name="hello_blank_fragment">Hello blank fragment</string> | 32 | <string name="hello_blank_fragment">Hello blank fragment</string> |
| 33 | 33 | ||
| 34 | <!-- inventarios dinamicos--> | 34 | <!-- inventarios dinamicos--> |
| 35 | <string name="invDinamicoVenta">Inventarios Dinamicos</string> | 35 | <string name="invDinamicoVenta">Inventarios Dinamicos</string> |
| 36 | <string name="invDinamicoCompra">Inventarios Sectorizados</string> | 36 | <string name="invDinamicoCompra">Inventarios Sectorizados</string> |
| 37 | 37 | ||
| 38 | <!-- ventana emergente--> | 38 | <!-- ventana emergente--> |
| 39 | <string name="adv">Ingrese la cantidad contada</string> | 39 | <string name="adv">Ingrese la cantidad contada</string> |
| 40 | <string name="invVentas">Inventarios Dinamicos de Ventas</string> | 40 | <string name="invVentas">Inventarios Dinamicos de Ventas</string> |
| 41 | <string name="btnConfirmar">Confirmar</string> | 41 | <string name="btnConfirmar">Confirmar</string> |
| 42 | <string name="btnCancela">Cancelar</string> | 42 | <string name="btnCancela">Cancelar</string> |
| 43 | 43 | ||
| 44 | 44 | ||
| 45 | <!-- Fragment Inventario--> | 45 | <!-- Fragment Inventario--> |
| 46 | <string name="invTitulo">Inventarios Dinamicos</string> | 46 | <string name="invTitulo">Inventarios Dinámicos</string> |
| 47 | <string name="invTituloV">Inventarios de Ventas</string> | 47 | <string name="invTituloV">Inventarios de Ventas</string> |
| 48 | <string name="invTituloD">Inventarios de Depositos</string> | 48 | <string name="invTituloD">Inventarios de Depositos</string> |
| 49 | <string name="invCodigoBarras">Código Barras:</string> | 49 | <string name="invCodigoBarras">Código Barras:</string> |
| 50 | <string name="btnExportarInv">Exportar Inventario</string> | 50 | <string name="btnExportarInv">Exportar Inventario</string> |
| 51 | <string name="btnBorrarInv">Borrar Inventario</string> | 51 | <string name="btnBorrarInv">Borrar Inventario</string> |
| 52 | <string name="ibBusDesc">Busqueda por Descripción</string> | ||
| 53 | <string name="ibBusCB">Busqueda por C. Barras</string> | ||
| 54 | <string name="ibBusCO">Busqueda por Código de Origen</string> | ||
| 52 | <string name="switch_1">+ 1</string> | 55 | <string name="switch_1">+ 1</string> |
| 53 | 56 | ||
| 54 | <!-- Fragmento Configuraciones--> | 57 | <!-- Fragmento Configuraciones--> |
| 55 | <string name="tvTituloConf">Configuraciones</string> | 58 | <string name="tvTituloConf">Configuraciones</string> |
| 56 | <string name="tvSeleccioneServidor">Seleccione un Servidor</string> | 59 | <string name="tvSeleccioneServidor">Seleccione un Servidor</string> |
| 57 | <string name="btnValidarServidor">Validar</string> | 60 | <string name="btnValidarServidor">Validar</string> |
| 58 | <string name="btnAgregarServidor">Agregar un nuevo servidor</string> | 61 | <string name="btnAgregarServidor">Agregar un nuevo servidor</string> |
| 59 | <string name="tvUbicacionCarpetas">Ubicación de las carpetas de uso interno</string> | 62 | <string name="tvUbicacionCarpetas">Ubicación de las carpetas de uso interno</string> |
| 60 | <string name="tvTituloArea">Area de Invetnario</string> | 63 | <string name="tvTituloArea">Area de Invetnario</string> |
| 61 | <string name="rbVentas">Inventarios de Ventas</string> | 64 | <string name="rbVentas">Inventarios de Ventas</string> |
| 62 | <string name="rbDeposito">Inventarios de Depositos</string> | 65 | <string name="rbDeposito">Inventarios de Depositos</string> |
| 63 | <string name="tvLosProductos">Los productos no contabilizados en Inventarios</string> | 66 | <string name="tvLosProductos">Los productos no contabilizados en Inventarios</string> |
| 64 | <string name="tvColumnas">Columnas a Visualizar</string> | 67 | <string name="tvColumnas">Columnas a Visualizar</string> |
| 65 | 68 | ||
| 66 | <string name="rbProInclu">Solo se ajustan los productos incluidos en el conteo.</string> | 69 | <string name="rbProInclu">Solo se ajustan los productos incluidos en el conteo.</string> |
| 67 | <string name="rbProNoInclu">Ajusta productos no incluidos en el conteo con stock en cero.</string> | 70 | <string name="rbProNoInclu">Ajusta productos no incluidos en el conteo con stock en cero.</string> |
| 68 | 71 | ||
| 69 | <string name="cbMostrarStock">Mostror stock en el sistema al momento de la descarga del maestro.</string> | 72 | <string name="cbMostrarStock">Mostror stock en el sistema al momento de la descarga del maestro.</string> |
| 70 | <string name="cbHabiLectura">Habilitar Lectura de codigo de barras en balanza.</string> | 73 | <string name="cbHabiLectura">Habilitar Lectura de codigo de barras en balanza.</string> |
| 71 | 74 | ||
| 72 | <string name="tvColumMostrar">Columnas a mostrar en inventario</string> | 75 | <string name="tvColumMostrar">Columnas a mostrar en inventario</string> |
| 73 | 76 | ||
| 74 | <string name="rbCodigoDebo">Código DEBO</string> | 77 | <string name="rbCodigoDebo">Código DEBO</string> |
| 75 | <string name="rbCodigoOrigen">Código Origen</string> | 78 | <string name="rbCodigoOrigen">Código Origen</string> |
| 76 | <string name="rbCodigoBarras">Código de Barras</string> | 79 | <string name="rbCodigoBarras">Código de Barras</string> |
| 77 | 80 | ||
| 78 | 81 | ||
| 79 | <!-- Spinner servidor--> | 82 | <!-- Spinner servidor--> |
| 80 | <string-array name="spinnerServidor"> | 83 | <string-array name="spinnerServidor"> |
| 81 | <item>Servidor Laboratorio 1</item> | 84 | <item>Servidor Laboratorio 1</item> |
| 82 | <item>Servidor Laboratorio 2</item> | 85 | <item>Servidor Laboratorio 2</item> |
| 83 | <item>Servidor Laboratorio 3</item> | 86 | <item>Servidor Laboratorio 3</item> |
| 84 | </string-array> | 87 | </string-array> |
| 85 | <string name="leyendaSpinner">Seleccione Servidor Predeterminado</string> | 88 | <string name="leyendaSpinner">Seleccione Servidor Predeterminado</string> |
| 86 | 89 | ||
| 87 | <string name="cbMostrarExistencia">Existencia</string> | 90 | <string name="cbMostrarExistencia">Existencia</string> |
| 88 | <string name="cbMostrarPrecio">Precio</string> | 91 | <string name="cbMostrarPrecio">Precio</string> |
| 89 | 92 | ||
| 90 | <string name="btnGuardar">Guardar Cambios</string> | 93 | <string name="btnGuardar">Guardar Cambios</string> |
| 91 | 94 | ||
| 92 | <!-- fragment Actualizacion de Maestros--> | 95 | <!-- fragment Actualizacion de Maestros--> |
| 93 | <string name="tvActMaestros">Actualización de Maestros</string> | 96 | <string name="tvActMaestros">Actualización de Maestros</string> |
| 94 | <string name="tvMedio">Seleccione el medio por el cual desea realizar la importación de maestros</string> | 97 | <string name="tvMedio">Seleccione el medio por el cual desea realizar la importación de maestros</string> |
| 95 | <string name="obPorWifi">Via Wifi</string> | 98 | <string name="obPorWifi">Via Wifi</string> |
| 96 | <string name="obViaArchivo">Via Archivos MaeTable</string> | 99 | <string name="obViaArchivo">Via Archivos MaeTable</string> |
| 97 | 100 | ||
| 98 | <string name="btnConfirmarAct">Confirmar Actualización</string> | 101 | <string name="btnConfirmarAct">Confirmar Actualización</string> |
| 99 | 102 | ||
| 100 | <!-- Fragment Save--> | 103 | <!-- Fragment Save--> |
| 101 | <string name="tvConfServi">Configuración de Servidores</string> | 104 | <string name="tvConfServi">Configuración de Servidores</string> |
| 102 | <string name="server">Ingrese la direccion del servidor</string> | 105 | <string name="server">Ingrese la direccion del servidor</string> |
| 103 | <string name="etNomServer">Ingrese una descripción para la conexión</string> | 106 | <string name="etNomServer">Ingrese una descripción para la conexión</string> |
| 104 | <string name="btnGuardarConfServ">Guardar Conexión</string> | 107 | <string name="btnGuardarConfServ">Guardar Conexión</string> |
| 105 | 108 | ||
| 106 | <!-- Dialog--> | 109 | <!-- Dialog--> |
| 107 | <string name="sTitulo">Producto Buscado</string> | 110 | <string name="sTitulo">Producto Buscado</string> |
| 108 | <string name="btnOk">Aceptar</string> | 111 | <string name="btnOk">Aceptar</string> |
| 109 | <string name="btnCancelar">Cancelar</string> | 112 | <string name="btnCancelar">Cancelar</string> |
| 110 | <string name="sMensaje">¡No se encontro el producto ingresado!</string> | 113 | <string name="sMensaje">¡No se encontro el producto ingresado!</string> |
| 111 | <string name="sMensajeEncontrado">¡Ingrese la cantidad contada!</string> | 114 | <string name="sMensajeEncontrado">¡Ingrese la cantidad contada!</string> |
| 112 | <string name="sTituloNueva">Producto ingresado esta cargado</string> | 115 | <string name="sTituloNueva">Producto ingresado esta cargado</string> |
| 113 | <string name="sCantidadNueva">¡Por favor ingrese la nueva Cantidad!</string> | 116 | <string name="sCantidadNueva">¡Por favor ingrese la nueva Cantidad!</string> |
| 114 | <string name="sMensajeBorrarInv">¡Seguro que desea Borrar el inventario!</string> | 117 | <string name="sMensajeBorrarInv">¡Seguro que desea Borrar el inventario!</string> |
| 115 | <string name="sTituloBorrarInv">Borrar Inventario</string> | 118 | <string name="sTituloBorrarInv">Borrar Inventario</string> |
| 116 | 119 | ||
| 117 | <string name="sMensajeExportar">¡Confirma que exporta el Inventario!</string> | 120 | <string name="sMensajeExportar">¡Confirma que exporta el Inventario!</string> |
| 118 | <string name="sTituloExportar">Exportación de Inventarios</string> | 121 | <string name="sTituloExportar">Exportación de Inventarios</string> |
| 119 | 122 | ||
| 120 | <!-- FRAGMENT SERVIDOR--> | 123 | <!-- FRAGMENT SERVIDOR--> |
| 121 | <string name="tvTitutloServer">Alta de Servidores</string> | 124 | <string name="tvTitutloServer">Alta de Servidores</string> |
| 122 | <string name="tvNomServer">Ingrese un nombre para identificar al servidor</string> | 125 | <string name="tvNomServer">Ingrese un nombre para identificar al servidor</string> |
| 123 | <string name="tvDirServer">Ingrese la dirección del servidor</string> | 126 | <string name="tvDirServer">Ingrese la dirección del servidor</string> |
| 124 | <string name="btnGuardarServidores">Guardar Servidor</string> | 127 | <string name="btnGuardarServidores">Guardar Servidor</string> |
| 125 | 128 | ||
| 126 | <string name="tvSeleccion">Toque sobre la operación que desea realizar</string> | 129 | <string name="tvSeleccion">Toque sobre la operación que desea realizar</string> |
| 127 | <string name="rbSumar">Sumar</string> | 130 | <string name="rbSumar">Sumar</string> |
| 128 | <string name="rbRestar">Restar</string> | 131 | <string name="rbRestar">Restar</string> |
| 129 | <string name="rbModificar">Reemplazar</string> | 132 | <string name="rbModificar">Reemplazar</string> |
| 130 | <string name="tvTotal">Cantidad Final</string>tvTotal | 133 | <string name="tvTotal">Cantidad Final</string>tvTotal |
| 131 | <string name="tvResultado">La cantidad final es:</string>tvTotal | 134 | <string name="tvResultado">La cantidad final es:</string>tvTotal |
| 132 | 135 | ||
| 133 | <string name="large_text"> | 136 | <string name="large_text"> |
| 134 | "Material is the metaphor.\n\n" | 137 | "Material is the metaphor.\n\n" |
| 135 | 138 | ||
| 136 | "A material metaphor is the unifying theory of a rationalized space and a system of motion." | 139 | "A material metaphor is the unifying theory of a rationalized space and a system of motion." |
| 137 | "The material is grounded in tactile reality, inspired by the study of paper and ink, yet " | 140 | "The material is grounded in tactile reality, inspired by the study of paper and ink, yet " |
| 138 | "technologically advanced and open to imagination and magic.\n" | 141 | "technologically advanced and open to imagination and magic.\n" |
| 139 | "Surfaces and edges of the material provide visual cues that are grounded in reality. The " | 142 | "Surfaces and edges of the material provide visual cues that are grounded in reality. The " |
| 140 | "use of familiar tactile attributes helps users quickly understand affordances. Yet the " | 143 | "use of familiar tactile attributes helps users quickly understand affordances. Yet the " |
| 141 | "flexibility of the material creates new affordances that supercede those in the physical " | 144 | "flexibility of the material creates new affordances that supercede those in the physical " |
| 142 | "world, without breaking the rules of physics.\n" | 145 | "world, without breaking the rules of physics.\n" |
| 143 | "The fundamentals of light, surface, and movement are key to conveying how objects move, " | 146 | "The fundamentals of light, surface, and movement are key to conveying how objects move, " |
| 144 | "interact, and exist in space and in relation to each other. Realistic lighting shows " | 147 | "interact, and exist in space and in relation to each other. Realistic lighting shows " |
| 145 | "seams, divides space, and indicates moving parts.\n\n" | 148 | "seams, divides space, and indicates moving parts.\n\n" |
| 146 | 149 | ||
| 147 | "Bold, graphic, intentional.\n\n" | 150 | "Bold, graphic, intentional.\n\n" |
| 148 | 151 | ||
| 149 | "The foundational elements of print based design typography, grids, space, scale, color, " | 152 | "The foundational elements of print based design typography, grids, space, scale, color, " |
| 150 | "and use of imagery guide visual treatments. These elements do far more than please the " | 153 | "and use of imagery guide visual treatments. These elements do far more than please the " |
| 151 | "eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge " | 154 | "eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge " |
| 152 | "imagery, large scale typography, and intentional white space create a bold and graphic " | 155 | "imagery, large scale typography, and intentional white space create a bold and graphic " |
| 153 | "interface that immerse the user in the experience.\n" | 156 | "interface that immerse the user in the experience.\n" |
| 154 | "An emphasis on user actions makes core functionality immediately apparent and provides " | 157 | "An emphasis on user actions makes core functionality immediately apparent and provides " |
| 155 | "waypoints for the user.\n\n" | 158 | "waypoints for the user.\n\n" |
| 156 | 159 | ||
| 157 | "Motion provides meaning.\n\n" | 160 | "Motion provides meaning.\n\n" |
| 158 | 161 | ||
| 159 | "Motion respects and reinforces the user as the prime mover. Primary user actions are " | 162 | "Motion respects and reinforces the user as the prime mover. Primary user actions are " |
| 160 | "inflection points that initiate motion, transforming the whole design.\n" | 163 | "inflection points that initiate motion, transforming the whole design.\n" |
| 161 | "All action takes place in a single environment. Objects are presented to the user without " | 164 | "All action takes place in a single environment. Objects are presented to the user without " |
| 162 | "breaking the continuity of experience even as they transform and reorganize.\n" | 165 | "breaking the continuity of experience even as they transform and reorganize.\n" |
| 163 | "Motion is meaningful and appropriate, serving to focus attention and maintain continuity. " | 166 | "Motion is meaningful and appropriate, serving to focus attention and maintain continuity. " |
| 164 | "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n" | 167 | "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n" |
| 165 | 168 | ||
| 166 | "3D world.\n\n" | 169 | "3D world.\n\n" |
| 167 | 170 | ||
| 168 | "The material environment is a 3D space, which means all objects have x, y, and z " | 171 | "The material environment is a 3D space, which means all objects have x, y, and z " |
| 169 | "dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the " | 172 | "dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the " |
| 170 | "positive z-axis extending towards the viewer. Every sheet of material occupies a single " | 173 | "positive z-axis extending towards the viewer. Every sheet of material occupies a single " |
| 171 | "position along the z-axis and has a standard 1dp thickness.\n" | 174 | "position along the z-axis and has a standard 1dp thickness.\n" |
| 172 | "On the web, the z-axis is used for layering and not for perspective. The 3D world is " | 175 | "On the web, the z-axis is used for layering and not for perspective. The 3D world is " |
| 173 | "emulated by manipulating the y-axis.\n\n" | 176 | "emulated by manipulating the y-axis.\n\n" |
| 174 | 177 | ||
| 175 | "Light and shadow.\n\n" | 178 | "Light and shadow.\n\n" |
| 176 | 179 | ||
| 177 | "Within the material environment, virtual lights illuminate the scene. Key lights create " | 180 | "Within the material environment, virtual lights illuminate the scene. Key lights create " |
| 178 | "directional shadows, while ambient light creates soft shadows from all angles.\n" | 181 | "directional shadows, while ambient light creates soft shadows from all angles.\n" |
| 179 | "Shadows in the material environment are cast by these two light sources. In Android " | 182 | "Shadows in the material environment are cast by these two light sources. In Android " |
| 180 | "development, shadows occur when light sources are blocked by sheets of material at " | 183 | "development, shadows occur when light sources are blocked by sheets of material at " |
| 181 | "various positions along the z-axis. On the web, shadows are depicted by manipulating the " | 184 | "various positions along the z-axis. On the web, shadows are depicted by manipulating the " |
| 182 | "y-axis only. The following example shows the card with a height of 6dp.\n\n" | 185 | "y-axis only. The following example shows the card with a height of 6dp.\n\n" |
| 183 | 186 | ||
| 184 | "Resting elevation.\n\n" | 187 | "Resting elevation.\n\n" |
| 185 | 188 | ||
| 186 | "All material objects, regardless of size, have a resting elevation, or default elevation " | 189 | "All material objects, regardless of size, have a resting elevation, or default elevation " |
| 187 | "that does not change. If an object changes elevation, it should return to its resting " | 190 | "that does not change. If an object changes elevation, it should return to its resting " |
| 188 | "elevation as soon as possible.\n\n" | 191 | "elevation as soon as possible.\n\n" |
| 189 | 192 | ||
| 190 | "Component elevations.\n\n" | 193 | "Component elevations.\n\n" |
| 191 | 194 | ||
| 192 | "The resting elevation for a component type is consistent across apps (e.g., FAB elevation " | 195 | "The resting elevation for a component type is consistent across apps (e.g., FAB elevation " |
| 193 | "does not vary from 6dp in one app to 16dp in another app).\n" | 196 | "does not vary from 6dp in one app to 16dp in another app).\n" |
| 194 | "Components may have different resting elevations across platforms, depending on the depth " | 197 | "Components may have different resting elevations across platforms, depending on the depth " |
| 195 | "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n" | 198 | "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n" |
| 196 | 199 | ||
| 197 | "Responsive elevation and dynamic elevation offsets.\n\n" | 200 | "Responsive elevation and dynamic elevation offsets.\n\n" |
| 198 | 201 | ||
| 199 | "Some component types have responsive elevation, meaning they change elevation in response " | 202 | "Some component types have responsive elevation, meaning they change elevation in response " |
| 200 | "to user input (e.g., normal, focused, and pressed) or system events. These elevation " | 203 | "to user input (e.g., normal, focused, and pressed) or system events. These elevation " |
| 201 | "changes are consistently implemented using dynamic elevation offsets.\n" | 204 | "changes are consistently implemented using dynamic elevation offsets.\n" |
| 202 | "Dynamic elevation offsets are the goal elevation that a component moves towards, relative " | 205 | "Dynamic elevation offsets are the goal elevation that a component moves towards, relative " |
| 203 | "to the component’s resting state. They ensure that elevation changes are consistent " | 206 | "to the component’s resting state. They ensure that elevation changes are consistent " |
| 204 | "across actions and component types. For example, all components that lift on press have " | 207 | "across actions and component types. For example, all components that lift on press have " |
| 205 | "the same elevation change relative to their resting elevation.\n" | 208 | "the same elevation change relative to their resting elevation.\n" |
| 206 | "Once the input event is completed or cancelled, the component will return to its resting " | 209 | "Once the input event is completed or cancelled, the component will return to its resting " |
| 207 | "elevation.\n\n" | 210 | "elevation.\n\n" |
| 208 | 211 | ||
| 209 | "Avoiding elevation interference.\n\n" | 212 | "Avoiding elevation interference.\n\n" |
| 210 | 213 | ||
| 211 | "Components with responsive elevations may encounter other components as they move between " | 214 | "Components with responsive elevations may encounter other components as they move between " |
| 212 | "their resting elevations and dynamic elevation offsets. Because material cannot pass " | 215 | "their resting elevations and dynamic elevation offsets. Because material cannot pass " |
| 213 | "through other material, components avoid interfering with one another any number of ways, " | 216 | "through other material, components avoid interfering with one another any number of ways, " |
| 214 | "whether on a per component basis or using the entire app layout.\n" | 217 | "whether on a per component basis or using the entire app layout.\n" |
| 215 | "On a component level, components can move or be removed before they cause interference. " | 218 | "On a component level, components can move or be removed before they cause interference. " |
| 216 | "For example, a floating action button (FAB) can disappear or move off screen before a " | 219 | "For example, a floating action button (FAB) can disappear or move off screen before a " |
| 217 | "user picks up a card, or it can move if a snackbar appears.\n" | 220 | "user picks up a card, or it can move if a snackbar appears.\n" |
| 218 | "On the layout level, design your app layout to minimize opportunities for interference. " | 221 | "On the layout level, design your app layout to minimize opportunities for interference. " |
| 219 | "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere " | 222 | "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere " |
| 220 | "when a user tries to pick up one of cards.\n\n" | 223 | "when a user tries to pick up one of cards.\n\n" |
| 221 | </string> | 224 | </string> |
| 222 | </resources> | 225 | </resources> |