@lodev09/react-native-true-sheet 3.10.0-beta.2 → 3.10.0-beta.3

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.
@@ -11,6 +11,7 @@ import android.view.View
11
11
  import android.view.accessibility.AccessibilityNodeInfo
12
12
  import android.widget.FrameLayout
13
13
  import androidx.core.graphics.ColorUtils
14
+ import androidx.core.view.ViewCompat
14
15
  import com.facebook.react.uimanager.PixelUtil.dpToPx
15
16
 
16
17
  /**
@@ -131,12 +132,13 @@ class TrueSheetGrabberView(context: Context, private val options: GrabberOptions
131
132
  }
132
133
 
133
134
  fun updateAccessibilityValue(index: Int, detentCount: Int) {
134
- stateDescription = when {
135
+ val description: CharSequence? = when {
135
136
  index < 0 || detentCount <= 0 -> null
136
137
  index >= detentCount - 1 -> "Expanded"
137
138
  index == 0 -> "Collapsed"
138
139
  else -> "Detent ${index + 1} of $detentCount"
139
140
  }
141
+ ViewCompat.setStateDescription(this, description)
140
142
  }
141
143
 
142
144
  private fun getAdaptiveColor(baseColor: Int? = null): Int {
@@ -43,7 +43,9 @@ using namespace facebook::react;
43
43
 
44
44
  @end
45
45
 
46
- @interface TrueSheetContainerView () <TrueSheetContentViewDelegate, TrueSheetHeaderViewDelegate>
46
+ @interface TrueSheetContainerView () <TrueSheetContentViewDelegate,
47
+ TrueSheetHeaderViewDelegate,
48
+ TrueSheetFooterViewDelegate>
47
49
  @end
48
50
 
49
51
  @implementation TrueSheetContainerView {
@@ -176,6 +178,7 @@ using namespace facebook::react;
176
178
  return;
177
179
  }
178
180
  _footerView = (TrueSheetFooterView *)childComponentView;
181
+ _footerView.delegate = self;
179
182
  }
180
183
  }
181
184
 
@@ -192,6 +195,7 @@ using namespace facebook::react;
192
195
  }
193
196
 
194
197
  if ([childComponentView isKindOfClass:[TrueSheetFooterView class]]) {
198
+ _footerView.delegate = nil;
195
199
  _footerView = nil;
196
200
  }
197
201
 
@@ -222,6 +226,17 @@ using namespace facebook::react;
222
226
 
223
227
  - (void)headerViewDidChangeSize:(CGSize)newSize {
224
228
  [self.delegate containerViewHeaderDidChangeSize:newSize];
229
+ if (@available(iOS 26.0, *)) {
230
+ [self setupEdgeInteractions];
231
+ }
232
+ }
233
+
234
+ #pragma mark - TrueSheetFooterViewDelegate
235
+
236
+ - (void)footerViewDidChangeSize:(CGSize)newSize {
237
+ if (@available(iOS 26.0, *)) {
238
+ [self setupEdgeInteractions];
239
+ }
225
240
  }
226
241
 
227
242
  #pragma mark - Keyboard Observer
@@ -17,9 +17,15 @@
17
17
 
18
18
  NS_ASSUME_NONNULL_BEGIN
19
19
 
20
+ @protocol TrueSheetFooterViewDelegate <NSObject>
21
+ @optional
22
+ - (void)footerViewDidChangeSize:(CGSize)size;
23
+ @end
24
+
20
25
  @interface TrueSheetFooterView : RCTViewComponentView <TrueSheetKeyboardObserverDelegate>
21
26
 
22
27
  @property (nonatomic, weak, nullable) TrueSheetKeyboardObserver *keyboardObserver;
28
+ @property (nonatomic, weak, nullable) id<TrueSheetFooterViewDelegate> delegate;
23
29
 
24
30
  - (void)setupConstraintsWithHeight:(CGFloat)height;
25
31
 
@@ -92,6 +92,7 @@ using namespace facebook::react;
92
92
 
93
93
  if (height != _lastHeight) {
94
94
  [self setupConstraintsWithHeight:height];
95
+ [self.delegate footerViewDidChangeSize:CGSizeMake(layoutMetrics.frame.size.width, height)];
95
96
  }
96
97
  }
97
98
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lodev09/react-native-true-sheet",
3
- "version": "3.10.0-beta.2",
3
+ "version": "3.10.0-beta.3",
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",