Package com.avaya.clientservices.collaboration.contentsharing

## Class ContentSharingRenderer<T extends android.view.View & ZoomableSharingView>

- java.lang.Object
- - com.avaya.clientservices.collaboration.contentsharing.ContentSharingRenderer<T>

- All Implemented Interfaces:
    `ContentSharingListener`

      public class ContentSharingRenderer<T extends android.view.View & ZoomableSharingView>
      extends java.lang.Object
      implements ContentSharingListener

  ContentSharingRenderer object provides views on which will be displayed the content sharing session.

  It implements the `ContentSharingListener` interface. To be notified about current content sharing session changes, it should be registered on the `ContentSharing` object using `ContentSharing.setContentSharingRenderer(ContentSharingRenderer)`. This should be done as early as possible. The best place to do that is `CollaborationListener.onCollaborationStarted(Collaboration)` callback.

  Renderer object provides two types of view for the user: zoomable view `ZoomableSharingView` and not zoomable `ImageView`. The user can decide which they want to use calling for prime `getContentSharingView(View)` and for the latter `getContentSharingView(Context)`.

  Also, it provides methods for setting pause and cursor icons `setPauseIcon(Bitmap)`, `setCursorIcon(Bitmap)`.

  See Also:
    `ZoomableSharingView`, `CollaborationListener.onCollaborationStarted(Collaboration)`, `getContentSharingView(View)`, `getContentSharingView(Context)`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static interface` | `ContentSharingRenderer.RendererPrivateListener` | Represents private listener on content sharing session events.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ContentSharingRenderer()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addListener​(ContentSharingRenderer.RendererPrivateListener listener)` | Adds a new `ContentSharingRenderer.RendererPrivateListener` listener to the renderer object.
    `android.view.View` | `getContentSharingView​(android.content.Context context)` | Creates content sharing view without zoomable functionality.
    `android.view.View` | `getContentSharingView​(ZoomableImageView sharingView)` | Deprecated.
    `android.view.View` | `getContentSharingView​(T sharingView)` | Creates zoomable version of content sharing view.
    `android.graphics.Bitmap` | `getLastImageBitmap()` | Returns last successfully processed image bitmap.
    `long` | `getRendererId()` |
    `boolean` | `isScreenSharingPaused()` | Detects if current content sharing session is paused.
    `void` | `onContentSharingEnded​(ContentSharing contentSharing)` | Reports that content sharing session has been ended either locally or remotely.
    `void` | `onContentSharingPaused​(ContentSharing contentSharing)` | Reports that content sharing session has been paused either locally or remotely.
    `void` | `onContentSharingResumed​(ContentSharing contentSharing)` | Reports that content sharing session has been resumed either locally or remotely.
    `void` | `onContentSharingStarted​(ContentSharing contentSharing, Participant participant)` | Reports that content sharing session has been started either locally or remotely
    `void` | `onCursorReceived​(ContentSharing contentSharing, Point position)` | Sends information about cursor position of the participant who shares screen.
    `void` | `onSharingFrameReceived​(ContentSharing contentSharing, Size size)` | Reports that entire content sharing frame was received from server.
    `void` | `removeListener​(ContentSharingRenderer.RendererPrivateListener listener)` | Removes a `ContentSharingRenderer.RendererPrivateListener` listener from the renderer object.
    `void` | `setCursorIcon​(android.graphics.Bitmap cursorIcon)` | Sets cursor icon which will be displayed in content sharing session.
    `void` | `setImageBitmap​(android.graphics.Bitmap bitmap)` | Sets `Bitmap` image on renderer object to be displayed on views.
    `void` | `setPauseIcon​(android.graphics.Bitmap pauseIcon)` | Sets pause icon which will be displayed in content sharing session.
    `void` | `setRendererId​(long rendererId)` |

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ContentSharingRenderer

          public ContentSharingRenderer()

  - ### Method Detail

    - #### addListener

          public void addListener​(ContentSharingRenderer.RendererPrivateListener listener)

      Adds a new `ContentSharingRenderer.RendererPrivateListener` listener to the renderer object.
      Parameters:
        `listener` - private listener object to be added.

    - #### removeListener

          public void removeListener​(ContentSharingRenderer.RendererPrivateListener listener)

      Removes a `ContentSharingRenderer.RendererPrivateListener` listener from the renderer object.
      Parameters:
        `listener` - private listener object to be removed.

    - #### onContentSharingStarted

          public void onContentSharingStarted​(ContentSharing contentSharing,
                                              Participant participant)

      Description copied from interface: `ContentSharingListener`
      Reports that content sharing session has been started either locally or remotely
      Specified by:
        `onContentSharingStarted` in interface `ContentSharingListener`
      Parameters:
        `contentSharing` - content sharing session the callback is associated with.
        `participant` - data of participant who started content sharing.

    - #### onContentSharingEnded

          public void onContentSharingEnded​(ContentSharing contentSharing)

      Description copied from interface: `ContentSharingListener`
      Reports that content sharing session has been ended either locally or remotely.
      Specified by:
        `onContentSharingEnded` in interface `ContentSharingListener`
      Parameters:
        `contentSharing` - content sharing session the callback is associated with.

    - #### onContentSharingPaused

          public void onContentSharingPaused​(ContentSharing contentSharing)

      Description copied from interface: `ContentSharingListener`
      Reports that content sharing session has been paused either locally or remotely.
      Specified by:
        `onContentSharingPaused` in interface `ContentSharingListener`
      Parameters:
        `contentSharing` - content sharing session the callback is associated with.

    - #### onContentSharingResumed

          public void onContentSharingResumed​(ContentSharing contentSharing)

      Description copied from interface: `ContentSharingListener`
      Reports that content sharing session has been resumed either locally or remotely.
      Specified by:
        `onContentSharingResumed` in interface `ContentSharingListener`
      Parameters:
        `contentSharing` - content sharing session the callback is associated with.

    - #### onCursorReceived

          public void onCursorReceived​(ContentSharing contentSharing,
                                       Point position)

      Description copied from interface: `ContentSharingListener`
      Sends information about cursor position of the participant who shares screen.
      Specified by:
        `onCursorReceived` in interface `ContentSharingListener`
      Parameters:
        `contentSharing` - content sharing object.
        `position` - cursor position.

    - #### onSharingFrameReceived

          public void onSharingFrameReceived​(ContentSharing contentSharing,
                                             Size size)

      Description copied from interface: `ContentSharingListener`
      Reports that entire content sharing frame was received from server. It indicates that the client screen sharing is ready to be shown to the user. Size parameter lets the client properly update UI with sharing size if needed.
      Specified by:
        `onSharingFrameReceived` in interface `ContentSharingListener`
      Parameters:
        `contentSharing` - content sharing object.
        `size` - size of received sharing frame.

    - #### setImageBitmap

          public void setImageBitmap​(android.graphics.Bitmap bitmap)

      Sets `Bitmap` image on renderer object to be displayed on views. Notifies private listeners about this change.
      Parameters:
        `bitmap` - image to set.

    - #### setCursorIcon

          public void setCursorIcon​(android.graphics.Bitmap cursorIcon)

      Sets cursor icon which will be displayed in content sharing session.
      Parameters:
        `cursorIcon` - cursor icon.

    - #### setPauseIcon

          public void setPauseIcon​(android.graphics.Bitmap pauseIcon)

      Sets pause icon which will be displayed in content sharing session.
      Parameters:
        `pauseIcon` - pause icon.

    - #### getLastImageBitmap

          public android.graphics.Bitmap getLastImageBitmap()

      Returns last successfully processed image bitmap.
      Returns:
        last bitmap image.

    - #### isScreenSharingPaused

          public boolean isScreenSharingPaused()

      Detects if current content sharing session is paused.
      Returns:
        true if current content sharing session is paused, otherwise false.

    - #### getContentSharingView

          public android.view.View getContentSharingView​(T sharingView)

      Creates zoomable version of content sharing view. On this view will be displayed a content sharing session with cursor and pause events.
      Parameters:
        `sharingView` - zoomable view.
      Returns:
        content sharing view.

    - #### getContentSharingView

          @Deprecated
          public android.view.View getContentSharingView​(ZoomableImageView sharingView)

      Deprecated.

    - #### getContentSharingView

          public android.view.View getContentSharingView​(android.content.Context context)

      Creates content sharing view without zoomable functionality. On this view will be displayed a content sharing session with cursor and pause events.
      Parameters:
        `context` - context.
      Returns:
        content sharing view.

    - #### getRendererId

          public long getRendererId()

    - #### setRendererId

          public void setRendererId​(long rendererId)