Inetgración de todas las funcionalidades y RecycleView pacientes
This commit is contained in:
parent
b6d8a26880
commit
2a21d6b537
|
@ -15,6 +15,9 @@
|
|||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.MedicalHealth"
|
||||
tools:targetApi="31" >
|
||||
<activity
|
||||
android:name=".PacienteActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ModificarRecetaActivity"
|
||||
android:exported="false" />
|
||||
|
|
|
@ -30,8 +30,7 @@ class AgregarActivity : AppCompatActivity() {
|
|||
binding.btnConfirmar.setOnClickListener {
|
||||
//db.crearTablaPacientes()
|
||||
agregarPaciente()
|
||||
val intent = Intent(this@AgregarActivity, EliminarActivity::class.java)
|
||||
startActivity(intent)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
private fun agregarPaciente() {
|
||||
|
|
|
@ -27,6 +27,7 @@ class MainActivity : AppCompatActivity() {
|
|||
Toast.makeText(this@MainActivity,"VALIDADO",Toast.LENGTH_LONG).show()
|
||||
val intent = Intent(this@MainActivity, PrincipalActivity::class.java)
|
||||
//intent.putExtra("IDPaciente",binding.tvUsuario.text.toString())
|
||||
intent.putExtra("Cedula", binding.tvUsuario.text.toString())
|
||||
startActivity(intent)
|
||||
}else if(resPaciente==true){
|
||||
Toast.makeText(this@MainActivity,"VALIDADO",Toast.LENGTH_LONG).show()
|
||||
|
|
|
@ -35,8 +35,6 @@ class ModificarActivity : AppCompatActivity() {
|
|||
paciente.domicilio = binding.etDomicilio.text.toString()
|
||||
db.modificarPaciente(paciente)
|
||||
finish()
|
||||
intent = Intent(this@ModificarActivity, ConsultarPacientesActivity::class.java)
|
||||
startActivity(intent)
|
||||
Toast.makeText(this@ModificarActivity, "Información Actualizada UwU", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
package com.terratenientes.medicalhealth
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.terratenientes.medicalhealth.adapters.CellClickListener
|
||||
import com.terratenientes.medicalhealth.adapters.DoctorDataBaseHelper
|
||||
import com.terratenientes.medicalhealth.adapters.PacienteViewAdapter
|
||||
import com.terratenientes.medicalhealth.adapters.RecetaDataBaseHelper
|
||||
import com.terratenientes.medicalhealth.adapters.RecetaViewAdapter
|
||||
import com.terratenientes.medicalhealth.data.Paciente
|
||||
import com.terratenientes.medicalhealth.data.Receta
|
||||
import com.terratenientes.medicalhealth.databinding.ActivityPacienteBinding
|
||||
|
||||
class PacienteActivity : AppCompatActivity(), CellClickListener {
|
||||
lateinit var binding : ActivityPacienteBinding
|
||||
private var idPaciente : String =""
|
||||
private lateinit var db: DoctorDataBaseHelper
|
||||
private lateinit var recycleAdapter : PacienteViewAdapter
|
||||
private lateinit var pacientes : List<Paciente>
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityPacienteBinding.inflate(layoutInflater)
|
||||
val view = binding.root
|
||||
setContentView(view)
|
||||
db = DoctorDataBaseHelper(this@PacienteActivity)
|
||||
pacientes = db.obtenerPacientes()
|
||||
recycleAdapter = PacienteViewAdapter(pacientes, this@PacienteActivity, this@PacienteActivity)
|
||||
binding.rvPacientes.layoutManager = LinearLayoutManager(this)
|
||||
binding.rvPacientes.adapter = recycleAdapter
|
||||
Log.i("Pacientes", pacientes.toString())
|
||||
binding.ivAgregarPaciente.setOnClickListener {
|
||||
val intent = Intent(this@PacienteActivity, AgregarActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
recycleAdapter.refreshData(db.obtenerPacientes())
|
||||
}
|
||||
|
||||
override fun onCellClickListener(position: Int) {
|
||||
}
|
||||
|
||||
override fun onEliminarClickListener(position: Int) {
|
||||
val paciente = pacientes[position]
|
||||
Log.i("Paciente Elim", paciente.toString())
|
||||
db.eliminarPaciente(paciente.id)
|
||||
recycleAdapter.refreshData(db.obtenerPacientes())
|
||||
}
|
||||
|
||||
override fun onModifyClickListener(position: Int) {
|
||||
val paciente = pacientes[position]
|
||||
val intent = Intent(this@PacienteActivity, ModificarActivity::class.java)
|
||||
intent.putExtra("Id", paciente.id)
|
||||
intent.putExtra("Nombre Paciente", paciente.nombre)
|
||||
intent.putExtra("Apellido Paterno", paciente.apellidoPaterno)
|
||||
intent.putExtra("Apellido Materno", paciente.apellidoMaterno)
|
||||
intent.putExtra("Domicilio", paciente.domicilio)
|
||||
intent.putExtra("Edad", paciente.edad)
|
||||
intent.putExtra("Sexo", paciente.sexo)
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
|
@ -3,41 +3,42 @@ package com.terratenientes.medicalhealth
|
|||
import android.content.Intent
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import com.terratenientes.medicalhealth.adapters.DoctorDataBaseHelper
|
||||
import com.terratenientes.medicalhealth.data.Doctor
|
||||
import com.terratenientes.medicalhealth.databinding.ActivityPrincipalBinding
|
||||
import com.terratenientes.medicalhealth.reports.ConsultarPacientesActivity
|
||||
|
||||
class PrincipalActivity : AppCompatActivity() {
|
||||
lateinit var binding : ActivityPrincipalBinding
|
||||
lateinit var db : DoctorDataBaseHelper
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityPrincipalBinding.inflate(layoutInflater)
|
||||
val view = binding.root
|
||||
setContentView(view)
|
||||
|
||||
binding.btnAgregarPaciente.setOnClickListener {
|
||||
val intent = Intent(this@PrincipalActivity, AgregarActivity::class.java)
|
||||
db = DoctorDataBaseHelper(this@PrincipalActivity)
|
||||
Log.i("Datos Doctor", intent.getStringExtra("Cedula").toString())
|
||||
datosDoctor(intent.getStringExtra("Cedula").toString())
|
||||
binding.ivPacientes.setOnClickListener {
|
||||
val intent = Intent(this@PrincipalActivity, PacienteActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
binding.btnEliminarPaciente.setOnClickListener {
|
||||
val intent = Intent(this@PrincipalActivity, EliminarActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
binding.btnAgregarReceta.setOnClickListener {
|
||||
binding.ivRecetas.setOnClickListener {
|
||||
val intent = Intent(this@PrincipalActivity, RecetaActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
binding.btnEliminarReceta.setOnClickListener {
|
||||
val intent = Intent (this@PrincipalActivity, EliminarRecetaActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
binding.btnCerrar.setOnClickListener {
|
||||
val intent = Intent(this@PrincipalActivity, MainActivity::class.java)
|
||||
startActivity(intent)
|
||||
finish()
|
||||
}
|
||||
|
||||
private fun datosDoctor(cedula : String){
|
||||
val doctores : List<Doctor> = db.obtenerDoctor(cedula)
|
||||
val doctor : Doctor = doctores.get(0)
|
||||
Log.i("Datos Doctor", doctor.toString())
|
||||
binding.tvNombreDoctor.setText("Nombre: ${doctor.Nombre}")
|
||||
binding.tvTelefonoDoctor.setText("Telefono: ${doctor.Telefono}")
|
||||
binding.tvCedulaDoctor.setText("Cédula: ${doctor.Cedula}")
|
||||
binding.tvConsultorioDoctor.setText("Consultorio: ${doctor.Consultorio}")
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ import android.database.sqlite.SQLiteDatabase
|
|||
import android.database.sqlite.SQLiteOpenHelper
|
||||
import com.terratenientes.medicalhealth.data.Doctor
|
||||
import com.terratenientes.medicalhealth.data.Paciente
|
||||
import com.terratenientes.medicalhealth.data.Receta
|
||||
|
||||
class DoctorDataBaseHelper (context: Context) : SQLiteOpenHelper(context, DATABASE_NAME,null,
|
||||
DATABASE_VERSION
|
||||
|
@ -51,6 +52,7 @@ class DoctorDataBaseHelper (context: Context) : SQLiteOpenHelper(context, DATABA
|
|||
val dropTablePacientes = "DROP TABLE IF EXISTS $TABLE_PACIENTES"
|
||||
db?.execSQL(dropTablePacientes)
|
||||
}
|
||||
|
||||
fun crearTablaPacientes(){
|
||||
val db=writableDatabase
|
||||
val crearTablaPacientes =
|
||||
|
@ -73,6 +75,25 @@ class DoctorDataBaseHelper (context: Context) : SQLiteOpenHelper(context, DATABA
|
|||
db.insert(TABLE_NAME,null, values)
|
||||
db.close()
|
||||
}
|
||||
|
||||
@SuppressLint("Range")
|
||||
fun obtenerDoctor(cedula : String): List<Doctor>{
|
||||
val doctores = mutableListOf<Doctor>()
|
||||
val db = readableDatabase
|
||||
var cursor = db.rawQuery("SELECT * FROM $TABLE_NAME WHERE $COLUMN_CEDULA = '${cedula}'", null)
|
||||
while (cursor.moveToNext()) {
|
||||
val cedula = cursor.getString(cursor.getColumnIndex(COLUMN_CEDULA))
|
||||
val nombreDoctor = cursor.getString(cursor.getColumnIndex(COLUMN_NOMBRE))
|
||||
val apellidoDoctor = cursor.getString(cursor.getColumnIndex(COLUMN_APELLIDO))
|
||||
val telefonoDoctor = cursor.getString(cursor.getColumnIndex(COLUMN_TELEFONO))
|
||||
val consultorioDoctor = cursor.getInt(cursor.getColumnIndex(COLUMN_CONSULTORIO))
|
||||
val doctor = Doctor(cedula,nombreDoctor,apellidoDoctor,telefonoDoctor,consultorioDoctor)
|
||||
doctores.add(doctor)
|
||||
}
|
||||
cursor.close()
|
||||
return doctores
|
||||
}
|
||||
|
||||
fun agregarPaciente(paciente: Paciente) {
|
||||
val db = writableDatabase
|
||||
val values = ContentValues().apply {
|
||||
|
@ -88,6 +109,13 @@ class DoctorDataBaseHelper (context: Context) : SQLiteOpenHelper(context, DATABA
|
|||
db.close()
|
||||
}
|
||||
|
||||
fun eliminarPaciente(id : Int) : Int{
|
||||
val db = writableDatabase
|
||||
val resultadoEliminacion = db.delete(TABLE_PACIENTES, "$COLUMN_ID_PACIENTE = ?", arrayOf(id.toString()))
|
||||
db.close()
|
||||
return resultadoEliminacion
|
||||
}
|
||||
|
||||
fun modificarPaciente(paciente: Paciente){
|
||||
val db = writableDatabase
|
||||
val values = ContentValues().apply {
|
||||
|
@ -165,5 +193,24 @@ class DoctorDataBaseHelper (context: Context) : SQLiteOpenHelper(context, DATABA
|
|||
return edadPaciente
|
||||
}
|
||||
|
||||
@SuppressLint("Range")
|
||||
fun obtenerPacientes(): List<Paciente>{
|
||||
val pacientes = mutableListOf<Paciente>()
|
||||
val db = readableDatabase
|
||||
val cursor = db.rawQuery("SELECT * FROM ${TABLE_PACIENTES}", null)
|
||||
while (cursor.moveToNext()) {
|
||||
val idPaciente = cursor.getInt(cursor.getColumnIndex(COLUMN_ID_PACIENTE))
|
||||
val nombrePaciente = cursor.getString(cursor.getColumnIndex(COLUMN_NOMBRE_PACIENTE))
|
||||
val apellidoPaterno = cursor.getString(cursor.getColumnIndex(COLUMN_APELLIDO_PATERNO_PACIENTE))
|
||||
val apellidoMaterno = cursor.getString(cursor.getColumnIndex(COLUMN_APELLIDO_MATERNO_PACIENTE))
|
||||
val edadPaciente = cursor.getInt(cursor.getColumnIndex(COLUMN_EDAD))
|
||||
val sexoPaciente = cursor.getString(cursor.getColumnIndex(COLUMN_SEXO))
|
||||
val domicilioPaciente = cursor.getString(cursor.getColumnIndex(COLUMN_DOMICILIO))
|
||||
val paciente = Paciente(idPaciente,nombrePaciente, apellidoPaterno, apellidoMaterno, edadPaciente, sexoPaciente, domicilioPaciente)
|
||||
pacientes.add(paciente)
|
||||
}
|
||||
cursor.close()
|
||||
return pacientes
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
package com.terratenientes.medicalhealth.adapters
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.terratenientes.medicalhealth.R
|
||||
import com.terratenientes.medicalhealth.data.Paciente
|
||||
|
||||
class PacienteViewAdapter (private var notes : List<Paciente>, context: Context, val cellClickListener: CellClickListener) :
|
||||
RecyclerView.Adapter<PacienteViewAdapter.NoteViewHolder>() {
|
||||
class NoteViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
val tvNombre : TextView = itemView.findViewById(R.id.tv_nombre)
|
||||
val tvApellidoPaterno : TextView = itemView.findViewById(R.id.tv_apellido_paterno)
|
||||
val tvApellidoMaterno : TextView = itemView.findViewById(R.id.tv_apellido_materno)
|
||||
val tv_edad : TextView = itemView.findViewById(R.id.tv_edad)
|
||||
val tv_sexo : TextView = itemView.findViewById(R.id.tv_sexo)
|
||||
val tv_domicilio : TextView = itemView.findViewById(R.id.tv_domicilio)
|
||||
val ivModificar : ImageView = itemView.findViewById(R.id.iv_modificar_paciente)
|
||||
val ivEliminar : ImageView = itemView.findViewById(R.id.iv_eliminar_paciente)
|
||||
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NoteViewHolder {
|
||||
val view =
|
||||
LayoutInflater.from(parent.context).inflate(R.layout.rc_paciente_item, parent, false)
|
||||
return NoteViewHolder(view)
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return notes.size
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: NoteViewHolder, position: Int) {
|
||||
val note = notes[position]
|
||||
holder.tvNombre.text = note.nombre
|
||||
holder.tvApellidoPaterno.text = note.apellidoPaterno
|
||||
holder.tvApellidoMaterno.text = note.apellidoMaterno
|
||||
holder.tv_edad.text = note.edad.toString()
|
||||
holder.tv_sexo.text = note.sexo
|
||||
holder.tv_domicilio.text = note.domicilio
|
||||
|
||||
holder.ivEliminar.setOnClickListener {
|
||||
cellClickListener.onEliminarClickListener(position)
|
||||
}
|
||||
holder.ivModificar.setOnClickListener {
|
||||
cellClickListener.onModifyClickListener(position)
|
||||
}
|
||||
}
|
||||
|
||||
fun refreshData(newNotes: List<Paciente>) {
|
||||
this.notes = newNotes
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M12,4A4,4 0,0 1,16 8A4,4 0,0 1,12 12A4,4 0,0 1,8 8A4,4 0,0 1,12 4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"/>
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14.84,16.26C17.86,16.83 20,18.29 20,20V22H4V20C4,18.29 6.14,16.83 9.16,16.26L12,21L14.84,16.26M8,8H16V10A4,4 0,0 1,12 14A4,4 0,0 1,8 10V8M8,7L8.41,2.9C8.46,2.39 8.89,2 9.41,2H14.6C15.11,2 15.54,2.39 15.59,2.9L16,7H8M12,3H11V4H10V5H11V6H12V5H13V4H12V3Z"/>
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M13,9H18.5L13,3.5V9M6,2H14L20,8V20A2,2 0,0 1,18 22H6C4.89,22 4,21.1 4,20V4C4,2.89 4.89,2 6,2M15,18V16H6V18H15M18,14V12H6V14H18Z"/>
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M13.5,8H12V13L16.28,15.54L17,14.33L13.5,12.25V8M13,3A9,9 0,0 0,4 12H1L4.96,16.03L9,12H6A7,7 0,0 1,13 5A7,7 0,0 1,20 12A7,7 0,0 1,13 19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0,0 0,22 12A9,9 0,0 0,13 3"/>
|
||||
</vector>
|
|
@ -4,6 +4,6 @@
|
|||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" />
|
||||
</vector>
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"/>
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0,0 0,2 12A10,10 0,0 0,12 22A10,10 0,0 0,22 12A10,10 0,0 0,12 2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z"/>
|
||||
</vector>
|
|
@ -114,17 +114,5 @@
|
|||
android:background="@drawable/radius_btn"
|
||||
android:text="@string/bt_agregar" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_cancelar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/bt_cancelar"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/radius_btn"
|
||||
android:layout_marginEnd="50dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".PacienteActivity">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/tv_titulo_consultar"
|
||||
android:textSize="30dp"
|
||||
android:textColor="@color/primaryColor"
|
||||
android:gravity="center"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_agregar_paciente"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:src="@drawable/plus_circle_outline"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_pacientes"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="550dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="8dp"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_descargar_csv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/btn_csv"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:background="@drawable/radius_btn"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
|
@ -7,39 +7,143 @@
|
|||
android:orientation="vertical"
|
||||
tools:context="PrincipalActivity">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_agregar_paciente"
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/tv_agregar_paciente_titulo"/>
|
||||
<Button
|
||||
android:id="@+id/btn_eliminar_paciente"
|
||||
android:text="@string/app_name"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:textColor="@color/primaryColor"
|
||||
android:textSize="30dp"/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp"
|
||||
android:layout_margin="20dp"
|
||||
android:src="@drawable/doctor"/>
|
||||
|
||||
<GridLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/eliminar_paciente_titulo"/>
|
||||
<Button
|
||||
android:id="@+id/btn_agregar_receta"
|
||||
android:layout_marginTop="80dp"
|
||||
android:columnCount="1"
|
||||
android:rowCount="4">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nombre_doctor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_column="0"
|
||||
android:layout_row="0"
|
||||
android:textSize="25dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="Nombre:"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_telefono_doctor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_column="0"
|
||||
android:layout_row="1"
|
||||
android:textSize="25dp"
|
||||
android:layout_marginTop="35dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="Telefono:"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_cedula_doctor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_column="0"
|
||||
android:layout_row="2"
|
||||
android:textSize="25dp"
|
||||
android:layout_marginTop="35dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="Cédula:"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_consultorio_doctor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_column="0"
|
||||
android:layout_row="3"
|
||||
android:textSize="25dp"
|
||||
android:layout_marginTop="35dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="Consultorio:"/>
|
||||
|
||||
</GridLayout>
|
||||
|
||||
<GridLayout
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/btn_agregar_receta"/>
|
||||
android:background="@drawable/radius_tv"
|
||||
android:backgroundTint="@color/primaryColor"
|
||||
android:layout_marginTop="80dp"
|
||||
android:columnCount="3"
|
||||
android:rowCount="2">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_eliminar_receta"
|
||||
android:layout_width="match_parent"
|
||||
<ImageView
|
||||
android:id="@+id/iv_pacientes"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Eliminar Receta"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_cerrar"
|
||||
android:layout_width="match_parent"
|
||||
android:src="@drawable/account"
|
||||
android:layout_column="0"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_row="0"/>
|
||||
<ImageView
|
||||
android:id="@+id/iv_recetas"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Cerrar Sesión"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
android:src="@drawable/file_document"
|
||||
android:layout_column="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_row="0"/>
|
||||
<ImageView
|
||||
android:id="@+id/iv_historial"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/history"
|
||||
android:layout_column="2"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_row="0"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Pacientes"
|
||||
android:textColor="@color/white"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_column="0"
|
||||
android:gravity="center"
|
||||
android:layout_row="1"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Recetas"
|
||||
android:textColor="@color/white"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_column="1"
|
||||
android:gravity="center"
|
||||
android:layout_row="1"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Historial"
|
||||
android:textColor="@color/white"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_column="2"
|
||||
android:gravity="center"
|
||||
android:layout_row="1"/>
|
||||
</GridLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -0,0 +1,107 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:layout_margin="10dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="8dp">
|
||||
|
||||
<GridLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:columnCount="3"
|
||||
android:rowCount="3">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_nombre"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_column="0"
|
||||
android:layout_row="0"
|
||||
android:text="@string/ht_nombre"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_apellido_paterno"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_column="1"
|
||||
android:layout_row="0"
|
||||
android:text="@string/ht_apellido_paterno"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_apellido_materno"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_column="2"
|
||||
android:layout_row="0"
|
||||
android:text="@string/ht_apellido_materno"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_edad"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_column="0"
|
||||
android:layout_row="1"
|
||||
android:text="@string/et_modificar_edad"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_sexo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_column="1"
|
||||
android:layout_row="1"
|
||||
android:text="@string/et_modificar_sexo"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_domicilio"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_column="2"
|
||||
android:layout_row="1"
|
||||
android:text="@string/ht_domicilio"/>
|
||||
<ImageView
|
||||
android:id="@+id/iv_modificar_paciente"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_column="1"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_row="2"
|
||||
android:src="@drawable/update"/>
|
||||
<ImageView
|
||||
android:id="@+id/iv_eliminar_paciente"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_column="2"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_row="2"
|
||||
android:src="@drawable/delete"/>
|
||||
|
||||
</GridLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue