Class SystemUiDelegate

java.lang.Object
com.jwplayer.pub.api.fullscreen.delegates.SystemUiDelegate

public class SystemUiDelegate extends Object
Responsible for hiding and showing the System UI (Status Bar, Navigation Bar, etc.) during fullscreen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected View
    DecorView for the current Activity.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SystemUiDelegate(Activity activity, Lifecycle lifecycle, Handler handler, View decorView)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doSystemUiVisibility(boolean fullscreen)
    Handle System UI changes.
    void
    onStateChanged(LifecycleOwner source, Lifecycle.Event event)
     
    void
    setFullscreen(boolean fullscreen)
     
    void
    setUseFullscreenLayoutFlags(boolean useFullscreenLayoutFlags)
    Determines whether View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN and View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION flags are used during fullscreen.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mDecorView

      protected View mDecorView
      DecorView for the current Activity.
  • Constructor Details

    • SystemUiDelegate

      public SystemUiDelegate(Activity activity, Lifecycle lifecycle, Handler handler, View decorView)
  • Method Details

    • setFullscreen

      public void setFullscreen(boolean fullscreen)
    • onStateChanged

      public void onStateChanged(LifecycleOwner source, Lifecycle.Event event)
    • setUseFullscreenLayoutFlags

      public void setUseFullscreenLayoutFlags(boolean useFullscreenLayoutFlags)
      Determines whether View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN and View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION flags are used during fullscreen.

      These flags create an issue on Android 4.1, 4.2, and 4.3 devices when using the SupportActionBar, set this to false to disable using these flags.

    • doSystemUiVisibility

      protected void doSystemUiVisibility(boolean fullscreen)
      Handle System UI changes.

      Default behavior is to hide the system UI when fullscreen == true and show it when fullscreen == false.

      Parameters:
      fullscreen - True when entering fullscreen.