Class ChannelFragment

  • All Implemented Interfaces:
    ai.nexconn.chatui.widget.adapter.IViewProviderListener , ai.nexconn.chatui.widget.pullrefresh.listener.OnLoadMoreListener , ai.nexconn.chatui.widget.pullrefresh.listener.OnRefreshListener , android.content.ComponentCallbacks , android.view.View.OnClickListener , android.view.View.OnCreateContextMenuListener , androidx.activity.result.ActivityResultCaller , androidx.lifecycle.HasDefaultViewModelProviderFactory , androidx.lifecycle.LifecycleOwner , androidx.lifecycle.ViewModelStoreOwner , androidx.savedstate.SavedStateRegistryOwner

    
    public class ChannelFragment
    extends Fragment implements OnRefreshListener, View.OnClickListener, OnLoadMoreListener, IViewProviderListener<T>
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      void initConversation(String targetId, ChannelType channelType, Bundle bundle)
      void onViewClick(int clickType, UiMessage data)
      boolean onViewLongClick(View view, int clickType, UiMessage data)
      boolean onViewLongClick(int clickType, UiMessage data)
      List<MessageLongClickItem> onSetupLongClickItems() Builds the list of long-press menu items.
      LinearLayout getNotificationContainer() Returns the top notification bar container.
      void hideNotificationView(View notificationView) Hides the notification view previously shown by showNotificationView.
      void showNotificationView(View notificationView) Displays a view in the notification area.
      boolean onBackPressed()
      void onRefresh(@NonNull() RefreshLayout refreshLayout)
      NCExtension getNCExtension()
      void onActivityResult(int requestCode, int resultCode, @Nullable() Intent data)
      void onRequestPermissionsResult(int requestCode, @NonNull() Array<String> permissions, @NonNull() Array<int> grantResults)
      View onCreateView(@NonNull() LayoutInflater inflater, @Nullable() ViewGroup container, @Nullable() Bundle savedInstanceState) Find views by ID and bindlisteners.
      void onViewCreated(@NonNull() View view, @Nullable() Bundle savedInstanceState)
      void onResume()
      void onPause()
      void onStart()
      void onStop()
      void onDestroyView()
      void onClick(View v)
      void onLoadMore(@NonNull() RefreshLayout refreshLayout)
      void onWarningDialog(String msg) Warning dialog, e.g.
      void noMoreMessageToFetch() Called when message fetching completes and there are no more messages to fetch.
      MessageListAdapter onResolveAdapter() Returns the adapter.
      void addHeaderView(View view)
      void addFooterView(View view)
      void setEmptyView(View view)
      void setEmptyView(@LayoutRes() int emptyId)
      • Methods inherited from class androidx.fragment.app.Fragment

        dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hasOptionsMenu, hashCode, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreate, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onSaveInstanceState, onViewStateRestored, postponeEnterTransition, 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, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
      • Methods inherited from class androidx.lifecycle.HasDefaultViewModelProviderFactory

        getDefaultViewModelCreationExtras
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChannelFragment

        ChannelFragment()
    • Method Detail

      • onViewClick

         void onViewClick(int clickType, UiMessage data)
        Parameters:
        clickType - identifier to distinguish click events
        data - the data source
      • onViewLongClick

         boolean onViewLongClick(View view, int clickType, UiMessage data)
        Parameters:
        view - the view that triggered the long press
        clickType - identifier to distinguish click events
        data - the data source
      • onViewLongClick

         boolean onViewLongClick(int clickType, UiMessage data)
        Parameters:
        clickType - identifier to distinguish click events
        data - the data source
      • onSetupLongClickItems

         List<MessageLongClickItem> onSetupLongClickItems()

        Builds the list of long-press menu items. The List order determines menu display order.

        Subclasses can:

        // a) Add/remove items on top of the defaults
        List<MessageLongClickItem> items = super.onSetupLongClickItems();
        items.add(new MyItem());
        return items;
        
        // b) Fully customize
        List<MessageLongClickItem> items = new ArrayList<>();
        items.add(new MessageLongClickCopyItem());
        return items;
        
      • getNotificationContainer

         LinearLayout getNotificationContainer()

        Returns the top notification bar container.

        Returns:

        the notification container

      • hideNotificationView

         void hideNotificationView(View notificationView)

        Hides the notification view previously shown by showNotificationView.

        Parameters:
        notificationView - the notification view to hide
      • showNotificationView

         void showNotificationView(View notificationView)

        Displays a view in the notification area.

      • onActivityResult

         void onActivityResult(int requestCode, int resultCode, @Nullable() Intent data)
      • onCreateView

        @Nullable() View onCreateView(@NonNull() LayoutInflater inflater, @Nullable() ViewGroup container, @Nullable() Bundle savedInstanceState)

        Find views by ID and bindlisteners.

      • onViewCreated

         void onViewCreated(@NonNull() View view, @Nullable() Bundle savedInstanceState)
      • onWarningDialog

         void onWarningDialog(String msg)

        Warning dialog, e.g. "Failed to join chatroom". To customize: 1. Create a subclass of ChannelFragment. 2. Override onWarningDialog.

        Parameters:
        msg - the dialog message
      • noMoreMessageToFetch

         void noMoreMessageToFetch()

        Called when message fetching completes and there are no more messages to fetch.

        Since:

        5.8.2

      • addHeaderView

         void addHeaderView(View view)
        Parameters:
        view - custom list header view
      • addFooterView

         void addFooterView(View view)
        Parameters:
        view - custom list footer view
      • setEmptyView

         void setEmptyView(View view)
        Parameters:
        view - custom empty-state view for the list
      • setEmptyView

         void setEmptyView(@LayoutRes() int emptyId)
        Parameters:
        emptyId - layout resource ID for the custom empty-state view