react-native-gesture-handler 2.13.2 → 2.13.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,7 @@
1
1
  require "json"
2
2
 
3
- fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
3
+ new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
4
+ apple_platform = new_arch_enabled ? '11.0' : '9.0'
4
5
 
5
6
  Pod::Spec.new do |s|
6
7
  # NPM package specification
@@ -15,27 +16,29 @@ Pod::Spec.new do |s|
15
16
  s.source = { :git => "https://github.com/software-mansion/react-native-gesture-handler", :tag => "#{s.version}" }
16
17
  s.source_files = "ios/**/*.{h,m,mm}"
17
18
  s.requires_arc = true
19
+ s.platforms = { ios: apple_platform, tvos: apple_platform }
18
20
 
19
- if fabric_enabled
20
- folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
21
-
22
- s.pod_target_xcconfig = {
23
- 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly"',
24
- 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
25
- }
26
- s.platforms = { ios: '11.0', tvos: '11.0' }
27
- s.compiler_flags = folly_compiler_flags + ' -DRCT_NEW_ARCH_ENABLED'
28
-
29
- s.dependency "React"
30
- s.dependency "React-RCTFabric" # This is for fabric component
31
- s.dependency "React-Codegen"
32
- s.dependency "RCT-Folly"
33
- s.dependency "RCTRequired"
34
- s.dependency "RCTTypeSafety"
35
- s.dependency "ReactCommon/turbomodule/core"
21
+ if defined?(install_modules_dependencies()) != nil
22
+ install_modules_dependencies(s);
36
23
  else
37
- s.platforms = { :ios => "9.0", :tvos => "9.0" }
38
-
39
- s.dependency "React-Core"
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
40
43
  end
41
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.2",
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",