تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
في بعض الحالات، يمكنك استخدام XML وRemoteViews لتوفير طريقة عرض.
قد يكون سبق لك تنفيذ ميزة بدون ميزة "نظرة سريعة"، أو أنّ الميزة
غير متوفّرة بعد أو متاحة في واجهة برمجة التطبيقات Glance API الحالية. في هذه المواقف،
توفّر ميزة "نظرة سريعة" واجهة برمجة تطبيقات AndroidRemoteViews لإمكانية التشغيل التفاعلي.
إنّ عنصر AndroidRemoteViews القابل للإنشاء يتيح وضع RemoteViews معًا.
مع العناصر الأخرى القابلة للإنشاء:
valpackageName=LocalContext.current.packageNameColumn(modifier=GlanceModifier.fillMaxSize()){Text("Isn't that cool?")AndroidRemoteViews(RemoteViews(packageName,R.layout.example_layout))}
يمكنك إنشاء RemoteViews وتحديدها كما تفعل بدون تفعيل ميزة "نظرة سريعة" وببساطة.
كمعلمة.
بالإضافة إلى ذلك، يمكنك إنشاء حاويات RemoteViews للعناصر القابلة للإنشاء:
AndroidRemoteViews(remoteViews=RemoteViews(packageName,R.layout.my_container_view),containerViewId=R.id.example_view){Column(modifier=GlanceModifier.fillMaxSize()){Text("My title")Text("Maybe a long content...")}}
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-08-25 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-25 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["In some cases, you may want to use XML and `RemoteViews` to provide a view.\nPerhaps you have already implemented a feature without Glance, or the feature is\nnot yet available or possible with the current Glance API. For these situations,\nGlance provides `AndroidRemoteViews`, an interoperability API.\n\nThe `AndroidRemoteViews` composable allows `RemoteViews` to be placed together\nwith your other composables:\n\n\n```kotlin\nval packageName = LocalContext.current.packageName\nColumn(modifier = GlanceModifier.fillMaxSize()) {\n Text(\"Isn't that cool?\")\n AndroidRemoteViews(RemoteViews(packageName, R.layout.example_layout))\n}https://github.com/android/snippets/blob/5673ffc60b614daf028ee936227128eb8c4f9781/compose/snippets/src/main/java/com/example/compose/snippets/glance/GlanceSnippets.kt#L903-L907\n```\n\n\u003cbr /\u003e\n\nCreate and define the `RemoteViews` as you would without Glance, and simply pass\nit as a parameter.\n\nIn addition, you can create `RemoteViews` containers for your composables:\n\n\n```kotlin\nAndroidRemoteViews(\n remoteViews = RemoteViews(packageName, R.layout.my_container_view),\n containerViewId = R.id.example_view\n) {\n Column(modifier = GlanceModifier.fillMaxSize()) {\n Text(\"My title\")\n Text(\"Maybe a long content...\")\n }\n}https://github.com/android/snippets/blob/5673ffc60b614daf028ee936227128eb8c4f9781/compose/snippets/src/main/java/com/example/compose/snippets/glance/GlanceSnippets.kt#L916-L925\n```\n\n\u003cbr /\u003e\n\nIn this case, a layout that contains the \"container\" is passed with the defined\nID. This container must be a [`ViewGroup`](/reference/android/view/ViewGroup), since it is used to place the\ndefined content.\n| **Note:** Any children of the defined container are removed and replaced with the content. Also, the provided `ViewGroup` must be supported by `RemoteViews.` See [`RemoteViewsWidget.kt`](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:glance/glance-appwidget/integration-tests/demos/src/main/java/androidx/glance/appwidget/demos/RemoteViewsWidget.kt) for an example of using `AndroidRemoteViews`."]]