设置

要集成 Ink API,首先在您的应用中添加依赖项。从那里,您可以访问用于墨迹需求的不同模块。

Ink API 库可从 Google Maven 存储库获取。将依赖项添加到应用的 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"
}