| Oct | NOV | Dec |
| 02 | ||
| 2019 | 2020 | 2021 |
COLLECTED BY
Collection: Outlinks From Tweets
MainActivity.ktin each of the examples to see Jetpack Compose APIs such as crossfade
animation, custom components, using typography, and displaying light and dark
colors in the in-IDE preview.
build.gradle file is configured correctly,
as described in Configure Gradle.
Now you're ready to start developing an app using Jetpack Compose. To help you
get started and learn about what you can do with the toolkit, try the Jetpack
Compose tutorial.
hes configuring your project, you might see a
banner that asks you to build your project. That's because the new module uses
Jetpack Compose live previews, which requires you to compile
and build your project to see a live preview.
plugins {
id 'org.jetbrains.kotlin.android' version '1.4.0'
}
build.gradle file, as shown below. Also set the
version for the Kotlin compiler plugin.
android {
defaultConfig {
...
minSdkVersion 21
}
buildFeatures {
// Enables Jetpack Compose for this module
compose true
}
...
// Set both the Java and Kotlin compilers to target Java 8.
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
useIR = true
}
composeOptions {
kotlinCompilerVersion '1.4.0'
kotlinCompilerExtensionVersion '1.0.0-alpha05'
}
}
build.gradlefile,
as shown below:
dependencies {
implementation 'androidx.compose.ui:ui:1.0.0-alpha05'
// Tooling support (Previews, etc.)
implementation 'androidx.ui:ui-tooling:1.0.0-alpha05'
// Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.)
implementation 'androidx.compose.foundation:foundation:1.0.0-alpha05'
// Material Design
implementation 'androidx.compose.material:material:1.0.0-alpha05'
// Material design icons
implementation 'androidx.compose.material:material-icons-core:1.0.0-alpha05'
implementation 'androidx.compose.material:material-icons-extended:1.0.0-alpha05'
// Integration with observables
implementation 'androidx.compose.runtime:runtime-livedata:1.0.0-alpha05'
implementation 'androidx.compose.runtime:runtime-rxjava2:1.0.0-alpha05'
// UI Tests
androidTestImplementation 'androidx.ui:ui-test:1.0.0-alpha05'
}
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-28 UTC.