Skip to content

Commit 15b0626

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Migrate ReactInterceptingViewGroup to kotlin
Summary: Migrate ReactInterceptingViewGroup to kotlin bypass-github-export-checks changelog: [internal] internal Reviewed By: rshest Differential Revision: D51262573 fbshipit-source-id: fe233d7f02b4e8165300e8929707396ccab272c8
1 parent 915b3c1 commit 15b0626

File tree

2 files changed

+31
-32
lines changed

2 files changed

+31
-32
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/touch/ReactInterceptingViewGroup.java

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
package com.facebook.react.touch
9+
10+
import android.view.ViewGroup
11+
12+
/**
13+
* This interface should be implemented by all [ViewGroup] subviews that can be instantiating by
14+
* [NativeViewHierarchyManager]. It is used to configure onInterceptTouch event listener which then
15+
* is used to control touch event flow in cases in which they requested to be intercepted by some
16+
* parent view based on a JS gesture detector.
17+
*/
18+
interface ReactInterceptingViewGroup {
19+
20+
/**
21+
* A [ViewGroup] instance that implement this interface is responsible for storing the listener
22+
* passed as an argument and then calling [OnInterceptTouchEventListener#onInterceptTouchEvent]
23+
* from [ViewGroup#onInterceptTouchEvent] and returning the result. If some custom handling of
24+
* this method apply for the view, it should be called after the listener returns and only in a
25+
* case when it returns false.
26+
*
27+
* @param listener A callback that [ViewGroup] should delegate calls for
28+
* [ViewGroup#onInterceptTouchEvent] to
29+
*/
30+
fun setOnInterceptTouchEventListener(listener: OnInterceptTouchEventListener)
31+
}

0 commit comments

Comments
 (0)