@lodev09/react-native-true-sheet 3.1.0-beta.3 → 3.1.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -467,7 +467,7 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
467
467
  */
468
468
  fun hideDialog() {
469
469
  isDialogVisible = false
470
- dialog?.window?.decorView?.visibility = View.INVISIBLE
470
+ dialog?.window?.decorView?.visibility = INVISIBLE
471
471
 
472
472
  // Emit off-screen position (detent = 0 since sheet is fully hidden)
473
473
  emitChangePositionDelegate(screenHeight, realtime = false)
@@ -479,7 +479,7 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
479
479
  */
480
480
  fun showDialog() {
481
481
  isDialogVisible = true
482
- dialog?.window?.decorView?.visibility = View.VISIBLE
482
+ dialog?.window?.decorView?.visibility = VISIBLE
483
483
 
484
484
  // Emit current position
485
485
  val positionPx = bottomSheetView?.let { ScreenUtils.getScreenY(it) } ?: screenHeight
@@ -564,12 +564,14 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
564
564
  1 -> {
565
565
  setPeekHeight(getDetentHeight(detents[0]), isPresented)
566
566
  expandedOffset = screenHeight - peekHeight
567
- isFitToContents = true
567
+ isFitToContents = expandedOffset == 0
568
568
  }
569
569
 
570
570
  2 -> {
571
571
  setPeekHeight(getDetentHeight(detents[0]), isPresented)
572
+ halfExpandedRatio = minOf(getDetentHeight(detents[1]).toFloat() / screenHeight.toFloat(), 0.9f)
572
573
  expandedOffset = screenHeight - getDetentHeight(detents[1])
574
+ isFitToContents = expandedOffset == 0
573
575
  }
574
576
 
575
577
  3 -> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lodev09/react-native-true-sheet",
3
- "version": "3.1.0-beta.3",
3
+ "version": "3.1.0-beta.4",
4
4
  "description": "The true native bottom sheet experience for your React Native Apps.",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/module/index.js",