diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
index 0c0c338..cc1cbde 100644
--- a/.idea/deploymentTargetDropDown.xml
+++ b/.idea/deploymentTargetDropDown.xml
@@ -3,7 +3,20 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/com/terratenientes/medicalhealth/MainActivity.kt b/app/src/main/java/com/terratenientes/medicalhealth/MainActivity.kt
index ad5c5cb..8cdc1c9 100644
--- a/app/src/main/java/com/terratenientes/medicalhealth/MainActivity.kt
+++ b/app/src/main/java/com/terratenientes/medicalhealth/MainActivity.kt
@@ -40,6 +40,7 @@ class MainActivity : AppCompatActivity() {
//dbRecetas.crearTablaReceta()
//db.createTable()
//dbHistorial.crearTablaHistorial()
+ //db.crearTablaPacientes()
binding.btnIniciarSesion.setOnClickListener {
historial.fecha = obtenerFecha()
var res = db.validarDatos(
diff --git a/app/src/main/java/com/terratenientes/medicalhealth/PacientePrincipalActivity.kt b/app/src/main/java/com/terratenientes/medicalhealth/PacientePrincipalActivity.kt
index d6a9eda..eee2c84 100644
--- a/app/src/main/java/com/terratenientes/medicalhealth/PacientePrincipalActivity.kt
+++ b/app/src/main/java/com/terratenientes/medicalhealth/PacientePrincipalActivity.kt
@@ -56,6 +56,9 @@ class PacientePrincipalActivity : AppCompatActivity(), CellClickListener {
binding.rvRecetasPaciente.layoutManager=LinearLayoutManager(this)
binding.rvRecetasPaciente.adapter= recycleAdapter
+ binding.ivLogout.setOnClickListener {
+ finish()
+ }
}
override fun onResume() {
diff --git a/app/src/main/java/com/terratenientes/medicalhealth/PrincipalActivity.kt b/app/src/main/java/com/terratenientes/medicalhealth/PrincipalActivity.kt
index 7b64519..47f98b9 100644
--- a/app/src/main/java/com/terratenientes/medicalhealth/PrincipalActivity.kt
+++ b/app/src/main/java/com/terratenientes/medicalhealth/PrincipalActivity.kt
@@ -45,6 +45,10 @@ class PrincipalActivity : AppCompatActivity() {
historial = Historial("Doctor", null,"Se inicio la actividad de menu principal", obtenerFecha())
datosDoctor(intent.getStringExtra("Cedula").toString())
añadirHistorial(historial)
+ binding.ivLogout.setOnClickListener {
+ finish()
+ Toast.makeText(this@PrincipalActivity,"Sesión cerrada", Toast.LENGTH_LONG).show()
+ }
binding.ivPacientes.setOnClickListener {
val intent = Intent(this@PrincipalActivity, PacienteActivity::class.java)
intent.putExtra("NombreDoctor", nombreDoctor)
diff --git a/app/src/main/java/com/terratenientes/medicalhealth/RegistrarDActivity.kt b/app/src/main/java/com/terratenientes/medicalhealth/RegistrarDActivity.kt
index bff7828..55eaa3a 100644
--- a/app/src/main/java/com/terratenientes/medicalhealth/RegistrarDActivity.kt
+++ b/app/src/main/java/com/terratenientes/medicalhealth/RegistrarDActivity.kt
@@ -29,7 +29,6 @@ class RegistrarDActivity : AppCompatActivity() {
dbHistorial = HistorialDataBaseHelper(this@RegistrarDActivity)
historial = Historial(null, null, "Se abrio la actividad de registro", obtenerFecha())
añadirHistorial(historial)
- db= DoctorDataBaseHelper(this@RegistrarDActivity)
db = DoctorDataBaseHelper(this@RegistrarDActivity)
binding.btnRegistrar.setOnClickListener {
@@ -46,14 +45,10 @@ class RegistrarDActivity : AppCompatActivity() {
val domicilio = binding.etDomicilio.text.toString()
val contrasena= binding.etContrasenaRegistro.text.toString()
val usuario= Doctor(cedula,nombre,apellido,telefono,domicilio.toInt())
- db.agregarDoctores(usuario,contrasena)
- Toast.makeText(this@RegistrarDActivity,"USUARIO AGREGADO",Toast.LENGTH_LONG).show()
- historial.eventoRealizado = "Se registraron los datos de un doctor"
- historial.fecha = obtenerFecha()
- historial.tipoUsuario = "Doctor"
- historial.nombreUsuario = nombre
- añadirHistorial(historial)
- val contrasena = binding.etContrasenaRegistro.text.toString()
+ /*db.agregarDoctores(usuario,contrasena)
+ Toast.makeText(this@RegistrarDActivity,"USUARIO AGREGADO",Toast.LENGTH_LONG).show()*/
+
+
if (cedula.isEmpty() || nombre.isEmpty() || apellido.isEmpty() || telefono.isEmpty() || domicilio.isEmpty() || contrasena.isEmpty()) {
Toast.makeText(this, "Todos los campos son obligatorios.", Toast.LENGTH_LONG).show()
@@ -95,6 +90,11 @@ class RegistrarDActivity : AppCompatActivity() {
val usuario = Doctor(cedula, nombre, apellido, telefono, domicilio.toInt())
db.agregarDoctores(usuario, contrasena)
+ historial.eventoRealizado = "Se registraron los datos de un doctor"
+ historial.fecha = obtenerFecha()
+ historial.tipoUsuario = "Doctor"
+ historial.nombreUsuario = nombre
+ añadirHistorial(historial)
Toast.makeText(this@RegistrarDActivity, "USUARIO AGREGADO", Toast.LENGTH_LONG).show()
finish()
diff --git a/app/src/main/res/drawable/logout.xml b/app/src/main/res/drawable/logout.xml
new file mode 100644
index 0000000..8a42cf9
--- /dev/null
+++ b/app/src/main/res/drawable/logout.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/layout/activity_paciente_principal.xml b/app/src/main/res/layout/activity_paciente_principal.xml
index 86a433f..92e9b0c 100644
--- a/app/src/main/res/layout/activity_paciente_principal.xml
+++ b/app/src/main/res/layout/activity_paciente_principal.xml
@@ -7,12 +7,20 @@
android:layout_height="match_parent"
tools:context=".PacientePrincipalActivity">
+
+
diff --git a/app/src/main/res/layout/activity_principal.xml b/app/src/main/res/layout/activity_principal.xml
index db2ed2c..081ba38 100644
--- a/app/src/main/res/layout/activity_principal.xml
+++ b/app/src/main/res/layout/activity_principal.xml
@@ -7,22 +7,34 @@
android:orientation="vertical"
tools:context="PrincipalActivity">
-
+ android:layout_height="40dp"
+ android:orientation="horizontal">
+
+
+
-
+ android:src="@drawable/doctor"/>
diff --git a/app/src/main/res/layout/rc_receta_item.xml b/app/src/main/res/layout/rc_receta_item.xml
index d717f76..8cbb8a7 100644
--- a/app/src/main/res/layout/rc_receta_item.xml
+++ b/app/src/main/res/layout/rc_receta_item.xml
@@ -81,8 +81,8 @@
+ app:layout_constraintVertical_bias="0.581" />