设置

如需集成 Ink API,请先在应用中添加依赖项。然后,您可以根据手写需求访问不同的模块。

您可以从 Google Maven 制品库中获取 Ink API 库。将依赖项添加到应用的 build.gradle 文件,如下所示:

Kotlin

dependencies {
    val ink_version = "1.0.0-alpha01"

    implementation("androidx.ink:ink-authoring:$ink_version")
    implementation("androidx.ink:ink-brush:$ink_version")
    implementation("androidx.ink:ink-geometry:$ink_version")
    implementation("androidx.ink:ink-nativeloader:$ink_version1")
    implementation("androidx.ink:ink-rendering:$ink_version")
    implementation("androidx.ink:ink-strokes:$ink_version")
}

Groovy

dependencies {
    def ink_version = "1.0.0-alpha01"

    implementation "androidx.ink:ink-authoring:$ink_version"
    implementation "androidx.ink:ink-brush:$ink_version"
    implementation "androidx.ink:ink-geometry:$ink_version"
    implementation "androidx.ink:ink-nativeloader:$ink_version"
    implementation "androidx.ink:ink-rendering:$ink_version"
    implementation "androidx.ink:ink-strokes:$ink_version"
}