Interface IPluginModule

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Drawable obtainDrawable(Context context) Gets the plugin icon.
      abstract String obtainTitle(Context context) Gets the plugin title.
      abstract void onClick(Fragment currentFragment, RongExtension extension, int index) Called when the plugin is clicked.
      abstract void onActivityResult(int requestCode, int resultCode, Intent data) Returns data results when the activity finishes.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • obtainDrawable

         abstract Drawable obtainDrawable(Context context)

        Gets the plugin icon.

        Parameters:
        context - Context.
        Returns:

        The icon Drawable.

      • obtainTitle

         abstract String obtainTitle(Context context)

        Gets the plugin title.

        Parameters:
        context - Context.
        Returns:

        The title string.

      • onClick

         abstract void onClick(Fragment currentFragment, RongExtension extension, int index)

        Called when the plugin is clicked. 1. If data from the Extension is needed, call the corresponding Extension methods to obtain it. 2. If a new activity needs to be started after clicking, use startActivityForResult or startActivityForPluginResult.

        Note: Do not hold long-lived references to the fragment or extension object, as this will cause memory leaks.

        Parameters:
        currentFragment - The fragment associated with the plugin.
        extension - The RongExtension object.
        index - The index of the plugin in the plugin panel.
      • onActivityResult

         abstract void onActivityResult(int requestCode, int resultCode, Intent data)

        Returns data results when the activity finishes.

        In onClick, you may start a new activity in two ways:

        1. Using startActivityForResult — you need to handle the result in the corresponding Activity's Activity#onActivityResult(int, int, Intent).

        2. Using startActivityForPluginResult — after ChannelFragment receives Activity#onActivityResult(int, int, Intent), you must call onActivityPluginResult so that RongExtension can return the data result through IPluginModule's onActivityResult method.

        Parameters:
        requestCode - The request code used when starting the activity; will not exceed 255.
        resultCode - The result code returned when the activity finishes.
        data - The returned data.