Custom Overlays Guide

On Android you can create a custom overlay to your users. To do this, StreamLayer has implemented an extendable SLRCustomOverlay class to add the overlay notification. The class elements are:

  1. Set the custom overlay to the list menu.
  2. @property actionId id for the navigation. Example:
  • in the ids.xml define
  • @property titleId string resource for button title
  • @property iconId id resource for button image
  • @property fullClassName full class name of the Fragment class - “io.streamlayer.demo.MainFragment”

Optionally you can add position on bottom menu or hide it from menu by making the following calls:
SLRCustomOverlay.position(Int) and SLRCustomOverlay.showOnBottomMenu(Boolean).

You can send notification through StreamLayer.addCustomOverlays() function:

StreamLayer.addCustomOverlays(arrayOf(
    SLRCustomOverlay(
        R.id.action_public_chat,
        R.string.public_chat,
        R.drawable.ic_public_chat,
        MainFragment::class.qualifiedName)
             .showOnBottomMenu(true)
             .position(3)
       )
)