public class

SwipeDismissViewLayout

extends FrameLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.urbanairship.push.iam.view.SwipeDismissViewLayout

Class Overview

The SwipeDismissViewLayout allows its children to be dismissed from a horizontal swipe or drag. The layout will notify the listener when a child view is being dismissed or dragged. A dismissed view will be settled at the edge of the SwipeDismissViewLayout view. After the view is settled, it will call the listener's onDismissed(View) and be removed from the SwipeDismissViewLayout.

Summary

Nested Classes
interface SwipeDismissViewLayout.Listener Interface to listen for dismissing the message view. 
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
SwipeDismissViewLayout(Context context)
SwipeDismissViewLayout Constructor
SwipeDismissViewLayout(Context context, AttributeSet attrs)
SwipeDismissViewLayout Constructor
SwipeDismissViewLayout(Context context, AttributeSet attrs, int defStyle)
SwipeDismissViewLayout Constructor
SwipeDismissViewLayout(Context context, AttributeSet attrs, int defStyle, int defResStyle)
SwipeDismissViewLayout Constructor
Public Methods
void computeScroll()
float getMinFlingVelocity()
Gets the minimum velocity needed to initiate a fling, as measured in pixels per second.
float getXFraction()
Gets the view's x translation as a fraction of its width.
float getYFraction()
Gets the view's y translation as a fraction of its height.
boolean onInterceptTouchEvent(MotionEvent event)
boolean onTouchEvent(MotionEvent event)
void setListener(SwipeDismissViewLayout.Listener listener)
Sets the dismiss listener.
void setMinFlingVelocity(float minFlingVelocity)
Sets the minimum velocity needed to initiate a fling, as measured in pixels per second.
void setXFraction(float xFraction)
Sets the view's x translation as a fraction of its width.
void setYFraction(float yFraction)
Sets the view's y translation as a fraction of its height.
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public SwipeDismissViewLayout (Context context)

SwipeDismissViewLayout Constructor

Parameters
context A Context object used to access application assets.

public SwipeDismissViewLayout (Context context, AttributeSet attrs)

SwipeDismissViewLayout Constructor

Parameters
context A Context object used to access application assets.
attrs An AttributeSet passed to our parent.

public SwipeDismissViewLayout (Context context, AttributeSet attrs, int defStyle)

SwipeDismissViewLayout Constructor

Parameters
context A Context object used to access application assets.
attrs An AttributeSet passed to our parent.
defStyle The default style resource ID.

public SwipeDismissViewLayout (Context context, AttributeSet attrs, int defStyle, int defResStyle)

SwipeDismissViewLayout Constructor

Parameters
context A Context object used to access application assets.
attrs An AttributeSet passed to our parent.
defStyle The default style resource ID.
defResStyle A resource identifier of a style resource that supplies default values for the view, used only if defStyle is 0 or can not be found in the theme. Can be 0 to not look for defaults.

Public Methods

public void computeScroll ()

public float getMinFlingVelocity ()

Gets the minimum velocity needed to initiate a fling, as measured in pixels per second.

The default value is loaded from the ViewConfiguration.getScaledMinimumFlingVelocity().

Returns
  • The minimum fling velocity in pixels per second.

public float getXFraction ()

Gets the view's x translation as a fraction of its width.

Used to animate a view into the screen with a ObjectAnimator.

Returns
  • The view's x translation as a fraction of its width.

public float getYFraction ()

Gets the view's y translation as a fraction of its height.

Used to animate a view into the screen with a ObjectAnimator.

Returns
  • The view's y translation as a fraction of its height.

public boolean onInterceptTouchEvent (MotionEvent event)

public boolean onTouchEvent (MotionEvent event)

public void setListener (SwipeDismissViewLayout.Listener listener)

Sets the dismiss listener.

Parameters
listener The dismiss listener.

public void setMinFlingVelocity (float minFlingVelocity)

Sets the minimum velocity needed to initiate a fling, as measured in pixels per second.

The default value is loaded from the ViewConfiguration.getScaledMinimumFlingVelocity().

Parameters
minFlingVelocity The minimum fling velocity in pixels per second.

public void setXFraction (float xFraction)

Sets the view's x translation as a fraction of its width.

Used to animate a view into the screen with a ObjectAnimator.

public void setYFraction (float yFraction)

Sets the view's y translation as a fraction of its height.

Used to animate a view into the screen with a ObjectAnimator.