diff --git a/patches/@haileyok+bluesky-video+0.2.4.patch b/patches/@haileyok+bluesky-video+0.2.4.patch new file mode 100644 index 000000000..fd23a7510 --- /dev/null +++ b/patches/@haileyok+bluesky-video+0.2.4.patch @@ -0,0 +1,98 @@ +diff --git a/node_modules/@haileyok/bluesky-video/android/src/main/java/expo/modules/blueskyvideo/FullscreenActivity.kt b/node_modules/@haileyok/bluesky-video/android/src/main/java/expo/modules/blueskyvideo/FullscreenActivity.kt +index d4f83cc..b5f8461 100644 +--- a/node_modules/@haileyok/bluesky-video/android/src/main/java/expo/modules/blueskyvideo/FullscreenActivity.kt ++++ b/node_modules/@haileyok/bluesky-video/android/src/main/java/expo/modules/blueskyvideo/FullscreenActivity.kt +@@ -1,10 +1,15 @@ + package expo.modules.blueskyvideo + + import android.graphics.Color ++import android.os.Build + import android.os.Bundle ++import android.view.View + import android.view.ViewGroup ++import android.view.WindowInsets + import android.view.WindowManager + import androidx.appcompat.app.AppCompatActivity ++import androidx.core.view.ViewCompat ++import androidx.core.view.WindowCompat + import androidx.media3.common.util.UnstableApi + import androidx.media3.ui.PlayerView + import java.lang.ref.WeakReference +@@ -25,40 +30,49 @@ class FullscreenActivity : AppCompatActivity() { + return + } + +- this.window.setFlags( +- WindowManager.LayoutParams.FLAG_FULLSCREEN, +- WindowManager.LayoutParams.FLAG_FULLSCREEN, +- ) ++ // Enable edge-to-edge mode but keep navigation bar persistent ++ WindowCompat.setDecorFitsSystemWindows(window, false) + +- val keepDisplayOn = this.getIntent().getBooleanExtra("keepDisplayOn", false) +- +- if (keepDisplayOn) { +- this.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) ++ val playerView = PlayerView(this).apply { ++ setBackgroundColor(Color.BLACK) ++ setShowSubtitleButton(true) ++ setShowNextButton(false) ++ setShowPreviousButton(false) ++ setFullscreenButtonClickListener { ++ finish() ++ } ++ layoutParams = ViewGroup.LayoutParams( ++ ViewGroup.LayoutParams.MATCH_PARENT, ++ ViewGroup.LayoutParams.MATCH_PARENT ++ ) ++ useController = true ++ controllerAutoShow = false ++ controllerHideOnTouch = true + } ++ playerView.player = player ++ setContentView(playerView) + +- // Update the player viewz +- val playerView = +- PlayerView(this).apply { +- setBackgroundColor(Color.BLACK) +- setShowSubtitleButton(true) +- setShowNextButton(false) +- setShowPreviousButton(false) +- setFullscreenButtonClickListener { +- finish() +- } ++ // Adjust layout for system insets to accommodate persistent nav bar ++ ViewCompat.setOnApplyWindowInsetsListener(playerView) { view, insets -> ++ val systemBarsInsets = insets.getInsets(WindowInsets.Type.systemBars()) ++ view.setPadding(0, systemBarsInsets.top, 0, systemBarsInsets.bottom) ++ insets ++ } + +- layoutParams = +- ViewGroup.LayoutParams( +- ViewGroup.LayoutParams.MATCH_PARENT, +- ViewGroup.LayoutParams.MATCH_PARENT, +- ) +- useController = true +- controllerAutoShow = false +- controllerHideOnTouch = true ++ // Prevent hiding of the navigation bar ++ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { ++ window.insetsController?.let { ++ it.systemBarsBehavior = android.view.WindowInsetsController.BEHAVIOR_DEFAULT + } +- playerView.player = player ++ } else { ++ @Suppress("DEPRECATION") ++ window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN) ++ } + +- setContentView(playerView) ++ val keepDisplayOn = this.intent.getBooleanExtra("keepDisplayOn", false) ++ if (keepDisplayOn) { ++ this.window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON) ++ } + } + + override fun onDestroy() {