تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
الإضافة هي أي ميزة تظهر على خلفية شاشة الساعة مع الوقت.
مثلاً، يُعدّ مؤشر البطارية إحدى الإضافات. إنّ Complics API مخصّصة لكل من خلفيات شاشة الساعة وتطبيقات مصدر البيانات.
يشرح باقي هذا المستند مصادر البيانات وخلفيات شاشة الساعة وأنواع الإضافات.
مصدر البيانات الإضافي
إنّ التطبيقات التي توفّر بيانات، مثل مستوى البطارية أو الطقس أو عدد الخطوات، لاستخدامها في خلفيات شاشة الساعة
الخاصة بالمضاعفات، تسمى مصادر بيانات الإضافات. توفر مصادر البيانات هذه بيانات أولية ولا تتحمل مسؤولية التحكم في كيفية عرض البيانات على خلفية شاشة الساعة.
للاطّلاع على معلومات حول كتابة التطبيقات التي توفّر بيانات لخلفيات شاشة الساعة، يُرجى مراجعة
تعرّض البيانات
للتعقيدات.
يوضِّح المخطّط التالي طريقة توسّط "Wear OS من Google" في تدفّق البيانات من المصادر إلى خلفيات شاشة الساعة.
الشكل 1. تدفق بيانات الإضافة
إضافات على خلفيات شاشة الساعة
تتلقّى خلفيات شاشة الساعة بيانات من مصادر بيانات الإضافات، ما يتيح لها
تضمين إضافات بدون الحاجة إلى رمز للحصول على البيانات الأساسية. وتحتفظ خلفيات شاشة الساعة بالتحكّم في طريقة عرض البيانات كي تتمكن من دمج البيانات بشكل طبيعي مع تصميمها. لمزيد من المعلومات، راجِع دليل التصميم حول الإضافات.
تحدّد أنواع الإضافات أنواع البيانات التي يمكن عرضها في الإضافة أو توفيرها من خلال مصدر بيانات. على سبيل المثال، يمكنك استخدام النوع SHORT_TEXT عندما تتألف
البيانات بشكل أساسي من سلسلة قصيرة. يحتوي الكائن ComplicationData دائمًا على نوع إضافة واحد يحدّد الحقول المطلوبة والاختيارية. ويمثل الحقل المطلوب الجزء الأساسي من البيانات، وتأخذ معظم الأنواع أسماءها من الحقل المطلوب.
تستخدم مصادر البيانات أنواع الإضافات بشكل مختلف عن خلفيات شاشة الساعة:
يختار مصدر البيانات أنواع بيانات الإضافة التي سيتم توفيرها، بما في ذلك الحقول الاختيارية من تلك الأنواع التي تريد توفيرها، وعدد الأنواع المختلفة التي يمكن توفيرها. على سبيل المثال، قد يتيح مصدر عدد الخطوات
النوعَين RANGED_VALUE
وSHORT_TEXT،
وقد يتيح مصدر الاجتماع التالي النوعَين SHORT_TEXT
وLONG_TEXT.
يمكنك اختيار عدد الإضافات التي تريد تضمينها في خلفية شاشة الساعة وأنواع الإضافات التي تريد توفيرها. على سبيل المثال، قد تتوافق إضافة الاتصال على خلفية شاشة الساعة مع الأنواع SHORT_TEXT وICON وRANGED_VALUE.
قد يكون المقياس الظاهر على خلفية شاشة الساعة متوافقًا مع النوع
RANGED_VALUE فقط.
لمزيد من المعلومات حول أنواع الإضافات والحقول المختلفة المتاحة لكل نوع،
يمكنك الاطّلاع على
أنواع الإضافات.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# About complications\n\nA\n[complication](https://en.wikipedia.org/wiki/Complication_(horology))\nis any feature that is displayed on a watch face in addition to the time.\nFor example, a battery\nindicator is a complication. The\n[Complications API](/reference/kotlin/androidx/wear/watchface/complications/package-summary)\nis for both watch faces and data source apps.\n\n\nThe rest of this document describes data sources, watch faces, and\ncomplication types.\n\nComplication data source\n------------------------\n\nApps that provide data such as\nbattery level, weather, or step counts to watch faces for\ncomplications are called *complication data sources* . These data\nsources supply raw data\nand are not responsible for controlling how their data is rendered on a\nwatch face.\nTo learn about writing apps that provide data to watch faces, see\n[Expose data to\ncomplications](/training/wearables/exposing-data-complications).\n\nThe following diagram shows how Wear OS by Google mediates the flow of data\nfrom sources to watch faces.\n**Figure 1.** The flow of complication data.\n\nComplications on watch faces\n----------------------------\n\nWatch faces receive data from complication data sources, which lets them\ninclude\ncomplications without needing code for getting the underlying data. Watch\nfaces retain\ncontrol over how the data is rendered, so they can integrate data\nnaturally with their\ndesign. For more information, see the design guide about\n[Complications](/training/wearables/design/complications).\n\nTo learn how to add complications to a watch face, see\n[Add complications to a watch face](/training/wearables/watch-faces/adding-complications).\n\nComplication types\n------------------\n\nComplication types define what kinds of data can be shown in a\ncomplication or supplied by\na data source. For example, use the `SHORT_TEXT` type when the\ndata consists\nprimarily of a short string. A\n[`ComplicationData`](/reference/androidx/wear/watchface/complications/data/ComplicationData) object always has a single\ncomplication type that defines required and optional fields. A required\nfield\nrepresents the primary piece of data; most types take their name from\nthe required field.\n\nData sources use complication types differently from watch faces:\n\n- A data source chooses the types of complication data to supply, including which optional fields of those types to supply, and how many different types can be supported. For example, a step-count source might support the `RANGED_VALUE` and `SHORT_TEXT` types, and a next-meeting source might support the `SHORT_TEXT` and `LONG_TEXT` types.\n- You can choose how many complications to include in your watch face and the complication types to support. For example, a dial complication on a watch face might support the `SHORT_TEXT`, `ICON`, and `RANGED_VALUE` types. A gauge on the watch face might support only the `RANGED_VALUE` type.\n\nTo learn more about different complication types and fields supported by\neach type, see\n[Complication types](/training/wearables/watch-faces/adding-complications#types-fields)."]]