본문으로 건너뛰기
Skillpedia
모바일 앱10k · #11936

glance-canonical-layouts

하는 일

이 스킬은 Android 샘플 프로젝트의 표준 위젯 레이아웃을 Jetpack Glance를 사용해 앱에 복사합니다. 레이아웃에는 체크리스트, 이미지 그리드, 스냅 스크롤, 표준 도구 모음이 포함됩니다. 홈 화면 위젯을 만드는 Android 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓체크리스트나 이미지 그리드가 있는 홈 화면 위젯을 원할 때.
  • ✓Android 앱에 표준 위젯 도구 모음이나 스냅 스크롤 레이아웃이 필요할 때.
  • ✓새 위젯이 위젯 선택 화면에 보이지 않아 등록을 확인해야 할 때.

스킬 링크

https://github.com/android/skills/blob/main/system/glance-canonical-layouts/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/android/skills/blob/main/system/glance-canonical-layouts/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“표준 Glance 레이아웃을 사용해 내 Android 앱에 체크리스트 위젯을 추가해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 선택한 레이아웃의 참조 파일을 앱에 복사하고, 패키지 이름과 import를 업데이트합니다. 사용하지 않는 부분을 지우고, 위젯 선택 화면에 보이도록 매니페스트에 위젯 리시버를 등록합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

To implement a widget Canonical Layout that follows the recommended design patterns:

  1. The project MUST use Jetpack Glance.
  2. You MUST locate the requested layout from the list under Canonical Layout Reference Files.
  3. Copy the layout reference files into your project's target app module (e.g., src/main/java/ and src/main/res/) in one step to implement the exact design and reduce the number of tool calls.
  4. You MUST set override val sizeMode: SizeMode = SizeMode.Exact in the widget provider class.
  5. Validate that your project compiles, updating sample package declarations, import paths, and class names to match the target app's package name.
  6. Clean your project's widget code, removing unused classes (for example, unused buttons).
  7. You MUST register the widget receiver in AndroidManifest.xml inside <application> after <activity>, ensuring android:resource="@xml/..." matches the filename of the copied Widget Info XML. Otherwise, the widget won't appear in the widget picker:
<br />
<receiver android:name=".glance.MyReceiver"
    android:exported="true">
    <intent-filter>
        <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
    </intent-filter>
    <meta-data
        android:name="android.appwidget.provider"
        android:resource="@xml/my_app_widget_info" />
</receiver>
<br />

Dependencies

Add Jetpack Glance dependencies to the app module's build.gradle.kts (dependencies block):

  • androidx.glance:glance-appwidget:1.2.0 or higher
  • androidx.glance:glance-material3:1.2.0 or higher
  • androidx.glance:glance-appwidget-preview:1.2.0 or higher
  • androidx.glance:glance-preview:1.2.0 or higher

Use version 1.3.0-alpha02 or higher with compileSdk = 37 and Android Gradle Plugin (AGP) 9.1.0 or higher (for example, agp = "9.1.0" in gradle/libs.versions.toml) when implementing Snap Scrolling.

If copying sample data repositories that load bitmaps with Coil (such as FakeImageGridDataRepository.kt, FakeImageTextListDataRepository.kt, or FakeTextWithImageRepository.kt), also add an image loading library dependency such as io.coil-kt:coil (e.g., implementation("io.coil-kt:coil:2.7.0")) if one doesn't already exist.

Canonical layout reference files

Action list layout (action_list)

자주 묻는 질문

위젯이 선택 화면에 없는 이유는 무엇인가요?

리시버가 매니페스트에 일치하는 위젯 정보 파일과 함께 등록되어야 하며, 스킬이 이를 확인합니다.

Jetpack Glance가 필요한가요?

네. 이 레이아웃을 쓰려면 프로젝트가 Jetpack Glance를 사용해야 합니다.

어떤 크기 모드를 사용하나요?

스킬이 위젯 제공자 클래스에서 크기 모드를 정확(exact) 모드로 설정합니다.

상세 정보

작성자의 원본 설명

Use this skill to create home screen widgets using Jetpack Glance Canonical Layouts from the Android Platform Samples project, or when asked to implement standard widget layout patterns (including Check List, Image Grid, Snap Scrolling, and Standard Toolbar).

repo: android/skills

인기도

GitHub 스타
10k
순위
#11936
라이선스
Apache-2.0
업데이트
2026. 10. 29.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬