Class SystemUiDelegate
java.lang.Object
com.jwplayer.pub.api.fullscreen.delegates.SystemUiDelegate
- All Implemented Interfaces:
androidx.lifecycle.LifecycleEventObserver,androidx.lifecycle.LifecycleObserver
Responsible for hiding and showing the System UI (Status Bar, Navigation Bar, etc.) during fullscreen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected android.view.ViewDecorView for the current Activity. -
Constructor Summary
ConstructorsConstructorDescriptionSystemUiDelegate(android.app.Activity activity, androidx.lifecycle.Lifecycle lifecycle, android.os.Handler handler, android.view.View decorView) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoSystemUiVisibility(boolean fullscreen) Handle System UI changes.voidonStateChanged(androidx.lifecycle.LifecycleOwner source, androidx.lifecycle.Lifecycle.Event event) voidsetFullscreen(boolean fullscreen) voidsetUseFullscreenLayoutFlags(boolean useFullscreenLayoutFlags) Determines whether View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN and View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION flags are used during fullscreen.
-
Field Details
-
mDecorView
protected android.view.View mDecorViewDecorView for the current Activity.
-
-
Constructor Details
-
SystemUiDelegate
public SystemUiDelegate(android.app.Activity activity, androidx.lifecycle.Lifecycle lifecycle, android.os.Handler handler, android.view.View decorView)
-
-
Method Details
-
setFullscreen
public void setFullscreen(boolean fullscreen) -
onStateChanged
public void onStateChanged(@NonNull androidx.lifecycle.LifecycleOwner source, @NonNull androidx.lifecycle.Lifecycle.Event event) - Specified by:
onStateChangedin interfaceandroidx.lifecycle.LifecycleEventObserver
-
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.
-