تخصيص الشاشة باستخدام الصور
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
ملاحظة: تتوفّر هذه الميزة في الإصدار 4 من تنسيق Watch Face
والإصدارات الأحدث.
يمكن أن يساعد السماح للمستخدم باختيار الصور لتضمينها في خلفية شاشة الساعة في
إضافة لمسة شخصية إلى تجربة خلفية شاشة الساعة.
يتناول قسم استخدام الصور كيفية عرض الصور في
خلفية شاشة الساعة. إذا كنت تريد السماح للمستخدم بالاختيار من بين مجموعة من
الصور المحدّدة مسبقًا، استخدِم ListConfiguration
كما هو موضّح في قسم تحديد
إعدادات المستخدم.
لاستخدام صور في خلفية شاشة الساعة يمكن للمستخدم ضبطها، استخدِم العنصر
<PhotosConfiguration>
، على سبيل المثال:
<UserConfigurations>
<PhotosConfiguration id="photoConfig" configType="SINGLE"/>
</UserConfigurations>
يمكن أن يكون الرمز configType
إما SINGLE
أو MULTIPLE
للإشارة إلى ما إذا كان
يمكن للمستخدم اختيار صورة واحدة ضمن الصورة المصاحبة أو مجموعة
من الصور.
السماح بتحميل صورة واحدة
في حال استخدام صورة واحدة، يمكن استخدامها ضمن عنصر PartImage
على النحو التالي:
<PartImage ...>
<Photos source="[CONFIGURATION.photoConfig]" defaultImageResource="default_image"/>
</PartImage>
يُرجى ملاحظة الرمز defaultImageResource
الذي يظهر عندما لا يختار المستخدم
صورة في التطبيق المصاحب، وهو سمة مطلوبة.
إذا أراد المستخدم اختيار صورة مختلفة، عليه استخدام التطبيق المصاحب
لاستبدال الصورة المحدّدة حاليًا بأخرى.
إتاحة استخدام صور متعددة
يتيح استخدام PhotosConfiguration
مع configType="MULTIPLE"
لخلفية شاشة الساعة
عرض صورة من مجموعة، ويمكن التبديل بينها إما من خلال
النقر عليها أو تلقائيًا بعد عدد معيّن من المشاهدات.
<Photos change="ON_VISIBLE TAP" changeAfterEvery="5"
source="[CONFIGURATION.photoConfig]" defaultImageResource="default_image"/>
يوضّح المثال السابق الخيارَين المقدَّمَين عند استخدام
MULTIPLE
:
- تسمح سمة
change
للمطوّر بتحديد الأحداث التي يجب أن تؤدي إلى التبديل بين الصور المتاحة.
في المثال السابق، تم تحديد كل من TAP
وON_VISIBLE
، ما يعني
أنّ الصورة تتغيّر استجابةً إما للنقر على الصورة أو
استجابةً لظهور الصورة.
- لا تنطبق سمة
changeAfterEvery
إلا على حدث ON_VISIBLE
التغيير، الذي يحدّد عدد المرات التي كان من المفترض أن تظهر فيها الصورة
قبل تغييرها. على سبيل المثال، قد تعتقد أنّ تغيير الصورة
في كل مرة يوقِظ فيها المستخدم ساعته أمر متكرّر جدًا. القيمة التلقائية هنا
هي 3.
لمزيد من التفاصيل حول استخدام PhotosConfiguration
، اطّلِع على النماذج على
GitHub.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Personalize with photos\n\n**Note**: This feature is available on version 4 and higher of Watch Face\nFormat.\n\nAllowing the user to select photos for inclusion on the watch face can help\nbring a personal touch to your watch face experience.\n\nThe [working with images](/training/wearables/wff/images) section already covers how to display images in\nyour watch face. If you want to allow the user to choose from a range of\npredefined images, then use a `ListConfiguration` as shown in the [define user\nconfigurations](/training/wearables/wff/personalization/user-configurations) section.\n\nTo use images in your watch face that the user can configure, use the\n`\u003cPhotosConfiguration\u003e` element, for example: \n\n \u003cUserConfigurations\u003e\n \u003cPhotosConfiguration id=\"photoConfig\" configType=\"SINGLE\"/\u003e\n \u003c/UserConfigurations\u003e\n\nThe `configType` can be either `SINGLE` or `MULTIPLE` indicating whether the\nuser will be able to select a single image within the companion or a collection\nof photos.\n\nSupport a single photo\n----------------------\n\nFor the single image case, the photo can be used within a `PartImage` element as\nfollows: \n\n \u003cPartImage ...\u003e\n \u003cPhotos source=\"[CONFIGURATION.photoConfig]\" defaultImageResource=\"default_image\"/\u003e\n \u003c/PartImage\u003e\n\nNote the `defaultImageResource`, which is shown when the user has not\nselected a photo in the companion and is a required attribute.\n\nIf the user wishes to select a different photo, then they must use the companion\nto replace the existing selection with another.\n\nSupport multiple photos\n-----------------------\n\nUsing `PhotosConfiguration` with `configType=\"MULTIPLE\"` allows the watch face\nto display a photo from a collection, which can be cycled through either through\ntapping or automatically after so many views have taken place. \n\n \u003cPhotos change=\"ON_VISIBLE TAP\" changeAfterEvery=\"5\"\n source=\"[CONFIGURATION.photoConfig]\" defaultImageResource=\"default_image\"/\u003e\n\nThe preceding example shows the two options that are introduced when using\n`MULTIPLE`:\n\n1. The `change` attribute allows the developer to specify what events should cause the photo to cycle through the available images.\n\nIn the preceding example, both `TAP` and `ON_VISIBLE` are specified, meaning\nthat the photo changes in response *either* to a user tapping the photo *or*\nin response to the photo becoming visible.\n\n1. The `changeAfterEvery` attribute applies only to the `ON_VISIBLE` change event, specifing how many times the photo should have become visible before the photo is changed. For example, you may feel that changing the photo every time the user wakes their watch is too frequent. The default value here is 3.\n\nFor more details on working with `PhotosConfiguration`, see the samples on\nGitHub."]]