קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בדיקה
יש כמה כלים שיעזרו לכם לבדוק במהירות את התוכן מבחינת נגישות:
Android Accessibility Suite: כולל את תפריט הנגישות, 'הקראה', 'גישה באמצעות מתג' ו-TalkBack, שמספקים תובנות לגבי האופן שבו הסמנטיקה של האפליקציה פועלת למשתמשים בטכנולוגיות האלה. מומלץ מאוד לבדוק את האתר באמצעות טכנולוגיות העזרה של Android, כי זו הדרך הטובה ביותר להבין איך המשתמשים שלכם עם צרכים של נגישות יחוו את האתר.
Layout Inspector: מאפשר לבדוק ולתקן באגים בסמינטיקה של כל רכיב, ולזהות מידע חסר או שגוי.
אפליקציית Accessibility Scanner: סורקת את המסך ומציגה הצעות לשיפור הנגישות שלו על ידי זיהוי של כמה מלכודות נפוצות.
ניפוי באגים
בין Compose, מערכת הסמנטיקה ושירותי הנגישות של Android, יכול להיות שתתקלו בהתנהגויות לא צפויות שקשורות לנגישות שקשה לעקוב אחריהן.
מאפיינים סמנטיים יכולים לעזור לכם להבין למה הרכיבים מתנהגים בצורה מסוימת.
אתם יכולים לנפות באגים בבעיות שקשורות להתנהגות הנגישות באמצעות כלי לבדיקת הפריסה ב-Android Studio, באמצעות TreeDebug בהגדרות למפתחים של TalkBack או באמצעות printToLog של ComposeTestRule. כל הכלים האלה יכולים לספק מידע על צמתים (ועל המאפיינים שלהם) שנחשפים לשירותי נגישות על ידי Compose.
בדוגמה הבאה נעשה שימוש בכלי לבדיקת הפריסה כדי לנפות באגים במסך עם שלושה רכיבים, כאשר כששירותי הנגישות מופעלים, הרכיב הראשון לא נבחר, ולרכיב השני אין משוב על פעולה שמשויכת אליו. אפשר לבדוק את המאפיינים הסמנטיים כדי למצוא בעיות פוטנציאליות.
עץ הרכיבים בכלי לבדיקת הפריסה מכיל מידע על גבולות, פרמטרים ומידע סמנטי אחר שמשויך לאלמנט. בעץ, כל שלושת הרכיבים מזוהים:
איור 2. כלי לבדיקת פריסות עם כל שלושת הרכיבים.
המאפיין hideFromAccessibility מיושם על הרכיב הראשון. המשמעות היא שהאלמנט עשוי להיות מסומן כמוסתר במקום כלשהו בעץ הסמנטיקה, או שהוא מוסתר על ידי שכבת-על דקורטיבית כלשהי.
איור 3. כלי לבדיקת פריסות: הרכיב הראשון עם hideFromAccessibility.
לרכיב השני יש מאפיין focus, אבל אין לו onClick כמו לרכיב הקודם. לכן, יכול להיות שחסרה פונקציית שינוי מסוג clickable במקום כלשהו, ולכן שירות נגישות כמו TalkBack לא מודיע למשתמש על אות פעולה כלשהו:
איור 4. כלי לבדיקת פריסות: הרכיב השני עם focused.
לרכיב הטקסט השלישי יש את כל המאפיינים הנדרשים – אפשר להתמקד בו, יש לו onClick ונוספו לו סמנטיקה נוספת – ולכן הוא מפורש כצפוי.
איור 5. Layout Inspector: הרכיב השלישי עם כל ממשקי ה-API.
כך תוכלו להשתמש בכלי לניפוי באגים כדי לבדוק למה שירותי הנגישות לא מבצעים הודעות או בחירות מסוימות.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[[["התוכן קל להבנה","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 (שעון UTC)."],[],[],null,["# Inspect and debug\n\nInspect\n-------\n\nSeveral tools can help you quickly inspect your content from an accessibility\npoint of view:\n\n- [Android Accessibility Suite](https://play.google.com/store/apps/details?id=com.google.android.marvin.talkback): Includes Accessibility Menu, Select to Speak, Switch Access, and TalkBack, which provide insight into how your app's semantics work for users of these technologies. Testing with Android's assistive technologies is highly recommended as the best way to understand what your users with accessibility needs will experience.\n- [Layout Inspector](/develop/ui/compose/tooling/debug#layout_inspector): Lets you inspect and debug semantics of each composable, and helps identify any missing or incorrect information.\n- [Accessibility Scanner](https://support.google.com/accessibility/android/answer/6376570) app: Scans your screen and provides suggestions to improve its accessibility by identifying some common pitfalls.\n\nDebug\n-----\n\nBetween Compose, the semantics system, and Android accessibility services, you\nmight run into unexpected accessibility behaviors that are difficult to trace.\nSemantic properties can help you understand why your components are behaving\nthe way that they are.\n\nYou can debug accessibility behavior issues with the [Layout Inspector](/develop/ui/compose/tooling/debug#layout_inspector) in\nAndroid Studio, TreeDebug in TalkBack developer settings, or `ComposeTestRule`'s\n[`printToLog`](/reference/kotlin/androidx/compose/ui/test/package-summary#(androidx.compose.ui.test.SemanticsNodeInteraction).printToLog(kotlin.String,kotlin.Int)). All of these tools can provide information about nodes\n(and their properties) that are exposed to accessibility services by Compose.\n\nThe following example uses Layout Inspector to debug a screen with three\nelements where, with accessibility services on, the first one isn't being\nselected, and the second one doesn't have any action feedback associated with\nit. You can examine the semantic properties to find potential issues.\n\nThe component tree in Layout Inspector contains information about an element's\nbounds, parameters, and other semantic information associated with it. In the\ntree, all three elements are recognized:\n**Figure 2.** Layout Inspector with all three elements..\n\nThe first element has the `hideFromAccessibility` property applied. This\nindicates that the element may be marked as hidden somewhere in the semantics\ntree, or it is obscured by some decorative overlay.\n**Figure 3.** Layout Inspector: first element with `hideFromAccessibility`.\n\nThe second element has a focus property, but no `onClick` like the previous\nelement. Therefore, it might be missing a `clickable` modifier somewhere, which\nis why an accessibility service like TalkBack may not be announcing some\naction signal to the user:\n**Figure 4.** Layout Inspector: second element with `focused`.\n\nThe third text element has all the necessary properties---it is focusable, has\nan `onClick`, and other additional semantics applied---which is why it's\ninterpreted as expected.\n**Figure 5.** Layout Inspector: third element with all APIs.\n\nIn this way, you can use debugging tools to investigate why certain\nannouncements or selections aren't performed by accessibility services.\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [Accessibility in Compose](/develop/ui/compose/tooling/debug#layout_inspector)\n- \\[Material Design 2 in Compose\\]\\[19\\]\n- [Testing your Compose layout](https://support.google.com/accessibility/android/answer/6376570)"]]