Actualizacion pantalla de bienvenida y cambios varios
This commit is contained in:
@@ -4,7 +4,8 @@ Saludapp es una aplicación Android moderna enfocada en la salud y el bienestar,
|
|||||||
|
|
||||||
## 🚀 Características
|
## 🚀 Características
|
||||||
- Interfaz de usuario moderna con **Jetpack Compose**.
|
- Interfaz de usuario moderna con **Jetpack Compose**.
|
||||||
- Diseño basado en **Material 3**.
|
- Pantalla de inicio atractiva con mensaje de bienvenida.
|
||||||
|
- Diseño basado en **Material 3** con soporte para temas dinámicos.
|
||||||
- Arquitectura limpia y escalable.
|
- Arquitectura limpia y escalable.
|
||||||
|
|
||||||
## 🛠️ Tecnologías utilizadas
|
## 🛠️ Tecnologías utilizadas
|
||||||
@@ -29,8 +30,9 @@ Saludapp es una aplicación Android moderna enfocada en la salud y el bienestar,
|
|||||||
|
|
||||||
## 📂 Estructura del Proyecto
|
## 📂 Estructura del Proyecto
|
||||||
- `app/`: Contiene el código fuente principal de la aplicación.
|
- `app/`: Contiene el código fuente principal de la aplicación.
|
||||||
- `src/main/java/com/example/saludapp/`: Contiene las actividades y composables principales.
|
- `src/main/java/com/example/saludapp/MainActivity.kt`: Punto de entrada de la aplicación.
|
||||||
- `ui/theme/`: Configuración del tema, colores y tipografía de Material 3.
|
- `src/main/java/com/example/saludapp/ui/StartScreen.kt`: Composable de la pantalla de inicio.
|
||||||
|
- `src/main/java/com/example/saludapp/ui/theme/`: Configuración del tema, colores y tipografía de Material 3.
|
||||||
|
|
||||||
---
|
---
|
||||||
Desarrollado con ❤️ para mejorar la salud de los usuarios.
|
Desarrollado con ❤️ para mejorar la salud de los usuarios.
|
||||||
|
|||||||
@@ -5,16 +5,12 @@ plugins {
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.example.saludapp"
|
namespace = "com.example.saludapp"
|
||||||
compileSdk {
|
compileSdk = 37
|
||||||
version = release(36) {
|
|
||||||
minorApiLevel = 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.example.saludapp"
|
applicationId = "com.example.saludapp"
|
||||||
minSdk = 34
|
minSdk = 34
|
||||||
targetSdk = 36
|
targetSdk = 37
|
||||||
versionCode = 1
|
versionCode = 1
|
||||||
versionName = "1.0"
|
versionName = "1.0"
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,7 @@ import android.os.Bundle
|
|||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import com.example.saludapp.ui.StartScreen
|
||||||
import androidx.compose.foundation.layout.padding
|
|
||||||
import androidx.compose.material3.Scaffold
|
|
||||||
import androidx.compose.material3.Text
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
|
||||||
import com.example.saludapp.ui.theme.SaludappTheme
|
import com.example.saludapp.ui.theme.SaludappTheme
|
||||||
|
|
||||||
class MainActivity : ComponentActivity() {
|
class MainActivity : ComponentActivity() {
|
||||||
@@ -19,29 +13,10 @@ class MainActivity : ComponentActivity() {
|
|||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
setContent {
|
setContent {
|
||||||
SaludappTheme {
|
SaludappTheme {
|
||||||
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
StartScreen {
|
||||||
Greeting(
|
// Acción al presionar el botón
|
||||||
name = "Android",
|
|
||||||
modifier = Modifier.padding(innerPadding)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun Greeting(name: String, modifier: Modifier = Modifier) {
|
|
||||||
Text(
|
|
||||||
text = "Hello $name!",
|
|
||||||
modifier = modifier
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Preview(showBackground = true)
|
|
||||||
@Composable
|
|
||||||
fun GreetingPreview() {
|
|
||||||
SaludappTheme {
|
|
||||||
Greeting("Android")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.example.saludapp.ui
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.material3.*
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.example.saludapp.ui.theme.SaludappTheme
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun StartScreen(onStartClick: () -> Unit = {}) {
|
||||||
|
Surface(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
color = MaterialTheme.colorScheme.background
|
||||||
|
) {
|
||||||
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.padding(24.dp),
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
verticalArrangement = Arrangement.Center
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = "Saludapp",
|
||||||
|
style = MaterialTheme.typography.headlineLarge.copy(
|
||||||
|
fontWeight = FontWeight.Bold,
|
||||||
|
fontSize = 40.sp,
|
||||||
|
color = MaterialTheme.colorScheme.primary
|
||||||
|
),
|
||||||
|
textAlign = TextAlign.Center
|
||||||
|
)
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
|
Text(
|
||||||
|
text = "Tu compañero diario para una vida más saludable.",
|
||||||
|
style = MaterialTheme.typography.bodyLarge,
|
||||||
|
textAlign = TextAlign.Center,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(48.dp))
|
||||||
|
|
||||||
|
Button(
|
||||||
|
onClick = onStartClick,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.height(56.dp)
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = "Empezar",
|
||||||
|
style = MaterialTheme.typography.titleMedium
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Preview(showBackground = true)
|
||||||
|
@Composable
|
||||||
|
fun StartScreenPreview() {
|
||||||
|
SaludappTheme {
|
||||||
|
StartScreen()
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user