Skip to content

Commit d1fa49f

Browse files
committed
fix(android): fix for latest N and getting application context
1 parent 1a8b3ea commit d1fa49f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gesturehandler/gesturehandler.android.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ export class PanGestureHandler extends Handler<com.swmansion.gesturehandler.PanG
353353
@nativeProperty({ nativeSetterName: 'setAverageTouches' }) avgTouches: number;
354354
@nativeProperty numberOfPointers: number;
355355
createNative(options) {
356-
const context = Application.android.context as android.content.Context;
356+
const context = Utils.android.getApplicationContext() as android.content.Context;
357357
return new com.swmansion.gesturehandler.PanGestureHandler(context);
358358
}
359359
getExtraData(handler: com.swmansion.gesturehandler.PanGestureHandler) {
@@ -439,7 +439,7 @@ export class LongPressGestureHandler extends Handler<com.swmansion.gesturehandle
439439
@nativeProperty minDurationMs: number;
440440
@nativeProperty({ converter: { fromNative: Utils.layout.toDevicePixels } }) maxDist: number;
441441
createNative(options) {
442-
const context = Application.android.context as android.content.Context;
442+
const context = Utils.android.getApplicationContext() as android.content.Context;
443443
return new com.swmansion.gesturehandler.LongPressGestureHandler(context);
444444
}
445445
getExtraData(handler: com.swmansion.gesturehandler.LongPressGestureHandler) {

0 commit comments

Comments
 (0)