このページでは、Glance を使用するための開発環境の設定方法について説明します。
タイプに基づいて、特定の Glance 依存関係をアプリのモジュールに追加します。 「ひと目でわかる」指定します。
dependencies {
// For AppWidgets support
implementation "androidx.glance:glance-appwidget:1.1.0"
// For interop APIs with Material 3
implementation "androidx.glance:glance-material3:1.1.0"
// For interop APIs with Material 2
implementation "androidx.glance:glance-material:1.1.0"
}
Compose Compiler を有効にする
次のオプションを設定して、Compose コンパイラを スナップ
android {
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.14"
}
kotlinOptions {
jvmTarget = "1.8"
}
}
最新バージョンは Glance のリリースページから入手できます。