@lodev09/react-native-true-sheet 3.9.0 → 3.9.1

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.
@@ -14,7 +14,6 @@ import androidx.appcompat.app.AppCompatActivity
14
14
  import androidx.coordinatorlayout.widget.CoordinatorLayout
15
15
  import androidx.core.graphics.createBitmap
16
16
  import androidx.core.view.isNotEmpty
17
- import androidx.transition.TransitionManager
18
17
  import com.facebook.react.R
19
18
  import com.facebook.react.bridge.ReadableMap
20
19
  import com.facebook.react.uimanager.JSPointerDispatcher
@@ -448,8 +447,8 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
448
447
  override fun coordinatorLayoutDidChangeConfiguration() {
449
448
  if (!isPresented) return
450
449
 
451
- sheetView?.updateGravity(animated = false)
452
- updateBehaviorMaxWidth(animated = false)
450
+ sheetView?.updateGravity()
451
+ updateBehaviorMaxWidth()
453
452
  updateStateDimensions()
454
453
  sheetView?.let { emitChangePositionDelegate(it.top, realtime = false) }
455
454
  }
@@ -1188,17 +1187,12 @@ class TrueSheetViewController(private val reactContext: ThemedReactContext) :
1188
1187
  // MARK: - Detent Helpers
1189
1188
  // =============================================================================
1190
1189
 
1191
- fun updateBehaviorMaxWidth(animated: Boolean = true) {
1190
+ fun updateBehaviorMaxWidth() {
1192
1191
  val behavior = this.behavior ?: return
1193
1192
  val applyMaxWidth = maxContentWidth != null && !ScreenUtils.isPortraitPhone(reactContext)
1194
1193
  val newMaxWidth = if (applyMaxWidth) maxContentWidth!! else DEFAULT_MAX_WIDTH.dpToPx().toInt()
1195
1194
  if (behavior.maxWidth == newMaxWidth) return
1196
1195
 
1197
- if (animated) {
1198
- sheetView?.let { view ->
1199
- (view.parent as? CoordinatorLayout)?.let { TransitionManager.beginDelayedTransition(it) }
1200
- }
1201
- }
1202
1196
  behavior.maxWidth = newMaxWidth
1203
1197
  }
1204
1198
 
@@ -14,7 +14,6 @@ import android.view.View
14
14
  import android.view.ViewOutlineProvider
15
15
  import android.widget.FrameLayout
16
16
  import androidx.coordinatorlayout.widget.CoordinatorLayout
17
- import androidx.transition.TransitionManager
18
17
  import com.facebook.react.uimanager.PixelUtil.dpToPx
19
18
  import com.facebook.react.uimanager.ThemedReactContext
20
19
  import com.google.android.material.bottomsheet.BottomSheetBehavior
@@ -125,16 +124,12 @@ class TrueSheetBottomSheetView(private val reactContext: ThemedReactContext) : F
125
124
  }
126
125
  }
127
126
 
128
- fun updateGravity(animated: Boolean = true) {
127
+ fun updateGravity() {
129
128
  val params = layoutParams as? CoordinatorLayout.LayoutParams ?: return
130
129
  val (gravity, margin) = resolveAnchor()
131
130
 
132
131
  if (params.gravity == gravity && params.marginStart == margin) return
133
132
 
134
- if (animated) {
135
- (parent as? CoordinatorLayout)?.let { TransitionManager.beginDelayedTransition(it) }
136
- }
137
-
138
133
  params.gravity = gravity
139
134
  params.marginStart = margin
140
135
  params.marginEnd = margin
@@ -71,6 +71,7 @@ static const CGFloat kDefaultGrabberTopMargin = 5.0;
71
71
  return;
72
72
  }
73
73
 
74
+ self.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
74
75
  [parentView addSubview:self];
75
76
  [self applyConfiguration];
76
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lodev09/react-native-true-sheet",
3
- "version": "3.9.0",
3
+ "version": "3.9.1",
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",