react-native-screens 3.19.0 → 3.21.0
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.
- package/README.md +2 -1
- package/RNScreens.podspec +1 -1
- package/android/build.gradle +24 -6
- package/android/src/main/java/com/swmansion/rnscreens/CustomSearchView.kt +4 -0
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.kt +7 -9
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfigViewManager.kt +12 -4
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarManager.kt +32 -8
- package/android/src/main/java/com/swmansion/rnscreens/SearchBarView.kt +36 -15
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderAttachedEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/HeaderDetachedEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarBlurEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarChangeTextEvent.kt +29 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarCloseEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarFocusEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarOpenEvent.kt +24 -0
- package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt +26 -0
- package/android/src/main/res/base/anim/rns_standard_accelerate_interpolator.xml +6 -0
- package/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml +38 -0
- package/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml +38 -0
- package/android/src/main/res/v33/anim-v33/rns_default_exit_in.xml +38 -0
- package/android/src/main/res/v33/anim-v33/rns_default_exit_out.xml +38 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerDelegate.java +3 -0
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerInterface.java +1 -0
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenState.h +1 -2
- package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.h +11 -0
- package/ios/RCTImageComponentView+RNSScreenStackHeaderConfig.mm +14 -0
- package/ios/RNSConvert.h +2 -2
- package/ios/RNSConvert.mm +2 -2
- package/ios/RNSFullWindowOverlay.h +5 -5
- package/ios/RNSFullWindowOverlay.mm +13 -13
- package/ios/RNSScreen.h +7 -6
- package/ios/RNSScreen.mm +35 -33
- package/ios/RNSScreenContainer.h +2 -2
- package/ios/RNSScreenContainer.mm +5 -5
- package/ios/RNSScreenNavigationContainer.mm +3 -3
- package/ios/RNSScreenStack.h +4 -4
- package/ios/RNSScreenStack.mm +62 -23
- package/ios/RNSScreenStackHeaderConfig.h +10 -3
- package/ios/RNSScreenStackHeaderConfig.mm +138 -81
- package/ios/RNSScreenStackHeaderSubview.h +5 -6
- package/ios/RNSScreenStackHeaderSubview.mm +20 -11
- package/ios/RNSScreenWindowTraits.mm +21 -2
- package/ios/RNSSearchBar.h +5 -4
- package/ios/RNSSearchBar.mm +87 -12
- package/ios/RNScreens.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNScreens.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNScreens.xcodeproj/project.xcworkspace/xcuserdata/wojciechlewicki.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNScreens.xcodeproj/xcuserdata/wojciechlewicki.xcuserdatad/xcschemes/xcschememanagement.plist +19 -0
- package/lib/commonjs/TransitionProgressContext.js.map +1 -1
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +0 -5
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -8
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -8
- package/lib/commonjs/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js +0 -5
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/SearchBarNativeComponent.js +7 -7
- package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.native.js +53 -11
- package/lib/commonjs/index.native.js.map +1 -1
- package/lib/commonjs/native-stack/index.js.map +1 -1
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js +18 -16
- package/lib/commonjs/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/commonjs/native-stack/types.js.map +1 -1
- package/lib/commonjs/native-stack/utils/HeaderHeightContext.js.map +1 -1
- package/lib/commonjs/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
- package/lib/commonjs/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/commonjs/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/commonjs/native-stack/views/FontProcessor.js +1 -0
- package/lib/commonjs/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/commonjs/native-stack/views/HeaderConfig.js +3 -1
- package/lib/commonjs/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js +14 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js +3 -1
- package/lib/commonjs/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedTransitionProgressContext.js.map +1 -1
- package/lib/commonjs/reanimated/index.js.map +1 -1
- package/lib/commonjs/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useTransitionProgress.js.map +1 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +0 -5
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenContainerNativeComponent.js +0 -5
- package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNativeComponent.js +0 -5
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +0 -5
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -6
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -6
- package/lib/module/fabric/ScreenStackHeaderSubviewNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackNativeComponent.js +0 -5
- package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/module/fabric/SearchBarNativeComponent.js +4 -6
- package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.native.js +54 -11
- package/lib/module/index.native.js.map +1 -1
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js +18 -16
- package/lib/module/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
- package/lib/module/native-stack/types.js.map +1 -1
- package/lib/module/native-stack/utils/SafeAreaProviderCompat.js.map +1 -1
- package/lib/module/native-stack/utils/getDefaultHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/utils/useBackPressSubscription.js.map +1 -1
- package/lib/module/native-stack/utils/useHeaderHeight.js.map +1 -1
- package/lib/module/native-stack/views/FontProcessor.js +1 -0
- package/lib/module/native-stack/views/FontProcessor.js.map +1 -1
- package/lib/module/native-stack/views/HeaderConfig.js +3 -1
- package/lib/module/native-stack/views/HeaderConfig.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js +15 -1
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreen.js.map +1 -1
- package/lib/module/reanimated/ReanimatedScreenProvider.js +3 -1
- package/lib/module/reanimated/ReanimatedScreenProvider.js.map +1 -1
- package/lib/module/reanimated/useReanimatedTransitionProgress.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/useTransitionProgress.js.map +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts +6 -0
- package/lib/typescript/fabric/ScreenContainerNativeComponent.d.ts +6 -0
- package/lib/typescript/fabric/ScreenNativeComponent.d.ts +62 -0
- package/lib/typescript/fabric/ScreenNavigationContainerNativeComponent.d.ts +6 -0
- package/lib/typescript/fabric/ScreenStackHeaderConfigNativeComponent.d.ts +34 -0
- package/lib/typescript/fabric/ScreenStackHeaderSubviewNativeComponent.d.ts +9 -0
- package/lib/typescript/fabric/ScreenStackNativeComponent.d.ts +9 -0
- package/lib/typescript/fabric/SearchBarNativeComponent.d.ts +46 -0
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +2 -2
- package/lib/typescript/native-stack/types.d.ts +55 -1
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +1 -1
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts +1 -1
- package/lib/typescript/types.d.ts +81 -2
- package/lib/typescript/useTransitionProgress.d.ts +3 -3
- package/native-stack/README.md +59 -1
- package/package.json +11 -14
- package/src/fabric/FullWindowOverlayNativeComponent.ts +6 -0
- package/src/fabric/ScreenContainerNativeComponent.ts +6 -0
- package/src/fabric/ScreenNativeComponent.ts +97 -0
- package/src/fabric/ScreenNavigationContainerNativeComponent.ts +9 -0
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.ts +43 -0
- package/src/fabric/ScreenStackHeaderSubviewNativeComponent.ts +20 -0
- package/src/fabric/ScreenStackNativeComponent.ts +12 -0
- package/src/fabric/SearchBarNativeComponent.ts +73 -0
- package/src/index.native.tsx +107 -14
- package/src/index.tsx +4 -3
- package/src/native-stack/navigators/createNativeStackNavigator.tsx +23 -19
- package/src/native-stack/types.tsx +55 -0
- package/src/native-stack/views/FontProcessor.tsx +1 -0
- package/src/native-stack/views/HeaderConfig.tsx +3 -1
- package/src/native-stack/views/NativeStackView.tsx +14 -2
- package/src/types.tsx +84 -2
- package/android/src/main/java/com/swmansion/rnscreens/LifecycleHelper.kt +0 -60
- package/createNativeStackNavigator/README.md +0 -522
- package/createNativeStackNavigator/package.json +0 -6
- package/lib/commonjs/createNativeStackNavigator.js +0 -374
- package/lib/commonjs/createNativeStackNavigator.js.map +0 -1
- package/lib/module/createNativeStackNavigator.js +0 -366
- package/lib/module/createNativeStackNavigator.js.map +0 -1
- package/lib/typescript/createNativeStackNavigator.d.ts +0 -51
- package/src/createNativeStackNavigator.tsx +0 -594
- package/src/fabric/FullWindowOverlayNativeComponent.js +0 -19
- package/src/fabric/ScreenContainerNativeComponent.js +0 -19
- package/src/fabric/ScreenNativeComponent.js +0 -104
- package/src/fabric/ScreenNavigationContainerNativeComponent.js +0 -19
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.js +0 -54
- package/src/fabric/ScreenStackHeaderSubviewNativeComponent.js +0 -31
- package/src/fabric/ScreenStackNativeComponent.js +0 -23
- package/src/fabric/SearchBarNativeComponent.js +0 -62
- /package/android/src/main/res/{anim → base/anim}/rns_default_enter_in.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_default_enter_out.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_default_exit_in.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_default_exit_out.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_fade_from_bottom.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_fade_in.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_fade_out.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_fade_to_bottom.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_no_animation_20.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_no_animation_250.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_no_animation_350.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_no_animation_medium.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_in_from_bottom.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_in_from_left.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_in_from_right.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_out_to_bottom.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_out_to_left.xml +0 -0
- /package/android/src/main/res/{anim → base/anim}/rns_slide_out_to_right.xml +0 -0
package/README.md
CHANGED
|
@@ -91,11 +91,13 @@ Screens are already integrated with the React Native's most popular navigation l
|
|
|
91
91
|
|
|
92
92
|
[Fabric](https://reactnative.dev/architecture/fabric-renderer) is React Native's new rendering system.
|
|
93
93
|
|
|
94
|
+
- As of [version `3.19.0`](https://github.com/software-mansion/react-native-screens/releases/tag/3.19.0) of this project, Fabric is supported only for react-native 0.71+. Support for lower versions has been dropped.
|
|
94
95
|
- As of [version `3.18.0`](https://github.com/software-mansion/react-native-screens/releases/tag/3.18.0) of this project, Fabric is supported only for react-native 0.70+. Support for lower versions has been dropped.
|
|
95
96
|
- As of [version `3.14.0`](https://github.com/software-mansion/react-native-screens/releases/tag/3.14.0) of this project, Fabric is supported only for react-native 0.69+. Support for lower versions has been dropped.
|
|
96
97
|
|
|
97
98
|
| version | react-native version |
|
|
98
99
|
| ------- | -------------------- |
|
|
100
|
+
| 3.19.0+ | 0.71.0+ |
|
|
99
101
|
| 3.18.0+ | 0.70.0+ |
|
|
100
102
|
| 3.14.0+ | 0.69.0+ |
|
|
101
103
|
|
|
@@ -153,7 +155,6 @@ To take advantage of the native stack navigator primitive for React Navigation t
|
|
|
153
155
|
|
|
154
156
|
- for React Navigation >= v6 to the [Native Stack Navigator part of React Navigation documentation](https://reactnavigation.org/docs/native-stack-navigator)
|
|
155
157
|
- for React Navigation v5 to the [README in react-native-screens/native-stack](https://github.com/software-mansion/react-native-screens/tree/main/native-stack)
|
|
156
|
-
- for older versions to the [README in react-native-screens/createNativeStackNavigator](https://github.com/software-mansion/react-native-screens/tree/main/createNativeStackNavigator)
|
|
157
158
|
|
|
158
159
|
## `FullWindowOverlay`
|
|
159
160
|
|
package/RNScreens.podspec
CHANGED
|
@@ -26,7 +26,7 @@ Pod::Spec.new do |s|
|
|
|
26
26
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
27
27
|
}
|
|
28
28
|
s.platforms = { ios: '11.0', tvos: '11.0' }
|
|
29
|
-
s.compiler_flags = folly_compiler_flags + ' ' + '-
|
|
29
|
+
s.compiler_flags = folly_compiler_flags + ' ' + '-DRCT_NEW_ARCH_ENABLED'
|
|
30
30
|
s.source_files = 'ios/**/*.{h,m,mm,cpp}'
|
|
31
31
|
s.requires_arc = true
|
|
32
32
|
|
package/android/build.gradle
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
buildscript {
|
|
2
|
+
ext {
|
|
3
|
+
rnsDefaultTargetSdkVersion = 31
|
|
4
|
+
rnsDefaultCompileSdkVersion = 31
|
|
5
|
+
rnsDefaultMinSdkVersion = 21
|
|
6
|
+
rnsDefaultKotlinVersion = '1.6.21'
|
|
7
|
+
}
|
|
2
8
|
ext.safeExtGet = {prop, fallback ->
|
|
3
9
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
4
10
|
}
|
|
@@ -8,7 +14,7 @@ buildscript {
|
|
|
8
14
|
}
|
|
9
15
|
dependencies {
|
|
10
16
|
classpath('com.android.tools.build:gradle:4.2.2')
|
|
11
|
-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion',
|
|
17
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', rnsDefaultKotlinVersion)}"
|
|
12
18
|
classpath "com.diffplug.spotless:spotless-plugin-gradle:5.15.0"
|
|
13
19
|
}
|
|
14
20
|
}
|
|
@@ -38,7 +44,11 @@ def reactNativeArchitectures() {
|
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
android {
|
|
41
|
-
compileSdkVersion safeExtGet('compileSdkVersion',
|
|
47
|
+
compileSdkVersion safeExtGet('compileSdkVersion', rnsDefaultCompileSdkVersion)
|
|
48
|
+
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
|
|
49
|
+
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
|
|
50
|
+
namespace "com.swmansion.rnscreens"
|
|
51
|
+
}
|
|
42
52
|
|
|
43
53
|
// Used to override the NDK path/version on internal CI or by allowing
|
|
44
54
|
// users to customize the NDK path/version from their root project (e.g. for M1 support)
|
|
@@ -50,8 +60,8 @@ android {
|
|
|
50
60
|
}
|
|
51
61
|
|
|
52
62
|
defaultConfig {
|
|
53
|
-
minSdkVersion safeExtGet('minSdkVersion',
|
|
54
|
-
targetSdkVersion safeExtGet('targetSdkVersion',
|
|
63
|
+
minSdkVersion safeExtGet('minSdkVersion', rnsDefaultMinSdkVersion)
|
|
64
|
+
targetSdkVersion safeExtGet('targetSdkVersion', rnsDefaultTargetSdkVersion)
|
|
55
65
|
versionCode 1
|
|
56
66
|
versionName "1.0"
|
|
57
67
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
@@ -68,12 +78,13 @@ android {
|
|
|
68
78
|
}
|
|
69
79
|
packagingOptions {
|
|
70
80
|
// For some reason gradle only complains about the duplicated version of libreact_render libraries
|
|
71
|
-
// while there are more libraries copied in intermediates folder of the lib build directory, we
|
|
81
|
+
// while there are more libraries copied in intermediates folder of the lib build directory, we exclude
|
|
72
82
|
// only the ones that make the build fail (ideally we should only include librnscreens_modules but we
|
|
73
|
-
// are only allowed to specify
|
|
83
|
+
// are only allowed to specify exclude patterns)
|
|
74
84
|
exclude "**/libreact_render*.so"
|
|
75
85
|
}
|
|
76
86
|
sourceSets.main {
|
|
87
|
+
ext.androidResDir = "src/main/res"
|
|
77
88
|
java {
|
|
78
89
|
if (isNewArchitectureEnabled()) {
|
|
79
90
|
srcDirs += [
|
|
@@ -87,6 +98,13 @@ android {
|
|
|
87
98
|
}
|
|
88
99
|
|
|
89
100
|
}
|
|
101
|
+
res {
|
|
102
|
+
if (safeExtGet('compileSdkVersion', rnsDefaultCompileSdkVersion) >= 33) {
|
|
103
|
+
srcDirs = ["${androidResDir}/base", "${androidResDir}/v33"]
|
|
104
|
+
} else {
|
|
105
|
+
srcDirs = ["${androidResDir}/base"]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
90
108
|
}
|
|
91
109
|
}
|
|
92
110
|
|
|
@@ -36,6 +36,10 @@ class CustomSearchView(context: Context, fragment: Fragment) : SearchView(contex
|
|
|
36
36
|
requestFocusFromTouch()
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
fun clearText() = setQuery("", false)
|
|
40
|
+
|
|
41
|
+
fun setText(text: String) = setQuery(text, false)
|
|
42
|
+
|
|
39
43
|
override fun setOnCloseListener(listener: OnCloseListener?) {
|
|
40
44
|
mCustomOnCloseListener = listener
|
|
41
45
|
}
|
|
@@ -16,9 +16,10 @@ import androidx.fragment.app.Fragment
|
|
|
16
16
|
import com.facebook.react.ReactApplication
|
|
17
17
|
import com.facebook.react.bridge.JSApplicationIllegalArgumentException
|
|
18
18
|
import com.facebook.react.bridge.ReactContext
|
|
19
|
-
import com.facebook.react.
|
|
20
|
-
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
19
|
+
import com.facebook.react.uimanager.UIManagerHelper
|
|
21
20
|
import com.facebook.react.views.text.ReactTypefaceUtils
|
|
21
|
+
import com.swmansion.rnscreens.events.HeaderAttachedEvent
|
|
22
|
+
import com.swmansion.rnscreens.events.HeaderDetachedEvent
|
|
22
23
|
|
|
23
24
|
class ScreenStackHeaderConfig(context: Context) : ViewGroup(context) {
|
|
24
25
|
private val mConfigSubviews = ArrayList<ScreenStackHeaderSubview>(3)
|
|
@@ -64,11 +65,6 @@ class ScreenStackHeaderConfig(context: Context) : ViewGroup(context) {
|
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
private fun sendEvent(eventName: String, eventContent: WritableMap?) {
|
|
68
|
-
(context as ReactContext).getJSModule(RCTEventEmitter::class.java)
|
|
69
|
-
?.receiveEvent(id, eventName, eventContent)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
68
|
override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
|
|
73
69
|
// no-op
|
|
74
70
|
}
|
|
@@ -80,7 +76,8 @@ class ScreenStackHeaderConfig(context: Context) : ViewGroup(context) {
|
|
|
80
76
|
override fun onAttachedToWindow() {
|
|
81
77
|
super.onAttachedToWindow()
|
|
82
78
|
mIsAttachedToWindow = true
|
|
83
|
-
|
|
79
|
+
UIManagerHelper.getEventDispatcherForReactTag(context as ReactContext, id)
|
|
80
|
+
?.dispatchEvent(HeaderAttachedEvent(id))
|
|
84
81
|
// we want to save the top inset before the status bar can be hidden, which would resolve in
|
|
85
82
|
// inset being 0
|
|
86
83
|
if (headerTopInset == null) {
|
|
@@ -96,7 +93,8 @@ class ScreenStackHeaderConfig(context: Context) : ViewGroup(context) {
|
|
|
96
93
|
override fun onDetachedFromWindow() {
|
|
97
94
|
super.onDetachedFromWindow()
|
|
98
95
|
mIsAttachedToWindow = false
|
|
99
|
-
|
|
96
|
+
UIManagerHelper.getEventDispatcherForReactTag(context as ReactContext, id)
|
|
97
|
+
?.dispatchEvent(HeaderDetachedEvent(id))
|
|
100
98
|
}
|
|
101
99
|
|
|
102
100
|
private val screen: Screen?
|
|
@@ -11,6 +11,8 @@ import com.facebook.react.uimanager.ViewManagerDelegate
|
|
|
11
11
|
import com.facebook.react.uimanager.annotations.ReactProp
|
|
12
12
|
import com.facebook.react.viewmanagers.RNSScreenStackHeaderConfigManagerDelegate
|
|
13
13
|
import com.facebook.react.viewmanagers.RNSScreenStackHeaderConfigManagerInterface
|
|
14
|
+
import com.swmansion.rnscreens.events.HeaderAttachedEvent
|
|
15
|
+
import com.swmansion.rnscreens.events.HeaderDetachedEvent
|
|
14
16
|
import javax.annotation.Nonnull
|
|
15
17
|
|
|
16
18
|
@ReactModule(name = ScreenStackHeaderConfigViewManager.REACT_CLASS)
|
|
@@ -133,10 +135,12 @@ class ScreenStackHeaderConfigViewManager : ViewGroupManager<ScreenStackHeaderCon
|
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
override fun getExportedCustomDirectEventTypeConstants(): Map<String, Any>? {
|
|
136
|
-
return MapBuilder.
|
|
137
|
-
.
|
|
138
|
-
|
|
139
|
-
.
|
|
138
|
+
return MapBuilder.of(
|
|
139
|
+
HeaderAttachedEvent.EVENT_NAME,
|
|
140
|
+
MapBuilder.of("registrationName", "onAttached"),
|
|
141
|
+
HeaderDetachedEvent.EVENT_NAME,
|
|
142
|
+
MapBuilder.of("registrationName", "onDetached"),
|
|
143
|
+
)
|
|
140
144
|
}
|
|
141
145
|
|
|
142
146
|
protected override fun getDelegate(): ViewManagerDelegate<ScreenStackHeaderConfig> = mDelegate
|
|
@@ -162,6 +166,10 @@ class ScreenStackHeaderConfigViewManager : ViewGroupManager<ScreenStackHeaderCon
|
|
|
162
166
|
logNotAvailable("backTitleFontSize")
|
|
163
167
|
}
|
|
164
168
|
|
|
169
|
+
override fun setBackTitleVisible(view: ScreenStackHeaderConfig?, value: Boolean) {
|
|
170
|
+
logNotAvailable("backTitleVisible")
|
|
171
|
+
}
|
|
172
|
+
|
|
165
173
|
override fun setLargeTitle(view: ScreenStackHeaderConfig?, value: Boolean) {
|
|
166
174
|
logNotAvailable("largeTitle")
|
|
167
175
|
}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
package com.swmansion.rnscreens
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.bridge.JSApplicationIllegalArgumentException
|
|
4
|
+
import com.facebook.react.bridge.ReadableArray
|
|
4
5
|
import com.facebook.react.common.MapBuilder
|
|
5
6
|
import com.facebook.react.module.annotations.ReactModule
|
|
6
7
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
7
8
|
import com.facebook.react.uimanager.ViewGroupManager
|
|
8
9
|
import com.facebook.react.uimanager.annotations.ReactProp
|
|
10
|
+
import com.swmansion.rnscreens.events.SearchBarBlurEvent
|
|
11
|
+
import com.swmansion.rnscreens.events.SearchBarChangeTextEvent
|
|
12
|
+
import com.swmansion.rnscreens.events.SearchBarCloseEvent
|
|
13
|
+
import com.swmansion.rnscreens.events.SearchBarFocusEvent
|
|
14
|
+
import com.swmansion.rnscreens.events.SearchBarOpenEvent
|
|
15
|
+
import com.swmansion.rnscreens.events.SearchBarSearchButtonPressEvent
|
|
9
16
|
|
|
10
17
|
@ReactModule(name = SearchBarManager.REACT_CLASS)
|
|
11
18
|
class SearchBarManager : ViewGroupManager<SearchBarView>() {
|
|
@@ -90,15 +97,32 @@ class SearchBarManager : ViewGroupManager<SearchBarView>() {
|
|
|
90
97
|
view.shouldShowHintSearchIcon = shouldShowHintSearchIcon ?: true
|
|
91
98
|
}
|
|
92
99
|
|
|
100
|
+
override fun receiveCommand(root: SearchBarView, commandId: String?, args: ReadableArray?) {
|
|
101
|
+
when (commandId) {
|
|
102
|
+
"focus" -> root.handleFocusJsRequest()
|
|
103
|
+
"blur" -> root.handleBlurJsRequest()
|
|
104
|
+
"clearText" -> root.handleClearTextJsRequest()
|
|
105
|
+
"toggleCancelButton" -> root.handleToggleCancelButtonJsRequest(false) // just a dummy argument
|
|
106
|
+
"setText" -> root.handleSetTextJsRequest(args?.getString(0))
|
|
107
|
+
else -> throw JSApplicationIllegalArgumentException("Unsupported native command received: $commandId")
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
93
111
|
override fun getExportedCustomDirectEventTypeConstants(): Map<String, Any>? {
|
|
94
|
-
return MapBuilder.
|
|
95
|
-
.
|
|
96
|
-
|
|
97
|
-
.
|
|
98
|
-
|
|
99
|
-
.
|
|
100
|
-
|
|
101
|
-
.
|
|
112
|
+
return MapBuilder.of(
|
|
113
|
+
SearchBarBlurEvent.EVENT_NAME,
|
|
114
|
+
MapBuilder.of("registrationName", "onBlur"),
|
|
115
|
+
SearchBarChangeTextEvent.EVENT_NAME,
|
|
116
|
+
MapBuilder.of("registrationName", "onChangeText"),
|
|
117
|
+
SearchBarCloseEvent.EVENT_NAME,
|
|
118
|
+
MapBuilder.of("registrationName", "onClose"),
|
|
119
|
+
SearchBarFocusEvent.EVENT_NAME,
|
|
120
|
+
MapBuilder.of("registrationName", "onFocus"),
|
|
121
|
+
SearchBarOpenEvent.EVENT_NAME,
|
|
122
|
+
MapBuilder.of("registrationName", "onOpen"),
|
|
123
|
+
SearchBarSearchButtonPressEvent.EVENT_NAME,
|
|
124
|
+
MapBuilder.of("registrationName", "onSearchButtonPress"),
|
|
125
|
+
)
|
|
102
126
|
}
|
|
103
127
|
|
|
104
128
|
companion object {
|
|
@@ -3,11 +3,17 @@ package com.swmansion.rnscreens
|
|
|
3
3
|
import android.annotation.SuppressLint
|
|
4
4
|
import android.text.InputType
|
|
5
5
|
import androidx.appcompat.widget.SearchView
|
|
6
|
-
import com.facebook.react.bridge.Arguments
|
|
7
6
|
import com.facebook.react.bridge.ReactContext
|
|
8
|
-
import com.facebook.react.
|
|
9
|
-
import com.facebook.react.uimanager.events.
|
|
7
|
+
import com.facebook.react.uimanager.UIManagerHelper
|
|
8
|
+
import com.facebook.react.uimanager.events.Event
|
|
9
|
+
import com.facebook.react.uimanager.events.EventDispatcher
|
|
10
10
|
import com.facebook.react.views.view.ReactViewGroup
|
|
11
|
+
import com.swmansion.rnscreens.events.SearchBarBlurEvent
|
|
12
|
+
import com.swmansion.rnscreens.events.SearchBarChangeTextEvent
|
|
13
|
+
import com.swmansion.rnscreens.events.SearchBarCloseEvent
|
|
14
|
+
import com.swmansion.rnscreens.events.SearchBarFocusEvent
|
|
15
|
+
import com.swmansion.rnscreens.events.SearchBarOpenEvent
|
|
16
|
+
import com.swmansion.rnscreens.events.SearchBarSearchButtonPressEvent
|
|
11
17
|
|
|
12
18
|
@SuppressLint("ViewConstructor")
|
|
13
19
|
class SearchBarView(reactContext: ReactContext?) : ReactViewGroup(reactContext) {
|
|
@@ -95,32 +101,47 @@ class SearchBarView(reactContext: ReactContext?) : ReactViewGroup(reactContext)
|
|
|
95
101
|
}
|
|
96
102
|
|
|
97
103
|
private fun handleTextChange(newText: String?) {
|
|
98
|
-
|
|
99
|
-
event.putString("text", newText)
|
|
100
|
-
sendEvent("onChangeText", event)
|
|
104
|
+
sendEvent(SearchBarChangeTextEvent(id, newText))
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
private fun handleFocusChange(hasFocus: Boolean) {
|
|
104
|
-
sendEvent(if (hasFocus)
|
|
108
|
+
sendEvent(if (hasFocus) SearchBarFocusEvent(id) else SearchBarBlurEvent(id))
|
|
105
109
|
}
|
|
106
110
|
|
|
107
111
|
private fun handleClose() {
|
|
108
|
-
sendEvent(
|
|
112
|
+
sendEvent(SearchBarCloseEvent(id))
|
|
109
113
|
}
|
|
110
114
|
|
|
111
115
|
private fun handleOpen() {
|
|
112
|
-
sendEvent(
|
|
116
|
+
sendEvent(SearchBarOpenEvent(id))
|
|
113
117
|
}
|
|
114
118
|
|
|
115
119
|
private fun handleTextSubmit(newText: String?) {
|
|
116
|
-
|
|
117
|
-
event.putString("text", newText)
|
|
118
|
-
sendEvent("onSearchButtonPress", event)
|
|
120
|
+
sendEvent(SearchBarSearchButtonPressEvent(id, newText))
|
|
119
121
|
}
|
|
120
122
|
|
|
121
|
-
private fun sendEvent(
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
private fun sendEvent(event: Event<*>) {
|
|
124
|
+
val eventDispatcher: EventDispatcher? =
|
|
125
|
+
UIManagerHelper.getEventDispatcherForReactTag(context as ReactContext, id)
|
|
126
|
+
eventDispatcher?.dispatchEvent(event)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
fun handleClearTextJsRequest() {
|
|
130
|
+
screenStackFragment?.searchView?.clearText()
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
fun handleFocusJsRequest() {
|
|
134
|
+
screenStackFragment?.searchView?.focus()
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
fun handleBlurJsRequest() {
|
|
138
|
+
screenStackFragment?.searchView?.clearFocus()
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
fun handleToggleCancelButtonJsRequest(flag: Boolean) = Unit
|
|
142
|
+
|
|
143
|
+
fun handleSetTextJsRequest(text: String?) {
|
|
144
|
+
text?.let { screenStackFragment?.searchView?.setText(it) }
|
|
124
145
|
}
|
|
125
146
|
|
|
126
147
|
enum class SearchBarAutoCapitalize {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package com.swmansion.rnscreens.events
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Arguments
|
|
4
|
+
import com.facebook.react.uimanager.events.Event
|
|
5
|
+
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
6
|
+
|
|
7
|
+
class HeaderAttachedEvent(viewId: Int) : Event<ScreenAppearEvent>(viewId) {
|
|
8
|
+
override fun getEventName(): String {
|
|
9
|
+
return EVENT_NAME
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
override fun getCoalescingKey(): Short {
|
|
13
|
+
// All events for a given view can be coalesced.
|
|
14
|
+
return 0
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
|
|
18
|
+
rctEventEmitter.receiveEvent(viewTag, eventName, Arguments.createMap())
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
companion object {
|
|
22
|
+
const val EVENT_NAME = "topAttached"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package com.swmansion.rnscreens.events
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Arguments
|
|
4
|
+
import com.facebook.react.uimanager.events.Event
|
|
5
|
+
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
6
|
+
|
|
7
|
+
class HeaderDetachedEvent(viewId: Int) : Event<ScreenAppearEvent>(viewId) {
|
|
8
|
+
override fun getEventName(): String {
|
|
9
|
+
return EVENT_NAME
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
override fun getCoalescingKey(): Short {
|
|
13
|
+
// All events for a given view can be coalesced.
|
|
14
|
+
return 0
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
|
|
18
|
+
rctEventEmitter.receiveEvent(viewTag, eventName, Arguments.createMap())
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
companion object {
|
|
22
|
+
const val EVENT_NAME = "topDetached"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package com.swmansion.rnscreens.events
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Arguments
|
|
4
|
+
import com.facebook.react.uimanager.events.Event
|
|
5
|
+
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
6
|
+
|
|
7
|
+
class SearchBarBlurEvent(viewId: Int) : Event<ScreenAppearEvent>(viewId) {
|
|
8
|
+
override fun getEventName(): String {
|
|
9
|
+
return EVENT_NAME
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
override fun getCoalescingKey(): Short {
|
|
13
|
+
// All events for a given view can be coalesced.
|
|
14
|
+
return 0
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
|
|
18
|
+
rctEventEmitter.receiveEvent(viewTag, eventName, Arguments.createMap())
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
companion object {
|
|
22
|
+
const val EVENT_NAME = "topBlur"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
package com.swmansion.rnscreens.events
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Arguments
|
|
4
|
+
import com.facebook.react.uimanager.events.Event
|
|
5
|
+
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
6
|
+
|
|
7
|
+
class SearchBarChangeTextEvent(
|
|
8
|
+
viewId: Int,
|
|
9
|
+
private val text: String?,
|
|
10
|
+
) : Event<ScreenAppearEvent>(viewId) {
|
|
11
|
+
override fun getEventName(): String {
|
|
12
|
+
return EVENT_NAME
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
override fun getCoalescingKey(): Short {
|
|
16
|
+
// All events for a given view can be coalesced.
|
|
17
|
+
return 0
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
|
|
21
|
+
val map = Arguments.createMap()
|
|
22
|
+
map.putString("text", text)
|
|
23
|
+
rctEventEmitter.receiveEvent(viewTag, eventName, map)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
companion object {
|
|
27
|
+
const val EVENT_NAME = "topChangeText"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package com.swmansion.rnscreens.events
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Arguments
|
|
4
|
+
import com.facebook.react.uimanager.events.Event
|
|
5
|
+
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
6
|
+
|
|
7
|
+
class SearchBarCloseEvent(viewId: Int) : Event<ScreenAppearEvent>(viewId) {
|
|
8
|
+
override fun getEventName(): String {
|
|
9
|
+
return EVENT_NAME
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
override fun getCoalescingKey(): Short {
|
|
13
|
+
// All events for a given view can be coalesced.
|
|
14
|
+
return 0
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
|
|
18
|
+
rctEventEmitter.receiveEvent(viewTag, eventName, Arguments.createMap())
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
companion object {
|
|
22
|
+
const val EVENT_NAME = "topClose"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package com.swmansion.rnscreens.events
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Arguments
|
|
4
|
+
import com.facebook.react.uimanager.events.Event
|
|
5
|
+
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
6
|
+
|
|
7
|
+
class SearchBarFocusEvent(viewId: Int) : Event<ScreenAppearEvent>(viewId) {
|
|
8
|
+
override fun getEventName(): String {
|
|
9
|
+
return EVENT_NAME
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
override fun getCoalescingKey(): Short {
|
|
13
|
+
// All events for a given view can be coalesced.
|
|
14
|
+
return 0
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
|
|
18
|
+
rctEventEmitter.receiveEvent(viewTag, eventName, Arguments.createMap())
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
companion object {
|
|
22
|
+
const val EVENT_NAME = "topFocus"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
package com.swmansion.rnscreens.events
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Arguments
|
|
4
|
+
import com.facebook.react.uimanager.events.Event
|
|
5
|
+
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
6
|
+
|
|
7
|
+
class SearchBarOpenEvent(viewId: Int) : Event<ScreenAppearEvent>(viewId) {
|
|
8
|
+
override fun getEventName(): String {
|
|
9
|
+
return EVENT_NAME
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
override fun getCoalescingKey(): Short {
|
|
13
|
+
// All events for a given view can be coalesced.
|
|
14
|
+
return 0
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
|
|
18
|
+
rctEventEmitter.receiveEvent(viewTag, eventName, Arguments.createMap())
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
companion object {
|
|
22
|
+
const val EVENT_NAME = "topOpen"
|
|
23
|
+
}
|
|
24
|
+
}
|
package/android/src/main/java/com/swmansion/rnscreens/events/SearchBarSearchButtonPressEvent.kt
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
package com.swmansion.rnscreens.events
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Arguments
|
|
4
|
+
import com.facebook.react.uimanager.events.Event
|
|
5
|
+
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
6
|
+
|
|
7
|
+
class SearchBarSearchButtonPressEvent(viewId: Int, private val text: String?) : Event<ScreenAppearEvent>(viewId) {
|
|
8
|
+
override fun getEventName(): String {
|
|
9
|
+
return EVENT_NAME
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
override fun getCoalescingKey(): Short {
|
|
13
|
+
// All events for a given view can be coalesced.
|
|
14
|
+
return 0
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
|
|
18
|
+
val map = Arguments.createMap()
|
|
19
|
+
map.putString("text", text)
|
|
20
|
+
rctEventEmitter.receiveEvent(viewTag, eventName, map)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
companion object {
|
|
24
|
+
const val EVENT_NAME = "topSearchButtonPress"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
|
|
3
|
+
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
|
4
|
+
android:shareInterpolator="false">
|
|
5
|
+
|
|
6
|
+
<alpha
|
|
7
|
+
android:fromAlpha="0.0"
|
|
8
|
+
android:toAlpha="1.0"
|
|
9
|
+
android:fillEnabled="true"
|
|
10
|
+
android:fillBefore="true"
|
|
11
|
+
android:fillAfter="true"
|
|
12
|
+
android:interpolator="@android:anim/linear_interpolator"
|
|
13
|
+
android:startOffset="50"
|
|
14
|
+
android:duration="83" />
|
|
15
|
+
|
|
16
|
+
<translate
|
|
17
|
+
android:fromXDelta="10%"
|
|
18
|
+
android:toXDelta="0"
|
|
19
|
+
android:fillEnabled="true"
|
|
20
|
+
android:fillBefore="true"
|
|
21
|
+
android:fillAfter="true"
|
|
22
|
+
android:startOffset="0"
|
|
23
|
+
android:interpolator="@android:interpolator/fast_out_extra_slow_in"
|
|
24
|
+
android:duration="450" />
|
|
25
|
+
|
|
26
|
+
<extend
|
|
27
|
+
android:fromExtendLeft="10%"
|
|
28
|
+
android:fromExtendTop="0"
|
|
29
|
+
android:fromExtendRight="0"
|
|
30
|
+
android:fromExtendBottom="0"
|
|
31
|
+
android:toExtendLeft="10%"
|
|
32
|
+
android:toExtendTop="0"
|
|
33
|
+
android:toExtendRight="0"
|
|
34
|
+
android:toExtendBottom="0"
|
|
35
|
+
android:interpolator="@android:interpolator/fast_out_extra_slow_in"
|
|
36
|
+
android:startOffset="0"
|
|
37
|
+
android:duration="450" />
|
|
38
|
+
</set>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
|
|
3
|
+
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
|
4
|
+
android:shareInterpolator="false">
|
|
5
|
+
|
|
6
|
+
<alpha
|
|
7
|
+
android:fromAlpha="1.0"
|
|
8
|
+
android:toAlpha="0.0"
|
|
9
|
+
android:fillEnabled="true"
|
|
10
|
+
android:fillBefore="true"
|
|
11
|
+
android:fillAfter="true"
|
|
12
|
+
android:interpolator="@anim/rns_standard_accelerate_interpolator"
|
|
13
|
+
android:startOffset="0"
|
|
14
|
+
android:duration="450" />
|
|
15
|
+
|
|
16
|
+
<translate
|
|
17
|
+
android:fromXDelta="0"
|
|
18
|
+
android:toXDelta="-10%"
|
|
19
|
+
android:fillEnabled="true"
|
|
20
|
+
android:fillBefore="true"
|
|
21
|
+
android:fillAfter="true"
|
|
22
|
+
android:interpolator="@android:interpolator/fast_out_extra_slow_in"
|
|
23
|
+
android:startOffset="0"
|
|
24
|
+
android:duration="450" />
|
|
25
|
+
|
|
26
|
+
<extend
|
|
27
|
+
android:fromExtendLeft="0"
|
|
28
|
+
android:fromExtendTop="0"
|
|
29
|
+
android:fromExtendRight="10%"
|
|
30
|
+
android:fromExtendBottom="0"
|
|
31
|
+
android:toExtendLeft="0"
|
|
32
|
+
android:toExtendTop="0"
|
|
33
|
+
android:toExtendRight="10%"
|
|
34
|
+
android:toExtendBottom="0"
|
|
35
|
+
android:interpolator="@android:interpolator/fast_out_extra_slow_in"
|
|
36
|
+
android:startOffset="0"
|
|
37
|
+
android:duration="450" />
|
|
38
|
+
</set>
|