設定

如要整合 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"
}