├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── ReactNativeKeyboardTrackingView.podspec ├── example ├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── android │ ├── app │ │ ├── _BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── reactnativekeyboardtrackingview │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.android.js ├── app.ios.js ├── app.json ├── index.js ├── ios │ ├── Podfile │ ├── Podfile.lock │ ├── ReactNativeKeyboardTrackingView-tvOS │ │ └── Info.plist │ ├── ReactNativeKeyboardTrackingView-tvOSTests │ │ └── Info.plist │ ├── ReactNativeKeyboardTrackingView.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── ReactNativeKeyboardTrackingView-tvOS.xcscheme │ │ │ └── ReactNativeKeyboardTrackingView.xcscheme │ ├── ReactNativeKeyboardTrackingView.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── ReactNativeKeyboardTrackingView │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── ReactNativeKeyboardTrackingViewTests │ │ ├── Info.plist │ │ └── ReactNativeKeyboardTrackingViewTests.m ├── metro.config.js ├── package-lock.json └── package.json ├── img ├── add_lib.png ├── add_proj.png └── demo.gif ├── index.js ├── lib ├── KeyboardTrackingView.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── KeyboardTrackingViewManager.h ├── KeyboardTrackingViewManager.m ├── ObservingInputAccessoryView.h ├── ObservingInputAccessoryView.m ├── UIResponder+FirstResponder.h └── UIResponder+FirstResponder.m ├── package.json └── src ├── KeyboardAwareInsetsView.js ├── KeyboardTrackingView.android.js └── KeyboardTrackingView.ios.js /.gitignore: -------------------------------------------------------------------------------- 1 | npm-debug.log 2 | 3 | ######################### 4 | # .gitignore file for Xcode5 5 | # 6 | # NB: if you are storing "built" products, this WILL NOT WORK, 7 | # and you should use a different .gitignore (or none at all) 8 | # This file is for SOURCE projects, where there are many extra 9 | # files that we want to exclude 10 | # 11 | # For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects 12 | # and https://gist.github.com/adamgit/3786883 13 | ######################### 14 | 15 | ##### 16 | # OS X temporary files that should never be committed 17 | 18 | .DS_Store 19 | *.swp 20 | *.lock 21 | profile 22 | # cocoapods specific exclusions 23 | !Podfile.lock 24 | !Manifest.lock 25 | 26 | #### Code coverage 27 | # json file which is used by Xcode plugin called PuncoverPlugin to show code coverrage informtaion in the Xcode gutter 28 | # it is generated using Slather 29 | .gutter.json 30 | 31 | #### 32 | # Xcode temporary files that should never be committed 33 | # 34 | # NB: NIB/XIB files still exist even on Storyboard projects, so we want this... 35 | 36 | *~.nib 37 | 38 | 39 | #### 40 | # Xcode build files - 41 | # 42 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData" 43 | 44 | DerivedData/ 45 | 46 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build" 47 | 48 | build/ 49 | 50 | 51 | ##### 52 | # Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups) 53 | # 54 | # This is complicated: 55 | # 56 | # SOMETIMES you need to put this file in version control. 57 | # Apple designed it poorly - if you use "custom executables", they are 58 | # saved in this file. 59 | # 99% of projects do NOT use those, so they do NOT want to version control this file. 60 | # ..but if you're in the 1%, comment out the line "*.pbxuser" 61 | 62 | *.pbxuser 63 | *.mode1v3 64 | *.mode2v3 65 | *.perspectivev3 66 | # NB: also, whitelist the default ones, some projects need to use these 67 | !default.pbxuser 68 | !default.mode1v3 69 | !default.mode2v3 70 | !default.perspectivev3 71 | 72 | 73 | #### 74 | # Xcode 4 - semi-personal settings, often included in workspaces 75 | # 76 | # You can safely ignore the xcuserdata files - but do NOT ignore the files next to them 77 | # 78 | 79 | xcuserdata 80 | 81 | #### 82 | # XCode 4 workspaces - more detailed 83 | # 84 | # Workspaces are important! They are a core feature of Xcode - don't exclude them :) 85 | # 86 | # Workspace layout is quite spammy. For reference: 87 | # 88 | # (root)/ 89 | # (project-name).xcodeproj/ 90 | # project.pbxproj 91 | # project.xcworkspace/ 92 | # contents.xcworkspacedata 93 | # xcuserdata/ 94 | # (your name)/xcuserdatad/ 95 | # xcuserdata/ 96 | # (your name)/xcuserdatad/ 97 | # 98 | # 99 | # 100 | # Xcode 4 workspaces - SHARED 101 | # 102 | # This is UNDOCUMENTED (google: "developer.apple.com xcshareddata" - 0 results 103 | # But if you're going to kill personal workspaces, at least keep the shared ones... 104 | # 105 | # 106 | !xcshareddata 107 | 108 | #### 109 | # XCode 4 build-schemes 110 | # 111 | # PRIVATE ones are stored inside xcuserdata 112 | !xcschemes 113 | 114 | #### 115 | # Xcode 4 - Deprecated classes 116 | # 117 | # Allegedly, if you manually "deprecate" your classes, they get moved here. 118 | # 119 | # We're using source-control, so this is a "feature" that we do not want! 120 | 121 | *.moved-aside 122 | 123 | #### 124 | # Xcode 5 - Source Control files 125 | # 126 | # Xcode 5 introduced a new file type .xccheckout. This files contains VCS metadata 127 | # and should therefore not be checked into the VCS. 128 | 129 | *.xccheckout 130 | 131 | #### 132 | # Xcode 7 133 | # 134 | # Code coverage files 135 | 136 | *.gcda 137 | *.gcno 138 | 139 | #### 140 | # UNKNOWN: recommended by others, but I can't discover what these files are 141 | # 142 | # ...none. Everything is now explained.: 143 | 144 | #### 145 | # Webstorm 146 | # 147 | .idea 148 | 149 | example/ios/Pods/ 150 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | example/ 2 | img/ 3 | 4 | test/ 5 | res/generated/ 6 | 7 | .npmignore 8 | 9 | 10 | ################# 11 | # from .gitignore: 12 | ################ 13 | 14 | 15 | ############ 16 | # Node 17 | ############ 18 | # Logs 19 | logs 20 | *.log 21 | npm-debug.log* 22 | 23 | # Runtime data 24 | pids 25 | *.pid 26 | *.seed 27 | 28 | # Directory for instrumented libs generated by jscoverage/JSCover 29 | lib-cov 30 | 31 | # Coverage directory used by tools like istanbul 32 | coverage 33 | 34 | # nyc test coverage 35 | .nyc_output 36 | 37 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 38 | .grunt 39 | 40 | # node-waf configuration 41 | .lock-wscript 42 | 43 | # Compiled binary addons (http://nodejs.org/api/addons.html) 44 | build/Release 45 | 46 | # Dependency directories 47 | node_modules 48 | jspm_packages 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional REPL history 54 | .node_repl_history 55 | 56 | ################ 57 | # JetBrains 58 | ################ 59 | .idea 60 | 61 | ## File-based project format: 62 | *.iws 63 | 64 | ## Plugin-specific files: 65 | 66 | # IntelliJ 67 | /out/ 68 | 69 | # mpeltonen/sbt-idea plugin 70 | .idea_modules/ 71 | 72 | # JIRA plugin 73 | atlassian-ide-plugin.xml 74 | 75 | # Crashlytics plugin (for Android Studio and IntelliJ) 76 | com_crashlytics_export_strings.xml 77 | crashlytics.properties 78 | crashlytics-build.properties 79 | fabric.properties 80 | 81 | 82 | ############ 83 | # iOS 84 | ############ 85 | # Xcode 86 | # 87 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 88 | 89 | ## Build generated 90 | ios/build/ 91 | ios/DerivedData/ 92 | 93 | ## Various settings 94 | *.pbxuser 95 | !default.pbxuser 96 | *.mode1v3 97 | !default.mode1v3 98 | *.mode2v3 99 | !default.mode2v3 100 | *.perspectivev3 101 | !default.perspectivev3 102 | ios/xcuserdata/ 103 | 104 | ## Other 105 | *.moved-aside 106 | *.xcuserstate 107 | 108 | ## Obj-C/Swift specific 109 | *.hmap 110 | *.ipa 111 | *.dSYM.zip 112 | *.dSYM 113 | 114 | # CocoaPods 115 | # 116 | # We recommend against adding the Pods directory to your .gitignore. However 117 | # you should judge for yourself, the pros and cons are mentioned at: 118 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 119 | # 120 | ios/Pods/ 121 | 122 | # Carthage 123 | # 124 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 125 | # Carthage/Checkouts 126 | 127 | Carthage/Build 128 | 129 | # fastlane 130 | # 131 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 132 | # screenshots whenever they are needed. 133 | # For more information about the recommended setup visit: 134 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 135 | 136 | fastlane/report.xml 137 | fastlane/screenshots 138 | 139 | 140 | ############ 141 | # Android 142 | ############ 143 | # Built application files 144 | *.apk 145 | *.ap_ 146 | 147 | # Files for the Dalvik VM 148 | *.dex 149 | 150 | # Java class files 151 | *.class 152 | 153 | # Generated files 154 | android/bin/ 155 | android/gen/ 156 | android/out/ 157 | 158 | # Gradle files 159 | android/.gradle/ 160 | android/build/ 161 | android/*/build/ 162 | 163 | # Local configuration file (sdk path, etc) 164 | local.properties 165 | 166 | # Proguard folder generated by Eclipse 167 | android/proguard/ 168 | 169 | # Log Files 170 | *.log 171 | 172 | # Android Studio Navigation editor temp files 173 | android/.navigation/ 174 | 175 | # Android Studio captures folder 176 | android/captures/ 177 | 178 | # Intellij 179 | *.iml 180 | 181 | # Keystore files 182 | *.jks 183 | 184 | ################## 185 | # React-Native 186 | ################## 187 | # OSX 188 | # 189 | .DS_Store 190 | 191 | # Xcode 192 | # 193 | build/ 194 | *.pbxuser 195 | !default.pbxuser 196 | *.mode1v3 197 | !default.mode1v3 198 | *.mode2v3 199 | !default.mode2v3 200 | *.perspectivev3 201 | !default.perspectivev3 202 | xcuserdata 203 | *.xccheckout 204 | *.moved-aside 205 | DerivedData 206 | *.hmap 207 | *.ipa 208 | *.xcuserstate 209 | project.xcworkspace 210 | 211 | # Android/IJ 212 | # 213 | .idea 214 | android/.idea 215 | android/.gradle 216 | android/local.properties 217 | 218 | # node.js 219 | # 220 | node_modules/ 221 | npm-debug.log 222 | 223 | # BUCK 224 | buck-out/ 225 | \.buckd/ 226 | android/app/libs 227 | android/keystores/debug.keystore 228 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Wix.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Important: deprecation alert 2 | This library is being deprecated and the repository will not be maintaned, the components have moved to our UI library - please start migrating to [RN-UILib](https://github.com/wix/react-native-ui-lib/). 3 | If you want to try out our excelent (and constantly improving) UI compoenent library, please use: 4 | ``` 5 | import {Keyboard} from 'react-native-ui-lib'; 6 | const KeyboardTrackingView = Keyboard.KeyboardTrackingView; 7 | ``` 8 | If you don't want to import the whole library, you can use only the `keyboard` package: 9 | ``` 10 | import {KeyboardTrackingView} from 'react-native-ui-lib/keyboard'; 11 | ``` 12 | 13 | # react-native-keyboard-tracking-view 14 | A react native UI component that enables “keyboard tracking" for this view and it's sub-views. Would typically be used when you have a TextInput inside this view. 15 | 16 | ![Demo](https://github.com/wix/react-native-keyboard-tracking-view/blob/master/img/demo.gif) 17 | 18 | ## Installation 19 | 20 | - Install using `npm`: 21 | 22 | ``` 23 | npm i react-native-keyboard-tracking-view --save 24 | ``` 25 | 26 | - Locate the module lib folder in your node modules: 27 | `PROJECT_DIR/node_modules/react-native-keyboard-tracking-view/lib`. 28 | 29 | - Drag the `KeyboardTrackingView.xcodeproj` project file into your project 30 | 31 | ![](https://github.com/wix/react-native-keyboard-tracking-view/blob/master/img/add_proj.png) 32 | 33 | - Add `libKeyboardTrackingView.a` to your target's **Linked Frameworks and Libraries**. 34 | 35 | ![](https://github.com/wix/react-native-keyboard-tracking-view/blob/master/img/add_lib.png) 36 | 37 | ## How To Use 38 | Require the native component: 39 | 40 | ```js 41 | import {KeyboardTrackingView} from 'react-native-keyboard-tracking-view'; 42 | ``` 43 | 44 | Now use it in your jsx as the parent of the views you whish to track the keyboard (usually wraps a TextInput at the bottom of the screen): 45 | 46 | ```jsx 47 | 48 | 49 | 50 | ``` 51 | 52 | ##Native Properties 53 | 54 | Attribute | Description 55 | -------- | ----------- 56 | trackInteractive | boolean property that enables tracking of the keyboard when it's dismissed interactively. False by default. Why? When using an external keyboard (BT), you still get the keyboard events and the view just hovers when you focus the input. Also, if you're not using interactive style of dismissing the KB (or if you don't have an input inside this view) it doesn't make sense to track it anyway. (This is caused because of the usage of inputAccessory to be able to track the keyboard interactive change and it introduces this bug) 57 | 58 | 59 | ## Example Project 60 | 61 | Check out the full example project [here](https://github.com/wix/react-native-keyboard-tracking-view/tree/master/example). 62 | 63 | In the example folder, perform `npm install` and then run it from the Xcode project. 64 | -------------------------------------------------------------------------------- /ReactNativeKeyboardTrackingView.podspec: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "ReactNativeKeyboardTrackingView" 7 | s.version = package['version'] 8 | s.summary = "React Native Keyboard Tracking View" 9 | 10 | s.authors = "Wix.com" 11 | s.homepage = package['homepage'] 12 | s.license = package['license'] 13 | s.platforms = { :ios => "9.0", :tvos => "9.2" } 14 | 15 | s.module_name = 'ReactNativeKeyboardTrackingView' 16 | 17 | s.source = { :git => "https://github.com/wix/react-native-keyboard-tracking-view", :tag => "#{s.version}" } 18 | s.source_files = "lib/**/*.{h,m}" 19 | 20 | s.dependency 'React' 21 | s.frameworks = 'UIKit' 22 | end 23 | -------------------------------------------------------------------------------- /example/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["module:metro-react-native-babel-preset"] 3 | } 4 | -------------------------------------------------------------------------------- /example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | 16 | ; Ignore polyfills 17 | .*/Libraries/polyfills/.* 18 | 19 | ; Ignore metro 20 | .*/node_modules/metro/.* 21 | 22 | [include] 23 | 24 | [libs] 25 | node_modules/react-native/Libraries/react-native/react-native-interface.js 26 | node_modules/react-native/flow/ 27 | node_modules/react-native/flow-github/ 28 | 29 | [options] 30 | emoji=true 31 | 32 | esproposal.optional_chaining=enable 33 | esproposal.nullish_coalescing=enable 34 | 35 | module.system=haste 36 | module.system.haste.use_name_reducers=true 37 | # get basename 38 | module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1' 39 | # strip .js or .js.flow suffix 40 | module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1' 41 | # strip .ios suffix 42 | module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1' 43 | module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1' 44 | module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1' 45 | module.system.haste.paths.blacklist=.*/__tests__/.* 46 | module.system.haste.paths.blacklist=.*/__mocks__/.* 47 | module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/Animated/src/polyfills/.* 48 | module.system.haste.paths.whitelist=/node_modules/react-native/Libraries/.* 49 | 50 | munge_underscores=true 51 | 52 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 53 | 54 | module.file_ext=.js 55 | module.file_ext=.jsx 56 | module.file_ext=.json 57 | module.file_ext=.native.js 58 | 59 | suppress_type=$FlowIssue 60 | suppress_type=$FlowFixMe 61 | suppress_type=$FlowFixMeProps 62 | suppress_type=$FlowFixMeState 63 | 64 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 65 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 66 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 67 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 68 | 69 | [version] 70 | ^0.78.0 71 | -------------------------------------------------------------------------------- /example/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.reactnativekeyboardtrackingview", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.reactnativekeyboardtrackingview", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format 22 | * bundleCommand: "ram-bundle", 23 | * 24 | * // whether to bundle JS and assets in debug mode 25 | * bundleInDebug: false, 26 | * 27 | * // whether to bundle JS and assets in release mode 28 | * bundleInRelease: true, 29 | * 30 | * // whether to bundle JS and assets in another build variant (if configured). 31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 32 | * // The configuration property can be in the following formats 33 | * // 'bundleIn${productFlavor}${buildType}' 34 | * // 'bundleIn${buildType}' 35 | * // bundleInFreeDebug: true, 36 | * // bundleInPaidRelease: true, 37 | * // bundleInBeta: true, 38 | * 39 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 40 | * // for example: to disable dev mode in the staging build type (if configured) 41 | * devDisabledInStaging: true, 42 | * // The configuration property can be in the following formats 43 | * // 'devDisabledIn${productFlavor}${buildType}' 44 | * // 'devDisabledIn${buildType}' 45 | * 46 | * // the root of your project, i.e. where "package.json" lives 47 | * root: "../../", 48 | * 49 | * // where to put the JS bundle asset in debug mode 50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 51 | * 52 | * // where to put the JS bundle asset in release mode 53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 54 | * 55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 56 | * // require('./image.png')), in debug mode 57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 58 | * 59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 60 | * // require('./image.png')), in release mode 61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 62 | * 63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 67 | * // for example, you might want to remove it from here. 68 | * inputExcludes: ["android/**", "ios/**"], 69 | * 70 | * // override which node gets called and with what additional arguments 71 | * nodeExecutableAndArgs: ["node"], 72 | * 73 | * // supply additional arguments to the packager 74 | * extraPackagerArgs: [] 75 | * ] 76 | */ 77 | 78 | project.ext.react = [ 79 | entryFile: "index.js", 80 | enableHermes: false, // clean and rebuild if changing 81 | ] 82 | 83 | apply from: "../../node_modules/react-native/react.gradle" 84 | 85 | /** 86 | * Set this to true to create two separate APKs instead of one: 87 | * - An APK that only works on ARM devices 88 | * - An APK that only works on x86 devices 89 | * The advantage is the size of the APK is reduced by about 4MB. 90 | * Upload all the APKs to the Play Store and people will download 91 | * the correct one based on the CPU architecture of their device. 92 | */ 93 | def enableSeparateBuildPerCPUArchitecture = false 94 | 95 | /** 96 | * Run Proguard to shrink the Java bytecode in release builds. 97 | */ 98 | def enableProguardInReleaseBuilds = false 99 | 100 | /** 101 | * The preferred build flavor of JavaScriptCore. 102 | * 103 | * For example, to use the international variant, you can use: 104 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 105 | * 106 | * The international variant includes ICU i18n library and necessary data 107 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 108 | * give correct results when using with locales other than en-US. Note that 109 | * this variant is about 6MiB larger per architecture than default. 110 | */ 111 | def jscFlavor = 'org.webkit:android-jsc:+' 112 | 113 | /** 114 | * Whether to enable the Hermes VM. 115 | * 116 | * This should be set on project.ext.react and mirrored here. If it is not set 117 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 118 | * and the benefits of using Hermes will therefore be sharply reduced. 119 | */ 120 | def enableHermes = project.ext.react.get("enableHermes", false); 121 | 122 | android { 123 | compileSdkVersion rootProject.ext.compileSdkVersion 124 | 125 | compileOptions { 126 | sourceCompatibility JavaVersion.VERSION_1_8 127 | targetCompatibility JavaVersion.VERSION_1_8 128 | } 129 | 130 | defaultConfig { 131 | applicationId "com.reactnativekeyboardtrackingview" 132 | minSdkVersion rootProject.ext.minSdkVersion 133 | targetSdkVersion rootProject.ext.targetSdkVersion 134 | versionCode 1 135 | versionName "1.0" 136 | } 137 | splits { 138 | abi { 139 | reset() 140 | enable enableSeparateBuildPerCPUArchitecture 141 | universalApk false // If true, also generate a universal APK 142 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 143 | } 144 | } 145 | signingConfigs { 146 | debug { 147 | storeFile file('debug.keystore') 148 | storePassword 'android' 149 | keyAlias 'androiddebugkey' 150 | keyPassword 'android' 151 | } 152 | } 153 | buildTypes { 154 | debug { 155 | signingConfig signingConfigs.debug 156 | } 157 | release { 158 | // Caution! In production, you need to generate your own keystore file. 159 | // see https://facebook.github.io/react-native/docs/signed-apk-android. 160 | signingConfig signingConfigs.debug 161 | minifyEnabled enableProguardInReleaseBuilds 162 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 163 | } 164 | } 165 | // applicationVariants are e.g. debug, release 166 | applicationVariants.all { variant -> 167 | variant.outputs.each { output -> 168 | // For each separate APK per architecture, set a unique version code as described here: 169 | // https://developer.android.com/studio/build/configure-apk-splits.html 170 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 171 | def abi = output.getFilter(OutputFile.ABI) 172 | if (abi != null) { // null for the universal-debug, universal-release variants 173 | output.versionCodeOverride = 174 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 175 | } 176 | 177 | } 178 | } 179 | } 180 | 181 | dependencies { 182 | implementation fileTree(dir: "libs", include: ["*.jar"]) 183 | implementation "com.facebook.react:react-native:+" // From node_modules 184 | 185 | if (enableHermes) { 186 | def hermesPath = "../../node_modules/hermes-engine/android/"; 187 | debugImplementation files(hermesPath + "hermes-debug.aar") 188 | releaseImplementation files(hermesPath + "hermes-release.aar") 189 | } else { 190 | implementation jscFlavor 191 | } 192 | } 193 | 194 | // Run this once to be able to run the application with BUCK 195 | // puts all compile dependencies into folder libs for BUCK to use 196 | task copyDownloadableDepsToLibs(type: Copy) { 197 | from configurations.compile 198 | into 'libs' 199 | } 200 | 201 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 202 | -------------------------------------------------------------------------------- /example/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/reactnativekeyboardtrackingview/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.reactnativekeyboardtrackingview; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "ReactNativeKeyboardTrackingView"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/reactnativekeyboardtrackingview/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.reactnativekeyboardtrackingview; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.soloader.SoLoader; 10 | import java.lang.reflect.InvocationTargetException; 11 | import java.util.List; 12 | 13 | public class MainApplication extends Application implements ReactApplication { 14 | 15 | private final ReactNativeHost mReactNativeHost = 16 | new ReactNativeHost(this) { 17 | @Override 18 | public boolean getUseDeveloperSupport() { 19 | return BuildConfig.DEBUG; 20 | } 21 | 22 | @Override 23 | protected List getPackages() { 24 | @SuppressWarnings("UnnecessaryLocalVariable") 25 | List packages = new PackageList(this).getPackages(); 26 | // Packages that cannot be autolinked yet can be added manually here, for example: 27 | // packages.add(new MyReactNativePackage()); 28 | return packages; 29 | } 30 | 31 | @Override 32 | protected String getJSMainModuleName() { 33 | return "index"; 34 | } 35 | }; 36 | 37 | @Override 38 | public ReactNativeHost getReactNativeHost() { 39 | return mReactNativeHost; 40 | } 41 | 42 | @Override 43 | public void onCreate() { 44 | super.onCreate(); 45 | SoLoader.init(this, /* native exopackage */ false); 46 | initializeFlipper(this); // Remove this line if you don't want Flipper enabled 47 | } 48 | 49 | /** 50 | * Loads Flipper in React Native templates. 51 | * 52 | * @param context 53 | */ 54 | private static void initializeFlipper(Context context) { 55 | if (BuildConfig.DEBUG) { 56 | try { 57 | /* 58 | We use reflection here to pick up the class that initializes Flipper, 59 | since Flipper library is not available in release mode 60 | */ 61 | Class aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper"); 62 | aClass.getMethod("initializeFlipper", Context.class).invoke(null, context); 63 | } catch (ClassNotFoundException e) { 64 | e.printStackTrace(); 65 | } catch (NoSuchMethodException e) { 66 | e.printStackTrace(); 67 | } catch (IllegalAccessException e) { 68 | e.printStackTrace(); 69 | } catch (InvocationTargetException e) { 70 | e.printStackTrace(); 71 | } 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ReactNativeKeyboardTrackingView 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "28.0.3" 6 | minSdkVersion = 16 7 | compileSdkVersion = 28 8 | targetSdkVersion = 28 9 | } 10 | repositories { 11 | google() 12 | jcenter() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle:3.4.2") 16 | 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | mavenLocal() 25 | maven { 26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 27 | url("$rootDir/../node_modules/react-native/android") 28 | } 29 | maven { 30 | // Android JSC is installed from npm 31 | url("$rootDir/../node_modules/jsc-android/dist") 32 | } 33 | 34 | google() 35 | jcenter() 36 | maven { url 'https://jitpack.io' } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useAndroidX=true 21 | android.enableJetifier=true 22 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin, switch paths to Windows format before running java 129 | if $cygwin ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=$((i+1)) 158 | done 159 | case $i in 160 | (0) set -- ;; 161 | (1) set -- "$args0" ;; 162 | (2) set -- "$args0" "$args1" ;; 163 | (3) set -- "$args0" "$args1" "$args2" ;; 164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=$(save "$@") 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 185 | cd "$(dirname "$0")" 186 | fi 187 | 188 | exec "$JAVACMD" "$@" 189 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem http://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 34 | 35 | @rem Find java.exe 36 | if defined JAVA_HOME goto findJavaFromJavaHome 37 | 38 | set JAVA_EXE=java.exe 39 | %JAVA_EXE% -version >NUL 2>&1 40 | if "%ERRORLEVEL%" == "0" goto init 41 | 42 | echo. 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 44 | echo. 45 | echo Please set the JAVA_HOME variable in your environment to match the 46 | echo location of your Java installation. 47 | 48 | goto fail 49 | 50 | :findJavaFromJavaHome 51 | set JAVA_HOME=%JAVA_HOME:"=% 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 53 | 54 | if exist "%JAVA_EXE%" goto init 55 | 56 | echo. 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 58 | echo. 59 | echo Please set the JAVA_HOME variable in your environment to match the 60 | echo location of your Java installation. 61 | 62 | goto fail 63 | 64 | :init 65 | @rem Get command-line arguments, handling Windows variants 66 | 67 | if not "%OS%" == "Windows_NT" goto win9xME_args 68 | 69 | :win9xME_args 70 | @rem Slurp the command line arguments. 71 | set CMD_LINE_ARGS= 72 | set _SKIP=2 73 | 74 | :win9xME_args_slurp 75 | if "x%~1" == "x" goto execute 76 | 77 | set CMD_LINE_ARGS=%* 78 | 79 | :execute 80 | @rem Setup the command line 81 | 82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 83 | 84 | @rem Execute Gradle 85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 86 | 87 | :end 88 | @rem End local scope for the variables with windows NT shell 89 | if "%ERRORLEVEL%"=="0" goto mainEnd 90 | 91 | :fail 92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 93 | rem the _cmd.exe /c_ return code! 94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 95 | exit /b 1 96 | 97 | :mainEnd 98 | if "%OS%"=="Windows_NT" endlocal 99 | 100 | :omega 101 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'ReactNativeKeyboardTrackingView' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | -------------------------------------------------------------------------------- /example/app.android.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from 'react'; 2 | import {AppRegistry, StyleSheet, Text, View} from 'react-native'; 3 | import {KeyboardTrackingView} from 'react-native-keyboard-tracking-view'; 4 | 5 | class example extends Component { 6 | render() { 7 | return ( 8 | 9 | 10 | Keyboard tracking view example - doesn't do much on Android.. 11 | 12 | 13 | 14 | ); 15 | } 16 | } 17 | 18 | const styles = StyleSheet.create({ 19 | container: { 20 | flex: 1, 21 | justifyContent: 'center', 22 | alignItems: 'center', 23 | backgroundColor: '#F5FCFF', 24 | }, 25 | welcome: { 26 | fontSize: 20, 27 | textAlign: 'center', 28 | margin: 10, 29 | }, 30 | instructions: { 31 | textAlign: 'center', 32 | color: '#333333', 33 | marginBottom: 5, 34 | }, 35 | }); 36 | 37 | AppRegistry.registerComponent('ReactNativeKeyboardTrackingView', () => example); 38 | -------------------------------------------------------------------------------- /example/app.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | import React, {Component} from 'react'; 7 | import {AppRegistry, StyleSheet, Text, View, Image, ScrollView, TextInput, TouchableOpacity, Keyboard, Dimensions, PixelRatio} from 'react-native'; 8 | // import {BlurView} from 'react-native-blur'; 9 | import {KeyboardTrackingView} from 'react-native-keyboard-tracking-view'; 10 | import {AutoGrowingTextInput} from 'react-native-autogrow-textinput'; 11 | 12 | const screenSize = Dimensions.get('window'); 13 | const trackInteractive = true; 14 | const Images = [ 15 | 'https://static.pexels.com/photos/50721/pencils-crayons-colourful-rainbow-50721.jpeg', 16 | 'https://static.pexels.com/photos/60628/flower-garden-blue-sky-hokkaido-japan-60628.jpeg' 17 | ]; 18 | 19 | const KeyboardToolbar = ({ onActionPress, onLayout, inputRefCallback, trackingRefCallback}) => 20 | trackingRefCallback && trackingRefCallback(r)} 25 | > 26 | 27 | 28 | inputRefCallback && inputRefCallback(r)} 33 | placeholder={'Message'} 34 | /> 35 | 36 | Action 37 | 38 | 39 | ; 40 | 41 | class example extends Component { 42 | render() { 43 | return ( 44 | 45 | 49 | Keyboard tracking view example 50 | {Images.map((image, index) => ())} 51 | 52 | this._textInput._textInput.blur()} 54 | inputRefCallback={(r) => this._textInput = r} 55 | /> 56 | 57 | ); 58 | } 59 | } 60 | 61 | const styles = StyleSheet.create({ 62 | container: { 63 | flex: 1, 64 | backgroundColor: '#F5FCFF' 65 | }, 66 | scrollContainer: { 67 | justifyContent: 'center', 68 | padding: 15 69 | }, 70 | welcome: { 71 | fontSize: 20, 72 | textAlign: 'center', 73 | margin: 10, 74 | paddingTop: 50, 75 | paddingBottom: 50 76 | }, 77 | image: { 78 | height: 250, 79 | width: undefined, 80 | marginBottom: 10 81 | }, 82 | trackingToolbarContainer: { 83 | position: 'absolute', 84 | bottom: 0, 85 | left: 0, 86 | width: screenSize.width, 87 | borderWidth: 0.5 / PixelRatio.get() 88 | }, 89 | inputContainer: { 90 | flex: 1, 91 | flexDirection: 'row', 92 | alignItems: 'center', 93 | justifyContent: 'space-between', 94 | paddingLeft: 15, 95 | paddingRight: 15, 96 | paddingTop: 5, 97 | paddingBottom: 5, 98 | backgroundColor: 'white' 99 | }, 100 | textInput: { 101 | flex: 1, 102 | fontSize: 17, 103 | backgroundColor: 'white', 104 | borderWidth: 0.5 / PixelRatio.get(), 105 | borderRadius: 19, 106 | paddingTop: 8, 107 | paddingBottom: 5, 108 | paddingLeft: 15, 109 | }, 110 | sendButton: { 111 | paddingRight: 15, 112 | paddingLeft: 15 113 | } 114 | }); 115 | 116 | AppRegistry.registerComponent('ReactNativeKeyboardTrackingView', () => example); 117 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | require('./app'); 2 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | target 'ReactNativeKeyboardTrackingView' do 5 | 6 | pod 'ReactNativeKeyboardTrackingView', :path => "../../ReactNativeKeyboardTrackingView.podspec" 7 | 8 | # Pods for ReactNativeKeyboardTrackingView 9 | pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" 10 | pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" 11 | pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" 12 | pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" 13 | pod 'React', :path => '../node_modules/react-native/' 14 | pod 'React-Core', :path => '../node_modules/react-native/' 15 | pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules' 16 | pod 'React-Core/DevSupport', :path => '../node_modules/react-native/' 17 | pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' 18 | pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' 19 | pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' 20 | pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' 21 | pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' 22 | pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' 23 | pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' 24 | pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' 25 | pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' 26 | pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/' 27 | 28 | pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' 29 | pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' 30 | pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' 31 | pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' 32 | pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon" 33 | pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" 34 | pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga' 35 | 36 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' 37 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' 38 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' 39 | 40 | end -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost-for-react-native (1.63.0) 3 | - DoubleConversion (1.1.6) 4 | - FBLazyVector (0.61.4) 5 | - FBReactNativeSpec (0.61.4): 6 | - Folly (= 2018.10.22.00) 7 | - RCTRequired (= 0.61.4) 8 | - RCTTypeSafety (= 0.61.4) 9 | - React-Core (= 0.61.4) 10 | - React-jsi (= 0.61.4) 11 | - ReactCommon/turbomodule/core (= 0.61.4) 12 | - Folly (2018.10.22.00): 13 | - boost-for-react-native 14 | - DoubleConversion 15 | - Folly/Default (= 2018.10.22.00) 16 | - glog 17 | - Folly/Default (2018.10.22.00): 18 | - boost-for-react-native 19 | - DoubleConversion 20 | - glog 21 | - glog (0.3.5) 22 | - RCTRequired (0.61.4) 23 | - RCTTypeSafety (0.61.4): 24 | - FBLazyVector (= 0.61.4) 25 | - Folly (= 2018.10.22.00) 26 | - RCTRequired (= 0.61.4) 27 | - React-Core (= 0.61.4) 28 | - React (0.61.4): 29 | - React-Core (= 0.61.4) 30 | - React-Core/DevSupport (= 0.61.4) 31 | - React-Core/RCTWebSocket (= 0.61.4) 32 | - React-RCTActionSheet (= 0.61.4) 33 | - React-RCTAnimation (= 0.61.4) 34 | - React-RCTBlob (= 0.61.4) 35 | - React-RCTImage (= 0.61.4) 36 | - React-RCTLinking (= 0.61.4) 37 | - React-RCTNetwork (= 0.61.4) 38 | - React-RCTSettings (= 0.61.4) 39 | - React-RCTText (= 0.61.4) 40 | - React-RCTVibration (= 0.61.4) 41 | - React-Core (0.61.4): 42 | - Folly (= 2018.10.22.00) 43 | - glog 44 | - React-Core/Default (= 0.61.4) 45 | - React-cxxreact (= 0.61.4) 46 | - React-jsi (= 0.61.4) 47 | - React-jsiexecutor (= 0.61.4) 48 | - Yoga 49 | - React-Core/CoreModulesHeaders (0.61.4): 50 | - Folly (= 2018.10.22.00) 51 | - glog 52 | - React-Core/Default 53 | - React-cxxreact (= 0.61.4) 54 | - React-jsi (= 0.61.4) 55 | - React-jsiexecutor (= 0.61.4) 56 | - Yoga 57 | - React-Core/Default (0.61.4): 58 | - Folly (= 2018.10.22.00) 59 | - glog 60 | - React-cxxreact (= 0.61.4) 61 | - React-jsi (= 0.61.4) 62 | - React-jsiexecutor (= 0.61.4) 63 | - Yoga 64 | - React-Core/DevSupport (0.61.4): 65 | - Folly (= 2018.10.22.00) 66 | - glog 67 | - React-Core/Default (= 0.61.4) 68 | - React-Core/RCTWebSocket (= 0.61.4) 69 | - React-cxxreact (= 0.61.4) 70 | - React-jsi (= 0.61.4) 71 | - React-jsiexecutor (= 0.61.4) 72 | - React-jsinspector (= 0.61.4) 73 | - Yoga 74 | - React-Core/RCTActionSheetHeaders (0.61.4): 75 | - Folly (= 2018.10.22.00) 76 | - glog 77 | - React-Core/Default 78 | - React-cxxreact (= 0.61.4) 79 | - React-jsi (= 0.61.4) 80 | - React-jsiexecutor (= 0.61.4) 81 | - Yoga 82 | - React-Core/RCTAnimationHeaders (0.61.4): 83 | - Folly (= 2018.10.22.00) 84 | - glog 85 | - React-Core/Default 86 | - React-cxxreact (= 0.61.4) 87 | - React-jsi (= 0.61.4) 88 | - React-jsiexecutor (= 0.61.4) 89 | - Yoga 90 | - React-Core/RCTBlobHeaders (0.61.4): 91 | - Folly (= 2018.10.22.00) 92 | - glog 93 | - React-Core/Default 94 | - React-cxxreact (= 0.61.4) 95 | - React-jsi (= 0.61.4) 96 | - React-jsiexecutor (= 0.61.4) 97 | - Yoga 98 | - React-Core/RCTImageHeaders (0.61.4): 99 | - Folly (= 2018.10.22.00) 100 | - glog 101 | - React-Core/Default 102 | - React-cxxreact (= 0.61.4) 103 | - React-jsi (= 0.61.4) 104 | - React-jsiexecutor (= 0.61.4) 105 | - Yoga 106 | - React-Core/RCTLinkingHeaders (0.61.4): 107 | - Folly (= 2018.10.22.00) 108 | - glog 109 | - React-Core/Default 110 | - React-cxxreact (= 0.61.4) 111 | - React-jsi (= 0.61.4) 112 | - React-jsiexecutor (= 0.61.4) 113 | - Yoga 114 | - React-Core/RCTNetworkHeaders (0.61.4): 115 | - Folly (= 2018.10.22.00) 116 | - glog 117 | - React-Core/Default 118 | - React-cxxreact (= 0.61.4) 119 | - React-jsi (= 0.61.4) 120 | - React-jsiexecutor (= 0.61.4) 121 | - Yoga 122 | - React-Core/RCTSettingsHeaders (0.61.4): 123 | - Folly (= 2018.10.22.00) 124 | - glog 125 | - React-Core/Default 126 | - React-cxxreact (= 0.61.4) 127 | - React-jsi (= 0.61.4) 128 | - React-jsiexecutor (= 0.61.4) 129 | - Yoga 130 | - React-Core/RCTTextHeaders (0.61.4): 131 | - Folly (= 2018.10.22.00) 132 | - glog 133 | - React-Core/Default 134 | - React-cxxreact (= 0.61.4) 135 | - React-jsi (= 0.61.4) 136 | - React-jsiexecutor (= 0.61.4) 137 | - Yoga 138 | - React-Core/RCTVibrationHeaders (0.61.4): 139 | - Folly (= 2018.10.22.00) 140 | - glog 141 | - React-Core/Default 142 | - React-cxxreact (= 0.61.4) 143 | - React-jsi (= 0.61.4) 144 | - React-jsiexecutor (= 0.61.4) 145 | - Yoga 146 | - React-Core/RCTWebSocket (0.61.4): 147 | - Folly (= 2018.10.22.00) 148 | - glog 149 | - React-Core/Default (= 0.61.4) 150 | - React-cxxreact (= 0.61.4) 151 | - React-jsi (= 0.61.4) 152 | - React-jsiexecutor (= 0.61.4) 153 | - Yoga 154 | - React-CoreModules (0.61.4): 155 | - FBReactNativeSpec (= 0.61.4) 156 | - Folly (= 2018.10.22.00) 157 | - RCTTypeSafety (= 0.61.4) 158 | - React-Core/CoreModulesHeaders (= 0.61.4) 159 | - React-RCTImage (= 0.61.4) 160 | - ReactCommon/turbomodule/core (= 0.61.4) 161 | - React-cxxreact (0.61.4): 162 | - boost-for-react-native (= 1.63.0) 163 | - DoubleConversion 164 | - Folly (= 2018.10.22.00) 165 | - glog 166 | - React-jsinspector (= 0.61.4) 167 | - React-jsi (0.61.4): 168 | - boost-for-react-native (= 1.63.0) 169 | - DoubleConversion 170 | - Folly (= 2018.10.22.00) 171 | - glog 172 | - React-jsi/Default (= 0.61.4) 173 | - React-jsi/Default (0.61.4): 174 | - boost-for-react-native (= 1.63.0) 175 | - DoubleConversion 176 | - Folly (= 2018.10.22.00) 177 | - glog 178 | - React-jsiexecutor (0.61.4): 179 | - DoubleConversion 180 | - Folly (= 2018.10.22.00) 181 | - glog 182 | - React-cxxreact (= 0.61.4) 183 | - React-jsi (= 0.61.4) 184 | - React-jsinspector (0.61.4) 185 | - React-RCTActionSheet (0.61.4): 186 | - React-Core/RCTActionSheetHeaders (= 0.61.4) 187 | - React-RCTAnimation (0.61.4): 188 | - React-Core/RCTAnimationHeaders (= 0.61.4) 189 | - React-RCTBlob (0.61.4): 190 | - React-Core/RCTBlobHeaders (= 0.61.4) 191 | - React-Core/RCTWebSocket (= 0.61.4) 192 | - React-jsi (= 0.61.4) 193 | - React-RCTNetwork (= 0.61.4) 194 | - React-RCTImage (0.61.4): 195 | - React-Core/RCTImageHeaders (= 0.61.4) 196 | - React-RCTNetwork (= 0.61.4) 197 | - React-RCTLinking (0.61.4): 198 | - React-Core/RCTLinkingHeaders (= 0.61.4) 199 | - React-RCTNetwork (0.61.4): 200 | - React-Core/RCTNetworkHeaders (= 0.61.4) 201 | - React-RCTSettings (0.61.4): 202 | - React-Core/RCTSettingsHeaders (= 0.61.4) 203 | - React-RCTText (0.61.4): 204 | - React-Core/RCTTextHeaders (= 0.61.4) 205 | - React-RCTVibration (0.61.4): 206 | - React-Core/RCTVibrationHeaders (= 0.61.4) 207 | - ReactCommon/jscallinvoker (0.61.4): 208 | - DoubleConversion 209 | - Folly (= 2018.10.22.00) 210 | - glog 211 | - React-cxxreact (= 0.61.4) 212 | - ReactCommon/turbomodule/core (0.61.4): 213 | - DoubleConversion 214 | - Folly (= 2018.10.22.00) 215 | - glog 216 | - React-Core (= 0.61.4) 217 | - React-cxxreact (= 0.61.4) 218 | - React-jsi (= 0.61.4) 219 | - ReactCommon/jscallinvoker (= 0.61.4) 220 | - ReactNativeKeyboardTrackingView (5.7.0): 221 | - React 222 | - Yoga (1.14.0) 223 | 224 | DEPENDENCIES: 225 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 226 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 227 | - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`) 228 | - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) 229 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 230 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 231 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 232 | - React (from `../node_modules/react-native/`) 233 | - React-Core (from `../node_modules/react-native/`) 234 | - React-Core/DevSupport (from `../node_modules/react-native/`) 235 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 236 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 237 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 238 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 239 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 240 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 241 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 242 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 243 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 244 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 245 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 246 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 247 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 248 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 249 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 250 | - ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`) 251 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 252 | - ReactNativeKeyboardTrackingView (from `../../ReactNativeKeyboardTrackingView.podspec`) 253 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 254 | 255 | SPEC REPOS: 256 | trunk: 257 | - boost-for-react-native 258 | 259 | EXTERNAL SOURCES: 260 | DoubleConversion: 261 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 262 | FBLazyVector: 263 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 264 | FBReactNativeSpec: 265 | :path: "../node_modules/react-native/Libraries/FBReactNativeSpec" 266 | Folly: 267 | :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec" 268 | glog: 269 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 270 | RCTRequired: 271 | :path: "../node_modules/react-native/Libraries/RCTRequired" 272 | RCTTypeSafety: 273 | :path: "../node_modules/react-native/Libraries/TypeSafety" 274 | React: 275 | :path: "../node_modules/react-native/" 276 | React-Core: 277 | :path: "../node_modules/react-native/" 278 | React-CoreModules: 279 | :path: "../node_modules/react-native/React/CoreModules" 280 | React-cxxreact: 281 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 282 | React-jsi: 283 | :path: "../node_modules/react-native/ReactCommon/jsi" 284 | React-jsiexecutor: 285 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 286 | React-jsinspector: 287 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 288 | React-RCTActionSheet: 289 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 290 | React-RCTAnimation: 291 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 292 | React-RCTBlob: 293 | :path: "../node_modules/react-native/Libraries/Blob" 294 | React-RCTImage: 295 | :path: "../node_modules/react-native/Libraries/Image" 296 | React-RCTLinking: 297 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 298 | React-RCTNetwork: 299 | :path: "../node_modules/react-native/Libraries/Network" 300 | React-RCTSettings: 301 | :path: "../node_modules/react-native/Libraries/Settings" 302 | React-RCTText: 303 | :path: "../node_modules/react-native/Libraries/Text" 304 | React-RCTVibration: 305 | :path: "../node_modules/react-native/Libraries/Vibration" 306 | ReactCommon: 307 | :path: "../node_modules/react-native/ReactCommon" 308 | ReactNativeKeyboardTrackingView: 309 | :path: "../../ReactNativeKeyboardTrackingView.podspec" 310 | Yoga: 311 | :path: "../node_modules/react-native/ReactCommon/yoga" 312 | 313 | SPEC CHECKSUMS: 314 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c 315 | DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2 316 | FBLazyVector: feb35a6b7f7b50f367be07f34012f34a79282fa3 317 | FBReactNativeSpec: 51477b84b1bf7ab6f9ef307c24e3dd675391be44 318 | Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51 319 | glog: 1f3da668190260b06b429bb211bfbee5cd790c28 320 | RCTRequired: f3b3fb6f4723e8e52facb229d0c75fdc76773849 321 | RCTTypeSafety: 2ec60de6abb1db050b56ecc4b60188026078fd10 322 | React: 10e0130b57e55a7cd8c3dee37c1261102ce295f4 323 | React-Core: 636212410772d05f3a1eb79d965df2962ca1c70b 324 | React-CoreModules: 6f70d5e41919289c582f88c9ad9923fe5c87400a 325 | React-cxxreact: ddecbe9157ec1743f52ea17bf8d95debc0d6e846 326 | React-jsi: ca921f4041505f9d5197139b2d09eeb020bb12e8 327 | React-jsiexecutor: 8dfb73b987afa9324e4009bdce62a18ce23d983c 328 | React-jsinspector: d15478d0a8ada19864aa4d1cc1c697b41b3fa92f 329 | React-RCTActionSheet: 7369b7c85f99b6299491333affd9f01f5a130c22 330 | React-RCTAnimation: d07be15b2bd1d06d89417eb0343f98ffd2b099a7 331 | React-RCTBlob: 8e0b23d95c9baa98f6b0e127e07666aaafd96c34 332 | React-RCTImage: 443050d14a66e8c2332e9c055f45689d23e15cc7 333 | React-RCTLinking: ce9a90ba155aec41be49e75ec721bbae2d48a47e 334 | React-RCTNetwork: 41fe54bacc67dd00e6e4c4d30dd98a13e4beabc8 335 | React-RCTSettings: 45e3e0a6470310b2dab2ccc6d1d73121ba3ea936 336 | React-RCTText: 21934e0a51d522abcd0a275407e80af45d6fd9ec 337 | React-RCTVibration: 0f76400ee3cec6edb9c125da49fed279340d145a 338 | ReactCommon: a6a294e7028ed67b926d29551aa9394fd989c24c 339 | ReactNativeKeyboardTrackingView: 02137fac3b2ebd330d74fa54ead48b14750a2306 340 | Yoga: ba3d99dbee6c15ea6bbe3783d1f0cb1ffb79af0f 341 | 342 | PODFILE CHECKSUM: 7cbe8eef47c948ce74f562575528b4eed66b9c4d 343 | 344 | COCOAPODS: 1.8.4 345 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSExceptionDomains 28 | 29 | localhost 30 | 31 | NSExceptionAllowsInsecureHTTPLoads 32 | 33 | 34 | 35 | 36 | NSLocationWhenInUseUsageDescription 37 | 38 | UILaunchStoryboardName 39 | LaunchScreen 40 | UIRequiredDeviceCapabilities 41 | 42 | armv7 43 | 44 | UISupportedInterfaceOrientations 45 | 46 | UIInterfaceOrientationPortrait 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | UIViewControllerBasedStatusBarAppearance 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 11 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 12 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 14 | BBE859CBE42829443102FF10 /* libPods-ReactNativeKeyboardTrackingView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 089BCA07FD6F58A91F147CF0 /* libPods-ReactNativeKeyboardTrackingView.a */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 19 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 20 | 00E356F21AD99517003FC87E /* ReactNativeKeyboardTrackingViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactNativeKeyboardTrackingViewTests.m; sourceTree = ""; }; 21 | 089BCA07FD6F58A91F147CF0 /* libPods-ReactNativeKeyboardTrackingView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ReactNativeKeyboardTrackingView.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 13B07F961A680F5B00A75B9A /* ReactNativeKeyboardTrackingView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReactNativeKeyboardTrackingView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ReactNativeKeyboardTrackingView/AppDelegate.h; sourceTree = ""; }; 24 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = ReactNativeKeyboardTrackingView/AppDelegate.m; sourceTree = ""; }; 25 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 26 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = ReactNativeKeyboardTrackingView/Images.xcassets; sourceTree = ""; }; 27 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ReactNativeKeyboardTrackingView/Info.plist; sourceTree = ""; }; 28 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ReactNativeKeyboardTrackingView/main.m; sourceTree = ""; }; 29 | 2BFF173EE638D54786D6E2D0 /* Pods-ReactNativeKeyboardTrackingView.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeKeyboardTrackingView.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeKeyboardTrackingView/Pods-ReactNativeKeyboardTrackingView.release.xcconfig"; sourceTree = ""; }; 30 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 31 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; 32 | F0BA926CBAEB2652808C9132 /* Pods-ReactNativeKeyboardTrackingView.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeKeyboardTrackingView.debug.xcconfig"; path = "Target Support Files/Pods-ReactNativeKeyboardTrackingView/Pods-ReactNativeKeyboardTrackingView.debug.xcconfig"; sourceTree = ""; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | BBE859CBE42829443102FF10 /* libPods-ReactNativeKeyboardTrackingView.a in Frameworks */, 41 | ); 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | /* End PBXFrameworksBuildPhase section */ 45 | 46 | /* Begin PBXGroup section */ 47 | 00E356EF1AD99517003FC87E /* ReactNativeKeyboardTrackingViewTests */ = { 48 | isa = PBXGroup; 49 | children = ( 50 | 00E356F21AD99517003FC87E /* ReactNativeKeyboardTrackingViewTests.m */, 51 | 00E356F01AD99517003FC87E /* Supporting Files */, 52 | ); 53 | path = ReactNativeKeyboardTrackingViewTests; 54 | sourceTree = ""; 55 | }; 56 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 00E356F11AD99517003FC87E /* Info.plist */, 60 | ); 61 | name = "Supporting Files"; 62 | sourceTree = ""; 63 | }; 64 | 13B07FAE1A68108700A75B9A /* ReactNativeKeyboardTrackingView */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 68 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 69 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 70 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 71 | 13B07FB61A68108700A75B9A /* Info.plist */, 72 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 73 | 13B07FB71A68108700A75B9A /* main.m */, 74 | ); 75 | name = ReactNativeKeyboardTrackingView; 76 | sourceTree = ""; 77 | }; 78 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 82 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */, 83 | 089BCA07FD6F58A91F147CF0 /* libPods-ReactNativeKeyboardTrackingView.a */, 84 | ); 85 | name = Frameworks; 86 | sourceTree = ""; 87 | }; 88 | 7EB3CBF4022D4C2D8E21F52C /* Pods */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | F0BA926CBAEB2652808C9132 /* Pods-ReactNativeKeyboardTrackingView.debug.xcconfig */, 92 | 2BFF173EE638D54786D6E2D0 /* Pods-ReactNativeKeyboardTrackingView.release.xcconfig */, 93 | ); 94 | path = Pods; 95 | sourceTree = ""; 96 | }; 97 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | ); 101 | name = Libraries; 102 | sourceTree = ""; 103 | }; 104 | 83CBB9F61A601CBA00E9B192 = { 105 | isa = PBXGroup; 106 | children = ( 107 | 13B07FAE1A68108700A75B9A /* ReactNativeKeyboardTrackingView */, 108 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 109 | 00E356EF1AD99517003FC87E /* ReactNativeKeyboardTrackingViewTests */, 110 | 83CBBA001A601CBA00E9B192 /* Products */, 111 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 112 | 7EB3CBF4022D4C2D8E21F52C /* Pods */, 113 | ); 114 | indentWidth = 2; 115 | sourceTree = ""; 116 | tabWidth = 2; 117 | usesTabs = 0; 118 | }; 119 | 83CBBA001A601CBA00E9B192 /* Products */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 13B07F961A680F5B00A75B9A /* ReactNativeKeyboardTrackingView.app */, 123 | ); 124 | name = Products; 125 | sourceTree = ""; 126 | }; 127 | /* End PBXGroup section */ 128 | 129 | /* Begin PBXNativeTarget section */ 130 | 13B07F861A680F5B00A75B9A /* ReactNativeKeyboardTrackingView */ = { 131 | isa = PBXNativeTarget; 132 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeKeyboardTrackingView" */; 133 | buildPhases = ( 134 | 2E127A7833DFCA51723FA5A0 /* [CP] Check Pods Manifest.lock */, 135 | FD10A7F022414F080027D42C /* Start Packager */, 136 | 13B07F871A680F5B00A75B9A /* Sources */, 137 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 138 | 13B07F8E1A680F5B00A75B9A /* Resources */, 139 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 140 | ); 141 | buildRules = ( 142 | ); 143 | dependencies = ( 144 | ); 145 | name = ReactNativeKeyboardTrackingView; 146 | productName = ReactNativeKeyboardTrackingView; 147 | productReference = 13B07F961A680F5B00A75B9A /* ReactNativeKeyboardTrackingView.app */; 148 | productType = "com.apple.product-type.application"; 149 | }; 150 | /* End PBXNativeTarget section */ 151 | 152 | /* Begin PBXProject section */ 153 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 154 | isa = PBXProject; 155 | attributes = { 156 | LastUpgradeCheck = 0940; 157 | ORGANIZATIONNAME = Facebook; 158 | }; 159 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeKeyboardTrackingView" */; 160 | compatibilityVersion = "Xcode 3.2"; 161 | developmentRegion = English; 162 | hasScannedForEncodings = 0; 163 | knownRegions = ( 164 | en, 165 | Base, 166 | ); 167 | mainGroup = 83CBB9F61A601CBA00E9B192; 168 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 169 | projectDirPath = ""; 170 | projectRoot = ""; 171 | targets = ( 172 | 13B07F861A680F5B00A75B9A /* ReactNativeKeyboardTrackingView */, 173 | ); 174 | }; 175 | /* End PBXProject section */ 176 | 177 | /* Begin PBXResourcesBuildPhase section */ 178 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 179 | isa = PBXResourcesBuildPhase; 180 | buildActionMask = 2147483647; 181 | files = ( 182 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 183 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 184 | ); 185 | runOnlyForDeploymentPostprocessing = 0; 186 | }; 187 | /* End PBXResourcesBuildPhase section */ 188 | 189 | /* Begin PBXShellScriptBuildPhase section */ 190 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 191 | isa = PBXShellScriptBuildPhase; 192 | buildActionMask = 2147483647; 193 | files = ( 194 | ); 195 | inputPaths = ( 196 | ); 197 | name = "Bundle React Native code and images"; 198 | outputPaths = ( 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | shellPath = /bin/sh; 202 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 203 | }; 204 | 2E127A7833DFCA51723FA5A0 /* [CP] Check Pods Manifest.lock */ = { 205 | isa = PBXShellScriptBuildPhase; 206 | buildActionMask = 2147483647; 207 | files = ( 208 | ); 209 | inputFileListPaths = ( 210 | ); 211 | inputPaths = ( 212 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 213 | "${PODS_ROOT}/Manifest.lock", 214 | ); 215 | name = "[CP] Check Pods Manifest.lock"; 216 | outputFileListPaths = ( 217 | ); 218 | outputPaths = ( 219 | "$(DERIVED_FILE_DIR)/Pods-ReactNativeKeyboardTrackingView-checkManifestLockResult.txt", 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | shellPath = /bin/sh; 223 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 224 | showEnvVarsInLog = 0; 225 | }; 226 | FD10A7F022414F080027D42C /* Start Packager */ = { 227 | isa = PBXShellScriptBuildPhase; 228 | buildActionMask = 2147483647; 229 | files = ( 230 | ); 231 | inputFileListPaths = ( 232 | ); 233 | inputPaths = ( 234 | ); 235 | name = "Start Packager"; 236 | outputFileListPaths = ( 237 | ); 238 | outputPaths = ( 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | shellPath = /bin/sh; 242 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; 243 | showEnvVarsInLog = 0; 244 | }; 245 | /* End PBXShellScriptBuildPhase section */ 246 | 247 | /* Begin PBXSourcesBuildPhase section */ 248 | 13B07F871A680F5B00A75B9A /* Sources */ = { 249 | isa = PBXSourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 253 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 254 | ); 255 | runOnlyForDeploymentPostprocessing = 0; 256 | }; 257 | /* End PBXSourcesBuildPhase section */ 258 | 259 | /* Begin PBXVariantGroup section */ 260 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 261 | isa = PBXVariantGroup; 262 | children = ( 263 | 13B07FB21A68108700A75B9A /* Base */, 264 | ); 265 | name = LaunchScreen.xib; 266 | path = ReactNativeKeyboardTrackingView; 267 | sourceTree = ""; 268 | }; 269 | /* End PBXVariantGroup section */ 270 | 271 | /* Begin XCBuildConfiguration section */ 272 | 13B07F941A680F5B00A75B9A /* Debug */ = { 273 | isa = XCBuildConfiguration; 274 | baseConfigurationReference = F0BA926CBAEB2652808C9132 /* Pods-ReactNativeKeyboardTrackingView.debug.xcconfig */; 275 | buildSettings = { 276 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 277 | CURRENT_PROJECT_VERSION = 1; 278 | DEAD_CODE_STRIPPING = NO; 279 | INFOPLIST_FILE = ReactNativeKeyboardTrackingView/Info.plist; 280 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 281 | OTHER_LDFLAGS = ( 282 | "$(inherited)", 283 | "-ObjC", 284 | "-lc++", 285 | ); 286 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 287 | PRODUCT_NAME = ReactNativeKeyboardTrackingView; 288 | VERSIONING_SYSTEM = "apple-generic"; 289 | }; 290 | name = Debug; 291 | }; 292 | 13B07F951A680F5B00A75B9A /* Release */ = { 293 | isa = XCBuildConfiguration; 294 | baseConfigurationReference = 2BFF173EE638D54786D6E2D0 /* Pods-ReactNativeKeyboardTrackingView.release.xcconfig */; 295 | buildSettings = { 296 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 297 | CURRENT_PROJECT_VERSION = 1; 298 | INFOPLIST_FILE = ReactNativeKeyboardTrackingView/Info.plist; 299 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 300 | OTHER_LDFLAGS = ( 301 | "$(inherited)", 302 | "-ObjC", 303 | "-lc++", 304 | ); 305 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 306 | PRODUCT_NAME = ReactNativeKeyboardTrackingView; 307 | VERSIONING_SYSTEM = "apple-generic"; 308 | }; 309 | name = Release; 310 | }; 311 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 312 | isa = XCBuildConfiguration; 313 | buildSettings = { 314 | ALWAYS_SEARCH_USER_PATHS = NO; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 320 | CLANG_WARN_BOOL_CONVERSION = YES; 321 | CLANG_WARN_COMMA = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_EMPTY_BODY = YES; 326 | CLANG_WARN_ENUM_CONVERSION = YES; 327 | CLANG_WARN_INFINITE_RECURSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 334 | CLANG_WARN_STRICT_PROTOTYPES = YES; 335 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 336 | CLANG_WARN_UNREACHABLE_CODE = YES; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | COPY_PHASE_STRIP = NO; 340 | ENABLE_STRICT_OBJC_MSGSEND = YES; 341 | ENABLE_TESTABILITY = YES; 342 | GCC_C_LANGUAGE_STANDARD = gnu99; 343 | GCC_DYNAMIC_NO_PIC = NO; 344 | GCC_NO_COMMON_BLOCKS = YES; 345 | GCC_OPTIMIZATION_LEVEL = 0; 346 | GCC_PREPROCESSOR_DEFINITIONS = ( 347 | "DEBUG=1", 348 | "$(inherited)", 349 | ); 350 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 353 | GCC_WARN_UNDECLARED_SELECTOR = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 355 | GCC_WARN_UNUSED_FUNCTION = YES; 356 | GCC_WARN_UNUSED_VARIABLE = YES; 357 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 358 | MTL_ENABLE_DEBUG_INFO = YES; 359 | ONLY_ACTIVE_ARCH = YES; 360 | SDKROOT = iphoneos; 361 | }; 362 | name = Debug; 363 | }; 364 | 83CBBA211A601CBA00E9B192 /* Release */ = { 365 | isa = XCBuildConfiguration; 366 | buildSettings = { 367 | ALWAYS_SEARCH_USER_PATHS = NO; 368 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 369 | CLANG_CXX_LIBRARY = "libc++"; 370 | CLANG_ENABLE_MODULES = YES; 371 | CLANG_ENABLE_OBJC_ARC = YES; 372 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 373 | CLANG_WARN_BOOL_CONVERSION = YES; 374 | CLANG_WARN_COMMA = YES; 375 | CLANG_WARN_CONSTANT_CONVERSION = YES; 376 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 377 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 378 | CLANG_WARN_EMPTY_BODY = YES; 379 | CLANG_WARN_ENUM_CONVERSION = YES; 380 | CLANG_WARN_INFINITE_RECURSION = YES; 381 | CLANG_WARN_INT_CONVERSION = YES; 382 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 383 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 384 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 385 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 386 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 387 | CLANG_WARN_STRICT_PROTOTYPES = YES; 388 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 389 | CLANG_WARN_UNREACHABLE_CODE = YES; 390 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 391 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 392 | COPY_PHASE_STRIP = YES; 393 | ENABLE_NS_ASSERTIONS = NO; 394 | ENABLE_STRICT_OBJC_MSGSEND = YES; 395 | GCC_C_LANGUAGE_STANDARD = gnu99; 396 | GCC_NO_COMMON_BLOCKS = YES; 397 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 398 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 399 | GCC_WARN_UNDECLARED_SELECTOR = YES; 400 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 401 | GCC_WARN_UNUSED_FUNCTION = YES; 402 | GCC_WARN_UNUSED_VARIABLE = YES; 403 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 404 | MTL_ENABLE_DEBUG_INFO = NO; 405 | SDKROOT = iphoneos; 406 | VALIDATE_PRODUCT = YES; 407 | }; 408 | name = Release; 409 | }; 410 | /* End XCBuildConfiguration section */ 411 | 412 | /* Begin XCConfigurationList section */ 413 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeKeyboardTrackingView" */ = { 414 | isa = XCConfigurationList; 415 | buildConfigurations = ( 416 | 13B07F941A680F5B00A75B9A /* Debug */, 417 | 13B07F951A680F5B00A75B9A /* Release */, 418 | ); 419 | defaultConfigurationIsVisible = 0; 420 | defaultConfigurationName = Release; 421 | }; 422 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeKeyboardTrackingView" */ = { 423 | isa = XCConfigurationList; 424 | buildConfigurations = ( 425 | 83CBBA201A601CBA00E9B192 /* Debug */, 426 | 83CBBA211A601CBA00E9B192 /* Release */, 427 | ); 428 | defaultConfigurationIsVisible = 0; 429 | defaultConfigurationName = Release; 430 | }; 431 | /* End XCConfigurationList section */ 432 | }; 433 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 434 | } 435 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView.xcodeproj/xcshareddata/xcschemes/ReactNativeKeyboardTrackingView-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView.xcodeproj/xcshareddata/xcschemes/ReactNativeKeyboardTrackingView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its 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 | #import 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (nonatomic, strong) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its 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 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 19 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 20 | moduleName:@"ReactNativeKeyboardTrackingView" 21 | initialProperties:nil]; 22 | 23 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 24 | 25 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 26 | UIViewController *rootViewController = [UIViewController new]; 27 | rootViewController.view = rootView; 28 | self.window.rootViewController = rootViewController; 29 | [self.window makeKeyAndVisible]; 30 | return YES; 31 | } 32 | 33 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 34 | { 35 | #if DEBUG 36 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 37 | #else 38 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 39 | #endif 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ReactNativeKeyboardTrackingView 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSExceptionDomains 32 | 33 | localhost 34 | 35 | NSExceptionAllowsInsecureHTTPLoads 36 | 37 | 38 | 39 | 40 | NSLocationWhenInUseUsageDescription 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UIViewControllerBasedStatusBarAppearance 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingView/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its 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 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingViewTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/ReactNativeKeyboardTrackingViewTests/ReactNativeKeyboardTrackingViewTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its 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 | #import 9 | #import 10 | 11 | #import 12 | #import 13 | 14 | #define TIMEOUT_SECONDS 600 15 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 16 | 17 | @interface ReactNativeKeyboardTrackingViewTests : XCTestCase 18 | 19 | @end 20 | 21 | @implementation ReactNativeKeyboardTrackingViewTests 22 | 23 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 24 | { 25 | if (test(view)) { 26 | return YES; 27 | } 28 | for (UIView *subview in [view subviews]) { 29 | if ([self findSubviewInView:subview matching:test]) { 30 | return YES; 31 | } 32 | } 33 | return NO; 34 | } 35 | 36 | - (void)testRendersWelcomeScreen 37 | { 38 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 39 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 40 | BOOL foundElement = NO; 41 | 42 | __block NSString *redboxError = nil; 43 | #ifdef DEBUG 44 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 45 | if (level >= RCTLogLevelError) { 46 | redboxError = message; 47 | } 48 | }); 49 | #endif 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | #ifdef DEBUG 64 | RCTSetLogFunction(RCTDefaultLogFunction); 65 | #endif 66 | 67 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 68 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 69 | } 70 | 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: false, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "react-native start" 7 | }, 8 | "dependencies": { 9 | "metro-react-native-babel-preset": "^0.53.1", 10 | "react": "16.9.0", 11 | "react-native": "0.61.4", 12 | "react-native-autogrow-textinput": "^5.0.0", 13 | "react-native-keyboard-tracking-view": "latest" 14 | }, 15 | "devDependencies": { 16 | "@babel/core": "^7.4.0", 17 | "@babel/preset-env": "^7.3.1", 18 | "@babel/runtime": "^7.4.2" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /img/add_lib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/img/add_lib.png -------------------------------------------------------------------------------- /img/add_proj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/img/add_proj.png -------------------------------------------------------------------------------- /img/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wix-incubator/react-native-keyboard-tracking-view/d8eaf89ef78e38ca96675b720a1a636188cafa08/img/demo.gif -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import KeyboardTrackingView from './src/KeyboardTrackingView'; 2 | import KeyboardAwareInsetsView from './src/KeyboardAwareInsetsView'; 3 | export {KeyboardTrackingView, KeyboardAwareInsetsView}; 4 | -------------------------------------------------------------------------------- /lib/KeyboardTrackingView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D834CEEE1CC650F000FA5668 /* KeyboardTrackingViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D834CEEB1CC650F000FA5668 /* KeyboardTrackingViewManager.m */; }; 11 | D834CEEF1CC650F000FA5668 /* ObservingInputAccessoryView.m in Sources */ = {isa = PBXBuildFile; fileRef = D834CEED1CC650F000FA5668 /* ObservingInputAccessoryView.m */; }; 12 | D8904E471EA63900001198F0 /* ObservingInputAccessoryView.h in Headers */ = {isa = PBXBuildFile; fileRef = D834CEEC1CC650F000FA5668 /* ObservingInputAccessoryView.h */; }; 13 | D8904F521EA796A9001198F0 /* ObservingInputAccessoryView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D834CEEC1CC650F000FA5668 /* ObservingInputAccessoryView.h */; }; 14 | D8E5A4372044BF6F0000DA01 /* UIResponder+FirstResponder.h in Headers */ = {isa = PBXBuildFile; fileRef = D8E5A4352044BF6F0000DA01 /* UIResponder+FirstResponder.h */; }; 15 | D8E5A4382044BF6F0000DA01 /* UIResponder+FirstResponder.m in Sources */ = {isa = PBXBuildFile; fileRef = D8E5A4362044BF6F0000DA01 /* UIResponder+FirstResponder.m */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | D834CED61CC64F2400FA5668 /* CopyFiles */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = "include/$(PRODUCT_NAME)"; 23 | dstSubfolderSpec = 16; 24 | files = ( 25 | D8904F521EA796A9001198F0 /* ObservingInputAccessoryView.h in CopyFiles */, 26 | ); 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | D834CED81CC64F2400FA5668 /* libKeyboardTrackingView.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libKeyboardTrackingView.a; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | D834CEEA1CC650F000FA5668 /* KeyboardTrackingViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyboardTrackingViewManager.h; sourceTree = ""; }; 34 | D834CEEB1CC650F000FA5668 /* KeyboardTrackingViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KeyboardTrackingViewManager.m; sourceTree = ""; }; 35 | D834CEEC1CC650F000FA5668 /* ObservingInputAccessoryView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObservingInputAccessoryView.h; sourceTree = ""; }; 36 | D834CEED1CC650F000FA5668 /* ObservingInputAccessoryView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ObservingInputAccessoryView.m; sourceTree = ""; }; 37 | D8E5A4352044BF6F0000DA01 /* UIResponder+FirstResponder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIResponder+FirstResponder.h"; sourceTree = ""; }; 38 | D8E5A4362044BF6F0000DA01 /* UIResponder+FirstResponder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIResponder+FirstResponder.m"; sourceTree = ""; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | D834CED51CC64F2400FA5668 /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | ); 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | /* End PBXFrameworksBuildPhase section */ 50 | 51 | /* Begin PBXGroup section */ 52 | D834CECF1CC64F2400FA5668 = { 53 | isa = PBXGroup; 54 | children = ( 55 | D8E5A4352044BF6F0000DA01 /* UIResponder+FirstResponder.h */, 56 | D8E5A4362044BF6F0000DA01 /* UIResponder+FirstResponder.m */, 57 | D834CEEA1CC650F000FA5668 /* KeyboardTrackingViewManager.h */, 58 | D834CEEB1CC650F000FA5668 /* KeyboardTrackingViewManager.m */, 59 | D834CEEC1CC650F000FA5668 /* ObservingInputAccessoryView.h */, 60 | D834CEED1CC650F000FA5668 /* ObservingInputAccessoryView.m */, 61 | D834CED91CC64F2400FA5668 /* Products */, 62 | ); 63 | sourceTree = ""; 64 | }; 65 | D834CED91CC64F2400FA5668 /* Products */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | D834CED81CC64F2400FA5668 /* libKeyboardTrackingView.a */, 69 | ); 70 | name = Products; 71 | sourceTree = ""; 72 | }; 73 | /* End PBXGroup section */ 74 | 75 | /* Begin PBXHeadersBuildPhase section */ 76 | D8904E461EA63897001198F0 /* Headers */ = { 77 | isa = PBXHeadersBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | D8904E471EA63900001198F0 /* ObservingInputAccessoryView.h in Headers */, 81 | D8E5A4372044BF6F0000DA01 /* UIResponder+FirstResponder.h in Headers */, 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | /* End PBXHeadersBuildPhase section */ 86 | 87 | /* Begin PBXNativeTarget section */ 88 | D834CED71CC64F2400FA5668 /* KeyboardTrackingView */ = { 89 | isa = PBXNativeTarget; 90 | buildConfigurationList = D834CEE11CC64F2400FA5668 /* Build configuration list for PBXNativeTarget "KeyboardTrackingView" */; 91 | buildPhases = ( 92 | D8904E461EA63897001198F0 /* Headers */, 93 | D834CED61CC64F2400FA5668 /* CopyFiles */, 94 | D834CED41CC64F2400FA5668 /* Sources */, 95 | D834CED51CC64F2400FA5668 /* Frameworks */, 96 | ); 97 | buildRules = ( 98 | ); 99 | dependencies = ( 100 | ); 101 | name = KeyboardTrackingView; 102 | productName = KeyboardTrackingView; 103 | productReference = D834CED81CC64F2400FA5668 /* libKeyboardTrackingView.a */; 104 | productType = "com.apple.product-type.library.static"; 105 | }; 106 | /* End PBXNativeTarget section */ 107 | 108 | /* Begin PBXProject section */ 109 | D834CED01CC64F2400FA5668 /* Project object */ = { 110 | isa = PBXProject; 111 | attributes = { 112 | LastUpgradeCheck = 0730; 113 | ORGANIZATIONNAME = wix; 114 | TargetAttributes = { 115 | D834CED71CC64F2400FA5668 = { 116 | CreatedOnToolsVersion = 7.3; 117 | }; 118 | }; 119 | }; 120 | buildConfigurationList = D834CED31CC64F2400FA5668 /* Build configuration list for PBXProject "KeyboardTrackingView" */; 121 | compatibilityVersion = "Xcode 3.2"; 122 | developmentRegion = English; 123 | hasScannedForEncodings = 0; 124 | knownRegions = ( 125 | en, 126 | ); 127 | mainGroup = D834CECF1CC64F2400FA5668; 128 | productRefGroup = D834CED91CC64F2400FA5668 /* Products */; 129 | projectDirPath = ""; 130 | projectRoot = ""; 131 | targets = ( 132 | D834CED71CC64F2400FA5668 /* KeyboardTrackingView */, 133 | ); 134 | }; 135 | /* End PBXProject section */ 136 | 137 | /* Begin PBXSourcesBuildPhase section */ 138 | D834CED41CC64F2400FA5668 /* Sources */ = { 139 | isa = PBXSourcesBuildPhase; 140 | buildActionMask = 2147483647; 141 | files = ( 142 | D834CEEF1CC650F000FA5668 /* ObservingInputAccessoryView.m in Sources */, 143 | D834CEEE1CC650F000FA5668 /* KeyboardTrackingViewManager.m in Sources */, 144 | D8E5A4382044BF6F0000DA01 /* UIResponder+FirstResponder.m in Sources */, 145 | ); 146 | runOnlyForDeploymentPostprocessing = 0; 147 | }; 148 | /* End PBXSourcesBuildPhase section */ 149 | 150 | /* Begin XCBuildConfiguration section */ 151 | D834CEDF1CC64F2400FA5668 /* Debug */ = { 152 | isa = XCBuildConfiguration; 153 | buildSettings = { 154 | ALWAYS_SEARCH_USER_PATHS = NO; 155 | CLANG_ANALYZER_NONNULL = YES; 156 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 157 | CLANG_CXX_LIBRARY = "libc++"; 158 | CLANG_ENABLE_MODULES = YES; 159 | CLANG_ENABLE_OBJC_ARC = YES; 160 | CLANG_WARN_BOOL_CONVERSION = YES; 161 | CLANG_WARN_CONSTANT_CONVERSION = YES; 162 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 163 | CLANG_WARN_EMPTY_BODY = YES; 164 | CLANG_WARN_ENUM_CONVERSION = YES; 165 | CLANG_WARN_INT_CONVERSION = YES; 166 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 167 | CLANG_WARN_UNREACHABLE_CODE = YES; 168 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 169 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 170 | COPY_PHASE_STRIP = NO; 171 | DEBUG_INFORMATION_FORMAT = dwarf; 172 | ENABLE_STRICT_OBJC_MSGSEND = YES; 173 | ENABLE_TESTABILITY = YES; 174 | GCC_C_LANGUAGE_STANDARD = gnu99; 175 | GCC_DYNAMIC_NO_PIC = NO; 176 | GCC_NO_COMMON_BLOCKS = YES; 177 | GCC_OPTIMIZATION_LEVEL = 0; 178 | GCC_PREPROCESSOR_DEFINITIONS = ( 179 | "DEBUG=1", 180 | "$(inherited)", 181 | ); 182 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 183 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 184 | GCC_WARN_UNDECLARED_SELECTOR = YES; 185 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 186 | GCC_WARN_UNUSED_FUNCTION = YES; 187 | GCC_WARN_UNUSED_VARIABLE = YES; 188 | HEADER_SEARCH_PATHS = ( 189 | "$(inherited)", 190 | "$(SRCROOT)/../../react-native/React/**", 191 | "$(SRCROOT)/../../react-native/Libraries/**", 192 | ); 193 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 194 | MTL_ENABLE_DEBUG_INFO = YES; 195 | ONLY_ACTIVE_ARCH = YES; 196 | SDKROOT = iphoneos; 197 | }; 198 | name = Debug; 199 | }; 200 | D834CEE01CC64F2400FA5668 /* Release */ = { 201 | isa = XCBuildConfiguration; 202 | buildSettings = { 203 | ALWAYS_SEARCH_USER_PATHS = NO; 204 | CLANG_ANALYZER_NONNULL = YES; 205 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 206 | CLANG_CXX_LIBRARY = "libc++"; 207 | CLANG_ENABLE_MODULES = YES; 208 | CLANG_ENABLE_OBJC_ARC = YES; 209 | CLANG_WARN_BOOL_CONVERSION = YES; 210 | CLANG_WARN_CONSTANT_CONVERSION = YES; 211 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 212 | CLANG_WARN_EMPTY_BODY = YES; 213 | CLANG_WARN_ENUM_CONVERSION = YES; 214 | CLANG_WARN_INT_CONVERSION = YES; 215 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 216 | CLANG_WARN_UNREACHABLE_CODE = YES; 217 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 218 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 219 | COPY_PHASE_STRIP = NO; 220 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 221 | ENABLE_NS_ASSERTIONS = NO; 222 | ENABLE_STRICT_OBJC_MSGSEND = YES; 223 | GCC_C_LANGUAGE_STANDARD = gnu99; 224 | GCC_NO_COMMON_BLOCKS = YES; 225 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 226 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 227 | GCC_WARN_UNDECLARED_SELECTOR = YES; 228 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 229 | GCC_WARN_UNUSED_FUNCTION = YES; 230 | GCC_WARN_UNUSED_VARIABLE = YES; 231 | HEADER_SEARCH_PATHS = ( 232 | "$(inherited)", 233 | "$(SRCROOT)/../../react-native/React/**", 234 | "$(SRCROOT)/../../react-native/Libraries/**", 235 | ); 236 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 237 | MTL_ENABLE_DEBUG_INFO = NO; 238 | SDKROOT = iphoneos; 239 | VALIDATE_PRODUCT = YES; 240 | }; 241 | name = Release; 242 | }; 243 | D834CEE21CC64F2400FA5668 /* Debug */ = { 244 | isa = XCBuildConfiguration; 245 | buildSettings = { 246 | HEADER_SEARCH_PATHS = ( 247 | "$(inherited)", 248 | "$(SRCROOT)/../../react-native/React/**", 249 | "$(SRCROOT)/../../react-native/Libraries/**", 250 | ); 251 | OTHER_LDFLAGS = "-ObjC"; 252 | PRODUCT_NAME = "$(TARGET_NAME)"; 253 | PUBLIC_HEADERS_FOLDER_PATH = "/usr/local/include/$(TARGET_NAME)"; 254 | SKIP_INSTALL = YES; 255 | }; 256 | name = Debug; 257 | }; 258 | D834CEE31CC64F2400FA5668 /* Release */ = { 259 | isa = XCBuildConfiguration; 260 | buildSettings = { 261 | HEADER_SEARCH_PATHS = ( 262 | "$(inherited)", 263 | "$(SRCROOT)/../../react-native/React/**", 264 | "$(SRCROOT)/../../react-native/Libraries/**", 265 | ); 266 | OTHER_LDFLAGS = "-ObjC"; 267 | PRODUCT_NAME = "$(TARGET_NAME)"; 268 | PUBLIC_HEADERS_FOLDER_PATH = "/usr/local/include/$(TARGET_NAME)"; 269 | SKIP_INSTALL = YES; 270 | }; 271 | name = Release; 272 | }; 273 | /* End XCBuildConfiguration section */ 274 | 275 | /* Begin XCConfigurationList section */ 276 | D834CED31CC64F2400FA5668 /* Build configuration list for PBXProject "KeyboardTrackingView" */ = { 277 | isa = XCConfigurationList; 278 | buildConfigurations = ( 279 | D834CEDF1CC64F2400FA5668 /* Debug */, 280 | D834CEE01CC64F2400FA5668 /* Release */, 281 | ); 282 | defaultConfigurationIsVisible = 0; 283 | defaultConfigurationName = Release; 284 | }; 285 | D834CEE11CC64F2400FA5668 /* Build configuration list for PBXNativeTarget "KeyboardTrackingView" */ = { 286 | isa = XCConfigurationList; 287 | buildConfigurations = ( 288 | D834CEE21CC64F2400FA5668 /* Debug */, 289 | D834CEE31CC64F2400FA5668 /* Release */, 290 | ); 291 | defaultConfigurationIsVisible = 0; 292 | defaultConfigurationName = Release; 293 | }; 294 | /* End XCConfigurationList section */ 295 | }; 296 | rootObject = D834CED01CC64F2400FA5668 /* Project object */; 297 | } 298 | -------------------------------------------------------------------------------- /lib/KeyboardTrackingView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/KeyboardTrackingView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/KeyboardTrackingViewManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // KeyboardTrackingViewManager.h 3 | // ReactNativeChat 4 | // 5 | // Created by Artal Druk on 19/04/2016. 6 | // Copyright © 2016 Wix.com All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | @interface KeyboardTrackingViewManager : RCTViewManager 14 | @end 15 | -------------------------------------------------------------------------------- /lib/KeyboardTrackingViewManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // KeyboardTrackingViewManager.m 3 | // ReactNativeChat 4 | // 5 | // Created by Artal Druk on 19/04/2016. 6 | // Copyright © 2016 Wix.com All rights reserved. 7 | // 8 | 9 | #import "KeyboardTrackingViewManager.h" 10 | #import "ObservingInputAccessoryView.h" 11 | #import "UIResponder+FirstResponder.h" 12 | 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | #import 19 | 20 | #import 21 | 22 | 23 | NSUInteger const kInputViewKey = 101010; 24 | NSUInteger const kMaxDeferedInitializeAccessoryViews = 15; 25 | NSInteger const kTrackingViewNotFoundErrorCode = 1; 26 | NSInteger const kBottomViewHeight = 100; 27 | 28 | typedef NS_ENUM(NSUInteger, KeyboardTrackingScrollBehavior) { 29 | KeyboardTrackingScrollBehaviorNone, 30 | KeyboardTrackingScrollBehaviorScrollToBottomInvertedOnly, 31 | KeyboardTrackingScrollBehaviorFixedOffset 32 | }; 33 | 34 | @interface KeyboardTrackingView : UIView 35 | { 36 | Class _newClass; 37 | NSMapTable *_inputViewsMap; 38 | ObservingInputAccessoryView *_observingInputAccessoryView; 39 | UIView *_bottomView; 40 | CGFloat _bottomViewHeight; 41 | } 42 | 43 | @property (nonatomic, strong) UIScrollView *scrollViewToManage; 44 | @property (nonatomic) BOOL scrollIsInverted; 45 | @property (nonatomic) BOOL revealKeyboardInteractive; 46 | @property (nonatomic) BOOL isDraggingScrollView; 47 | @property (nonatomic) BOOL manageScrollView; 48 | @property (nonatomic) BOOL requiresSameParentToManageScrollView; 49 | @property (nonatomic) NSUInteger deferedInitializeAccessoryViewsCount; 50 | @property (nonatomic) CGFloat originalHeight; 51 | @property (nonatomic) KeyboardTrackingScrollBehavior scrollBehavior; 52 | @property (nonatomic) BOOL addBottomView; 53 | @property (nonatomic) BOOL scrollToFocusedInput; 54 | @property (nonatomic) BOOL allowHitsOutsideBounds; 55 | 56 | @end 57 | 58 | @interface KeyboardTrackingView () 59 | 60 | @end 61 | 62 | @implementation KeyboardTrackingView 63 | 64 | -(instancetype)init 65 | { 66 | self = [super init]; 67 | 68 | if (self) 69 | { 70 | [self addObserver:self forKeyPath:@"bounds" options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew context:NULL]; 71 | _inputViewsMap = [NSMapTable weakToWeakObjectsMapTable]; 72 | _deferedInitializeAccessoryViewsCount = 0; 73 | 74 | _observingInputAccessoryView = [ObservingInputAccessoryView new]; 75 | _observingInputAccessoryView.delegate = self; 76 | 77 | _manageScrollView = YES; 78 | _allowHitsOutsideBounds = NO; 79 | 80 | _bottomViewHeight = kBottomViewHeight; 81 | 82 | self.addBottomView = NO; 83 | self.scrollToFocusedInput = NO; 84 | 85 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(rctContentDidAppearNotification:) name:RCTContentDidAppearNotification object:nil]; 86 | } 87 | 88 | return self; 89 | } 90 | 91 | -(RCTRootView*)getRootView 92 | { 93 | UIView *view = self; 94 | while (view.superview != nil) 95 | { 96 | view = view.superview; 97 | if ([view isKindOfClass:[RCTRootView class]]) 98 | break; 99 | } 100 | 101 | if ([view isKindOfClass:[RCTRootView class]]) 102 | { 103 | return (RCTRootView*)view; 104 | } 105 | return nil; 106 | } 107 | 108 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { 109 | if (!_allowHitsOutsideBounds) { 110 | return [super hitTest:point withEvent:event]; 111 | } 112 | 113 | if (self.isHidden || self.alpha == 0 || self.clipsToBounds) { 114 | return nil; 115 | } 116 | 117 | UIView *subview = [super hitTest:point withEvent:event]; 118 | if (subview == nil) { 119 | NSArray* allSubviews = [self getBreadthFirstSubviewsForView:self]; 120 | for (UIView *tmpSubview in allSubviews) { 121 | CGPoint pointInSubview = [self convertPoint:point toView:tmpSubview]; 122 | if ([tmpSubview pointInside:pointInSubview withEvent:event]) { 123 | subview = tmpSubview; 124 | break; 125 | } 126 | } 127 | } 128 | 129 | return subview; 130 | } 131 | 132 | -(void)_swizzleWebViewInputAccessory:(WKWebView*)webview 133 | { 134 | UIView* subview; 135 | for (UIView* view in webview.scrollView.subviews) 136 | { 137 | if([[view.class description] hasPrefix:@"UIWeb"]) 138 | { 139 | subview = view; 140 | } 141 | } 142 | 143 | if(_newClass == nil) 144 | { 145 | NSString* name = [NSString stringWithFormat:@"%@_Tracking_%p", subview.class, self]; 146 | _newClass = NSClassFromString(name); 147 | 148 | _newClass = objc_allocateClassPair(subview.class, [name cStringUsingEncoding:NSASCIIStringEncoding], 0); 149 | if(!_newClass) return; 150 | 151 | Method method = class_getInstanceMethod([UIResponder class], @selector(inputAccessoryView)); 152 | class_addMethod(_newClass, @selector(inputAccessoryView), imp_implementationWithBlock(^(id _self){return _observingInputAccessoryView;}), method_getTypeEncoding(method)); 153 | 154 | objc_registerClassPair(_newClass); 155 | } 156 | 157 | object_setClass(subview, _newClass); 158 | [subview reloadInputViews]; 159 | } 160 | 161 | -(void)layoutSubviews 162 | { 163 | [super layoutSubviews]; 164 | [self updateBottomViewFrame]; 165 | } 166 | 167 | - (void)initializeAccessoryViewsAndHandleInsets 168 | { 169 | NSArray* allSubviews = [self getBreadthFirstSubviewsForView:[self getRootView]]; 170 | NSMutableArray* rctScrollViewsArray = [NSMutableArray array]; 171 | 172 | for (UIView* subview in allSubviews) 173 | { 174 | if(_manageScrollView) 175 | { 176 | if(_scrollViewToManage == nil) 177 | { 178 | if(_requiresSameParentToManageScrollView && [subview isKindOfClass:[RCTScrollView class]] && subview.superview == self.superview) 179 | { 180 | _scrollViewToManage = ((RCTScrollView*)subview).scrollView; 181 | } 182 | else if(!_requiresSameParentToManageScrollView && [subview isKindOfClass:[UIScrollView class]]) 183 | { 184 | _scrollViewToManage = (UIScrollView*)subview; 185 | } 186 | 187 | if(_scrollViewToManage != nil) 188 | { 189 | _scrollIsInverted = CGAffineTransformEqualToTransform(_scrollViewToManage.superview.transform, CGAffineTransformMakeScale(1, -1)); 190 | } 191 | } 192 | 193 | if([subview isKindOfClass:[RCTScrollView class]]) 194 | { 195 | [rctScrollViewsArray addObject:(RCTScrollView*)subview]; 196 | } 197 | } 198 | 199 | if ([subview isKindOfClass:NSClassFromString(@"RCTTextField")]) 200 | { 201 | UITextField *textField = nil; 202 | Ivar backedTextInputIvar = class_getInstanceVariable([subview class], "_backedTextInput"); 203 | if (backedTextInputIvar != NULL) 204 | { 205 | textField = [subview valueForKey:@"_backedTextInput"]; 206 | } 207 | else if([subview isKindOfClass:[UITextField class]]) 208 | { 209 | textField = (UITextField*)subview; 210 | } 211 | [self setupTextField:textField]; 212 | } 213 | else if ([subview isKindOfClass:NSClassFromString(@"RCTUITextField")] && [subview isKindOfClass:[UITextField class]]) 214 | { 215 | [self setupTextField:(UITextField*)subview]; 216 | } 217 | else if ([subview isKindOfClass:NSClassFromString(@"RCTMultilineTextInputView")]) 218 | { 219 | [self setupTextView:[subview valueForKey:@"_backedTextInputView"]]; 220 | } 221 | else if ([subview isKindOfClass:NSClassFromString(@"RCTTextView")]) 222 | { 223 | UITextView *textView = nil; 224 | Ivar backedTextInputIvar = class_getInstanceVariable([subview class], "_backedTextInput"); 225 | if (backedTextInputIvar != NULL) 226 | { 227 | textView = [subview valueForKey:@"_backedTextInput"]; 228 | } 229 | else if([subview isKindOfClass:[UITextView class]]) 230 | { 231 | textView = (UITextView*)subview; 232 | } 233 | [self setupTextView:textView]; 234 | } 235 | else if ([subview isKindOfClass:NSClassFromString(@"RCTUITextView")] && [subview isKindOfClass:[UITextView class]]) 236 | { 237 | [self setupTextView:(UITextView*)subview]; 238 | } 239 | else if ([subview isKindOfClass:[WKWebView class]]) 240 | { 241 | [self _swizzleWebViewInputAccessory:(WKWebView*)subview]; 242 | } 243 | } 244 | 245 | for (RCTScrollView *scrollView in rctScrollViewsArray) 246 | { 247 | if(scrollView.scrollView == _scrollViewToManage) 248 | { 249 | [scrollView removeScrollListener:self]; 250 | [scrollView addScrollListener:self]; 251 | break; 252 | } 253 | } 254 | 255 | #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_10_3 256 | if (@available(iOS 11.0, *)) { 257 | if (_scrollViewToManage != nil) { 258 | _scrollViewToManage.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; 259 | } 260 | } 261 | #endif 262 | 263 | [self _updateScrollViewInsets]; 264 | 265 | _originalHeight = _observingInputAccessoryView.height; 266 | 267 | [self addBottomViewIfNecessary]; 268 | } 269 | 270 | - (void)setupTextView:(UITextView*)textView 271 | { 272 | if (textView != nil) 273 | { 274 | [textView setInputAccessoryView:_observingInputAccessoryView]; 275 | [textView reloadInputViews]; 276 | [_inputViewsMap setObject:textView forKey:@(kInputViewKey)]; 277 | } 278 | } 279 | 280 | - (void)setupTextField:(UITextField*)textField 281 | { 282 | if (textField != nil) 283 | { 284 | [textField setInputAccessoryView:_observingInputAccessoryView]; 285 | [textField reloadInputViews]; 286 | [_inputViewsMap setObject:textField forKey:@(kInputViewKey)]; 287 | } 288 | } 289 | 290 | -(void) deferedInitializeAccessoryViewsAndHandleInsets 291 | { 292 | if(self.window == nil) 293 | { 294 | return; 295 | } 296 | 297 | if (_observingInputAccessoryView.height == 0 && self.deferedInitializeAccessoryViewsCount < kMaxDeferedInitializeAccessoryViews) 298 | { 299 | self.deferedInitializeAccessoryViewsCount++; 300 | 301 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 302 | [self deferedInitializeAccessoryViewsAndHandleInsets]; 303 | }); 304 | } 305 | else 306 | { 307 | dispatch_async(dispatch_get_main_queue(), ^{ 308 | [self initializeAccessoryViewsAndHandleInsets]; 309 | }); 310 | } 311 | } 312 | 313 | - (void)willMoveToWindow:(nullable UIWindow *)newWindow 314 | { 315 | if (newWindow == nil && [ObservingInputAccessoryViewManager sharedInstance].activeObservingInputAccessoryView == _observingInputAccessoryView) 316 | { 317 | [ObservingInputAccessoryViewManager sharedInstance].activeObservingInputAccessoryView = nil; 318 | } 319 | else if (newWindow != nil) 320 | { 321 | [ObservingInputAccessoryViewManager sharedInstance].activeObservingInputAccessoryView = _observingInputAccessoryView; 322 | } 323 | } 324 | 325 | -(void)didMoveToWindow 326 | { 327 | [super didMoveToWindow]; 328 | 329 | self.deferedInitializeAccessoryViewsCount = 0; 330 | 331 | [self deferedInitializeAccessoryViewsAndHandleInsets]; 332 | } 333 | 334 | -(void)dealloc 335 | { 336 | [self removeObserver:self forKeyPath:@"bounds"]; 337 | } 338 | 339 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 340 | { 341 | _observingInputAccessoryView.height = self.bounds.size.height; 342 | } 343 | 344 | - (void)observingInputAccessoryViewKeyboardWillDisappear:(ObservingInputAccessoryView *)observingInputAccessoryView 345 | { 346 | _bottomViewHeight = kBottomViewHeight; 347 | [self updateBottomViewFrame]; 348 | } 349 | 350 | - (NSArray*)getBreadthFirstSubviewsForView:(UIView*)view 351 | { 352 | if(view == nil) 353 | { 354 | return nil; 355 | } 356 | 357 | NSMutableArray *allSubviews = [NSMutableArray new]; 358 | NSMutableArray *queue = [NSMutableArray new]; 359 | 360 | [allSubviews addObject:view]; 361 | [queue addObject:view]; 362 | 363 | while ([queue count] > 0) { 364 | UIView *current = [queue lastObject]; 365 | [queue removeLastObject]; 366 | 367 | for (UIView *n in current.subviews) 368 | { 369 | [allSubviews addObject:n]; 370 | [queue insertObject:n atIndex:0]; 371 | } 372 | } 373 | return allSubviews; 374 | } 375 | 376 | - (NSArray*)getAllReactSubviewsForView:(UIView*)view 377 | { 378 | NSMutableArray *allSubviews = [NSMutableArray new]; 379 | for (UIView *subview in view.reactSubviews) 380 | { 381 | [allSubviews addObject:subview]; 382 | [allSubviews addObjectsFromArray:[self getAllReactSubviewsForView:subview]]; 383 | } 384 | return allSubviews; 385 | } 386 | 387 | - (void)_updateScrollViewInsets 388 | { 389 | if(self.scrollViewToManage != nil) 390 | { 391 | UIEdgeInsets insets = self.scrollViewToManage.contentInset; 392 | CGFloat bottomSafeArea = [self getBottomSafeArea]; 393 | CGFloat bottomInset = MAX(self.bounds.size.height, _observingInputAccessoryView.keyboardHeight + _observingInputAccessoryView.height); 394 | 395 | CGFloat originalBottomInset = self.scrollIsInverted ? insets.top : insets.bottom; 396 | CGPoint originalOffset = self.scrollViewToManage.contentOffset; 397 | 398 | bottomInset += (_observingInputAccessoryView.keyboardHeight == 0 ? bottomSafeArea : 0); 399 | if(self.scrollIsInverted) 400 | { 401 | insets.top = bottomInset; 402 | } 403 | else 404 | { 405 | insets.bottom = bottomInset; 406 | } 407 | self.scrollViewToManage.contentInset = insets; 408 | 409 | if(self.scrollBehavior == KeyboardTrackingScrollBehaviorScrollToBottomInvertedOnly && _scrollIsInverted) 410 | { 411 | BOOL fisrtTime = _observingInputAccessoryView.keyboardHeight == 0 && _observingInputAccessoryView.keyboardState == KeyboardStateHidden; 412 | BOOL willOpen = _observingInputAccessoryView.keyboardHeight != 0 && _observingInputAccessoryView.keyboardState == KeyboardStateHidden; 413 | BOOL isOpen = _observingInputAccessoryView.keyboardHeight != 0 && _observingInputAccessoryView.keyboardState == KeyboardStateShown; 414 | if(fisrtTime || willOpen || (isOpen && !self.isDraggingScrollView)) 415 | { 416 | [self.scrollViewToManage setContentOffset:CGPointMake(self.scrollViewToManage.contentOffset.x, -self.scrollViewToManage.contentInset.top) animated:!fisrtTime]; 417 | } 418 | } 419 | else if(self.scrollBehavior == KeyboardTrackingScrollBehaviorFixedOffset && !self.isDraggingScrollView) 420 | { 421 | CGFloat insetsDiff = (bottomInset - originalBottomInset) * (self.scrollIsInverted ? -1 : 1); 422 | self.scrollViewToManage.contentOffset = CGPointMake(originalOffset.x, originalOffset.y + insetsDiff); 423 | } 424 | 425 | insets = self.scrollViewToManage.contentInset; 426 | if(self.scrollIsInverted) 427 | { 428 | insets.top = bottomInset; 429 | } 430 | else 431 | { 432 | insets.bottom = bottomInset; 433 | } 434 | self.scrollViewToManage.scrollIndicatorInsets = insets; 435 | } 436 | } 437 | 438 | #pragma mark - bottom view 439 | 440 | -(void)setAddBottomView:(BOOL)addBottomView 441 | { 442 | _addBottomView = addBottomView; 443 | [self addBottomViewIfNecessary]; 444 | } 445 | 446 | -(void)addBottomViewIfNecessary 447 | { 448 | if (self.addBottomView && _bottomView == nil) 449 | { 450 | _bottomView = [UIView new]; 451 | _bottomView.backgroundColor = [UIColor whiteColor]; 452 | [self addSubview:_bottomView]; 453 | [self updateBottomViewFrame]; 454 | } 455 | else if (!self.addBottomView && _bottomView != nil) 456 | { 457 | [_bottomView removeFromSuperview]; 458 | _bottomView = nil; 459 | } 460 | } 461 | 462 | -(void)updateBottomViewFrame 463 | { 464 | if (_bottomView != nil) 465 | { 466 | _bottomView.frame = CGRectMake(0, self.frame.size.height, self.frame.size.width, _bottomViewHeight); 467 | } 468 | } 469 | 470 | #pragma mark - safe area 471 | 472 | -(void)safeAreaInsetsDidChange 473 | { 474 | #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_10_3 475 | if (@available(iOS 11.0, *)) { 476 | [super safeAreaInsetsDidChange]; 477 | } 478 | #endif 479 | [self updateTransformAndInsets]; 480 | } 481 | 482 | -(CGFloat)getBottomSafeArea 483 | { 484 | CGFloat bottomSafeArea = 0; 485 | #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_10_3 486 | if (@available(iOS 11.0, *)) { 487 | bottomSafeArea = self.superview ? self.superview.safeAreaInsets.bottom : self.safeAreaInsets.bottom; 488 | } 489 | #endif 490 | return bottomSafeArea; 491 | } 492 | 493 | #pragma RCTRootView notifications 494 | 495 | - (void) rctContentDidAppearNotification:(NSNotification*)notification 496 | { 497 | dispatch_async(dispatch_get_main_queue(), ^{ 498 | if(notification.object == [self getRootView] && _manageScrollView && _scrollViewToManage == nil) 499 | { 500 | [self initializeAccessoryViewsAndHandleInsets]; 501 | } 502 | }); 503 | } 504 | 505 | #pragma mark - ObservingInputAccessoryViewDelegate methods 506 | 507 | -(void)updateTransformAndInsets 508 | { 509 | CGFloat bottomSafeArea = [self getBottomSafeArea]; 510 | CGFloat accessoryTranslation = MIN(-bottomSafeArea, -_observingInputAccessoryView.keyboardHeight); 511 | 512 | if (_observingInputAccessoryView.keyboardHeight <= bottomSafeArea) { 513 | _bottomViewHeight = kBottomViewHeight; 514 | } else if (_observingInputAccessoryView.keyboardState != KeyboardStateWillHide) { 515 | _bottomViewHeight = 0; 516 | } 517 | [self updateBottomViewFrame]; 518 | 519 | self.transform = CGAffineTransformMakeTranslation(0, accessoryTranslation); 520 | [self _updateScrollViewInsets]; 521 | } 522 | 523 | - (void)performScrollToFocusedInput 524 | { 525 | if (_scrollViewToManage != nil && self.scrollToFocusedInput) 526 | { 527 | UIResponder *currentFirstResponder = [UIResponder currentFirstResponder]; 528 | if (currentFirstResponder != nil && [currentFirstResponder isKindOfClass:[UIView class]]) 529 | { 530 | UIView *reponderView = (UIView*)currentFirstResponder; 531 | if ([reponderView isDescendantOfView:_scrollViewToManage]) 532 | { 533 | CGRect frame = [_scrollViewToManage convertRect:reponderView.frame fromView:reponderView]; 534 | frame = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height + 20); 535 | [_scrollViewToManage scrollRectToVisible:frame animated:NO]; 536 | } 537 | } 538 | } 539 | } 540 | 541 | - (void)observingInputAccessoryViewDidChangeFrame:(ObservingInputAccessoryView*)observingInputAccessoryView 542 | { 543 | [self updateTransformAndInsets]; 544 | } 545 | 546 | - (void) observingInputAccessoryViewKeyboardWillAppear:(ObservingInputAccessoryView *)observingInputAccessoryView keyboardDelta:(CGFloat)delta 547 | { 548 | if (observingInputAccessoryView.keyboardHeight > 0) //prevent hiding the bottom view if an external keyboard is in use 549 | { 550 | _bottomViewHeight = 0; 551 | [self updateBottomViewFrame]; 552 | } 553 | 554 | [self performScrollToFocusedInput]; 555 | } 556 | 557 | #pragma mark - UIScrollViewDelegate methods 558 | 559 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView 560 | { 561 | if(_observingInputAccessoryView.keyboardState != KeyboardStateHidden || !self.revealKeyboardInteractive) 562 | { 563 | return; 564 | } 565 | 566 | UIView *inputView = [_inputViewsMap objectForKey:@(kInputViewKey)]; 567 | if (inputView != nil && scrollView.contentOffset.y * (self.scrollIsInverted ? -1 : 1) > (self.scrollIsInverted ? scrollView.contentInset.top : scrollView.contentInset.bottom) + 50 && ![inputView isFirstResponder]) 568 | { 569 | for (UIGestureRecognizer *gesture in scrollView.gestureRecognizers) 570 | { 571 | if([gesture isKindOfClass:[UIPanGestureRecognizer class]]) 572 | { 573 | gesture.enabled = NO; 574 | gesture.enabled = YES; 575 | } 576 | } 577 | 578 | [inputView reactFocus]; 579 | } 580 | } 581 | 582 | - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView 583 | { 584 | self.isDraggingScrollView = YES; 585 | } 586 | 587 | - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset 588 | { 589 | self.isDraggingScrollView = NO; 590 | } 591 | 592 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate 593 | { 594 | self.isDraggingScrollView = NO; 595 | } 596 | 597 | - (CGFloat)getKeyboardHeight 598 | { 599 | return _observingInputAccessoryView ? _observingInputAccessoryView.keyboardHeight : 0; 600 | } 601 | 602 | -(CGFloat)getScrollViewTopContentInset 603 | { 604 | return (self.scrollViewToManage != nil) ? -self.scrollViewToManage.contentInset.top : 0; 605 | } 606 | 607 | -(void)scrollToStart 608 | { 609 | if (self.scrollViewToManage != nil) 610 | { 611 | [self.scrollViewToManage setContentOffset:CGPointMake(self.scrollViewToManage.contentOffset.x, -self.scrollViewToManage.contentInset.top) animated:YES]; 612 | } 613 | } 614 | 615 | @end 616 | 617 | @implementation RCTConvert (KeyboardTrackingScrollBehavior) 618 | RCT_ENUM_CONVERTER(KeyboardTrackingScrollBehavior, (@{ @"KeyboardTrackingScrollBehaviorNone": @(KeyboardTrackingScrollBehaviorNone), 619 | @"KeyboardTrackingScrollBehaviorScrollToBottomInvertedOnly": @(KeyboardTrackingScrollBehaviorScrollToBottomInvertedOnly), 620 | @"KeyboardTrackingScrollBehaviorFixedOffset": @(KeyboardTrackingScrollBehaviorFixedOffset)}), 621 | KeyboardTrackingScrollBehaviorNone, unsignedIntegerValue) 622 | @end 623 | 624 | @implementation KeyboardTrackingViewManager 625 | 626 | @synthesize bridge = _bridge; 627 | 628 | RCT_EXPORT_MODULE() 629 | 630 | RCT_REMAP_VIEW_PROPERTY(scrollBehavior, scrollBehavior, KeyboardTrackingScrollBehavior) 631 | RCT_REMAP_VIEW_PROPERTY(revealKeyboardInteractive, revealKeyboardInteractive, BOOL) 632 | RCT_REMAP_VIEW_PROPERTY(manageScrollView, manageScrollView, BOOL) 633 | RCT_REMAP_VIEW_PROPERTY(requiresSameParentToManageScrollView, requiresSameParentToManageScrollView, BOOL) 634 | RCT_REMAP_VIEW_PROPERTY(addBottomView, addBottomView, BOOL) 635 | RCT_REMAP_VIEW_PROPERTY(scrollToFocusedInput, scrollToFocusedInput, BOOL) 636 | RCT_REMAP_VIEW_PROPERTY(allowHitsOutsideBounds, allowHitsOutsideBounds, BOOL) 637 | 638 | + (BOOL)requiresMainQueueSetup 639 | { 640 | return YES; 641 | } 642 | 643 | - (NSDictionary *)constantsToExport 644 | { 645 | return @{ 646 | @"KeyboardTrackingScrollBehaviorNone": @(KeyboardTrackingScrollBehaviorNone), 647 | @"KeyboardTrackingScrollBehaviorScrollToBottomInvertedOnly": @(KeyboardTrackingScrollBehaviorScrollToBottomInvertedOnly), 648 | @"KeyboardTrackingScrollBehaviorFixedOffset": @(KeyboardTrackingScrollBehaviorFixedOffset), 649 | }; 650 | } 651 | 652 | - (UIView *)view 653 | { 654 | return [[KeyboardTrackingView alloc] init]; 655 | } 656 | 657 | RCT_EXPORT_METHOD(getNativeProps:(nonnull NSNumber *)reactTag resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) 658 | { 659 | [self.bridge.uiManager addUIBlock: 660 | ^(__unused RCTUIManager *uiManager, NSDictionary *viewRegistry) { 661 | 662 | KeyboardTrackingView *view = viewRegistry[reactTag]; 663 | if (!view || ![view isKindOfClass:[KeyboardTrackingView class]]) { 664 | NSString *errorMessage = [NSString stringWithFormat:@"Error: cannot find KeyboardTrackingView with tag #%@", reactTag]; 665 | RCTLogError(@"%@", errorMessage); 666 | [self rejectPromise:reject withErrorMessage:errorMessage errorCode:kTrackingViewNotFoundErrorCode]; 667 | return; 668 | } 669 | 670 | resolve(@{@"trackingViewHeight": @(view.bounds.size.height), 671 | @"keyboardHeight": @([view getKeyboardHeight]), 672 | @"contentTopInset": @([view getScrollViewTopContentInset])}); 673 | }]; 674 | } 675 | 676 | RCT_EXPORT_METHOD(scrollToStart:(nonnull NSNumber *)reactTag) 677 | { 678 | [self.bridge.uiManager addUIBlock: 679 | ^(__unused RCTUIManager *uiManager, NSDictionary *viewRegistry) { 680 | 681 | KeyboardTrackingView *view = viewRegistry[reactTag]; 682 | if (!view || ![view isKindOfClass:[KeyboardTrackingView class]]) { 683 | RCTLogError(@"Error: cannot find KeyboardTrackingView with tag #%@", reactTag); 684 | return; 685 | } 686 | 687 | [view scrollToStart]; 688 | }]; 689 | } 690 | 691 | #pragma mark - helper methods 692 | 693 | -(void)rejectPromise:(RCTPromiseRejectBlock)reject withErrorMessage:(NSString*)errorMessage errorCode:(NSInteger)errorCode 694 | { 695 | NSString *errorDescription = NSLocalizedString(errorMessage, nil); 696 | NSError *error = [NSError errorWithDomain:@"com.keyboardTrackingView" code:errorCode userInfo:@{NSLocalizedFailureReasonErrorKey: errorDescription}]; 697 | reject([NSString stringWithFormat:@"%ld", (long)errorCode], errorDescription, error); 698 | } 699 | 700 | @end 701 | -------------------------------------------------------------------------------- /lib/ObservingInputAccessoryView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ObservingInputAccessoryView.h 3 | // ReactNativeChat 4 | // 5 | // Created by Artal Druk on 11/04/2016. 6 | // Copyright © 2016 Wix.com All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSUInteger, KeyboardState) { 12 | KeyboardStateHidden, 13 | KeyboardStateWillShow, 14 | KeyboardStateShown, 15 | KeyboardStateWillHide 16 | }; 17 | 18 | @class ObservingInputAccessoryView; 19 | 20 | @interface ObservingInputAccessoryViewManager : NSObject; 21 | +(ObservingInputAccessoryViewManager*)sharedInstance; 22 | @property (nonatomic, weak) ObservingInputAccessoryView *activeObservingInputAccessoryView; 23 | @end 24 | 25 | @protocol ObservingInputAccessoryViewDelegate 26 | 27 | - (void)observingInputAccessoryViewDidChangeFrame:(ObservingInputAccessoryView*)observingInputAccessoryView; 28 | 29 | @optional 30 | 31 | - (void)observingInputAccessoryViewKeyboardWillAppear:(ObservingInputAccessoryView*)observingInputAccessoryView keyboardDelta:(CGFloat)delta; 32 | - (void)observingInputAccessoryViewKeyboardWillDisappear:(ObservingInputAccessoryView*)observingInputAccessoryView; 33 | 34 | @end 35 | 36 | @interface ObservingInputAccessoryView : UIView 37 | 38 | @property (nonatomic, weak) id delegate; 39 | 40 | @property (nonatomic) CGFloat height; 41 | @property (nonatomic, readonly) CGFloat keyboardHeight; 42 | @property (nonatomic, readonly) KeyboardState keyboardState; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /lib/ObservingInputAccessoryView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ObservingInputAccessoryView.m 3 | // ReactNativeChat 4 | // 5 | // Created by Artal Druk on 11/04/2016. 6 | // Copyright © 2016 Wix.com All rights reserved. 7 | // 8 | 9 | #import "ObservingInputAccessoryView.h" 10 | 11 | @implementation ObservingInputAccessoryViewManager 12 | 13 | +(ObservingInputAccessoryViewManager*)sharedInstance 14 | { 15 | static ObservingInputAccessoryViewManager *instance = nil; 16 | static dispatch_once_t observingInputAccessoryViewManagerOnceToken = 0; 17 | 18 | dispatch_once(&observingInputAccessoryViewManagerOnceToken,^ 19 | { 20 | if (instance == nil) 21 | { 22 | instance = [ObservingInputAccessoryViewManager new]; 23 | } 24 | }); 25 | 26 | return instance; 27 | } 28 | 29 | @end 30 | 31 | @implementation ObservingInputAccessoryView 32 | { 33 | CGFloat _previousKeyboardHeight; 34 | } 35 | 36 | - (instancetype)init 37 | { 38 | self = [super init]; 39 | 40 | if(self) 41 | { 42 | self.userInteractionEnabled = NO; 43 | self.translatesAutoresizingMaskIntoConstraints = NO; 44 | self.autoresizingMask = UIViewAutoresizingFlexibleHeight; 45 | 46 | [self registerForKeyboardNotifications]; 47 | } 48 | 49 | return self; 50 | } 51 | 52 | - (void) registerForKeyboardNotifications 53 | { 54 | NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 55 | [notificationCenter addObserver:self selector:@selector(_keyboardWillShowNotification:) name:UIKeyboardWillShowNotification object:nil]; 56 | [notificationCenter addObserver:self selector:@selector(_keyboardDidShowNotification:) name:UIKeyboardDidShowNotification object:nil]; 57 | [notificationCenter addObserver:self selector:@selector(_keyboardWillHideNotification:) name:UIKeyboardWillHideNotification object:nil]; 58 | [notificationCenter addObserver:self selector:@selector(_keyboardDidHideNotification:) name:UIKeyboardDidHideNotification object:nil]; 59 | [notificationCenter addObserver:self selector:@selector(_keyboardWillChangeFrameNotification:) name:UIKeyboardWillChangeFrameNotification object:nil]; 60 | } 61 | 62 | - (void)willMoveToSuperview:(UIView *)newSuperview 63 | { 64 | if (self.superview) 65 | { 66 | [self.superview removeObserver:self forKeyPath:@"center"]; 67 | } 68 | 69 | if (newSuperview != nil) 70 | { 71 | [newSuperview addObserver:self forKeyPath:@"center" options:NSKeyValueObservingOptionNew context:nil]; 72 | } 73 | 74 | [super willMoveToSuperview:newSuperview]; 75 | } 76 | 77 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 78 | { 79 | if ((object == self.superview) && ([keyPath isEqualToString:@"center"])) 80 | { 81 | CGFloat centerY = self.superview.center.y; 82 | 83 | if([keyPath isEqualToString:@"center"]) 84 | { 85 | centerY = [change[NSKeyValueChangeNewKey] CGPointValue].y; 86 | } 87 | 88 | CGFloat boundsH = self.superview.bounds.size.height; 89 | 90 | _previousKeyboardHeight = _keyboardHeight; 91 | _keyboardHeight = MAX(0, self.window.bounds.size.height - (centerY - boundsH / 2) - self.intrinsicContentSize.height); 92 | 93 | [_delegate observingInputAccessoryViewDidChangeFrame:self]; 94 | } 95 | } 96 | 97 | -(void)dealloc 98 | { 99 | [self.superview removeObserver:self forKeyPath:@"center"]; 100 | 101 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 102 | } 103 | 104 | - (CGSize)intrinsicContentSize 105 | { 106 | return CGSizeMake(self.bounds.size.width, _keyboardState == KeyboardStateWillShow || _keyboardState == KeyboardStateWillHide ? 0 : _height); 107 | } 108 | 109 | - (void)setHeight:(CGFloat)height 110 | { 111 | _height = height; 112 | 113 | [self invalidateIntrinsicContentSize]; 114 | } 115 | 116 | - (void)_keyboardWillShowNotification:(NSNotification*)notification 117 | { 118 | _keyboardState = KeyboardStateWillShow; 119 | 120 | [self invalidateIntrinsicContentSize]; 121 | 122 | if([_delegate respondsToSelector:@selector(observingInputAccessoryViewKeyboardWillAppear:keyboardDelta:)]) 123 | { 124 | [_delegate observingInputAccessoryViewKeyboardWillAppear:self keyboardDelta:_keyboardHeight - _previousKeyboardHeight]; 125 | } 126 | } 127 | 128 | - (void)_keyboardDidShowNotification:(NSNotification*)notification 129 | { 130 | _keyboardState = KeyboardStateShown; 131 | 132 | [self invalidateIntrinsicContentSize]; 133 | } 134 | 135 | - (void)_keyboardWillHideNotification:(NSNotification*)notification 136 | { 137 | _keyboardState = KeyboardStateWillHide; 138 | 139 | [self invalidateIntrinsicContentSize]; 140 | 141 | if([_delegate respondsToSelector:@selector(observingInputAccessoryViewKeyboardWillDisappear:)]) 142 | { 143 | [_delegate observingInputAccessoryViewKeyboardWillDisappear:self]; 144 | } 145 | } 146 | 147 | - (void)_keyboardDidHideNotification:(NSNotification*)notification 148 | { 149 | _keyboardState = KeyboardStateHidden; 150 | 151 | [self invalidateIntrinsicContentSize]; 152 | } 153 | 154 | - (void)_keyboardWillChangeFrameNotification:(NSNotification*)notification 155 | { 156 | if(self.window) 157 | { 158 | return; 159 | } 160 | 161 | CGRect endFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; 162 | _keyboardHeight = [UIScreen mainScreen].bounds.size.height - endFrame.origin.y; 163 | 164 | [_delegate observingInputAccessoryViewDidChangeFrame:self]; 165 | 166 | [self invalidateIntrinsicContentSize]; 167 | } 168 | 169 | @end 170 | -------------------------------------------------------------------------------- /lib/UIResponder+FirstResponder.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface UIResponder (CurrentResponder) 5 | +(id)currentFirstResponder; 6 | @end 7 | -------------------------------------------------------------------------------- /lib/UIResponder+FirstResponder.m: -------------------------------------------------------------------------------- 1 | #import "UIResponder+FirstResponder.h" 2 | 3 | static __weak id currentFirstResponder; 4 | 5 | @implementation UIResponder (FirstResponder) 6 | 7 | +(id)currentFirstResponder { 8 | currentFirstResponder = nil; 9 | [[UIApplication sharedApplication] sendAction:@selector(findFirstResponder:) to:nil from:nil forEvent:nil]; 10 | return currentFirstResponder; 11 | } 12 | 13 | -(void)findFirstResponder:(id)sender { 14 | currentFirstResponder = self; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-keyboard-tracking-view", 3 | "publishConfig": { 4 | "registry": "https://registry.npmjs.org/" 5 | }, 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/wix/react-native-keyboard-tracking-view.git" 9 | }, 10 | "version": "5.7.0", 11 | "description": "React Native UI component which tracks the keyboard", 12 | "nativePackage": true, 13 | "bugs": { 14 | "url": "https://github.com/wix/react-native-keyboard-tracking-view/issues" 15 | }, 16 | "homepage": "https://github.com/wix/react-native-keyboard-tracking-view", 17 | "main": "index.js", 18 | "author": "Artal Druk ", 19 | "license": "MIT", 20 | "peerDependencies": { 21 | "react-native": ">=0.51.0", 22 | "react": ">=16.0.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/KeyboardAwareInsetsView.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {StyleSheet, Dimensions} from 'react-native'; 3 | import KeyboardTrackingView from './KeyboardTrackingView'; 4 | 5 | const KeyboardAwareInsetsView = (props) => 6 | ; 12 | 13 | const ScreenSize = Dimensions.get('window'); 14 | const styles = StyleSheet.create({ 15 | insetsView: { 16 | width: ScreenSize.width, 17 | height: 0.5, 18 | position: 'absolute', 19 | bottom: 0, 20 | left: 0, 21 | backgroundColor: 'transparent' 22 | }, 23 | }); 24 | 25 | export default KeyboardAwareInsetsView; 26 | -------------------------------------------------------------------------------- /src/KeyboardTrackingView.android.js: -------------------------------------------------------------------------------- 1 | import React, {PureComponent} from 'react'; 2 | import {View} from 'react-native'; 3 | 4 | export default class KeyboardTrackingView extends PureComponent { 5 | constructor(props) { 6 | super(props); 7 | } 8 | render() { 9 | return ( 10 | 11 | ); 12 | } 13 | async getNativeProps() { 14 | return {trackingViewHeight: 0, keyboardHeight: 0, contentTopInset: 0}; 15 | } 16 | scrollToStart() {} 17 | } 18 | -------------------------------------------------------------------------------- /src/KeyboardTrackingView.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by artald on 15/05/2016. 3 | */ 4 | 5 | import React, {PureComponent} from 'react'; 6 | import ReactNative, {requireNativeComponent, NativeModules} from 'react-native'; 7 | 8 | const NativeKeyboardTrackingView = requireNativeComponent('KeyboardTrackingView', null); 9 | const KeyboardTrackingViewManager = NativeModules.KeyboardTrackingViewManager; 10 | 11 | export default class KeyboardTrackingView extends PureComponent { 12 | constructor(props) { 13 | super(props); 14 | } 15 | render() { 16 | return ( 17 | this.ref = r}/> 18 | ); 19 | } 20 | 21 | async getNativeProps() { 22 | if (this.ref && KeyboardTrackingViewManager && KeyboardTrackingViewManager.getNativeProps) { 23 | return await KeyboardTrackingViewManager.getNativeProps(ReactNative.findNodeHandle(this.ref)); 24 | } 25 | return {}; 26 | } 27 | 28 | scrollToStart() { 29 | if (this.ref && KeyboardTrackingViewManager && KeyboardTrackingViewManager.scrollToStart) { 30 | KeyboardTrackingViewManager.scrollToStart(ReactNative.findNodeHandle(this.ref)); 31 | } 32 | } 33 | } 34 | --------------------------------------------------------------------------------