public class

InAppMessageFragment

extends Fragment
java.lang.Object
   ↳ android.app.Fragment
     ↳ com.urbanairship.push.iam.InAppMessageFragment

Class Overview

A fragment that displays an in-app message.

Summary

Nested Classes
interface InAppMessageFragment.Listener Listener for InAppMessageFragment events. 
Constants
long DEFAULT_DURATION Default duration in milliseconds.
[Expand]
Inherited Constants
From interface android.content.ComponentCallbacks2
Public Constructors
InAppMessageFragment()
Public Methods
final void addListener(InAppMessageFragment.Listener listener)
Subscribe a listener for in-app message fragment events.
static Bundle createArgs(InAppMessage message, int dismissAnimation)
Creates arguments for the InAppMessageFragment.
void dismiss(boolean animate)
Dismisses the fragment.
int getDismissAnimation()
Gets the dismiss animation resource ID.
InAppMessage getMessage()
Gets the in-app message.
boolean isDismissed()
Checks if the fragment has been dismissed.
void onCreate(Bundle savedInstance)
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void onPause()
void onResume()
void onSaveInstanceState(Bundle outState)
final void removeListener(InAppMessageFragment.Listener listener)
Unsubscribe a listener for in-app message fragment events.
[Expand]
Inherited Methods
From class android.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.content.ComponentCallbacks2
From interface android.view.View.OnCreateContextMenuListener

Constants

public static final long DEFAULT_DURATION

Default duration in milliseconds. The value is only used if the in-app message's getDuration() returns null.

Constant Value: 15000 (0x0000000000003a98)

Public Constructors

public InAppMessageFragment ()

Public Methods

public final void addListener (InAppMessageFragment.Listener listener)

Subscribe a listener for in-app message fragment events.

Parameters
listener An object implementing the InAppMessageFragment.Listener interface.

public static Bundle createArgs (InAppMessage message, int dismissAnimation)

Creates arguments for the InAppMessageFragment. Arguments must be set after creating the initial fragment.

Parameters
message The associated in-app message.
dismissAnimation Resource ID of a fragment transition to run when the message is dismissed.
Returns
  • A bundle with the given arguments for creating the InAppMessageFragment.

public void dismiss (boolean animate)

Dismisses the fragment.

Parameters
animate true if the fragment should animate out, otherwise false.

public int getDismissAnimation ()

Gets the dismiss animation resource ID.

Returns
  • The dismiss animation resource ID.

public InAppMessage getMessage ()

Gets the in-app message.

Returns
  • The in-app message.

public boolean isDismissed ()

Checks if the fragment has been dismissed.

Returns
  • true if the fragment is dismissed, otherwise false.

public void onCreate (Bundle savedInstance)

public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

public void onPause ()

public void onResume ()

public void onSaveInstanceState (Bundle outState)

public final void removeListener (InAppMessageFragment.Listener listener)

Unsubscribe a listener for in-app message fragment events.

Parameters
listener An object implementing the InAppMessageFragment.Listener interface.