@nativescript-community/ui-bottomsheet 0.0.0-stage → 1.0.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-common.js","sourceRoot":"","sources":["../../src/ui-bottomsheet/index-common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAa,IAAI,EAAY,MAAM,oBAAoB,CAAC;AAgBlF,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IACxB,4DAAW,CAAA;IACX,iEAAa,CAAA;IACb,+DAAY,CAAA;IACZ,+DAAY,CAAA;AAChB,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAID,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAC5D,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAAsB,CAAC;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AA8CpD,MAAM,OAAgB,uBAAwB,SAAQ,IAAI;IAA1D;;QA0BI,4BAAuB,GAAG,KAAK,CAAC;IAwIpC,CAAC;IAnJG,2BAA2B;QACvB,MAAM,IAAI,GAAyB;YAC/B,SAAS,EAAE,uBAAuB;YAClC,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,IAAI,CAAC,mBAAmB;YACjC,aAAa,EAAE,IAAI,CAAC,yBAAyB;SAChD,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAGM,kBAAkB;QACrB,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YAC/B,OAAO;QACX,CAAC;QACD,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAClD,MAAM,UAAU,GAAG,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,UAAU,KAAK,CAAC,CAAC,EAAE,CAAC;YACpB,e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ptions, ViewWithBottomSheetBase } from './index-common';
3
+ export { ViewWithBottomSheetBase } from './index-common';
4
+ /**
5
+ * Android: the detents are the stops of BottomSheetBehavior (collapsed, half expanded, expanded).
6
+ */
7
+ export declare class ViewWithBottomSheet extends ViewWithBottomSheetBase {
8
+ _bottomSheetFragment: com.nativescript.ui.bottomsheet.BottomSheetDialogFragment;
9
+ _bottomSheetOptions: BottomSheetOptions;
10
+ _bottomSheetBehavior: com.google.android.material.bottomsheet.BottomSheetBehavior<android.view.View>;
11
+ _detentCount: number;
12
+ _detentHeights: number[];
13
+ _baseDimAmount: number;
14
+ _undimmedIndex: number;
15
+ _bottomSheetWindow: android.view.Window;
16
+ _onDetentChange: (index: number) => void;
17
+ /**
18
+ * State of the behavior for the index of a detent: 1 detent = expanded, 2 = collapsed/expanded, 3 = collapsed/half expanded/expanded
19
+ */
20
+ /**
21
+ * `largestUndimmedDetentIndex`: no dim at the undimmed detent and below it, the dim grows above it
22
+ */
23
+ updateDimForSlide(slideOffset: number): void;
24
+ updateDimForState(state: number): void;
25
+ private stateForDetentIndex;
26
+ setBottomSheetDetentIndex(index: number, animated?: boolean): void;
27
+ getBottomSheetDetentIndex(): number;
28
+ /**
29
+ * Applies the `detents` option once the sheet is laid out (the available and the content heights are known)
30
+ */
31
+ applyDetents(sheet: android.view.View, behavior: com.google.android.material.bottomsheet.BottomSheetBehavior<android.view.View>, options: BottomSheetOptions): void;
32
+ /**
33
+ * BottomSheetBehavior only follows a child which supports nested scrolling: RecyclerView (@nativescript-community/ui-collectionview) does,
34
+ * the ScrollView and the ListView of NativeScript do not by default.
35
+ * `trackingScrollView` is the id of the view to enable, else the scrollable views of the content are enabled.
36
+ */
37
+ enableNestedScrolling(sheet: android.view.View): void;
38
+ applyGrabber(fragment: com.nativescript.ui.bottomsheet.BottomSheetDialogFragment, sheet: android.view.View): void;
39
+ applyCornerRadius(sheet: android.view.View, radius: number): void;
40
+ protected _hideNativeBottomSheet(parent: View, whenClosedCallback: () => void): void;
41
+ protected _showNativeBottomSheet(parent: View, options: BottomSheetOptions): void;
42
+ }
43
+ export declare function overrideBottomSheet(): void;
44
+ export declare function install(): void;
@@ -0,0 +1,475 @@
1
+ import { applyMixins } from '@nativescript-community/ui-core';
2
+ import { Application, Utils, View, fromObject } from '@nativescript/core';
3
+ import { StateBottomSheet, ViewWithBottomSheetBase } from './index-common';
4
+ export { ViewWithBottomSheetBase } from './index-common';
5
+ function getId(id) {
6
+ const context = Application.android.context;
7
+ return context.getResources().getIdentifier(id, 'id', context.getPackageName());
8
+ }
9
+ var ChangeStateBottomSheet = /** @class */ (function (_super) {
10
+ __extends(ChangeStateBottomSheet, _super);
11
+ function ChangeStateBottomSheet(owner) {
12
+ var _this = _super.call(this) || this;
13
+ _this.owner = owner;
14
+ return global.__native(_this);
15
+ }
16
+ ChangeStateBottomSheet.prototype.onSlide = function (bottomSheet, slideOffset) {
17
+ var _a;
18
+ var owner = (_a = this.owner) === null || _a === void 0 ? void 0 : _a.get();
19
+ owner === null || owner === void 0 ? void 0 : owner.updateDimForSlide(slideOffset);
20
+ if (owner && this.checkActiveCallback()) {
21
+ owner._onChangeStateBottomSheetCallback(StateBottomSheet.DRAGGING, slideOffset);
22
+ }
23
+ };
24
+ ChangeStateBottomSheet.prototype.onStateChanged = function (bottomSheet, newState) {
25
+ var _a;
26
+ var owner = (_a = this.owner) === null || _a === void 0 ? void 0 : _a.get();
27
+ if (!owner) {
28
+ return;
29
+ }
30
+ owner.updateDimForState(newState);
31
+ if (this.checkActiveCallback()) {
32
+ var status = this.getStateBottomSheetFromBottomSheetBehavior(newState);
33
+ if (status !== undefined) {
34
+ owner._onChangeStateBottomSheetCallback(status);
35
+ }
36
+ }
37
+ if (owner._onDetentChange && owner._detentCount > 0 && newState !== com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_DRAGGING && newState !== com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_SETTLING) {
38
+ var index = owner.getBottomSheetDetentIndex();
39
+ if (index >= 0) {
40
+ owner._onDetentChange(index);
41
+ }
42
+ }
43
+ };
44
+ ChangeStateBottomSheet.prototype.checkActiveCallback = function () {
45
+ var _a, _b;
46
+ return (_b = (_a = this.owner) === null || _a === void 0 ? void 0 : _a.get()) === null || _b === void 0 ? void 0 : _b._onChangeStateBottomSheetCallback;
47
+ };
48
+ ChangeStateBottomSheet.prototype.getStateBottomSheetFromBottomSheetBehavior = function (state) {
49
+ switch (state) {
50
+ case com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_HIDDEN:
51
+ return StateBottomSheet.CLOSED;
52
+ case com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_EXPANDED:
53
+ return StateBottomSheet.EXPANDED;
54
+ case com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_COLLAPSED:
55
+ return StateBottomSheet.COLLAPSED;
56
+ case com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_DRAGGING:
57
+ return StateBottomSheet.DRAGGING;
58
+ default:
59
+ // @ts-ignore
60
+ return;
61
+ }
62
+ };
63
+ return ChangeStateBottomSheet;
64
+ }(com.google.android.material.bottomsheet.BottomSheetBehavior.BottomSheetCallback));
65
+ const DRAG_HANDLE_MARGIN = 28;
66
+ /**
67
+ * Android: the detents are the stops of BottomSheetBehavior (collapsed, half expanded, expanded).
68
+ */
69
+ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
70
+ constructor() {
71
+ super(...arguments);
72
+ this._detentCount = 0;
73
+ this._detentHeights = [];
74
+ this._baseDimAmount = 0.32;
75
+ }
76
+ /**
77
+ * State of the behavior for the index of a detent: 1 detent = expanded, 2 = collapsed/expanded, 3 = collapsed/half expanded/expanded
78
+ */
79
+ /**
80
+ * `largestUndimmedDetentIndex`: no dim at the undimmed detent and below it, the dim grows above it
81
+ */
82
+ updateDimForSlide(slideOffset) {
83
+ const heights = this._detentHeights;
84
+ if (this._undimmedIndex === undefined || !this._bottomSheetWindow || heights.length < 2 || slideOffset < 0) {
85
+ return;
86
+ }
87
+ const min = heights[0];
88
+ const max = heights[heights.length - 1];
89
+ const undimmed = heights[Math.min(this._undimmedIndex, heights.length - 1)];
90
+ const height = min + slideOffset * (max - min);
91
+ const ratio = max > undimmed ? Math.min(1, Math.max(0, (height - undimmed) / (max - undimmed))) : 1;
92
+ this._bottomSheetWindow.setDimAmount(this._baseDimAmount * ratio);
93
+ }
94
+ updateDimForState(state) {
95
+ if (this._undimmedIndex === undefined || !this._bottomSheetWindow || this._detentCount === 0) {
96
+ return;
97
+ }
98
+ const BSB = com.google.android.material.bottomsheet.BottomSheetBehavior;
99
+ if (state === BSB.STATE_DRAGGING || state === BSB.STATE_SETTLING) {
100
+ return;
101
+ }
102
+ const index = this.getBottomSheetDetentIndex();
103
+ if (index >= 0) {
104
+ this._bottomSheetWindow.setDimAmount(index <= this._undimmedIndex ? 0 : this._baseDimAmount);
105
+ }
106
+ }
107
+ stateForDetentIndex(index) {
108
+ const BSB = com.google.android.material.bottomsheet.BottomSheetBehavior;
109
+ const count = this._detentCount;
110
+ if (count <= 1 || index >= count - 1) {
111
+ return BSB.STATE_EXPANDED;
112
+ }
113
+ return index <= 0 ? BSB.STATE_COLLAPSED : BSB.STATE_HALF_EXPANDED;
114
+ }
115
+ setBottomSheetDetentIndex(index, animated = true) {
116
+ const behavior = this._bottomSheetBehavior;
117
+ if (!behavior || this._detentCount === 0) {
118
+ return;
119
+ }
120
+ // setState animates
121
+ behavior.setState(this.stateForDetentIndex(index));
122
+ }
123
+ getBottomSheetDetentIndex() {
124
+ const behavior = this._bottomSheetBehavior;
125
+ if (!behavior || this._detentCount === 0) {
126
+ return -1;
127
+ }
128
+ const BSB = com.google.android.material.bottomsheet.BottomSheetBehavior;
129
+ switch (behavior.getState()) {
130
+ case BSB.STATE_COLLAPSED:
131
+ return this._detentCount > 1 ? 0 : -1;
132
+ case BSB.STATE_HALF_EXPANDED:
133
+ return 1;
134
+ case BSB.STATE_EXPANDED:
135
+ return this._detentCount - 1;
136
+ default:
137
+ return -1;
138
+ }
139
+ }
140
+ /**
141
+ * Applies the `detents` option once the sheet is laid out (the available and the content heights are known)
142
+ */
143
+ applyDetents(sheet, behavior, options) {
144
+ const parentHeight = sheet.getParent().getHeight();
145
+ const contentHeight = this.nativeViewProtected?.getHeight() || parentHeight;
146
+ const resolve = (detent) => {
147
+ let height;
148
+ if (detent === 'large') {
149
+ height = parentHeight;
150
+ }
151
+ else if (detent === 'medium') {
152
+ height = parentHeight / 2;
153
+ }
154
+ else if (detent === 'content') {
155
+ height = contentHeight;
156
+ }
157
+ else if (typeof detent === 'number') {
158
+ height = Utils.layout.toDevicePixels(detent);
159
+ }
160
+ else {
161
+ height = detent.fraction * parentHeight;
162
+ }
163
+ return Math.round(Math.min(height, parentHeight));
164
+ };
165
+ let detents = options.detents;
166
+ if (detents.length > 3) {
167
+ // collapsed, half expanded, expanded
168
+ detents = [detents[0], detents[Math.floor(detents.length / 2)], detents[detents.length - 1]];
169
+ }
170
+ const heights = detents.map(resolve);
171
+ const count = heights.length;
172
+ const max = heights[count - 1];
173
+ this._detentCount = count;
174
+ this._detentHeights = heights;
175
+ // the content can be smaller than the largest detent
176
+ sheet.setMinimumHeight(max);
177
+ behavior.setPeekHeight(heights[0]);
178
+ if (count <= 2) {
179
+ behavior.setFitToContents(true);
180
+ behavior.setSkipCollapsed(count === 1);
181
+ }
182
+ else {
183
+ behavior.setFitToContents(false);
184
+ behavior.setExpandedOffset(parentHeight - max);
185
+ behavior.setHalfExpandedRatio(Math.min(0.99, Math.max(0.01, heights[1] / parentHeight)));
186
+ behavior.setSkipCollapsed(false);
187
+ }
188
+ behavior.setState(this.stateForDetentIndex(options.initialDetentIndex || 0));
189
+ this.updateDimForState(behavior.getState());
190
+ }
191
+ /**
192
+ * BottomSheetBehavior only follows a child which supports nested scrolling: RecyclerView (@nativescript-community/ui-collectionview) does,
193
+ * the ScrollView and the ListView of NativeScript do not by default.
194
+ * `trackingScrollView` is the id of the view to enable, else the scrollable views of the content are enabled.
195
+ */
196
+ enableNestedScrolling(sheet) {
197
+ const trackingId = this._bottomSheetOptions?.trackingScrollView;
198
+ const enable = (view) => {
199
+ const native = view.nativeViewProtected;
200
+ if (native instanceof android.view.View && (native instanceof android.widget.ScrollView || native instanceof android.widget.AbsListView || native instanceof android.webkit.WebView || (trackingId && view.id === trackingId))) {
201
+ androidx.core.view.ViewCompat.setNestedScrollingEnabled(native, true);
202
+ }
203
+ };
204
+ this.eachChildView(function visit(child) {
205
+ enable(child);
206
+ child.eachChildView(visit);
207
+ return true;
208
+ });
209
+ enable(this);
210
+ // the behavior finds its scrolling child when laid out
211
+ sheet.requestLayout();
212
+ }
213
+ applyGrabber(fragment, sheet) {
214
+ const handle = new com.google.android.material.bottomsheet.BottomSheetDragHandleView(fragment.getActivity());
215
+ sheet.addView(handle, new android.widget.FrameLayout.LayoutParams(android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.Gravity.TOP));
216
+ // the content starts below the handle
217
+ const content = this.nativeViewProtected;
218
+ const params = content?.getLayoutParams();
219
+ if (params instanceof android.view.ViewGroup.MarginLayoutParams) {
220
+ params.topMargin = Utils.layout.toDevicePixels(DRAG_HANDLE_MARGIN);
221
+ content.setLayoutParams(params);
222
+ }
223
+ }
224
+ applyCornerRadius(sheet, radius) {
225
+ const background = sheet.getBackground();
226
+ if (background instanceof com.google.android.material.shape.MaterialShapeDrawable) {
227
+ const size = Utils.layout.toDevicePixels(radius);
228
+ background.setShapeAppearanceModel(background.getShapeAppearanceModel().toBuilder().setTopLeftCornerSize(size).setTopRightCornerSize(size).build());
229
+ }
230
+ }
231
+ _hideNativeBottomSheet(parent, whenClosedCallback) {
232
+ // call whenClosedCallback first because dismiss will call another one (without result)
233
+ whenClosedCallback();
234
+ const manager = this._bottomSheetFragment.getFragmentManager();
235
+ if (manager) {
236
+ this._bottomSheetFragment.dismissAllowingStateLoss();
237
+ }
238
+ this._bottomSheetFragment = null;
239
+ }
240
+ _showNativeBottomSheet(parent, options) {
241
+ this._bottomSheetOptions = options;
242
+ this._commonShowNativeBottomSheet(parent, options);
243
+ const that = new WeakRef(this);
244
+ const domId = this._domId;
245
+ const bottomSheetOptions = {
246
+ owner: this,
247
+ options,
248
+ shownCallback: () => {
249
+ this.bindingContext = fromObject(options.context);
250
+ this._raiseShownBottomSheetEvent();
251
+ },
252
+ dismissCallback: () => this._onDismissBottomSheetCallback?.()
253
+ };
254
+ const dfListener = new com.nativescript.ui.bottomsheet.BottomSheetDialogFragment.BottomSheetDialogFragmentListener({
255
+ onCreateDialog(fragment, savedInstanceState) {
256
+ const theme = fragment.getTheme();
257
+ const dialogListener = new com.nativescript.ui.bottomsheet.BottomSheetDialog.BottomSheetDialogListener({
258
+ onDetachedFromWindow(dialog) {
259
+ dialog.nListener = null;
260
+ },
261
+ onBackPressed(dialog) {
262
+ const sheetOptions = bottomSheetOptions.options;
263
+ if (sheetOptions?.dismissOnBackButton === false) {
264
+ sheetOptions.onDismissAttempt?.();
265
+ return true;
266
+ }
267
+ if (sheetOptions?.onWillDismiss && sheetOptions.onWillDismiss() === false) {
268
+ sheetOptions.onDismissAttempt?.();
269
+ return true;
270
+ }
271
+ const owner = that?.get();
272
+ if (!owner) {
273
+ return false;
274
+ }
275
+ const args = {
276
+ eventName: 'activityBackPressed',
277
+ object: owner,
278
+ activity: owner._context,
279
+ cancel: false
280
+ };
281
+ // Fist fire application.android global event
282
+ Application.android.notify(args);
283
+ if (args.cancel) {
284
+ return true;
285
+ }
286
+ owner.notify(args);
287
+ if (!args.cancel) {
288
+ args.cancel = owner.onBackPressed();
289
+ }
290
+ return args.cancel;
291
+ }
292
+ });
293
+ const dialog = new com.nativescript.ui.bottomsheet.BottomSheetDialog(fragment.getActivity(), theme);
294
+ dialog.setListener(dialogListener);
295
+ dialog.nListener = dialogListener;
296
+ if (bottomSheetOptions.options) {
297
+ const creationOptions = bottomSheetOptions.options;
298
+ if (creationOptions.dismissOnBackgroundTap !== undefined) {
299
+ dialog.setCanceledOnTouchOutside(creationOptions.dismissOnBackgroundTap);
300
+ }
301
+ if (creationOptions.disableDimBackground === true) {
302
+ dialog.getWindow().clearFlags(android.view.WindowManager.LayoutParams.FLAG_DIM_BEHIND);
303
+ }
304
+ }
305
+ return dialog;
306
+ },
307
+ onCreateView(fragment, inflater, container, savedInstanceState) {
308
+ const owner = that?.get();
309
+ if (owner) {
310
+ owner._setupAsRootView(fragment.getActivity());
311
+ owner.parent = Application.getRootView();
312
+ owner._isAddedToNativeVisualTree = true;
313
+ const window = fragment.getDialog().getWindow();
314
+ if (bottomSheetOptions.options?.windowSoftInputMode !== undefined) {
315
+ window.setSoftInputMode(bottomSheetOptions.options?.windowSoftInputMode);
316
+ }
317
+ else {
318
+ // the dialog seems to not follow the default activity softInputMode,
319
+ // thus set we set it here.
320
+ window.setSoftInputMode(owner._context.getWindow().getAttributes().softInputMode);
321
+ }
322
+ return owner.nativeViewProtected;
323
+ }
324
+ return null;
325
+ },
326
+ onStart(fragment) {
327
+ const owner = that?.get();
328
+ if (!owner) {
329
+ return;
330
+ }
331
+ const contentViewId = getId('design_bottom_sheet');
332
+ const view = fragment.getDialog().findViewById(contentViewId);
333
+ const transparent = bottomSheetOptions.options?.transparent === true;
334
+ if (transparent) {
335
+ // we need delay it just a bit or it wont work
336
+ setTimeout(() => {
337
+ view.setBackground(null);
338
+ }, 0);
339
+ }
340
+ else if (bottomSheetOptions.options?.backgroundOpacity) {
341
+ // we need delay it just a bit or it wont work
342
+ setTimeout(() => {
343
+ const backgroundDrawable = view.getBackground();
344
+ backgroundDrawable.setAlpha(bottomSheetOptions.options?.backgroundOpacity * 255);
345
+ view.setBackground(backgroundDrawable);
346
+ }, 0);
347
+ }
348
+ const behavior = com.google.android.material.bottomsheet.BottomSheetBehavior.from(view);
349
+ // prevent hiding the bottom sheet by
350
+ const dismissOnDraggingDownSheet = bottomSheetOptions.options?.dismissOnDraggingDownSheet !== false;
351
+ behavior.setHideable(dismissOnDraggingDownSheet);
352
+ const peekHeight = bottomSheetOptions.options?.detents?.length ? undefined : bottomSheetOptions.options?.peekHeight;
353
+ if (peekHeight) {
354
+ behavior.setState(com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_COLLAPSED);
355
+ behavior.setPeekHeight(Utils.layout.toDevicePixels(peekHeight));
356
+ }
357
+ if (!dismissOnDraggingDownSheet) {
358
+ // directly expand the bottom sheet after start
359
+ behavior.setState(com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_EXPANDED);
360
+ // set to maximum possible value to prevent dragging the sheet between peek and expanded height
361
+ behavior.setPeekHeight(java.lang.Integer.MAX_VALUE);
362
+ }
363
+ const skipCollapsedState = bottomSheetOptions.options?.skipCollapsedState === true && !bottomSheetOptions.options?.detents?.length;
364
+ if (skipCollapsedState) {
365
+ // directly expand the bottom sheet after start
366
+ behavior.setState(com.google.android.material.bottomsheet.BottomSheetBehavior.STATE_EXPANDED);
367
+ // disable peek/collapsed state
368
+ behavior.setSkipCollapsed(true);
369
+ }
370
+ owner._bottomSheetBehavior = behavior;
371
+ const window = fragment.getDialog().getWindow();
372
+ owner._bottomSheetWindow = window;
373
+ owner._baseDimAmount = window.getAttributes().dimAmount || 0.32;
374
+ owner._undimmedIndex = bottomSheetOptions.options?.largestUndimmedDetentIndex;
375
+ const sheetOptions = bottomSheetOptions.options;
376
+ if (!sheetOptions?.canTouchBehind && (sheetOptions?.onWillDismiss || sheetOptions?.onDismissAttempt)) {
377
+ // the tap outside is handled here to call onWillDismiss/onDismissAttempt
378
+ const touchOutside = view.getParent().findViewById(getId('touch_outside'));
379
+ touchOutside?.setOnClickListener(new android.view.View.OnClickListener({
380
+ onClick: () => {
381
+ if (sheetOptions.dismissOnBackgroundTap !== false && sheetOptions.onWillDismiss?.() !== false) {
382
+ fragment.getDialog().cancel();
383
+ }
384
+ else {
385
+ sheetOptions.onDismissAttempt?.();
386
+ }
387
+ }
388
+ }));
389
+ }
390
+ // the scrollable content (ScrollView, ListView, CollectionView...) must take part in the nested scrolling to be scrolled before the sheet
391
+ owner.enableNestedScrolling(view);
392
+ owner._onDetentChange = bottomSheetOptions.options?.onDetentChange;
393
+ if (bottomSheetOptions.options?.detents?.length) {
394
+ // once laid out
395
+ view.post(new java.lang.Runnable({
396
+ run: () => {
397
+ owner.applyDetents(view, behavior, bottomSheetOptions.options);
398
+ }
399
+ }));
400
+ }
401
+ if (bottomSheetOptions.options?.grabber !== false) {
402
+ owner.applyGrabber(fragment, view);
403
+ }
404
+ if (bottomSheetOptions.options?.cornerRadius !== undefined) {
405
+ // the background is set after the start
406
+ setTimeout(() => owner.applyCornerRadius(view, bottomSheetOptions.options.cornerRadius), 0);
407
+ }
408
+ const onChangeState = bottomSheetOptions.options?.onChangeState;
409
+ if (onChangeState || bottomSheetOptions.options?.onDetentChange || bottomSheetOptions.options?.largestUndimmedDetentIndex !== undefined) {
410
+ const changeStateBottomSheet = new ChangeStateBottomSheet(that);
411
+ behavior.addBottomSheetCallback(changeStateBottomSheet);
412
+ that?.get()?._onChangeStateBottomSheetCallback?.(changeStateBottomSheet.getStateBottomSheetFromBottomSheetBehavior(behavior.getState()));
413
+ }
414
+ if (owner && !owner.isLoaded) {
415
+ owner.callLoaded();
416
+ }
417
+ if (bottomSheetOptions.options.canTouchBehind) {
418
+ // necessary for smooth movement of the back page
419
+ fragment.getDialog().getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE);
420
+ const coordinator = view.getParent();
421
+ if (coordinator instanceof android.view.View) {
422
+ coordinator.findViewById(getId('touch_outside')).setOnTouchListener(new android.view.View.OnTouchListener({
423
+ onTouch(view, event) {
424
+ const forwardedEvent = android.view.MotionEvent.obtain(event);
425
+ forwardedEvent.setLocation(event.getRawX(), event.getRawY());
426
+ try {
427
+ fragment.getActivity().dispatchTouchEvent(forwardedEvent);
428
+ }
429
+ finally {
430
+ forwardedEvent.recycle();
431
+ }
432
+ return false;
433
+ }
434
+ }));
435
+ }
436
+ }
437
+ bottomSheetOptions.shownCallback();
438
+ },
439
+ onDismiss(fragment, dialog) {
440
+ const owner = that?.get();
441
+ if (owner) {
442
+ owner._bottomSheetCloseIgnore = true;
443
+ }
444
+ bottomSheetOptions.dismissCallback();
445
+ },
446
+ onDestroy(fragment) {
447
+ df.nListener = null;
448
+ const owner = that?.get();
449
+ if (owner) {
450
+ owner._bottomSheetCloseIgnore = false;
451
+ owner._bottomSheetClosed();
452
+ }
453
+ }
454
+ });
455
+ const df = new com.nativescript.ui.bottomsheet.BottomSheetDialogFragment();
456
+ df.setListener(dfListener);
457
+ df.nListener = dfListener;
458
+ this._bottomSheetFragment = df;
459
+ this._raiseShowingBottomSheetEvent();
460
+ //@ts-ignore
461
+ df.show(parent._getRootFragmentManager(), domId.toString());
462
+ }
463
+ }
464
+ let mixinInstalled = false;
465
+ export function overrideBottomSheet() {
466
+ applyMixins(View, [ViewWithBottomSheetBase, ViewWithBottomSheet]);
467
+ }
468
+ export function install() {
469
+ if (!mixinInstalled) {
470
+ mixinInstalled = true;
471
+ // overridePage();
472
+ overrideBottomSheet();
473
+ }
474
+ }
475
+ //# sourceMappingURL=index.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../src/ui-bottomsheet/index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAuC,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC/G,OAAO,EAAyC,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAElH,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AASzD,SAAS,KAAK,CAAC,EAAU;IACrB,MAAM,OAAO,GAA4B,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC;IACrE,OAAO,OAAO,CAAC,YAAY,EAAE,CAAC,aAAa,CAAC,EAAE,E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E,CAAC;CACJ;AAED,IAAI,cAAc,GAAG,KAAK,CAAC;AAC3B,MAAM,UAAU,mBAAmB;IAC/B,WAAW,CAAC,IAAI,EAAE,CAAC,uBAAuB,EAAE,mBAAmB,CAAC,CAAC,CAAC;AACtE,CAAC;AACD,MAAM,UAAU,OAAO;IACnB,IAAI,CAAC,cAAc,EAAE,CAAC;QAClB,cAAc,GAAG,IAAI,CAAC;QACtB,kBAAkB;QAClB,mBAAmB,EAAE,CAAC;IAC1B,CAAC;AACL,CAAC"}
package/index.d.ts ADDED
@@ -0,0 +1,100 @@
1
+ /**
2
+ * BottomSheet: adds `showBottomSheet()`/`closeBottomSheet()` to every View.
3
+ * Android uses Material BottomSheetDialogFragment. iOS uses the native UISheetPresentationController.
4
+ * @module @nativescript-community/ui-bottomsheet
5
+ */
6
+
7
+ import { View, ViewBase } from '@nativescript/core';
8
+ import { BottomSheetDetent, BottomSheetOptions } from './index-common';
9
+
10
+ export { BottomSheetDetent, BottomSheetOptions };
11
+
12
+ export declare abstract class ViewWithBottomSheetBase extends View {
13
+ // used when triggering the closing of the bottomsheet
14
+ /**
15
+ * @hidden
16
+ */
17
+ protected _closeBottomSheetCallback: Function;
18
+
19
+ // used when the bottomSheet is dismissed
20
+ /**
21
+ * @hidden
22
+ */
23
+ public _onDismissBottomSheetCallback: Function;
24
+
25
+ /**
26
+ * @hidden
27
+ */
28
+ _bottomSheetFragment: any; // com.google.android.material.bottomsheet.BottomSheetDialogFragment
29
+
30
+ /**
31
+ * @hidden
32
+ */
33
+ protected abstract _hideNativeBottomSheet(parent: any, whenClosedCallback: any): void;
34
+
35
+ /**
36
+ * @hidden
37
+ */
38
+ protected _bottomSheetContext: any;
39
+
40
+ /**
41
+ * @hidden
42
+ */
43
+ _raiseShownBottomSheetEvent(): void;
44
+
45
+ /**
46
+ * @hidden
47
+ */
48
+ public _bottomSheetClosed(): void;
49
+
50
+ /**
51
+ * @hidden
52
+ */
53
+ protected abstract _showNativeBottomSheet(parent: View, options: BottomSheetOptions): void;
54
+
55
+ /**
56
+ * @hidden
57
+ */
58
+ protected _commonShowNativeBottomSheet(parent: View, options: BottomSheetOptions): void;
59
+
60
+ /**
61
+ * @hidden
62
+ */
63
+ protected _raiseShowingBottomSheetEvent(): void;
64
+
65
+ /**
66
+ * closes the current BottomSheet
67
+ *
68
+ * @param args anything you want as a result of the `showBottomSheet` Promise
69
+ */
70
+ public closeBottomSheet(...args: any): void;
71
+
72
+ /**
73
+ * shows a modal BottomSheet
74
+ *
75
+ * @param {BottomSheetOptions} options
76
+ * @returns {View} view - the view shown in the BottomSheet
77
+ */
78
+ public showBottomSheet(options: BottomSheetOptions): ViewBase;
79
+
80
+ /**
81
+ * Moves the shown sheet to a detent
82
+ * @param index index in the `detents` option
83
+ */
84
+ public setBottomSheetDetentIndex(index: number, animated?: boolean): void;
85
+
86
+ /**
87
+ * Index of the detent the sheet currently rests at
88
+ */
89
+ public getBottomSheetDetentIndex(): number;
90
+ }
91
+ export function install(): void;
92
+
93
+ declare module '@nativescript/core/ui/core/view' {
94
+ interface View {
95
+ closeBottomSheet(...args: any): void;
96
+ showBottomSheet(options: BottomSheetOptions): ViewBase;
97
+ setBottomSheetDetentIndex(index: number, animated?: boolean): void;
98
+ getBottomSheetDetentIndex(): number;
99
+ }
100
+ }