Skip to content

Commit 1459375

Browse files
committed
chore: refactor
1 parent e9cb118 commit 1459375

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/ui-persistent-bottomsheet/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export class PersistentBottomSheet extends AbsoluteLayout {
144144
return false;
145145
}
146146
let deltaY = 0;
147-
if (global.isIOS && !this.iosIgnoreSafeArea) {
147+
if (__IOS__ && !this.iosIgnoreSafeArea) {
148148
deltaY -= Utils.layout.toDeviceIndependentPixels(this.getSafeAreaInsets().top);
149149
}
150150
const y = data.y + deltaY;
@@ -247,7 +247,7 @@ export class PersistentBottomSheet extends AbsoluteLayout {
247247
this._scrollView = value;
248248

249249
if (value) {
250-
// if (global.isIOS) {
250+
// if (__IOS__) {
251251
// (value.nativeViewProtected as UIScrollView).delaysContentTouches = true;
252252
// }
253253
value.on('scroll', this.onScroll, this);
@@ -353,14 +353,14 @@ export class PersistentBottomSheet extends AbsoluteLayout {
353353
}
354354
}
355355
private get scrollViewVerticalOffset() {
356-
if (global.isAndroid) {
356+
if (__ANDROID__) {
357357
return (this.scrollView.nativeViewProtected as androidx.core.view.ScrollingView).computeVerticalScrollOffset() / Utils.layout.getDisplayDensity();
358358
} else {
359359
return (this.scrollView.nativeViewProtected as UIScrollView).contentOffset.y;
360360
}
361361
}
362362
private set scrollViewVerticalOffset(value: number) {
363-
if (global.isAndroid) {
363+
if (__ANDROID__) {
364364
(this.scrollView.nativeViewProtected as androidx.recyclerview.widget.RecyclerView).scrollTo(0, 0);
365365
} else {
366366
(this.scrollView.nativeViewProtected as UIScrollView).contentOffset = CGPointMake(this.scrollView.nativeViewProtected.contentOffset.x, 0);
@@ -381,9 +381,9 @@ export class PersistentBottomSheet extends AbsoluteLayout {
381381
let touchY;
382382
// touch event gives you relative touch which varies with translateY
383383
// so we use touch location in the window
384-
if (global.isAndroid) {
384+
if (__ANDROID__) {
385385
touchY = Utils.layout.toDeviceIndependentPixels((event.android as android.view.MotionEvent).getRawY());
386-
} else if (global.isIOS) {
386+
} else if (__IOS__) {
387387
touchY = (event.ios.touches.anyObject() as UITouch).locationInView(null).y;
388388
}
389389
if (event.action === 'down') {
@@ -506,7 +506,7 @@ export class PersistentBottomSheet extends AbsoluteLayout {
506506
return;
507507
}
508508
this.animating = true;
509-
if (this._scrollView && global.isAndroid) {
509+
if (this._scrollView && __ANDROID__) {
510510
// on android we get unwanted scroll effect while "swipping the view"
511511
// cancel the views touches before animation to prevent that
512512
const time = Date.now();

0 commit comments

Comments
 (0)