@lodev09/react-native-true-sheet 0.6.0 → 0.8.0

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.
Files changed (37) hide show
  1. package/README.md +37 -20
  2. package/android/src/main/java/com/lodev09/truesheet/{core/TrueSheetBehavior.kt → TrueSheetBehavior.kt} +69 -40
  3. package/android/src/main/java/com/lodev09/truesheet/TrueSheetDialog.kt +84 -0
  4. package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +87 -61
  5. package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +5 -0
  6. package/android/src/main/java/com/lodev09/truesheet/core/Events.kt +1 -0
  7. package/android/src/main/java/com/lodev09/truesheet/core/KeyboardManager.kt +53 -0
  8. package/android/src/main/java/com/lodev09/truesheet/core/RootViewGroup.kt +1 -1
  9. package/android/src/main/java/com/lodev09/truesheet/core/Utils.kt +5 -37
  10. package/ios/Extensions/UIView+pinTo.swift +54 -10
  11. package/ios/TrueSheetView.swift +106 -56
  12. package/ios/TrueSheetViewController.swift +46 -36
  13. package/ios/TrueSheetViewManager.m +1 -0
  14. package/lib/commonjs/TrueSheet.js +11 -7
  15. package/lib/commonjs/TrueSheet.js.map +1 -1
  16. package/lib/commonjs/TrueSheetGrabber.js +56 -0
  17. package/lib/commonjs/TrueSheetGrabber.js.map +1 -0
  18. package/lib/commonjs/index.js +11 -0
  19. package/lib/commonjs/index.js.map +1 -1
  20. package/lib/module/TrueSheet.js +11 -7
  21. package/lib/module/TrueSheet.js.map +1 -1
  22. package/lib/module/TrueSheetGrabber.js +48 -0
  23. package/lib/module/TrueSheetGrabber.js.map +1 -0
  24. package/lib/module/index.js +1 -0
  25. package/lib/module/index.js.map +1 -1
  26. package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
  27. package/lib/typescript/src/TrueSheetGrabber.d.ts +31 -0
  28. package/lib/typescript/src/TrueSheetGrabber.d.ts.map +1 -0
  29. package/lib/typescript/src/index.d.ts +1 -0
  30. package/lib/typescript/src/index.d.ts.map +1 -1
  31. package/lib/typescript/src/types.d.ts +8 -0
  32. package/lib/typescript/src/types.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. package/src/TrueSheet.tsx +9 -7
  35. package/src/TrueSheetGrabber.tsx +74 -0
  36. package/src/index.ts +1 -0
  37. package/src/types.ts +9 -0
@@ -0,0 +1,53 @@
1
+ package com.lodev09.truesheet.core
2
+
3
+ import android.content.Context
4
+ import android.view.View
5
+ import android.view.ViewTreeObserver.OnGlobalLayoutListener
6
+ import android.view.inputmethod.InputMethodManager
7
+ import com.facebook.react.bridge.ReactContext
8
+
9
+ class KeyboardManager(reactContext: ReactContext) {
10
+ interface OnKeyboardListener {
11
+ fun onKeyboardStateChange(isVisible: Boolean)
12
+ }
13
+
14
+ private var screenView: View? = Utils.activityView(reactContext)
15
+ private var onGlobalLayoutListener: OnGlobalLayoutListener? = null
16
+ private var isKeyboardVisible = false
17
+
18
+ fun registerKeyboardListener(listener: OnKeyboardListener?) {
19
+ screenView?.apply {
20
+ unregisterKeyboardListener()
21
+
22
+ onGlobalLayoutListener = object : OnGlobalLayoutListener {
23
+ private var previousHeight = 0
24
+
25
+ override fun onGlobalLayout() {
26
+ val heightDiff = rootView.height - height
27
+ if (heightDiff > Utils.toPixel(200.0)) {
28
+ // Will ask InputMethodManager.isAcceptingText() to detect if keyboard appeared or not.
29
+ val inputManager = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
30
+ if (height != previousHeight && inputManager.isAcceptingText()) {
31
+ listener?.onKeyboardStateChange(true)
32
+
33
+ previousHeight = height
34
+ isKeyboardVisible = true
35
+ }
36
+ } else if (isKeyboardVisible) {
37
+ listener?.onKeyboardStateChange(false)
38
+ previousHeight = 0
39
+ isKeyboardVisible = false
40
+ }
41
+ }
42
+ }
43
+
44
+ getViewTreeObserver().addOnGlobalLayoutListener(onGlobalLayoutListener)
45
+ }
46
+ }
47
+
48
+ fun unregisterKeyboardListener() {
49
+ onGlobalLayoutListener?.let {
50
+ screenView?.getViewTreeObserver()?.removeOnGlobalLayoutListener(onGlobalLayoutListener)
51
+ }
52
+ }
53
+ }
@@ -26,7 +26,7 @@ import com.facebook.react.views.view.ReactViewGroup
26
26
  * styleHeight on the LayoutShadowNode to be the window size. This is done through the
27
27
  * UIManagerModule, and will then cause the children to layout as if they can fill the window.
28
28
  */
29
- internal class RootViewGroup(context: Context?) :
29
+ class RootViewGroup(context: Context?) :
30
30
  ReactViewGroup(context),
31
31
  RootView {
32
32
  private var hasAdjustedSize = false
@@ -1,46 +1,14 @@
1
1
  package com.lodev09.truesheet.core
2
2
 
3
- import android.annotation.SuppressLint
4
- import android.content.Context
5
- import android.graphics.Point
6
- import android.view.WindowManager
7
- import com.facebook.infer.annotation.Assertions
3
+ import android.view.View
8
4
  import com.facebook.react.bridge.Promise
5
+ import com.facebook.react.bridge.ReactContext
9
6
  import com.facebook.react.uimanager.PixelUtil
10
7
 
11
8
  object Utils {
12
- @SuppressLint("DiscouragedApi", "InternalInsetResource")
13
- fun maxSize(context: Context): Point {
14
- val minPoint = Point()
15
- val maxPoint = Point()
16
- val sizePoint = Point()
17
-
18
- val wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
19
- val display = Assertions.assertNotNull(wm).defaultDisplay
20
- // getCurrentSizeRange will return the min and max width and height that the window can be
21
- display.getCurrentSizeRange(minPoint, maxPoint)
22
- // getSize will return the dimensions of the screen in its current orientation
23
- display.getSize(sizePoint)
24
- val attrs = intArrayOf(android.R.attr.windowFullscreen)
25
- val theme = context.theme
26
- val ta = theme.obtainStyledAttributes(attrs)
27
- val windowFullscreen = ta.getBoolean(0, false)
28
-
29
- // We need to add the status bar height to the height if we have a fullscreen window,
30
- // because Display.getCurrentSizeRange doesn't include it.
31
- val resources = context.resources
32
- val statusBarId = resources.getIdentifier("status_bar_height", "dimen", "android")
33
- var statusBarHeight = 0
34
- if (windowFullscreen && statusBarId > 0) {
35
- statusBarHeight = resources.getDimension(statusBarId).toInt()
36
- }
37
- return if (sizePoint.x < sizePoint.y) {
38
- // If we are vertical the width value comes from min width and height comes from max height
39
- Point(minPoint.x, maxPoint.y + statusBarHeight)
40
- } else {
41
- // If we are horizontal the width value comes from max width and height comes from min height
42
- Point(maxPoint.x, minPoint.y + statusBarHeight)
43
- }
9
+ fun activityView(reactContext: ReactContext): View? {
10
+ val activity = reactContext.currentActivity ?: return null
11
+ return activity.findViewById(android.R.id.content)
44
12
  }
45
13
 
46
14
  fun toDIP(value: Int): Float = PixelUtil.toDIPFromPixel(value.toFloat())
@@ -6,20 +6,64 @@
6
6
  // LICENSE file in the root directory of this source tree.
7
7
  //
8
8
 
9
+ // MARK: - Constraints
10
+
11
+ struct Constraints {
12
+ var top: NSLayoutConstraint?
13
+ var bottom: NSLayoutConstraint?
14
+ var left: NSLayoutConstraint?
15
+ var right: NSLayoutConstraint?
16
+ var height: NSLayoutConstraint?
17
+ }
18
+
9
19
  extension UIView {
10
- func pinTo(view: UIView, from edges: UIRectEdge = .all, with height: CGFloat? = nil) {
11
- var constraints: [NSLayoutConstraint] = []
20
+ /// Pin a view to the given view.
21
+ /// Optionally accepts a completion handler for the resulting constraints
22
+ func pinTo(
23
+ view: UIView,
24
+ from edges: UIRectEdge = .all,
25
+ with height: CGFloat? = nil,
26
+ constraints: ((Constraints) -> Void)?
27
+ ) {
28
+ translatesAutoresizingMaskIntoConstraints = false
12
29
 
13
- if edges.contains(.top) { constraints.append(topAnchor.constraint(equalTo: view.topAnchor)) }
14
- if edges.contains(.bottom) { constraints.append(bottomAnchor.constraint(equalTo: view.bottomAnchor)) }
15
- if edges.contains(.left) { constraints.append(leadingAnchor.constraint(equalTo: view.leadingAnchor)) }
16
- if edges.contains(.right) { constraints.append(trailingAnchor.constraint(equalTo: view.trailingAnchor)) }
30
+ var topConstraint: NSLayoutConstraint?
31
+ var bottomConstraint: NSLayoutConstraint?
32
+ var leftConstraint: NSLayoutConstraint?
33
+ var rightConstraint: NSLayoutConstraint?
34
+ var heightConstraint: NSLayoutConstraint?
17
35
 
18
- if let height { constraints.append(heightAnchor.constraint(equalToConstant: height)) }
36
+ if edges.contains(.top) {
37
+ topConstraint = topAnchor.constraint(equalTo: view.topAnchor)
38
+ topConstraint?.isActive = true
39
+ }
40
+
41
+ if edges.contains(.bottom) {
42
+ bottomConstraint = bottomAnchor.constraint(equalTo: view.bottomAnchor)
43
+ bottomConstraint?.isActive = true
44
+ }
19
45
 
20
- if !constraints.isEmpty {
21
- translatesAutoresizingMaskIntoConstraints = false
22
- NSLayoutConstraint.activate(constraints)
46
+ if edges.contains(.left) {
47
+ leftConstraint = leadingAnchor.constraint(equalTo: view.leadingAnchor)
48
+ leftConstraint?.isActive = true
23
49
  }
50
+
51
+ if edges.contains(.right) {
52
+ rightConstraint = trailingAnchor.constraint(equalTo: view.trailingAnchor)
53
+ rightConstraint?.isActive = true
54
+ }
55
+
56
+ if let height {
57
+ heightConstraint = heightAnchor.constraint(equalToConstant: height)
58
+ heightConstraint?.isActive = true
59
+ }
60
+
61
+ constraints?(Constraints(
62
+ top: topConstraint,
63
+ bottom: bottomConstraint,
64
+ left: leftConstraint,
65
+ right: rightConstraint,
66
+ height: heightConstraint
67
+ ))
24
68
  }
25
69
  }
@@ -31,6 +31,13 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
31
31
 
32
32
  private var contentView: UIView?
33
33
  private var footerView: UIView?
34
+
35
+ // Reference the bottom constraint to adjust during keyboard event
36
+ private var footerViewBottomConstraint: NSLayoutConstraint?
37
+
38
+ // Reference height constraint during content updates
39
+ private var footerViewHeightConstraint: NSLayoutConstraint?
40
+
34
41
  private var rctScrollView: RCTScrollView?
35
42
 
36
43
  // Content height minus the footer height for `auto` layout
@@ -109,15 +116,43 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
109
116
  contentView = containerView.subviews[0]
110
117
  footerView = containerView.subviews[1]
111
118
 
112
- containerView.pinTo(view: viewController.view)
119
+ containerView.pinTo(view: viewController.view, constraints: nil)
120
+
121
+ // Set footer constraints
122
+ if let footerView {
123
+ footerView.pinTo(view: viewController.view, from: [.left, .right, .bottom], with: 0) { constraints in
124
+ self.footerViewBottomConstraint = constraints.bottom
125
+ self.footerViewHeightConstraint = constraints.height
126
+ }
127
+ }
113
128
 
114
- // Setup content constraints
129
+ // Update content containers
115
130
  setupContent()
116
131
  }
117
132
  }
118
133
 
119
134
  // MARK: - ViewController delegate
120
135
 
136
+ func viewControllerKeyboardWillHide() {
137
+ guard let footerViewBottomConstraint else { return }
138
+
139
+ footerViewBottomConstraint.constant = 0
140
+
141
+ UIView.animate(withDuration: 0.3) {
142
+ self.viewController.view.layoutIfNeeded()
143
+ }
144
+ }
145
+
146
+ func viewControllerKeyboardWillShow(_ keyboardHeight: CGFloat) {
147
+ guard let footerViewBottomConstraint else { return }
148
+
149
+ footerViewBottomConstraint.constant = -keyboardHeight
150
+
151
+ UIView.animate(withDuration: 0.3) {
152
+ self.viewController.view.layoutIfNeeded()
153
+ }
154
+ }
155
+
121
156
  func viewControllerDidChangeWidth(_ width: CGFloat) {
122
157
  guard let containerView else { return }
123
158
 
@@ -147,8 +182,17 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
147
182
  }
148
183
  }
149
184
 
185
+ func invalidate() {
186
+ viewController.dismiss(animated: true)
187
+ }
188
+
150
189
  // MARK: - Prop setters
151
190
 
191
+ @objc
192
+ func setDismissible(_ dismissible: Bool) {
193
+ viewController.isModalInPresentation = !dismissible
194
+ }
195
+
152
196
  @objc
153
197
  func setMaxHeight(_ height: NSNumber) {
154
198
  viewController.maxHeight = CGFloat(height.floatValue)
@@ -172,18 +216,28 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
172
216
  }
173
217
 
174
218
  @objc
175
- func setGrabber(_ visible: Bool) {
176
- viewController.grabber = visible
219
+ func setCornerRadius(_ radius: NSNumber?) {
220
+ var cornerRadius: CGFloat?
221
+ if let radius {
222
+ cornerRadius = CGFloat(radius.floatValue)
223
+ }
224
+
225
+ viewController.cornerRadius = cornerRadius
226
+ if #available(iOS 15.0, *) {
227
+ configureSheetIfPresented { sheet in
228
+ sheet.preferredCornerRadius = viewController.cornerRadius
229
+ }
230
+ }
177
231
  }
178
232
 
179
233
  @objc
180
- func setCornerRadius(_ radius: NSNumber?) {
181
- guard let radius else {
182
- viewController.cornerRadius = nil
183
- return
234
+ func setGrabber(_ visible: Bool) {
235
+ viewController.grabber = visible
236
+ if #available(iOS 15.0, *) {
237
+ configureSheetIfPresented { sheet in
238
+ sheet.prefersGrabberVisible = visible
239
+ }
184
240
  }
185
-
186
- viewController.cornerRadius = CGFloat(radius.floatValue)
187
241
  }
188
242
 
189
243
  @objc
@@ -192,10 +246,6 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
192
246
  rctScrollView = view
193
247
  }
194
248
 
195
- func invalidate() {
196
- viewController.dismiss(animated: true)
197
- }
198
-
199
249
  // MARK: - Methods
200
250
 
201
251
  private func sizeInfoData(from sizeInfo: SizeInfo?) -> [String: Any] {
@@ -206,20 +256,20 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
206
256
  return ["index": sizeInfo.index, "value": sizeInfo.value]
207
257
  }
208
258
 
209
- func configureSheetIfPresented() {
210
- // Resize sheet
211
- if #available(iOS 15.0, *), isPresented {
212
- viewController.configureSheet(at: activeIndex ?? 0, with: contentHeight, nil)
259
+ /// Use to customize some properties of the Sheet
260
+ @available(iOS 15.0, *)
261
+ func configureSheetIfPresented(completion: (UISheetPresentationController) -> Void) {
262
+ guard isPresented, let sheet = viewController.sheetPresentationController else {
263
+ return
213
264
  }
265
+
266
+ completion(sheet)
214
267
  }
215
268
 
216
- func dismiss(promise: Promise) {
269
+ /// Full reconfiguration of the Sheet
270
+ func configureSheetIfPresented() {
217
271
  if isPresented {
218
- viewController.dismiss(animated: true) {
219
- promise.resolve(nil)
220
- }
221
- } else {
222
- promise.resolve(nil)
272
+ viewController.configureSheet(at: activeIndex ?? 0, with: contentHeight, nil)
223
273
  }
224
274
  }
225
275
 
@@ -228,26 +278,35 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
228
278
 
229
279
  // Add constraints to fix weirdness and support ScrollView
230
280
  if let rctScrollView {
231
- contentView.pinTo(view: containerView)
232
- rctScrollView.pinTo(view: contentView)
281
+ contentView.pinTo(view: containerView, constraints: nil)
282
+ rctScrollView.pinTo(view: contentView, constraints: nil)
233
283
  }
234
284
 
235
- // Pin footer at the bottom
236
- if let footerView {
285
+ if let footerView, let footerViewHeightConstraint {
237
286
  if let footerContent = footerView.subviews.first {
238
287
  containerView.bringSubviewToFront(footerView)
239
- footerView.pinTo(
240
- view: viewController.view,
241
- from: [.bottom, .left, .right],
242
- with: footerContent.bounds.height
243
- )
288
+ footerViewHeightConstraint.constant = footerContent.bounds.height
244
289
  } else {
245
290
  containerView.sendSubviewToBack(footerView)
246
- footerView.removeConstraints(footerView.constraints)
291
+ footerViewHeightConstraint.constant = 0
247
292
  }
248
293
  }
249
294
  }
250
295
 
296
+ func dismiss(promise: Promise) {
297
+ guard isPresented else {
298
+ promise.resolve(nil)
299
+ return
300
+ }
301
+
302
+ // Dismiss the keyboard
303
+ contentView?.endEditing(true)
304
+
305
+ viewController.dismiss(animated: true) {
306
+ promise.resolve(nil)
307
+ }
308
+ }
309
+
251
310
  func present(at index: Int, promise: Promise) {
252
311
  let rvc = reactViewController()
253
312
 
@@ -261,31 +320,22 @@ class TrueSheetView: UIView, RCTInvalidating, TrueSheetViewControllerDelegate {
261
320
  return
262
321
  }
263
322
 
264
- if #available(iOS 15.0, *) {
265
- viewController.configureSheet(at: index, with: contentHeight) {
266
- if self.isPresented, let sizeInfo = self.viewController.selectedSizeInfo {
267
- self.viewControllerSheetDidChangeSize(sizeInfo)
268
- }
269
- }
270
- }
271
-
272
- if isPresented {
273
- promise.resolve(nil)
274
- } else {
275
- // Keep track of the active index
276
- activeIndex = index
277
-
278
- rvc.present(viewController, animated: true) {
279
- self.isPresented = true
323
+ viewController.configureSheet(at: index, with: contentHeight) { sizeInfo in
324
+ // Trigger onSizeChange event when size is changed while presenting
325
+ if self.isPresented {
326
+ self.viewControllerSheetDidChangeSize(sizeInfo)
327
+ promise.resolve(nil)
328
+ } else {
329
+ // Keep track of the active index
330
+ self.activeIndex = index
280
331
 
281
- var data = ["index": 0, "value": 0.0]
332
+ rvc.present(self.viewController, animated: true) {
333
+ self.isPresented = true
282
334
 
283
- if #available(iOS 15.0, *), let sizeInfo = self.viewController.selectedSizeInfo {
284
- data = self.sizeInfoData(from: sizeInfo)
335
+ let data = self.sizeInfoData(from: sizeInfo)
336
+ self.onPresent?(data)
337
+ promise.resolve(nil)
285
338
  }
286
-
287
- self.onPresent?(data)
288
- promise.resolve(nil)
289
339
  }
290
340
  }
291
341
  }
@@ -20,6 +20,8 @@ protocol TrueSheetViewControllerDelegate: AnyObject {
20
20
  func viewControllerDidDismiss()
21
21
  func viewControllerSheetDidChangeSize(_ sizeInfo: SizeInfo)
22
22
  func viewControllerWillAppear()
23
+ func viewControllerKeyboardWillShow(_ keyboardHeight: CGFloat)
24
+ func viewControllerKeyboardWillHide()
23
25
  }
24
26
 
25
27
  // MARK: - TrueSheetViewController
@@ -35,36 +37,8 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
35
37
 
36
38
  var sizes: [Any] = ["medium", "large"]
37
39
  var maxHeight: CGFloat?
38
-
39
- var cornerRadius: CGFloat? {
40
- didSet {
41
- if #available(iOS 15.0, *) {
42
- sheet?.preferredCornerRadius = cornerRadius
43
- }
44
- }
45
- }
46
-
47
- var grabber = true {
48
- didSet {
49
- if #available(iOS 15.0, *) {
50
- sheet?.prefersGrabberVisible = grabber
51
- }
52
- }
53
- }
54
-
55
- @available(iOS 15.0, *)
56
- var sheet: UISheetPresentationController? {
57
- return sheetPresentationController
58
- }
59
-
60
- @available(iOS 15.0, *)
61
- var selectedSizeInfo: SizeInfo? {
62
- guard let rawValue = sheet?.selectedDetentIdentifier?.rawValue else {
63
- return nil
64
- }
65
-
66
- return detentValues[rawValue]
67
- }
40
+ var cornerRadius: CGFloat?
41
+ var grabber = true
68
42
 
69
43
  // MARK: - Setup
70
44
 
@@ -80,6 +54,10 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
80
54
  view.insertSubview(blurView, at: 0)
81
55
  }
82
56
 
57
+ deinit {
58
+ NotificationCenter.default.removeObserver(self)
59
+ }
60
+
83
61
  @available(*, unavailable)
84
62
  required init?(coder _: NSCoder) {
85
63
  fatalError("init(coder:) has not been implemented")
@@ -93,6 +71,36 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
93
71
  }
94
72
  }
95
73
 
74
+ override func viewDidLoad() {
75
+ super.viewDidLoad()
76
+
77
+ NotificationCenter.default.addObserver(
78
+ self, selector: #selector(keyboardWillShow(_:)),
79
+ name: UIResponder.keyboardWillShowNotification,
80
+ object: nil
81
+ )
82
+
83
+ NotificationCenter.default.addObserver(
84
+ self, selector: #selector(keyboardWillHide(_:)),
85
+ name: UIResponder.keyboardWillHideNotification,
86
+ object: nil
87
+ )
88
+ }
89
+
90
+ @objc
91
+ private func keyboardWillShow(_ notification: Notification) {
92
+ guard let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue else {
93
+ return
94
+ }
95
+
96
+ delegate?.viewControllerKeyboardWillShow(keyboardSize.height)
97
+ }
98
+
99
+ @objc
100
+ private func keyboardWillHide(_: Notification) {
101
+ delegate?.viewControllerKeyboardWillHide()
102
+ }
103
+
96
104
  override func viewWillAppear(_ animated: Bool) {
97
105
  super.viewWillAppear(animated)
98
106
  delegate?.viewControllerWillAppear()
@@ -115,10 +123,13 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
115
123
  }
116
124
 
117
125
  /// Prepares the view controller for sheet presentation
118
- /// Do nothing on IOS 14 and below... sad
119
- @available(iOS 15.0, *)
120
- func configureSheet(at index: Int = 0, with contentHeight: CGFloat, _ completion: (() -> Void)?) {
121
- guard let sheet else { return }
126
+ func configureSheet(at index: Int = 0, with contentHeight: CGFloat, _ completion: ((SizeInfo) -> Void)?) {
127
+ let defaultSizeInfo = SizeInfo(index: index, value: view.bounds.height)
128
+
129
+ guard #available(iOS 15.0, *), let sheet = sheetPresentationController else {
130
+ completion?(defaultSizeInfo)
131
+ return
132
+ }
122
133
 
123
134
  detentValues = [:]
124
135
 
@@ -136,7 +147,6 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
136
147
  sheet.prefersEdgeAttachedInCompactHeight = true
137
148
  sheet.prefersGrabberVisible = grabber
138
149
  sheet.preferredCornerRadius = cornerRadius
139
-
140
150
  sheet.delegate = self
141
151
 
142
152
  var identifier: UISheetPresentationController.Detent.Identifier = .medium
@@ -152,7 +162,7 @@ class TrueSheetViewController: UIViewController, UISheetPresentationControllerDe
152
162
 
153
163
  sheet.animateChanges {
154
164
  sheet.selectedDetentIdentifier = identifier
155
- completion?()
165
+ completion?(self.detentValues[identifier.rawValue] ?? defaultSizeInfo)
156
166
  }
157
167
  }
158
168
  }
@@ -34,5 +34,6 @@ RCT_EXPORT_VIEW_PROPERTY(sizes, NSArray)
34
34
  RCT_EXPORT_VIEW_PROPERTY(blurTint, NSString)
35
35
  RCT_EXPORT_VIEW_PROPERTY(cornerRadius, NSNumber)
36
36
  RCT_EXPORT_VIEW_PROPERTY(grabber, BOOL)
37
+ RCT_EXPORT_VIEW_PROPERTY(dismissible, BOOL)
37
38
 
38
39
  @end
@@ -7,6 +7,7 @@ exports.TrueSheet = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _TrueSheetModule = require("./TrueSheetModule");
10
+ var _TrueSheetGrabber = require("./TrueSheetGrabber");
10
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
12
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
13
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -88,10 +89,11 @@ class TrueSheet extends _react.PureComponent {
88
89
  render() {
89
90
  const {
90
91
  sizes,
91
- backgroundColor,
92
+ backgroundColor = 'white',
93
+ grabber = true,
94
+ dismissible = true,
92
95
  blurTint,
93
96
  cornerRadius,
94
- grabber,
95
97
  maxHeight,
96
98
  FooterComponent,
97
99
  style,
@@ -99,7 +101,6 @@ class TrueSheet extends _react.PureComponent {
99
101
  children,
100
102
  ...rest
101
103
  } = this.props;
102
- const wrapperBackgroundColor = backgroundColor ?? 'white';
103
104
  return /*#__PURE__*/_react.default.createElement(TrueSheetNativeView, {
104
105
  ref: this.ref,
105
106
  style: $nativeSheet,
@@ -107,7 +108,8 @@ class TrueSheet extends _react.PureComponent {
107
108
  sizes: sizes ?? ['medium', 'large'],
108
109
  blurTint: blurTint,
109
110
  cornerRadius: cornerRadius,
110
- grabber: grabber ?? true,
111
+ grabber: grabber,
112
+ dismissible: dismissible,
111
113
  maxHeight: maxHeight,
112
114
  onPresent: this.onPresent,
113
115
  onDismiss: this.onDismiss,
@@ -123,8 +125,8 @@ class TrueSheet extends _react.PureComponent {
123
125
  borderTopRightRadius: cornerRadius,
124
126
  // Remove backgroundColor if `blurTint` is set on iOS
125
127
  backgroundColor: _reactNative.Platform.select({
126
- ios: blurTint ? undefined : wrapperBackgroundColor,
127
- android: wrapperBackgroundColor
128
+ ios: blurTint ? undefined : backgroundColor,
129
+ android: backgroundColor
128
130
  })
129
131
  }, style]
130
132
  }, rest), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
@@ -132,7 +134,9 @@ class TrueSheet extends _react.PureComponent {
132
134
  style: contentContainerStyle
133
135
  }, children), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
134
136
  collapsable: false
135
- }, !!FooterComponent && /*#__PURE__*/_react.default.createElement(FooterComponent, null))));
137
+ }, !!FooterComponent && /*#__PURE__*/_react.default.createElement(FooterComponent, null)), _reactNative.Platform.OS === 'android' && /*#__PURE__*/_react.default.createElement(_TrueSheetGrabber.TrueSheetGrabber, {
138
+ visible: grabber
139
+ })));
136
140
  }
137
141
  }
138
142
  exports.TrueSheet = TrueSheet;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_TrueSheetModule","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","LINKING_ERROR","Platform","select","ios","ComponentName","TrueSheetNativeView","requireNativeComponent","Error","TrueSheet","PureComponent","displayName","constructor","props","ref","createRef","onDismiss","onPresent","onSizeChange","state","scrollableHandle","handle","nodeHandle","findNodeHandle","current","updateState","scrollRef","setState","event","nativeEvent","componentDidMount","sizes","console","warn","componentDidUpdate","present","index","TrueSheetModule","resize","dismiss","render","backgroundColor","blurTint","cornerRadius","grabber","maxHeight","FooterComponent","style","contentContainerStyle","children","rest","wrapperBackgroundColor","createElement","$nativeSheet","View","collapsable","overflow","undefined","android","borderTopLeftRadius","borderTopRightRadius","exports","position","left","zIndex"],"sourceRoot":"../../src","sources":["T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EAAEtD,qBAAQ,CAACC,MAAM,CAAC;UAAEC,GAAG,EAAEqD,SAAS;UAAEC,OAAO,EAAE;QAAS,CAAC,CAAC;QAChEC,mBAAmB,EAAEhB,YAAY;QACjCiB,oBAAoB,EAAEjB,YAAY;QAElC;QACAF,eAAe,EAAEvC,qBAAQ,CAACC,MAAM,CAAC;UAC/BC,GAAG,EAAEsC,QAAQ,GAAGe,SAAS,GAAGN,sBAAsB;UAClDO,OAAO,EAAEP;QACX,CAAC;MACH,CAAC,EACDJ,KAAK;IACL,GACEG,IAAI,gBAERpF,MAAA,CAAAW,OAAA,CAAA2E,aAAA,CAACnF,YAAA,CAAAqF,IAAI;MAACC,WAAW,EAAE,KAAM;MAACR,KAAK,EAAEC;IAAsB,GACpDC,QACG,CAAC,eACPnF,MAAA,CAAAW,OAAA,CAAA2E,aAAA,CAACnF,YAAA,CAAAqF,IAAI;MAACC,WAAW,EAAE;IAAM,GAAE,CAAC,CAACT,eAAe,iBAAIhF,MAAA,CAAAW,OAAA,CAAA2E,aAAA,CAACN,eAAe,MAAE,CAAQ,CACtE,CACa,CAAC;EAE1B;AACF;AAACe,OAAA,CAAApD,SAAA,GAAAA,SAAA;AAED,MAAM4C,YAAuB,GAAG;EAC9BS,QAAQ,EAAE,UAAU;EACpBC,IAAI,EAAE,CAAC,IAAI;EACXC,MAAM,EAAE,CAAC;AACX,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_TrueSheetModule","_TrueSheetGrabber","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","LINKING_ERROR","Platform","select","ios","ComponentName","TrueSheetNativeView","requireNativeComponent","Error","TrueSheet","PureComponent","displayName","constructor","props","ref","createRef","onDismiss","onPresent","onSizeChange","state","scrollableHandle","handle","nodeHandle","findNodeHandle","current","updateState","scrollRef","setState","event","nativeEvent","componentDidMount","sizes","console","warn","componentDidUpdate","present","index","TrueSheetModule","resize","dismiss","render","backgroundColor","grabber","dismissible","blurTint","cornerRadius","maxHeight","FooterComponent","style","contentContainerStyle","children","rest","createElement","$nativeSheet","View","collapsable","overflow","undefined","android","borderTopLeftRadius","borderTopRightRadius","OS","TrueSheetGrabber","visible","exports","position","left","zIndex"],"sourceRoot":"../../src","sources":["TrueSheet.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAWA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAAqD,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UA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