החלקה כדי לחשוף
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מאפשרים למשתמשים להחליק על רכיב כדי לחשוף פעולות נוספות.

הרכיב החלקה כדי לחשוף מאפשר להוסיף פעולות נוספות לצ'יפים ולכרטיסים, במיוחד כשהם מופיעים ברשימות. הרכיב הזה מאפשר למשתמשים לבצע משימות במהירות בלי לצאת מהמסך.
המשתמשים יכולים להחליק צ'יפים וכרטיסים חלקית שמאלה כדי לגשת לפעולות האלה, ואז להקיש על פעולה כדי להשלים אותה. המשתמשים יכולים גם להחליק צ'יפים וכרטיסים שמאלה עד הסוף כדי לבצע במהירות את הפעולה הראשית.
לרכיב יש 2 משבצות לפעולות האלה:
- ראשי
- משני (אופציונלי)
אנטומיה
פעולות שגלויות
מפתחים יכולים להתאים אישית את הפעולות לתרחישים לדוגמה הייחודיים שלהם. כדאי להביא בחשבון את הצבעים והסמלים של הפעולות האלה כדי לעזור למשתמשים להבין את המשמעות שלהן.
הפעולות שנחשפות מופיעות באותו צד בכל הלוקאלים של השפות.
- פעולה ראשית
- פעולה משנית (אופציונלי)
התחייבות לפעולה ראשית
כדי לבצע את הפעולה הראשית, המשתמש יכול להקיש על הלחצן או להמשיך להחליק שמאלה. כך הלחצן יתפרס לכל רוחב המסך ויוצג בו תווית. הפעולה תיעלם אחרי שבוחרים בה.
בדוגמה הראשונה מוצגת אפשרות של לחצן יחיד. בדוגמה השנייה מוצגת אפשרות של לחצן כפול.
ביטול הפעולה
לפעולות הרסניות, מוסיפים רכיב ביטול כדי לאפשר למשתמשים לבטל את הפעולות האלה. מוסיפים את היכולת לבטל את הפעולה הראשית.
אם הוספת צ'יפ, יופיע לחצן של צ'יפ ביטול במקום הפעולה שהתחייבת לבצע.
אחרי זמן קצר, פעולת הביטול תיעלם והמערכת משלימה את הפעולה שהתחייבו עליה.
ערכי סף להחלקה
ההתנהגות של הרכיב 'החלקה כדי לחשוף' תלויה במרחק שהמשתמש מחליק במסך:
- אם המשתמש מחליק פחות מ-50% מהמסך, הרכיב חוזר למיקום ההתחלתי שלו ולא מתבצעת פעולה כלשהי.
- אם המשתמש מחליק במסך בין 50% ל-75% מהרוחב המלא, הרכיב נשאר גלוי חלקית והפעולות שמשויכות לרכיב מופיעות.
- אם המשתמש מחליק על יותר מ-75% מהמסך, הרכיב נעלם והמערכת מבצעת את הפעולה הראשית באופן אוטומטי.
הרכיבים הבאים בסגנון Material מיישמים את ההתנהגות של החלקה כדי לחשוף:
בכרטיסים
בצילום המסך הבא מוצגת המראה של הרכיב כשמחליקים כדי לחשוף אותו, כשמשתמשים בכיתה SwipeToRevealCard
:

בצ'יפים
בצילום המסך הבא מוצגת המראה של הרכיב כשמחליקים כדי לחשוף אותו, כשמשתמשים בכיתה SwipeToRevealChip
:

דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. 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,["# Swipe to reveal\n\nAllow users to swipe a component to reveal extra actions.\n\nThe *swipe to reveal* component lets you add extra actions to\nchips and cards, specifically when they appear in lists. This component lets\nusers quickly get things done without leaving the screen.\n\nUsers can partially swipe chips and cards to the left to access these\nactions, then tap on an action to complete it. Users can also fully swipe\nchips and cards to the left to quickly commit to the primary action. \nThe component has 2 slots for these actions:\n\n1. **Primary**\n2. **Secondary (optional)**\n\nAnatomy\n-------\n\n### Revealed actions\n\nDevelopers can customize the actions for their unique use cases. Consider\nthe color and iconography used in these actions to help users understand\nwhat they mean.\n\nThe revealed actions appear on the same side for all language\nlocales.\n\n1. **Primary action**\n2. **Secondary action (optional)** \n\n### Commit to a primary action\n\nTo commit to the primary action, a user can either tap on the button or\ncontinue swiping to the left. In this way, the button extends to the entire\nwidth of the screen and displays a label. The action fades away after being\nselected.\n\nThe first example shows a **single button option** . The\nsecond example shows a **double button option**. \n\n### Undo action\n\nFor destructive actions, add an undo component to let users reverse these\nactions. Add the undo capability to the primary action.\n\nIf added, an undo chip button appears in place of the committed action.\nAfter a short period of time, the undo action fades away, and the system\ncompletes the committed action. \n\n### Swipe thresholds\n\nThe swipe to reveal component's behavior depends upon how far the user\nswipes across the screen:\n\n- If the user swipes across less than 50% of the screen, the component snaps back to its starting position, and no action is taken.\n- If the user swipes across the screen between 50% and 75% of the full width, the component remains partially visible, and the actions associated with the component appear.\n- If the user swipes across more than 75% of the screen, the component disappears, and the system automatically performs the primary action.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nRelated components\n------------------\n\nThe following material-themed components implement the swipe to reveal behavior:\n\n- [`SwipeToRevealCard`](/reference/kotlin/androidx/wear/compose/material/package-summary#SwipeToRevealCard(androidx.wear.compose.material.SwipeToRevealAction,androidx.wear.compose.foundation.RevealState,androidx.compose.ui.Modifier,androidx.wear.compose.material.SwipeToRevealAction,androidx.wear.compose.material.SwipeToRevealAction,androidx.wear.compose.material.SwipeToRevealAction,androidx.wear.compose.material.SwipeToRevealActionColors,androidx.compose.ui.graphics.Shape,kotlin.Function0))\n- [`SwipeToRevealChip`](/reference/kotlin/androidx/wear/compose/material/package-summary#SwipeToRevealChip(androidx.wear.compose.material.SwipeToRevealAction,androidx.wear.compose.foundation.RevealState,androidx.compose.ui.Modifier,androidx.wear.compose.material.SwipeToRevealAction,androidx.wear.compose.material.SwipeToRevealAction,androidx.wear.compose.material.SwipeToRevealAction,androidx.wear.compose.material.SwipeToRevealActionColors,androidx.compose.ui.graphics.Shape,kotlin.Function0))\n\n### On cards\n\nThe following screenshots show the swipe to reveal component's appearance when\nusing the `SwipeToRevealCard` class:\n\n### On chips\n\nThe following screenshots show the swipe to reveal component's appearance when\nusing the `SwipeToRevealChip` class:"]]