public class

BannerDismissLayout

extends FrameLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.urbanairship.iam.banner.BannerDismissLayout

Class Overview

The BannerDismissLayout allows dismissing a banner with a vertical swipe gesture.

Summary

Nested Classes
interface BannerDismissLayout.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
BannerDismissLayout(Context context, AttributeSet attrs)
BannerDismissLayout Constructor
BannerDismissLayout(Context context, AttributeSet attrs, int defStyle)
BannerDismissLayout Constructor
BannerDismissLayout(Context context, AttributeSet attrs, int defStyle, int defResStyle)
BannerDismissLayout 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(BannerDismissLayout.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 setPlacement(String placement)
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 BannerDismissLayout (Context context, AttributeSet attrs)

BannerDismissLayout Constructor

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

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

BannerDismissLayout Constructor

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

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

BannerDismissLayout Constructor

Parameters
context A Context object used to access application assets.
attrs An AttributeSet passed to the 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 cannot 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 (BannerDismissLayout.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 setPlacement (String placement)

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.