Stay organized with collections
Save and categorize content based on your preferences.
SwipeDismissFrameLayout.Callback
public
static
abstract
class
SwipeDismissFrameLayout.Callback
extends Object
java.lang.Object
|
↳ |
android.support.wearable.view.SwipeDismissFrameLayout.Callback
|
This class is deprecated.
use the androidx.wear.widget.SwipeDismissFrameLayout
provided by the Jetpack Wear library instead.
Implement this callback to act on particular stages of the dismissal.
Summary
Public methods |
void
|
onDismissed(SwipeDismissFrameLayout layout)
Notifies listeners the dismissal is complete and the view now off screen.
|
boolean
|
onPreSwipeStart(float xDown, float yDown)
Notifies listeners that the view is now considering to start a dismiss gesture from a
particular point on the screen.
|
void
|
onSwipeCancelled()
Notifies listeners that the swipe gesture has ended without a dismissal.
|
void
|
onSwipeStart()
Notifies listeners that the view is now being dragged as part of a dismiss gesture.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
Callback
public Callback ()
Public methods
onDismissed
public void onDismissed (SwipeDismissFrameLayout layout)
Notifies listeners the dismissal is complete and the view now off screen.
Parameters |
layout |
SwipeDismissFrameLayout |
onPreSwipeStart
public boolean onPreSwipeStart (float xDown,
float yDown)
Notifies listeners that the view is now considering to start a dismiss gesture from a
particular point on the screen. The default implementation returns true for all coordinates
so that is is possible to start a swipe-to-dismiss gesture from any location. If any one
instance of this Callback returns false for a given set of coordinates, swipe-to-dismiss will
not be allowed to start in that point.
Returns |
boolean |
true if this gesture should be recognized as a swipe to dismiss gesture, false
otherwise.
|
onSwipeCancelled
public void onSwipeCancelled ()
Notifies listeners that the swipe gesture has ended without a dismissal.
onSwipeStart
public void onSwipeStart ()
Notifies listeners that the view is now being dragged as part of a dismiss gesture.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# SwipeDismissFrameLayout.Callback\n\nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nSwipeDismissFrameLayout.Callback\n================================\n\n\n`\npublic\nstatic\n\nabstract\nclass\nSwipeDismissFrameLayout.Callback\n`\n\n\n`\n\nextends `[Object](http://developer.android.com/reference/java/lang/Object.html)`\n\n\n`\n\n`\n\n\n`\n\n|---|----------------------------------------------------------------|\n| [java.lang.Object](http://developer.android.com/reference/java/lang/Object.html) ||\n| ↳ | android.support.wearable.view.SwipeDismissFrameLayout.Callback |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\n**This class is deprecated.** \n\nuse the `androidx.wear.widget.SwipeDismissFrameLayout` provided by the [Jetpack Wear](../../../../../jetpack/androidx/releases/wear) library instead.\n\nImplement this callback to act on particular stages of the dismissal.\n\nSummary\n-------\n\n| ### Public constructors ||\n|-----------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[Callback](../../../../../reference/android/support/wearable/view/SwipeDismissFrameLayout.Callback.html#Callback())`() ` |\n\n| ### Public methods ||\n|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void` | ` `[onDismissed](../../../../../reference/android/support/wearable/view/SwipeDismissFrameLayout.Callback.html#onDismissed(android.support.wearable.view.SwipeDismissFrameLayout))`(`[SwipeDismissFrameLayout](../../../../../reference/android/support/wearable/view/SwipeDismissFrameLayout.html)` layout) ` Notifies listeners the dismissal is complete and the view now off screen. |\n| ` boolean` | ` `[onPreSwipeStart](../../../../../reference/android/support/wearable/view/SwipeDismissFrameLayout.Callback.html#onPreSwipeStart(float,%20float))`(float xDown, float yDown) ` Notifies listeners that the view is now considering to start a dismiss gesture from a particular point on the screen. |\n| ` void` | ` `[onSwipeCancelled](../../../../../reference/android/support/wearable/view/SwipeDismissFrameLayout.Callback.html#onSwipeCancelled())`() ` Notifies listeners that the swipe gesture has ended without a dismissal. |\n| ` void` | ` `[onSwipeStart](../../../../../reference/android/support/wearable/view/SwipeDismissFrameLayout.Callback.html#onSwipeStart())`() ` Notifies listeners that the view is now being dragged as part of a dismiss gesture. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](http://developer.android.com/reference/java/lang/Object.html)` ` |------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------| | ` `[Object](http://developer.android.com/reference/java/lang/Object.html) | ` clone() ` | | ` boolean` | ` equals(`[Object](http://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void` | ` finalize() ` | | ` final `[Class](http://developer.android.com/reference/java/lang/Class.html)`\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` `[String](http://developer.android.com/reference/java/lang/String.html) | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic constructors\n-------------------\n\n### Callback\n\n```\npublic Callback ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### onDismissed\n\n```\npublic void onDismissed (SwipeDismissFrameLayout layout)\n```\n\nNotifies listeners the dismissal is complete and the view now off screen.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|----------------------------------|\n| `layout` | `SwipeDismissFrameLayout` \u003cbr /\u003e |\n\n### onPreSwipeStart\n\n```\npublic boolean onPreSwipeStart (float xDown, \n float yDown)\n```\n\nNotifies listeners that the view is now considering to start a dismiss gesture from a\nparticular point on the screen. The default implementation returns true for all coordinates\nso that is is possible to start a swipe-to-dismiss gesture from any location. If any one\ninstance of this Callback returns false for a given set of coordinates, swipe-to-dismiss will\nnot be allowed to start in that point.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `xDown` | `float`: The x coordinate of the initial [MotionEvent.ACTION_DOWN](http://developer.android.com/reference/android/view/MotionEvent.html#ACTION_DOWN) event for this motion. \u003cbr /\u003e |\n| `yDown` | `float`: The y coordinate of the initial [MotionEvent.ACTION_DOWN](http://developer.android.com/reference/android/view/MotionEvent.html#ACTION_DOWN) event for this motion. \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------------------------------------------------------------------------------------------------|\n| `boolean` | true if this gesture should be recognized as a swipe to dismiss gesture, false otherwise. \u003cbr /\u003e |\n\n### onSwipeCancelled\n\n```\npublic void onSwipeCancelled ()\n```\n\nNotifies listeners that the swipe gesture has ended without a dismissal.\n\n\u003cbr /\u003e\n\n### onSwipeStart\n\n```\npublic void onSwipeStart ()\n```\n\nNotifies listeners that the view is now being dragged as part of a dismiss gesture.\n\n\u003cbr /\u003e"]]