मुख्य सामग्री पर जाएँ
Skillpedia
मोबाइल ऐप10k · #11936

glance-canonical-layouts

यह क्या करती है

यह स्किल Jetpack Glance का उपयोग करके Android के सैंपल प्रोजेक्ट से मानक विजेट लेआउट आपके ऐप में कॉपी करती है। इनमें चेक लिस्ट, इमेज ग्रिड, स्नैप स्क्रॉलिंग और मानक टूलबार शामिल हैं। यह उन Android डेवलपरों के लिए है जो होम स्क्रीन विजेट बना रहे हैं।

कब इस्तेमाल करें

  • ✓जब आपको चेक लिस्ट या इमेज ग्रिड वाला होम स्क्रीन विजेट चाहिए।
  • ✓जब आपके Android ऐप के लिए मानक विजेट टूलबार या स्नैप स्क्रॉलिंग लेआउट चाहिए।
  • ✓जब नया विजेट विजेट पिकर में न दिखे और आपको उसका रजिस्ट्रेशन जाँचना हो।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/android/skills/blob/main/system/glance-canonical-layouts/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे Android ऐप में मानक Glance लेआउट का इस्तेमाल करके चेक लिस्ट विजेट जोड़िए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

स्किल चुने गए लेआउट की संदर्भ फ़ाइलें आपके ऐप में कॉपी करती है और पैकेज नाम व imports अपडेट करती है। वह बिना इस्तेमाल वाले हिस्से हटाती है और विजेट को पिकर में दिखाने के लिए manifest में विजेट receiver रजिस्टर करती है।

तकनीकी सामग्री (मूल 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)

अक्सर पूछे जाने वाले सवाल

मेरा विजेट पिकर से गायब क्यों है?

receiver को manifest में मेल खाती विजेट जानकारी फ़ाइल के साथ रजिस्टर होना चाहिए, और स्किल यह जाँचती है।

क्या इसे Jetpack Glance चाहिए?

हाँ। इन लेआउट के लिए प्रोजेक्ट में Jetpack Glance इस्तेमाल होना चाहिए।

यह कौन सा size mode इस्तेमाल करती है?

स्किल विजेट provider क्लास में विजेट का size mode 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
अपडेट की गई
29/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

agp-9-upgrade

10k

आपके एजेंट को Android ऐप को Android Gradle Plugin 9 पर ले जाने और उसके breaking changes सुधारने में मदद करती है। मल्टीप्लेटफ़ॉर्म प्रोजेक्ट के लिए नहीं।

कोडिंगमोबाइल ऐप

camerax

10k

आपके एजेंट को CameraX से Android कैमरा फ़ीचर बनाने में मदद करती है, जिसमें वीडियो रिकॉर्डिंग, हार्डवेयर कंट्रोल, ML Kit और Media3 इफ़ेक्ट शामिल हैं।

कोडिंगमोबाइल ऐप

android-for-cars-parked-apps

10k

आपके एजेंट को Android वीडियो, गेम या ब्राउज़र ऐप को Android Auto और Android Automotive पर parked ऐप के रूप में चलाने के लिए ढालने में मदद करती है।

कोडिंगमोबाइल ऐप

appfunctions

10k

आपके एजेंट को Android ऐप के मुख्य काम ढूँढकर उन्हें AppFunctions के रूप में देने में मदद करती है, ताकि AI एजेंट और वॉइस कमांड उन्हें चला सकें।

AI और एजेंटएजेंट

मिलती-जुलती skills