Class MessageListFragment
-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks,android.view.View.OnCreateContextMenuListener,androidx.activity.result.ActivityResultCaller,androidx.lifecycle.HasDefaultViewModelProviderFactory,androidx.lifecycle.LifecycleOwner,androidx.lifecycle.ViewModelStoreOwner,androidx.savedstate.SavedStateRegistryOwner
public class MessageListFragment extends Fragment
Self-contained chat screen which internally contains the following components:
MessageListHeaderView - displays the navigation icon, the channel information and the channel image
MessageListView - shows a list of paginated messages, with threads, replies, quotes, reactions and deleted messages
MessageComposerView - allows the user to send new messages as well as pick and choose attachments to send
Note: Fragments representing self-contained screens are easy to use. They allow you to explore the SDK's features in a breeze, however, they offer limited customization.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceMessageListFragment.BackPressListenerClick listener for the navigation button in the header. Finishes Activity by default.
Note: Implement the click listener in parent Fragment or Activity to override the default behavior.
public final classMessageListFragment.BuilderCreates instances of MessageListFragment.
-
Field Summary
Fields Modifier and Type Field Description public final StringmPreviousWhoprivate final Lifecyclelifecycleprivate final ViewModelStoreviewModelStoreprivate final CreationExtrasdefaultViewModelCreationExtrasprivate final ViewModelProvider.FactorydefaultViewModelProviderFactoryprivate final SavedStateRegistrysavedStateRegistry
-
Constructor Summary
Constructors Constructor Description MessageListFragment()
-
Method Summary
Modifier and Type Method Description UnitonAttach(Context context)ViewonCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)UnitonViewCreated(View view, Bundle savedInstanceState)UnitonDestroyView()UnitonDetach()final static MessageListFragmentnewInstance(String cid, Function1<MessageListFragment.Builder, Unit> initializer)Creates instances of MessageListFragment. final static MessageListFragmentnewInstance(String cid)Creates instances of MessageListFragment. -
Methods inherited from class androidx.fragment.app.Fragment
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getDefaultViewModelCreationExtras, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hasOptionsMenu, hashCode, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, onSaveInstanceState, onStart, onStop, onViewStateRestored, postponeEnterTransition, postponeEnterTransition, registerForActivityResult, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
onCreateView
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
-
onViewCreated
Unit onViewCreated(View view, Bundle savedInstanceState)
-
onDestroyView
Unit onDestroyView()
-
newInstance
@JvmOverloads() final static MessageListFragment newInstance(String cid, Function1<MessageListFragment.Builder, Unit> initializer)
Creates instances of MessageListFragment.
- Parameters:
cid- The full channel id.initializer- The initializer to customize builder params.
-
newInstance
@JvmOverloads() final static MessageListFragment newInstance(String cid)
Creates instances of MessageListFragment.
- Parameters:
cid- The full channel id.
-
-
-
-