@sdcx/bottom-sheet 0.6.0 → 0.7.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.
@@ -91,6 +91,11 @@ public class BottomSheet extends ReactViewGroup implements NestedScrollingParent
91
91
  viewDragHelper = ViewDragHelper.create(this, dragCallback);
92
92
  }
93
93
 
94
+ viewDragHelper.abort();
95
+ if (settleRunnable != null && settleRunnable.isPosted) {
96
+ settleRunnable.run();
97
+ }
98
+
94
99
  layoutChild();
95
100
  }
96
101
 
@@ -110,7 +115,7 @@ public class BottomSheet extends ReactViewGroup implements NestedScrollingParent
110
115
  if (state == COLLAPSED) {
111
116
  child.offsetTopAndBottom(collapsedOffset - top);
112
117
  } else if (state == EXPANDED) {
113
- child.offsetTopAndBottom(expandedOffset -top);
118
+ child.offsetTopAndBottom(expandedOffset - top);
114
119
  } else if (state == HIDDEN) {
115
120
  child.offsetTopAndBottom(getHeight() - top);
116
121
  }
@@ -170,7 +175,8 @@ public class BottomSheet extends ReactViewGroup implements NestedScrollingParent
170
175
  @VisibleForTesting
171
176
  View findScrollingChild(View view) {
172
177
  if (ViewCompat.isNestedScrollingEnabled(view)) {
173
- if (!view.canScrollHorizontally(1) && !view.canScrollHorizontally(-1) && (view.canScrollVertically(-1) || view.canScrollVertically(1))) {
178
+ if (!view.canScrollHorizontally(1) && !view.canScrollHorizontally(-1) &&
179
+ (view.canScrollVertically(-1) || view.canScrollVertically(1))) {
174
180
  return view;
175
181
  }
176
182
  }
@@ -253,7 +259,7 @@ public class BottomSheet extends ReactViewGroup implements NestedScrollingParent
253
259
  // it is not the top most view of its parent. This is not necessary when the touch event is
254
260
  // happening over the scrolling content as nested scrolling logic handles that case.
255
261
  View scroll = nestedScrollingChildRef != null ? nestedScrollingChildRef.get() : null;
256
- return action == MotionEvent.ACTION_MOVE
262
+ return action == MotionEvent.ACTION_MOVE
257
263
  && scroll != null
258
264
  && !ignoreEvents
259
265
  && state != DRAGGING
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sdcx/bottom-sheet",
3
3
  "description": "A react-native BottomSheet component.",
4
- "version": "0.6.0",
4
+ "version": "0.7.0",
5
5
  "main": "./lib/index.js",
6
6
  "typings": "./lib/index.d.ts",
7
7
  "react-native": "src/index",