mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Migrate ReactHitSlopView to kotlin
Summary: Migrate ReactHitSlopView to kotlin bypass-github-export-checks changelog: [internal] internal Reviewed By: rshest Differential Revision: D51262574 fbshipit-source-id: 7ad625bcdff1525299a0a9c9cf3409d081231b3c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7f52791767
commit
803c5bb669
-26
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.touch;
|
||||
|
||||
import android.graphics.Rect;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* This interface should be implemented by all {@link View} subclasses that want to use the hitSlop
|
||||
* prop to extend their touch areas.
|
||||
*/
|
||||
public interface ReactHitSlopView {
|
||||
|
||||
/**
|
||||
* Called when determining the touch area of a view.
|
||||
*
|
||||
* @return A {@link Rect} representing how far to extend the touch area in each direction.
|
||||
*/
|
||||
@Nullable
|
||||
Rect getHitSlopRect();
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.touch
|
||||
|
||||
import android.graphics.Rect
|
||||
|
||||
/**
|
||||
* This interface should be implemented by all [View] subclasses that want to use the hitSlop prop
|
||||
* to extend their touch areas.
|
||||
*/
|
||||
interface ReactHitSlopView {
|
||||
val hitSlopRect: Rect?
|
||||
}
|
||||
+1
-1
@@ -413,7 +413,7 @@ object ReactMapBufferPropSetter {
|
||||
PixelUtil.toPixelFromDIP(value.getDouble(EDGE_RIGHT)).toInt(),
|
||||
PixelUtil.toPixelFromDIP(value.getDouble(EDGE_BOTTOM)).toInt(),
|
||||
)
|
||||
hitSlopRect = rect
|
||||
setHitSlopRect(rect)
|
||||
}
|
||||
|
||||
private fun ReactViewGroup.importantForAccessibility(value: Int) {
|
||||
|
||||
Reference in New Issue
Block a user