資訊一覽設定
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本頁說明如何設定開發環境以使用 Glance。您可以從發行頁面取得最新版本。
根據要建構的「資訊一覽」類型,在應用程式模組中新增特定「資訊一覽」依附元件。
dependencies {
// For AppWidgets support
implementation "androidx.glance:glance-appwidget:1.1.1"
// For interop APIs with Material 3
implementation "androidx.glance:glance-material3:1.1.1"
// For interop APIs with Material 2
implementation "androidx.glance:glance-material:1.1.1"
}
啟用 Compose 編譯器
請設定下列選項,確保 Compose 編譯器適用於 Glance:
android {
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.15"
}
kotlinOptions {
jvmTarget = "1.8"
}
}
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-08-21 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-21 (世界標準時間)。"],[],[],null,["This page describes how to set up your development environment to use Glance.\nYou can get the latest available version from\n[the release page](/jetpack/androidx/releases/glance).\n\nAdd the specific Glance dependency in your app's module based on the type of\n\"glanceable\" you want to build. \n\n dependencies {\n // For AppWidgets support\n implementation \"androidx.glance:glance-appwidget:1.1.1\"\n\n // For interop APIs with Material 3\n implementation \"androidx.glance:glance-material3:1.1.1\"\n\n // For interop APIs with Material 2\n implementation \"androidx.glance:glance-material:1.1.1\"\n }\n\nActivate Compose compiler\n\nSet the following options to ensure that the Compose compiler is available for\nGlance: \n\n\n android {\n buildFeatures {\n compose true\n }\n\n composeOptions {\n kotlinCompilerExtensionVersion = \"1.5.15\"\n }\n\n kotlinOptions {\n jvmTarget = \"1.8\"\n }\n }"]]