Launch Button Visibility
Control Launch Button visibility in the StreamLayer Android SDK. Set SLRAppHost.isLaunchButtonEnabled to show or hide the button when displaying player controls or other UI elements.
Launch Button Visibility
Depending on your application, you may want to hide or show the Launch Button. For example, you may want to hide the Launch Button when your app is displaying player controls.
Runtime UI options live on the SLRAppHost interface, which you reach through the withStreamLayerUI extension on your FragmentActivity. Set isLaunchButtonEnabled to toggle visibility:
import androidx.appcompat.app.AppCompatActivity
import io.streamlayer.sdk.StreamLayer.withStreamLayerUI
class PlayerActivity : AppCompatActivity() {
private fun onPlayerControlsShown() {
withStreamLayerUI { isLaunchButtonEnabled = false }
}
private fun onPlayerControlsHidden() {
withStreamLayerUI { isLaunchButtonEnabled = true }
}
}The Launch Button is hidden while your controls are on screen and restored when they are dismissed. The default is true.
Call it from the Activity, not the Application
withStreamLayerUIresolvesSLRAppHostfrom theStreamLayerFragmentalready added to the activity'ssupportFragmentManager. Calling it before the fragment is attached silently does nothing.
Related
- Integration Guide — Complete SDK setup instructions
- UI Options Guide — Comprehensive
SLRAppHostconfiguration reference
Updated about 1 month ago
