한눈에 보기 설정

이 페이지에서는 Glance를 사용하도록 개발 환경을 설정하는 방법을 설명합니다.

Glance 종속 항목 추가

필요한 기능에 따라 앱의 모듈에 특정 Glance 종속 항목을 추가합니다.

dependencies {
   // For AppWidgets support
   implementation( "androidx.glance:glance-appwidget:1.0.0" )

   // For interop APIs with Material 2
   implementation( "androidx.glance:glance-material:1.0.0" )

   // For interop APIs with Material 3
   implementation( "androidx.glance:glance-material3:1.0.0" )
}

Compose 컴파일러 활성화

Compose 컴파일러를 Glance에 사용할 수 있도록 다음 옵션을 설정합니다.


android {
   buildFeatures {
      compose true
   }

   composeOptions {
      kotlinCompilerExtensionVersion = "1.5.11"
   }

   kotlinOptions {
      jvmTarget = "1.8"
   }
}


Glance 출시 페이지에서 사용 가능한 최신 버전을 다운로드할 수 있습니다.