השירות מספק לוגיקה להשוואה להפעלה מותנית של המראה, האנימציה וטיפול באירועים של אלמנטים צאצאים.
הוצגה ב-Wear OS 4.
תחביר
<Condition> <!-- The "Expressions" element is required. --> <Expressions> <Expression name="unique-name"> <!-- Arithmetic expression goes here. --> </Expression> <!-- Other expressions go here. --> </Expressions> <!-- The "expression" attribute is required. --> <Compare expression="expression-name"> <!-- ONE of the following only: --> <Group ... /> <PartText ... /> <PartImage ... /> <PartAnimatedImage ... /> <PartDraw ... /> <Condition ... /> <AnalogClock ... /> <DigitalClock ... /> </Compare> <!-- The "else" case for when all of the above "Compar e" conditions are false. --> <Default> <!-- ONE of the following only: --> <Group ... /> <PartText ... /> <PartImage ... /> <PartAnimatedImage ... /> <PartDraw ... /> <Condition ... /> <AnalogClock ... /> <DigitalClock ... /> </Default> </Condition>
רכיבים פנימיים
הרכיב Condition
מכיל את הרכיבים הפנימיים הבאים:
Expressions
מגדיר קבוצה של רכיבי
Expression
, לכל אחד מהם יש מאפייןname
והם מכילים ביטוי אריתמטי. הערך שלname
חייב להיות ייחודי ברכיבCondition
שמכיל אותו.רכיב
Condition
חייב להכיל לפחות רכיבExpressions
אחד.Compare
מכיל עץ אלמנטים יחיד שגלוי, נע ומגיב לאירועים רק אם הביטוי עם השם הנתון מקבל את הערך
true
או ערך שאינו אפס. המאפייןname
חייב להתאים למאפייןname
של רכיבExpression
שמופיע במקום אחר ברכיבCondition
.Default
מכיל עץ רכיבים יחיד שגלוי, נע ומגיב לאירועים רק כשאף אחת מקבוצות הרכיבים
Compare
לא מופעלת.
מומלץ עבורך
- הערה: טקסט הקישור מוצג כש-JavaScript מושבת
- AGSL Quick Reference
- הגדרת נתונים באמצעות ישויות של חדרים
- קישור נתונים ב-Android