设置

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

墨迹 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"
}