Skip to content

Commit 3885638

Browse files
committed
chore: refactor paving the way
1 parent d1fa49f commit 3885638

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

packages/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ public final void prepare(View view, GestureHandlerOrchestrator orchestrator) {
202202

203203
mView = view;
204204
mOrchestrator = orchestrator;
205+
onPrepare()
205206
}
207+
protected void onPrepare() {}
206208

207209
private int findNextLocalPointerId() {
208210
int localPointerId = 0;
@@ -405,6 +407,7 @@ public boolean shouldBeCancelledBy(GestureHandler handler) {
405407

406408
public boolean isWithinBounds(View view, float posX, float posY) {
407409

410+
// TODO: can we find a way to cache sClipRect ?
408411
if (!view.getLocalVisibleRect(sClipRect)) {
409412
return false;
410413
}

packages/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ private boolean isClipping(View view) {
565565
private static Rect sClipRect = new Rect();
566566

567567
private static boolean isTransformedTouchPointInView(float x, float y, View child) {
568+
// TODO: can we find a way to cache sClipRect as call it quite a lot?
568569
if (!child.getLocalVisibleRect(sClipRect)) {
569570
return false;
570571
}

packages/gesturehandler/platforms/android/java/com/swmansion/gesturehandler/NativeViewGestureHandler.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ public NativeViewGestureHandler() {
1616
setShouldCancelWhenOutside(true);
1717
}
1818

19+
protected void onPrepare() {
20+
21+
}
22+
23+
1924
public NativeViewGestureHandler setShouldActivateOnStart(boolean shouldActivateOnStart) {
2025
mShouldActivateOnStart = shouldActivateOnStart;
2126
return this;

0 commit comments

Comments
 (0)