public class

MessageCenterFragment

extends Fragment
java.lang.Object
   ↳ androidx.fragment.app.Fragment
     ↳ com.urbanairship.messagecenter.MessageCenterFragment

Class Overview

The Airship Message Center. The message list will be displayed using the MessageListFragment, and messages will be displayed either in a split view using MessageFragment or by starting an activity with the action VIEW_MESSAGE_INTENT_ACTION.

Summary

Nested Classes
class MessageCenterFragment.NoMessageSelectedFragment Fragment that displays instead of a message in split view when no message has been selected. 
[Expand]
Inherited Fields
From class androidx.fragment.app.Fragment
Public Constructors
MessageCenterFragment()
Public Methods
static MessageCenterFragment newInstance(String messageId)
Creates a new MessageCenterFragment
void onCreate(Bundle savedInstanceState)
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
Subclasses can override to replace with their own layout.
void onDestroyView()
void onPause()
void onResume()
void onSaveInstanceState(Bundle savedInstanceState)
void onViewCreated(View view, Bundle savedInstanceState)
void setMessageID(String messageId)
Sets the message ID to display.
void setPredicate(Predicate<Message> predicate)
Sets the predicate to use for filtering messages.
Protected Methods
void configureMessageListFragment(MessageListFragment messageListFragment)
Called to configure the messageListFragment.
void showMessage(String messageId)
Displays a message.
void showMessageExternally(Context context, String messageId)
Called to display a message in single pane mode.
[Expand]
Inherited Methods
From class androidx.fragment.app.Fragment
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.view.View.OnCreateContextMenuListener
From interface androidx.activity.result.ActivityResultCaller
From interface androidx.lifecycle.HasDefaultViewModelProviderFactory
From interface androidx.lifecycle.LifecycleOwner
From interface androidx.lifecycle.ViewModelStoreOwner
From interface androidx.savedstate.SavedStateRegistryOwner

Public Constructors

public MessageCenterFragment ()

Public Methods

public static MessageCenterFragment newInstance (String messageId)

Creates a new MessageCenterFragment

Parameters
messageId The message's ID to display.
Returns

public void onCreate (Bundle savedInstanceState)

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

Subclasses can override to replace with their own layout. If doing so, the returned view hierarchy must must contain a place holder view with ID R.id.message_list_container.

Parameters
inflater The LayoutInflater object that can be used to inflate any views in the fragment,
container If non-null, this is the parent view that the fragment's UI should be attached to. The fragment should not add the view itself, but this can be used to generate the LayoutParams of the view.
savedInstanceState If non-null, this fragment is being re-constructed from a previous saved state as given here.
Returns
  • Return the View for the fragment's UI.

public void onDestroyView ()

public void onPause ()

public void onResume ()

public void onSaveInstanceState (Bundle savedInstanceState)

public void onViewCreated (View view, Bundle savedInstanceState)

public void setMessageID (String messageId)

Sets the message ID to display.

Parameters
messageId The message ID.

public void setPredicate (Predicate<Message> predicate)

Sets the predicate to use for filtering messages. If unset, the default @link{MessageCenter} predicate will be used.

Parameters
predicate A predicate for filtering messages.

Protected Methods

protected void configureMessageListFragment (MessageListFragment messageListFragment)

Called to configure the messageListFragment.

Parameters
messageListFragment The message list fragment.

protected void showMessage (String messageId)

Displays a message.

Parameters
messageId The message ID.

protected void showMessageExternally (Context context, String messageId)

Called to display a message in single pane mode.

Parameters
context The context.
messageId The message Id.