Generalidades

Jectpack Componse para principiantes en Wear 3.0. Módulo Record Wear para unirse a Jectpack Compose… | por Pou | marzo de 2022

Jectpack Componse para principiantes en Wear 30 Modulo Record Wear
buildscript {
dependencies {
classpath "com.android.tools.build:gradle:7.0.0"
}
}
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android'
}
buildFeatures {
viewBinding true
compose true
}compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}kotlinOptions {
jvmTarget = "11"
}composeOptions {
kotlinCompilerExtensionVersion = "1.2.0-alpha05"
}
dependencies {
// General compose dependencies
implementation "androidx.activity:activity-compose:1.3.1"
implementation "androidx.compose.ui:ui-tooling-preview:1.0.3"
implementation "androidx.compose.foundation:foundation:1.0.3"
implementation "androidx.compose.material:material-icons-extended:1.0.3"
// Other compose dependencies

// Compose for Wear OS Dependencies
implementation "androidx.wear.compose:compose-material:1.0.0-alpha18"

// Foundation is additive, so you can use the mobile version in your Wear OS app.
implementation "androidx.wear.compose:compose-foundation:1.0.0-alpha18"

// If you are using Compose Navigation, use the Wear OS version (NOT THE MOBILE VERSION).
// Uncomment the line below and update the version number.
// implementation "androidx.wear.compose:compose-navigation:1.0.0-alpha18"

// Testing
testImplementation "junit:junit:4.13.2"
androidTestImplementation "androidx.test.ext:junit:1.1.3"
androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.0.3"
debugImplementation "androidx.compose.ui:ui-tooling:1.0.3"
}

class MainActivity : ComponentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

setContent {
Scaffold {
previewFirstScreen()
}
}
}

@Preview
@Composable
fun previewFirstScreen() {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.fillMaxSize().padding(5.dp)
) {
Row {
Text("Test")
}
}
}
}

1648113717 399 Jectpack Componse para principiantes en Wear 30 Modulo Record Wear

LEER  Google Stadia ahora te permite usar tu teléfono como controlador

Publicaciones relacionadas

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Botón volver arriba