From 25f72e59f06fa9f09d171727482d3c00badc95dd Mon Sep 17 00:00:00 2001 From: AngelSuarez03 Date: Wed, 8 May 2024 17:08:10 -0600 Subject: [PATCH] =?UTF-8?q?Eliminaci=C3=B3n=20botones=20pruebas=20/=20Boto?= =?UTF-8?q?nes=20en=20la=20Pantalla=20Principal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../medicalhealth/MainActivity.kt | 10 ------- .../medicalhealth/PrincipalActivity.kt | 23 +++++++++++++++- app/src/main/res/layout/activity_main.xml | 26 ------------------- .../main/res/layout/activity_principal.xml | 25 +++++++++++++++--- 4 files changed, 44 insertions(+), 40 deletions(-) diff --git a/app/src/main/java/com/terratenientes/medicalhealth/MainActivity.kt b/app/src/main/java/com/terratenientes/medicalhealth/MainActivity.kt index 6d709cc..ef65f3b 100644 --- a/app/src/main/java/com/terratenientes/medicalhealth/MainActivity.kt +++ b/app/src/main/java/com/terratenientes/medicalhealth/MainActivity.kt @@ -29,16 +29,6 @@ class MainActivity : AppCompatActivity() { Toast.makeText(this@MainActivity," NO VALIDADO",Toast.LENGTH_LONG).show() } } - - binding.btnPrueba.setOnClickListener { - val intent = Intent(this@MainActivity, AgregarActivity::class.java) - startActivity(intent) - } - - binding.btnPrueba2.setOnClickListener { - val intent = Intent(this@MainActivity, RecetaActivity::class.java) - startActivity(intent) - } binding.tvRegistrarme.setOnClickListener{ val intent = Intent(this@MainActivity, RegistrarDActivity::class.java) startActivity(intent) diff --git a/app/src/main/java/com/terratenientes/medicalhealth/PrincipalActivity.kt b/app/src/main/java/com/terratenientes/medicalhealth/PrincipalActivity.kt index 555e0b7..d325b95 100644 --- a/app/src/main/java/com/terratenientes/medicalhealth/PrincipalActivity.kt +++ b/app/src/main/java/com/terratenientes/medicalhealth/PrincipalActivity.kt @@ -1,11 +1,32 @@ package com.terratenientes.medicalhealth +import android.content.Intent import androidx.appcompat.app.AppCompatActivity import android.os.Bundle +import com.terratenientes.medicalhealth.databinding.ActivityPrincipalBinding class PrincipalActivity : AppCompatActivity() { + lateinit var binding : ActivityPrincipalBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_principal) + binding = ActivityPrincipalBinding.inflate(layoutInflater) + val view = binding.root + setContentView(view) + + binding.btnAgregarPaciente.setOnClickListener { + val intent = Intent(this@PrincipalActivity, AgregarActivity::class.java) + startActivity(intent) + } + + binding.btnEliminarPaciente.setOnClickListener { + val intent = Intent(this@PrincipalActivity, EliminarActivity::class.java) + startActivity(intent) + } + + binding.btnAgregarReceta.setOnClickListener { + val intent = Intent(this@PrincipalActivity, RecetaActivity::class.java) + startActivity(intent) + } + } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 307f5a4..8006261 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -61,32 +61,6 @@ android:backgroundTint="@color/primaryColor" /> -