react-native-gesture-handler 2.13.3 → 2.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,30 +3,6 @@ require "json"
3
3
  new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
4
4
  apple_platform = new_arch_enabled ? '11.0' : '9.0'
5
5
 
6
- # Utility function to install dependencies if React Native's
7
- # install_modules_dependencies is not defined
8
- def install_dependencies(s, new_arch_enabled)
9
- if new_arch_enabled
10
- folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
11
-
12
- s.pod_target_xcconfig = {
13
- 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly"',
14
- 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
15
- }
16
- s.compiler_flags = folly_compiler_flags + ' -DRCT_NEW_ARCH_ENABLED'
17
-
18
- s.dependency "React"
19
- s.dependency "React-RCTFabric" # This is for fabric component
20
- s.dependency "React-Codegen"
21
- s.dependency "RCT-Folly"
22
- s.dependency "RCTRequired"
23
- s.dependency "RCTTypeSafety"
24
- s.dependency "ReactCommon/turbomodule/core"
25
- else
26
- s.dependency "React-Core"
27
- end
28
- end
29
-
30
6
  Pod::Spec.new do |s|
31
7
  # NPM package specification
32
8
  package = JSON.parse(File.read(File.join(File.dirname(__FILE__), "package.json")))
@@ -45,6 +21,24 @@ Pod::Spec.new do |s|
45
21
  if defined?(install_modules_dependencies()) != nil
46
22
  install_modules_dependencies(s);
47
23
  else
48
- install_dependencies(s, new_arch_enabled)
24
+ if new_arch_enabled
25
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
26
+
27
+ s.pod_target_xcconfig = {
28
+ 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly"',
29
+ 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
30
+ }
31
+ s.compiler_flags = folly_compiler_flags + ' -DRCT_NEW_ARCH_ENABLED'
32
+
33
+ s.dependency "React"
34
+ s.dependency "React-RCTFabric" # This is for fabric component
35
+ s.dependency "React-Codegen"
36
+ s.dependency "RCT-Folly"
37
+ s.dependency "RCTRequired"
38
+ s.dependency "RCTTypeSafety"
39
+ s.dependency "ReactCommon/turbomodule/core"
40
+ else
41
+ s.dependency "React-Core"
42
+ end
49
43
  end
50
44
  end
@@ -188,6 +188,17 @@ class RNGestureHandlerButtonViewManager : ViewGroupManager<ButtonViewGroup>(), R
188
188
  return false
189
189
  }
190
190
 
191
+ private fun updateBackgroundColor(backgroundColor: Int, borderRadius: Float, selectable: Drawable?) {
192
+ val colorDrawable = PaintDrawable(backgroundColor)
193
+
194
+ if (borderRadius != 0f) {
195
+ colorDrawable.setCornerRadius(borderRadius)
196
+ }
197
+
198
+ val layerDrawable = LayerDrawable(if (selectable != null) arrayOf(colorDrawable, selectable) else arrayOf(colorDrawable))
199
+ background = layerDrawable
200
+ }
201
+
191
202
  fun updateBackground() {
192
203
  if (!needBackgroundUpdate) {
193
204
  return
@@ -223,19 +234,12 @@ class RNGestureHandlerButtonViewManager : ViewGroupManager<ButtonViewGroup>(), R
223
234
  if (useDrawableOnForeground && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
224
235
  foreground = selectable
225
236
  if (_backgroundColor != Color.TRANSPARENT) {
226
- setBackgroundColor(_backgroundColor)
237
+ updateBackgroundColor(_backgroundColor, borderRadius, null)
227
238
  }
228
239
  } else if (_backgroundColor == Color.TRANSPARENT && rippleColor == null) {
229
240
  background = selectable
230
241
  } else {
231
- val colorDrawable = PaintDrawable(_backgroundColor)
232
-
233
- if (borderRadius != 0f) {
234
- colorDrawable.setCornerRadius(borderRadius)
235
- }
236
-
237
- val layerDrawable = LayerDrawable(if (selectable != null) arrayOf(colorDrawable, selectable) else arrayOf(colorDrawable))
238
- background = layerDrawable
242
+ updateBackgroundColor(_backgroundColor, borderRadius, selectable)
239
243
  }
240
244
  }
241
245
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gesture-handler",
3
- "version": "2.13.3",
3
+ "version": "2.13.4",
4
4
  "description": "Experimental implementation of a new declarative API for gesture handling in react-native",
5
5
  "scripts": {
6
6
  "prepare": "bob build && husky install",