├── .eslintignore ├── .eslintrc.js ├── .github └── workflows │ └── build.yml ├── .gitignore ├── .prettierrc.js ├── LICENSE ├── README.md ├── __mocks__ └── react-native-safe-area-context.ts ├── babel.config.js ├── example ├── .buckconfig ├── .bundle │ └── config ├── .eslintrc.js ├── .gitignore ├── .prettierrc.js ├── .ruby-version ├── .watchmanconfig ├── Gemfile ├── Gemfile.lock ├── README.md ├── android │ ├── app │ │ ├── _BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── ReactNativeFlipper.kt │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MainApplication.kt │ │ │ └── res │ │ │ ├── drawable │ │ │ └── rn_edit_text_material.xml │ │ │ ├── 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.json ├── babel.config.js ├── index.js ├── ios │ ├── Podfile │ ├── Podfile.lock │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── example.xcscheme │ ├── example.xcworkspace │ │ └── contents.xcworkspacedata │ └── example │ │ ├── AppDelegate.swift │ │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── example-Bridging-Header.h ├── metro.config.js ├── package.json ├── src │ └── App.tsx ├── tsconfig.json └── yarn.lock ├── jest ├── fixtures.ts └── setup.ts ├── package.json ├── src ├── KeyboardAccessoryView.tsx ├── __tests__ │ └── KeyboardAccessoryView.test.tsx ├── hooks │ ├── __tests__ │ │ ├── useComponentSize.test.tsx │ │ ├── useKeyboardDimensions.test.tsx │ │ └── usePanResponder.test.tsx │ ├── index.ts │ ├── useComponentSize.tsx │ ├── useKeyboardDimensions.tsx │ └── usePanResponder.tsx └── index.ts ├── tsconfig.json └── yarn.lock /.eslintignore: -------------------------------------------------------------------------------- 1 | **/node_modules 2 | coverage/ 3 | example/ 4 | lib/ 5 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | jest: true, 4 | }, 5 | extends: [ 6 | '@react-native-community', 7 | 'plugin:jest/all', 8 | 'plugin:prettier/recommended', 9 | ], 10 | plugins: ['simple-import-sort', 'jest'], 11 | root: true, 12 | rules: { 13 | 'import/order': 'off', 14 | 'simple-import-sort/exports': 'error', 15 | 'simple-import-sort/imports': 'error', 16 | 'sort-imports': 'off', 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | 9 | jobs: 10 | build-and-test: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Setup Node.js environment 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: 16.x 20 | 21 | - name: Restore cache 22 | id: cache 23 | uses: actions/cache@v2 24 | with: 25 | path: node_modules 26 | key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} 27 | 28 | - name: Install dependencies 29 | if: steps.cache.outputs.cache-hit != 'true' 30 | run: yarn 31 | 32 | - run: yarn lint 33 | - run: yarn type-coverage 34 | 35 | - name: Coverage 36 | uses: paambaati/codeclimate-action@v2.7.5 37 | env: 38 | CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} 39 | with: 40 | coverageCommand: yarn test 41 | -------------------------------------------------------------------------------- /.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 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | *.hprof 32 | /android/gradlew 33 | /android/gradlew.bat 34 | /android/gradle/ 35 | 36 | # node.js 37 | # 38 | node_modules/ 39 | npm-debug.log 40 | yarn-error.log 41 | 42 | # BUCK 43 | buck-out/ 44 | \.buckd/ 45 | *.keystore 46 | !debug.keystore 47 | 48 | # fastlane 49 | # 50 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 51 | # screenshots whenever they are needed. 52 | # For more information about the recommended setup visit: 53 | # https://docs.fastlane.tools/best-practices/source-control/ 54 | 55 | */fastlane/report.xml 56 | */fastlane/Preview.html 57 | */fastlane/screenshots 58 | 59 | # Bundle artifact 60 | *.jsbundle 61 | 62 | # CocoaPods 63 | /ios/Pods/ 64 | 65 | # Library 66 | lib/ 67 | 68 | # Type coverage 69 | .type-coverage/ 70 | 71 | # Tests coverage 72 | coverage/ 73 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | jsxSingleQuote: true, 3 | semi: false, 4 | singleQuote: true, 5 | } 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Oleksandr Demchenko 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 | # React Native Keyboard Accessory View 2 | 3 | ⚠️⚠️⚠️ Deprected - see facebook/react-native#31402 on how to natively create this effect (works for React Native 0.68+) ⚠️⚠️⚠️ 4 | 5 |
6 | 7 | [![npm](https://img.shields.io/npm/v/@flyerhq/react-native-keyboard-accessory-view)](https://www.npmjs.com/package/@flyerhq/react-native-keyboard-accessory-view) 8 | [![build](https://github.com/flyerhq/react-native-keyboard-accessory-view/workflows/build/badge.svg)](https://github.com/flyerhq/react-native-keyboard-accessory-view/actions?query=workflow%3Abuild) 9 | [![Maintainability](https://api.codeclimate.com/v1/badges/642bed5d3abacc8b750e/maintainability)](https://codeclimate.com/github/flyerhq/react-native-keyboard-accessory-view/maintainability) 10 | [![Test Coverage](https://api.codeclimate.com/v1/badges/642bed5d3abacc8b750e/test_coverage)](https://codeclimate.com/github/flyerhq/react-native-keyboard-accessory-view/test_coverage) 11 | [![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&suffix=%&query=$.typeCoverage.is&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fflyerhq%2Freact-native-keyboard-accessory-view%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage) 12 | 13 | Keyboard accessory (sticky) view for your React Native app. Supports interactive dismiss on iOS, respects safe area and works in both portrait and landscape, on both iOS and Android. 14 | 15 | ![keyboard-accessory-view](https://user-images.githubusercontent.com/14123304/83332826-a761ef80-a29d-11ea-910b-b1025ae3aac9.gif) 16 | 17 | ## Getting Started 18 | 19 | This library depends on `react-native-safe-area-context`. If you use [React Navigation](https://reactnavigation.org) you probably already have it in your dependencies, so you're good to go. If not, please follow the instructions [here](https://github.com/th3rdwave/react-native-safe-area-context) to install it. Then run: 20 | 21 | ```sh 22 | yarn add @flyerhq/react-native-keyboard-accessory-view 23 | ``` 24 | 25 | ## Usage 26 | 27 | ```ts 28 | import { KeyboardAccessoryView } from '@flyerhq/react-native-keyboard-accessory-view' 29 | import { GestureResponderHandlers } from 'react-native' 30 | // ... 31 | const renderScrollable = (panHandlers: GestureResponderHandlers) => ( 32 | // Can be anything scrollable 33 | 34 | ) 35 | // ... 36 | return ( 37 | 38 | // Your accessory view 39 | 40 | ) 41 | ``` 42 | 43 | ### Handling wrong offsets 44 | 45 | Sometimes when you use a tab bar or similar component, the accessory view does not work correctly. In order to fix this, you need to use a combination of next props: `contentContainerStyle`, `contentOffsetKeyboardClosed`, `contentOffsetKeyboardOpened` and `spaceBetweenKeyboardAndAccessoryView`. 46 | 47 | First of all, you need to decide if you need this extra safe area margin at the bottom (as you can see the size of the accessory view is different when the keyboard is open and closed, that's because when it's closed, safe area bottom margin is added). If you have, for example, a tab bar, most likely you don't need this margin, because safe is area already occupied by the tab bar. To remove it pass this style: `contentContainerStyle={{ marginBottom: 0 }}`. 48 | 49 | When the first step is done, you need to check if you have a space between the accessory view and the keyboard, when the latter is opened. If you do, pass the offset to the `spaceBetweenKeyboardAndAccessoryView` prop. Usually, it can be calculated based on a bottom safe area inset from [react-native-safe-area-context](https://github.com/th3rdwave/react-native-safe-area-context) and/or the height of the tab bar, for example. 50 | 51 | Lastly, validate if the content above the accessory view has correct offsets, if no, you can adjust it using `contentOffsetKeyboardClosed` and `contentOffsetKeyboardOpened` props. Sometimes offsets are correct for the one keyboard state, use one of these props if this is the case. As with the `spaceBetweenKeyboardAndAccessoryView` prop, offsets are calculated based on the bottom safe area inset and/or the height of the tab bar, for example. 52 | 53 | ## Props 54 | 55 | ### `KeyboardAccessoryView` 56 | 57 | - `renderScrollable` (required) - accepts a `ReactNode`. Your scrollable component. 58 | 59 | - `style` (optional) - accepts [View Style Props](https://reactnative.dev/docs/view-style-props). Use to style the view which includes both content container and safe area insets. A common use case will be setting `backgroundColor` so the content container and safe area insets are of the matching color. 60 | 61 | - `contentContainerStyle` (optional) - accepts [View Style Props](https://reactnative.dev/docs/view-style-props). Use to style the content container, but not the safe area insets. 62 | 63 | - `contentOffsetKeyboardClosed` (optional) - accepts a number. Use to adjust content offset when the keyboard is open. Read more [here](#handling-wrong-offsets). 64 | 65 | - `contentOffsetKeyboardOpened` (optional) - accepts a number. Use to adjust content offset when the keyboard is closed. Read more [here](#handling-wrong-offsets). 66 | 67 | - `renderBackground` (optional) - accepts a function returning React node. This is useful when you want to have a custom node as a background (e.g. `` ). Remember about absolute positioning. 68 | 69 | - `scrollableContainerStyle` (optional) - accepts [View Style Props](https://reactnative.dev/docs/view-style-props). Use to style the container wrapping a scrollable component passed in `renderScrollable`. In case you want scrollable to fill the entire container try passing `flex: 1` here. 70 | 71 | - `spaceBetweenKeyboardAndAccessoryView` (optional) - accepts a number. Use to adjust space between the accessory view and the keyboard, when the latter is open. Read more [here](#handling-wrong-offsets). 72 | 73 | - `useListenersOnAndroid` (optional) - accepts a boolean. By default, Android OS will resize the window when the keyboard is open and accessory view will automatically be positioned above the keyboard. This behavior can be amended, so if for some reason accessory view doesn't appear on top of the keyboard, try setting this prop, it will calculate the content height based on a keyboard listener. Has no impact on iOS. 74 | 75 | ## License 76 | 77 | [MIT](LICENSE) 78 | -------------------------------------------------------------------------------- /__mocks__/react-native-safe-area-context.ts: -------------------------------------------------------------------------------- 1 | export const useSafeAreaFrame = jest.fn(() => ({ 2 | height: 896, 3 | width: 414, 4 | x: 0, 5 | y: 0, 6 | })) 7 | 8 | export const useSafeAreaInsets = jest.fn(() => ({ 9 | bottom: 34, 10 | left: 0, 11 | right: 0, 12 | top: 0, 13 | })) 14 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 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/.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /example/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@react-native-community', 'plugin:prettier/recommended'], 3 | plugins: ['simple-import-sort'], 4 | root: true, 5 | rules: { 6 | 'import/order': 'off', 7 | 'simple-import-sort/exports': 'error', 8 | 'simple-import-sort/imports': 'error', 9 | 'sort-imports': 'off', 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /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 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | *.hprof 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 | !debug.keystore 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://docs.fastlane.tools/best-practices/source-control/ 51 | 52 | */fastlane/report.xml 53 | */fastlane/Preview.html 54 | */fastlane/screenshots 55 | 56 | # Bundle artifact 57 | *.jsbundle 58 | 59 | # CocoaPods 60 | /ios/Pods/ 61 | -------------------------------------------------------------------------------- /example/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | jsxSingleQuote: true, 3 | semi: false, 4 | singleQuote: true, 5 | } 6 | -------------------------------------------------------------------------------- /example/.ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.5 2 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /example/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby '2.7.5' 5 | 6 | gem 'cocoapods', '~> 1.11', '>= 1.11.2' 7 | -------------------------------------------------------------------------------- /example/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.5) 5 | rexml 6 | activesupport (6.1.4.4) 7 | concurrent-ruby (~> 1.0, >= 1.0.2) 8 | i18n (>= 1.6, < 2) 9 | minitest (>= 5.1) 10 | tzinfo (~> 2.0) 11 | zeitwerk (~> 2.3) 12 | addressable (2.8.0) 13 | public_suffix (>= 2.0.2, < 5.0) 14 | algoliasearch (1.27.5) 15 | httpclient (~> 2.8, >= 2.8.3) 16 | json (>= 1.5.1) 17 | atomos (0.1.3) 18 | claide (1.1.0) 19 | cocoapods (1.11.2) 20 | addressable (~> 2.8) 21 | claide (>= 1.0.2, < 2.0) 22 | cocoapods-core (= 1.11.2) 23 | cocoapods-deintegrate (>= 1.0.3, < 2.0) 24 | cocoapods-downloader (>= 1.4.0, < 2.0) 25 | cocoapods-plugins (>= 1.0.0, < 2.0) 26 | cocoapods-search (>= 1.0.0, < 2.0) 27 | cocoapods-trunk (>= 1.4.0, < 2.0) 28 | cocoapods-try (>= 1.1.0, < 2.0) 29 | colored2 (~> 3.1) 30 | escape (~> 0.0.4) 31 | fourflusher (>= 2.3.0, < 3.0) 32 | gh_inspector (~> 1.0) 33 | molinillo (~> 0.8.0) 34 | nap (~> 1.0) 35 | ruby-macho (>= 1.0, < 3.0) 36 | xcodeproj (>= 1.21.0, < 2.0) 37 | cocoapods-core (1.11.2) 38 | activesupport (>= 5.0, < 7) 39 | addressable (~> 2.8) 40 | algoliasearch (~> 1.0) 41 | concurrent-ruby (~> 1.1) 42 | fuzzy_match (~> 2.0.4) 43 | nap (~> 1.0) 44 | netrc (~> 0.11) 45 | public_suffix (~> 4.0) 46 | typhoeus (~> 1.0) 47 | cocoapods-deintegrate (1.0.5) 48 | cocoapods-downloader (1.5.1) 49 | cocoapods-plugins (1.0.0) 50 | nap 51 | cocoapods-search (1.0.1) 52 | cocoapods-trunk (1.6.0) 53 | nap (>= 0.8, < 2.0) 54 | netrc (~> 0.11) 55 | cocoapods-try (1.2.0) 56 | colored2 (3.1.2) 57 | concurrent-ruby (1.1.9) 58 | escape (0.0.4) 59 | ethon (0.15.0) 60 | ffi (>= 1.15.0) 61 | ffi (1.15.5) 62 | fourflusher (2.3.1) 63 | fuzzy_match (2.0.4) 64 | gh_inspector (1.1.3) 65 | httpclient (2.8.3) 66 | i18n (1.8.11) 67 | concurrent-ruby (~> 1.0) 68 | json (2.6.1) 69 | minitest (5.15.0) 70 | molinillo (0.8.0) 71 | nanaimo (0.3.0) 72 | nap (1.1.0) 73 | netrc (0.11.0) 74 | public_suffix (4.0.6) 75 | rexml (3.2.5) 76 | ruby-macho (2.5.1) 77 | typhoeus (1.4.0) 78 | ethon (>= 0.9.0) 79 | tzinfo (2.0.4) 80 | concurrent-ruby (~> 1.0) 81 | xcodeproj (1.21.0) 82 | CFPropertyList (>= 2.3.3, < 4.0) 83 | atomos (~> 0.1.3) 84 | claide (>= 1.0.2, < 2.0) 85 | colored2 (~> 3.1) 86 | nanaimo (~> 0.3.0) 87 | rexml (~> 3.2.4) 88 | zeitwerk (2.5.3) 89 | 90 | PLATFORMS 91 | ruby 92 | 93 | DEPENDENCIES 94 | cocoapods (~> 1.11, >= 1.11.2) 95 | 96 | RUBY VERSION 97 | ruby 2.7.5p203 98 | 99 | BUNDLED WITH 100 | 2.3.5 101 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | ## Getting Started 4 | 5 | ```bash 6 | yarn 7 | ``` 8 | 9 | for iOS: 10 | 11 | ```bash 12 | npx pod-install 13 | ``` 14 | 15 | To run the app use: 16 | 17 | ```bash 18 | yarn ios 19 | ``` 20 | 21 | or 22 | 23 | ```bash 24 | yarn android 25 | ``` 26 | 27 | ## Updating project 28 | 29 | 1. Remove current `example` project 30 | 2. Create a project named `example` using [react-native-better-template](https://github.com/demchenkoalex/react-native-better-template) 31 | 3. Revert `README.md` so you can see this guide 32 | 4. In `tsconfig.json` add 33 | 34 | ```json 35 | "baseUrl": ".", 36 | "paths": { 37 | "@flyerhq/react-native-keyboard-accessory-view": ["../src"] 38 | }, 39 | ``` 40 | 41 | 5. Check the difference in `metro.config.js` and combine all 42 | 6. Revert `App.tsx` 43 | -------------------------------------------------------------------------------- /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.example", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.example", 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 | apply plugin: 'kotlin-android' 3 | 4 | import com.android.build.OutputFile 5 | 6 | /** 7 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 8 | * and bundleReleaseJsAndAssets). 9 | * These basically call `react-native bundle` with the correct arguments during the Android build 10 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 11 | * bundle directly from the development server. Below you can see all the possible configurations 12 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 13 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 14 | * 15 | * project.ext.react = [ 16 | * // the name of the generated asset file containing your JS bundle 17 | * bundleAssetName: "index.android.bundle", 18 | * 19 | * // the entry file for bundle generation. If none specified and 20 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 21 | * // default. Can be overridden with ENTRY_FILE environment variable. 22 | * entryFile: "index.android.js", 23 | * 24 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 25 | * bundleCommand: "ram-bundle", 26 | * 27 | * // whether to bundle JS and assets in debug mode 28 | * bundleInDebug: false, 29 | * 30 | * // whether to bundle JS and assets in release mode 31 | * bundleInRelease: true, 32 | * 33 | * // whether to bundle JS and assets in another build variant (if configured). 34 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 35 | * // The configuration property can be in the following formats 36 | * // 'bundleIn${productFlavor}${buildType}' 37 | * // 'bundleIn${buildType}' 38 | * // bundleInFreeDebug: true, 39 | * // bundleInPaidRelease: true, 40 | * // bundleInBeta: true, 41 | * 42 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 43 | * // for example: to disable dev mode in the staging build type (if configured) 44 | * devDisabledInStaging: true, 45 | * // The configuration property can be in the following formats 46 | * // 'devDisabledIn${productFlavor}${buildType}' 47 | * // 'devDisabledIn${buildType}' 48 | * 49 | * // the root of your project, i.e. where "package.json" lives 50 | * root: "../../", 51 | * 52 | * // where to put the JS bundle asset in debug mode 53 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 54 | * 55 | * // where to put the JS bundle asset in release mode 56 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 57 | * 58 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 59 | * // require('./image.png')), in debug mode 60 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 61 | * 62 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 63 | * // require('./image.png')), in release mode 64 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 65 | * 66 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 67 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 68 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 69 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 70 | * // for example, you might want to remove it from here. 71 | * inputExcludes: ["android/**", "ios/**"], 72 | * 73 | * // override which node gets called and with what additional arguments 74 | * nodeExecutableAndArgs: ["node"], 75 | * 76 | * // supply additional arguments to the packager 77 | * extraPackagerArgs: [] 78 | * ] 79 | */ 80 | 81 | project.ext.react = [ 82 | enableHermes: false, // clean and rebuild if changing 83 | ] 84 | 85 | apply from: '../../node_modules/react-native/react.gradle' 86 | 87 | /** 88 | * Set this to true to create two separate APKs instead of one: 89 | * - An APK that only works on ARM devices 90 | * - An APK that only works on x86 devices 91 | * The advantage is the size of the APK is reduced by about 4MB. 92 | * Upload all the APKs to the Play Store and people will download 93 | * the correct one based on the CPU architecture of their device. 94 | */ 95 | def enableSeparateBuildPerCPUArchitecture = false 96 | 97 | /** 98 | * Run Proguard to shrink the Java bytecode in release builds. 99 | */ 100 | def enableProguardInReleaseBuilds = false 101 | 102 | /** 103 | * The preferred build flavor of JavaScriptCore. 104 | * 105 | * For example, to use the international variant, you can use: 106 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 107 | * 108 | * The international variant includes ICU i18n library and necessary data 109 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 110 | * give correct results when using with locales other than en-US. Note that 111 | * this variant is about 6MiB larger per architecture than default. 112 | */ 113 | def jscFlavor = 'org.webkit:android-jsc:+' 114 | 115 | /** 116 | * Whether to enable the Hermes VM. 117 | * 118 | * This should be set on project.ext.react and that value will be read here. If it is not set 119 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 120 | * and the benefits of using Hermes will therefore be sharply reduced. 121 | */ 122 | def enableHermes = project.ext.react.get('enableHermes', false); 123 | 124 | /** 125 | * Architectures to build native code for in debug. 126 | */ 127 | def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures") 128 | 129 | android { 130 | ndkVersion rootProject.ext.ndkVersion 131 | 132 | compileSdkVersion rootProject.ext.compileSdkVersion 133 | 134 | defaultConfig { 135 | applicationId 'com.example' 136 | minSdkVersion rootProject.ext.minSdkVersion 137 | targetSdkVersion rootProject.ext.targetSdkVersion 138 | versionCode 1 139 | versionName '1.0' 140 | } 141 | splits { 142 | abi { 143 | reset() 144 | enable enableSeparateBuildPerCPUArchitecture 145 | universalApk false // If true, also generate a universal APK 146 | include 'armeabi-v7a', 'x86', 'arm64-v8a', 'x86_64' 147 | } 148 | } 149 | signingConfigs { 150 | debug { 151 | storeFile file('debug.keystore') 152 | storePassword 'android' 153 | keyAlias 'androiddebugkey' 154 | keyPassword 'android' 155 | } 156 | } 157 | buildTypes { 158 | debug { 159 | signingConfig signingConfigs.debug 160 | if (nativeArchitectures) { 161 | ndk { 162 | abiFilters nativeArchitectures.split(',') 163 | } 164 | } 165 | } 166 | release { 167 | // Caution! In production, you need to generate your own keystore file. 168 | // see https://reactnative.dev/docs/signed-apk-android. 169 | signingConfig signingConfigs.debug 170 | minifyEnabled enableProguardInReleaseBuilds 171 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 172 | } 173 | } 174 | 175 | // applicationVariants are e.g. debug, release 176 | applicationVariants.all { variant -> 177 | variant.outputs.each { output -> 178 | // For each separate APK per architecture, set a unique version code as described here: 179 | // https://developer.android.com/studio/build/configure-apk-splits.html 180 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 181 | def versionCodes = ['armeabi-v7a': 1, 'x86': 2, 'arm64-v8a': 3, 'x86_64': 4] 182 | def abi = output.getFilter(OutputFile.ABI) 183 | if (abi != null) { // null for the universal-debug, universal-release variants 184 | output.versionCodeOverride = 185 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 186 | } 187 | 188 | } 189 | } 190 | } 191 | 192 | dependencies { 193 | implementation fileTree(dir: 'libs', include: ['*.jar']) 194 | //noinspection GradleDynamicVersion 195 | implementation 'com.facebook.react:react-native:+' // From node_modules 196 | 197 | implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' 198 | 199 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 200 | exclude group: 'com.facebook.fbjni' 201 | } 202 | 203 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 204 | exclude group: 'com.facebook.flipper' 205 | exclude group: 'com.squareup.okhttp3', module: 'okhttp' 206 | } 207 | 208 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 209 | exclude group: 'com.facebook.flipper' 210 | } 211 | 212 | if (enableHermes) { 213 | def hermesPath = '../../node_modules/hermes-engine/android/'; 214 | debugImplementation files(hermesPath + 'hermes-debug.aar') 215 | releaseImplementation files(hermesPath + 'hermes-release.aar') 216 | } else { 217 | implementation jscFlavor 218 | } 219 | } 220 | 221 | // Run this once to be able to run the application with BUCK 222 | // puts all compile dependencies into folder libs for BUCK to use 223 | task copyDownloadableDepsToLibs(type: Copy) { 224 | from configurations.implementation 225 | into 'libs' 226 | } 227 | 228 | apply from: file('../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle'); applyNativeModulesAppBuildGradle(project) 229 | -------------------------------------------------------------------------------- /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/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyerhq/react-native-keyboard-accessory-view/f63975ba642209ec2b5d38e1d89f1fb48f0e03d2/example/android/app/debug.keystore -------------------------------------------------------------------------------- /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 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /example/android/app/src/debug/java/com/example/ReactNativeFlipper.kt: -------------------------------------------------------------------------------- 1 | package com.example 2 | 3 | import android.content.Context 4 | import com.facebook.flipper.android.AndroidFlipperClient 5 | import com.facebook.flipper.android.utils.FlipperUtils 6 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin 7 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin 8 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin 9 | import com.facebook.flipper.plugins.inspector.DescriptorMapping 10 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin 11 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor 12 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin 13 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin 14 | import com.facebook.react.ReactInstanceManager 15 | import com.facebook.react.ReactInstanceManager.ReactInstanceEventListener 16 | import com.facebook.react.bridge.ReactContext 17 | import com.facebook.react.modules.network.NetworkingModule 18 | 19 | object ReactNativeFlipper { 20 | @JvmStatic 21 | fun initializeFlipper(context: Context?, reactInstanceManager: ReactInstanceManager) { 22 | if (FlipperUtils.shouldEnableFlipper(context)) { 23 | val client = AndroidFlipperClient.getInstance(context) 24 | client.addPlugin(InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())) 25 | client.addPlugin(DatabasesFlipperPlugin(context)) 26 | client.addPlugin(SharedPreferencesFlipperPlugin(context)) 27 | client.addPlugin(CrashReporterPlugin.getInstance()) 28 | val networkFlipperPlugin = NetworkFlipperPlugin() 29 | NetworkingModule.setCustomClientBuilder { builder -> builder.addNetworkInterceptor(FlipperOkhttpInterceptor(networkFlipperPlugin)) } 30 | client.addPlugin(networkFlipperPlugin) 31 | client.start() 32 | 33 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 34 | // Hence we run if after all native modules have been initialized 35 | val reactContext = reactInstanceManager.currentReactContext 36 | if (reactContext == null) { 37 | reactInstanceManager.addReactInstanceEventListener( 38 | object : ReactInstanceEventListener { 39 | override fun onReactContextInitialized(reactContext: ReactContext) { 40 | reactInstanceManager.removeReactInstanceEventListener(this) 41 | reactContext.runOnNativeModulesQueueThread { client.addPlugin(FrescoFlipperPlugin()) } 42 | } 43 | }) 44 | } else { 45 | client.addPlugin(FrescoFlipperPlugin()) 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example 2 | 3 | import com.facebook.react.ReactActivity 4 | 5 | class MainActivity : ReactActivity() { 6 | 7 | override fun getMainComponentName(): String? { 8 | return "example" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainApplication.kt: -------------------------------------------------------------------------------- 1 | package com.example 2 | 3 | import android.app.Application 4 | import android.content.Context 5 | import com.facebook.react.* 6 | import com.facebook.soloader.SoLoader 7 | import java.lang.reflect.InvocationTargetException 8 | 9 | class MainApplication : Application(), ReactApplication { 10 | 11 | private val mReactNativeHost = object : ReactNativeHost(this) { 12 | override fun getUseDeveloperSupport(): Boolean { 13 | return BuildConfig.DEBUG 14 | } 15 | 16 | override fun getPackages(): List { 17 | val packages = PackageList(this).packages 18 | // Packages that cannot be autolinked yet can be added manually here, for example: 19 | // packages.add(MyReactNativePackage()); 20 | return packages 21 | } 22 | 23 | override fun getJSMainModuleName(): String { 24 | return "index" 25 | } 26 | } 27 | 28 | override fun getReactNativeHost(): ReactNativeHost { 29 | return mReactNativeHost 30 | } 31 | 32 | override fun onCreate() { 33 | super.onCreate() 34 | SoLoader.init(this, false) 35 | initializeFlipper(this, reactNativeHost.reactInstanceManager) 36 | } 37 | 38 | companion object { 39 | 40 | private fun initializeFlipper(context: Context, reactInstanceManager: ReactInstanceManager) { 41 | if (BuildConfig.DEBUG) { 42 | try { 43 | val aClass = Class.forName("com.example.ReactNativeFlipper") 44 | aClass 45 | .getMethod("initializeFlipper", Context::class.java, ReactInstanceManager::class.java) 46 | .invoke(null, context, reactInstanceManager) 47 | } catch (e: ClassNotFoundException) { 48 | e.printStackTrace() 49 | } catch (e: NoSuchMethodException) { 50 | e.printStackTrace() 51 | } catch (e: IllegalAccessException) { 52 | e.printStackTrace() 53 | } catch (e: InvocationTargetException) { 54 | e.printStackTrace() 55 | } 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 15 | 20 | 21 | 22 | 31 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyerhq/react-native-keyboard-accessory-view/f63975ba642209ec2b5d38e1d89f1fb48f0e03d2/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/flyerhq/react-native-keyboard-accessory-view/f63975ba642209ec2b5d38e1d89f1fb48f0e03d2/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/flyerhq/react-native-keyboard-accessory-view/f63975ba642209ec2b5d38e1d89f1fb48f0e03d2/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/flyerhq/react-native-keyboard-accessory-view/f63975ba642209ec2b5d38e1d89f1fb48f0e03d2/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/flyerhq/react-native-keyboard-accessory-view/f63975ba642209ec2b5d38e1d89f1fb48f0e03d2/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/flyerhq/react-native-keyboard-accessory-view/f63975ba642209ec2b5d38e1d89f1fb48f0e03d2/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/flyerhq/react-native-keyboard-accessory-view/f63975ba642209ec2b5d38e1d89f1fb48f0e03d2/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/flyerhq/react-native-keyboard-accessory-view/f63975ba642209ec2b5d38e1d89f1fb48f0e03d2/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/flyerhq/react-native-keyboard-accessory-view/f63975ba642209ec2b5d38e1d89f1fb48f0e03d2/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/flyerhq/react-native-keyboard-accessory-view/f63975ba642209ec2b5d38e1d89f1fb48f0e03d2/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example 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 = '31.0.0' 6 | minSdkVersion = 21 7 | compileSdkVersion = 31 8 | targetSdkVersion = 31 9 | kotlinVersion = '1.6.10' 10 | ndkVersion = '21.4.7075529' 11 | } 12 | repositories { 13 | google() 14 | mavenCentral() 15 | } 16 | dependencies { 17 | classpath 'com.android.tools.build:gradle:7.0.4' 18 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" 19 | // NOTE: Do not place your application dependencies here; they belong 20 | // in the individual module build.gradle files 21 | } 22 | } 23 | 24 | allprojects { 25 | repositories { 26 | maven { 27 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 28 | url "$rootDir/../node_modules/react-native/android" 29 | } 30 | maven { 31 | // Android JSC is installed from npm 32 | url "$rootDir/../node_modules/jsc-android/dist" 33 | } 34 | mavenCentral { 35 | // We don't want to fetch react-native from Maven Central as there are 36 | // older versions over there. 37 | content { 38 | excludeGroup "com.facebook.react" 39 | } 40 | } 41 | google() 42 | maven { url 'https://www.jitpack.io' } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /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: -Xmx1024m -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 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.99.0 29 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flyerhq/react-native-keyboard-accessory-view/f63975ba642209ec2b5d38e1d89f1fb48f0e03d2/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-7.3.3-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 | # https://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 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /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 https://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 Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } 5 | -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | } 4 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import { AppRegistry } from 'react-native' 6 | 7 | import { name as appName } from './app.json' 8 | import App from './src/App' 9 | 10 | AppRegistry.registerComponent(appName, () => App) 11 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '11.0' 5 | 6 | target 'example' do 7 | config = use_native_modules! 8 | 9 | use_react_native!( 10 | :path => config[:reactNativePath], 11 | # to enable hermes on iOS, change `false` to `true` and then install pods 12 | :hermes_enabled => false 13 | ) 14 | 15 | # Enables Flipper. 16 | # 17 | # Note that if you have use_frameworks! enabled, Flipper will not work and 18 | # you should disable the next line. 19 | use_flipper!() 20 | 21 | post_install do |installer| 22 | react_native_post_install(installer) 23 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost (1.76.0) 3 | - CocoaAsyncSocket (7.6.5) 4 | - DoubleConversion (1.1.6) 5 | - FBLazyVector (0.67.1) 6 | - FBReactNativeSpec (0.67.1): 7 | - RCT-Folly (= 2021.06.28.00-v2) 8 | - RCTRequired (= 0.67.1) 9 | - RCTTypeSafety (= 0.67.1) 10 | - React-Core (= 0.67.1) 11 | - React-jsi (= 0.67.1) 12 | - ReactCommon/turbomodule/core (= 0.67.1) 13 | - Flipper (0.99.0): 14 | - Flipper-Folly (~> 2.6) 15 | - Flipper-RSocket (~> 1.4) 16 | - Flipper-Boost-iOSX (1.76.0.1.11) 17 | - Flipper-DoubleConversion (3.1.7) 18 | - Flipper-Fmt (7.1.7) 19 | - Flipper-Folly (2.6.7): 20 | - Flipper-Boost-iOSX 21 | - Flipper-DoubleConversion 22 | - Flipper-Fmt (= 7.1.7) 23 | - Flipper-Glog 24 | - libevent (~> 2.1.12) 25 | - OpenSSL-Universal (= 1.1.180) 26 | - Flipper-Glog (0.3.6) 27 | - Flipper-PeerTalk (0.0.4) 28 | - Flipper-RSocket (1.4.3): 29 | - Flipper-Folly (~> 2.6) 30 | - FlipperKit (0.99.0): 31 | - FlipperKit/Core (= 0.99.0) 32 | - FlipperKit/Core (0.99.0): 33 | - Flipper (~> 0.99.0) 34 | - FlipperKit/CppBridge 35 | - FlipperKit/FBCxxFollyDynamicConvert 36 | - FlipperKit/FBDefines 37 | - FlipperKit/FKPortForwarding 38 | - FlipperKit/CppBridge (0.99.0): 39 | - Flipper (~> 0.99.0) 40 | - FlipperKit/FBCxxFollyDynamicConvert (0.99.0): 41 | - Flipper-Folly (~> 2.6) 42 | - FlipperKit/FBDefines (0.99.0) 43 | - FlipperKit/FKPortForwarding (0.99.0): 44 | - CocoaAsyncSocket (~> 7.6) 45 | - Flipper-PeerTalk (~> 0.0.4) 46 | - FlipperKit/FlipperKitHighlightOverlay (0.99.0) 47 | - FlipperKit/FlipperKitLayoutHelpers (0.99.0): 48 | - FlipperKit/Core 49 | - FlipperKit/FlipperKitHighlightOverlay 50 | - FlipperKit/FlipperKitLayoutTextSearchable 51 | - FlipperKit/FlipperKitLayoutIOSDescriptors (0.99.0): 52 | - FlipperKit/Core 53 | - FlipperKit/FlipperKitHighlightOverlay 54 | - FlipperKit/FlipperKitLayoutHelpers 55 | - YogaKit (~> 1.18) 56 | - FlipperKit/FlipperKitLayoutPlugin (0.99.0): 57 | - FlipperKit/Core 58 | - FlipperKit/FlipperKitHighlightOverlay 59 | - FlipperKit/FlipperKitLayoutHelpers 60 | - FlipperKit/FlipperKitLayoutIOSDescriptors 61 | - FlipperKit/FlipperKitLayoutTextSearchable 62 | - YogaKit (~> 1.18) 63 | - FlipperKit/FlipperKitLayoutTextSearchable (0.99.0) 64 | - FlipperKit/FlipperKitNetworkPlugin (0.99.0): 65 | - FlipperKit/Core 66 | - FlipperKit/FlipperKitReactPlugin (0.99.0): 67 | - FlipperKit/Core 68 | - FlipperKit/FlipperKitUserDefaultsPlugin (0.99.0): 69 | - FlipperKit/Core 70 | - FlipperKit/SKIOSNetworkPlugin (0.99.0): 71 | - FlipperKit/Core 72 | - FlipperKit/FlipperKitNetworkPlugin 73 | - fmt (6.2.1) 74 | - glog (0.3.5) 75 | - libevent (2.1.12) 76 | - OpenSSL-Universal (1.1.180) 77 | - RCT-Folly (2021.06.28.00-v2): 78 | - boost 79 | - DoubleConversion 80 | - fmt (~> 6.2.1) 81 | - glog 82 | - RCT-Folly/Default (= 2021.06.28.00-v2) 83 | - RCT-Folly/Default (2021.06.28.00-v2): 84 | - boost 85 | - DoubleConversion 86 | - fmt (~> 6.2.1) 87 | - glog 88 | - RCTRequired (0.67.1) 89 | - RCTTypeSafety (0.67.1): 90 | - FBLazyVector (= 0.67.1) 91 | - RCT-Folly (= 2021.06.28.00-v2) 92 | - RCTRequired (= 0.67.1) 93 | - React-Core (= 0.67.1) 94 | - React (0.67.1): 95 | - React-Core (= 0.67.1) 96 | - React-Core/DevSupport (= 0.67.1) 97 | - React-Core/RCTWebSocket (= 0.67.1) 98 | - React-RCTActionSheet (= 0.67.1) 99 | - React-RCTAnimation (= 0.67.1) 100 | - React-RCTBlob (= 0.67.1) 101 | - React-RCTImage (= 0.67.1) 102 | - React-RCTLinking (= 0.67.1) 103 | - React-RCTNetwork (= 0.67.1) 104 | - React-RCTSettings (= 0.67.1) 105 | - React-RCTText (= 0.67.1) 106 | - React-RCTVibration (= 0.67.1) 107 | - React-callinvoker (0.67.1) 108 | - React-Core (0.67.1): 109 | - glog 110 | - RCT-Folly (= 2021.06.28.00-v2) 111 | - React-Core/Default (= 0.67.1) 112 | - React-cxxreact (= 0.67.1) 113 | - React-jsi (= 0.67.1) 114 | - React-jsiexecutor (= 0.67.1) 115 | - React-perflogger (= 0.67.1) 116 | - Yoga 117 | - React-Core/CoreModulesHeaders (0.67.1): 118 | - glog 119 | - RCT-Folly (= 2021.06.28.00-v2) 120 | - React-Core/Default 121 | - React-cxxreact (= 0.67.1) 122 | - React-jsi (= 0.67.1) 123 | - React-jsiexecutor (= 0.67.1) 124 | - React-perflogger (= 0.67.1) 125 | - Yoga 126 | - React-Core/Default (0.67.1): 127 | - glog 128 | - RCT-Folly (= 2021.06.28.00-v2) 129 | - React-cxxreact (= 0.67.1) 130 | - React-jsi (= 0.67.1) 131 | - React-jsiexecutor (= 0.67.1) 132 | - React-perflogger (= 0.67.1) 133 | - Yoga 134 | - React-Core/DevSupport (0.67.1): 135 | - glog 136 | - RCT-Folly (= 2021.06.28.00-v2) 137 | - React-Core/Default (= 0.67.1) 138 | - React-Core/RCTWebSocket (= 0.67.1) 139 | - React-cxxreact (= 0.67.1) 140 | - React-jsi (= 0.67.1) 141 | - React-jsiexecutor (= 0.67.1) 142 | - React-jsinspector (= 0.67.1) 143 | - React-perflogger (= 0.67.1) 144 | - Yoga 145 | - React-Core/RCTActionSheetHeaders (0.67.1): 146 | - glog 147 | - RCT-Folly (= 2021.06.28.00-v2) 148 | - React-Core/Default 149 | - React-cxxreact (= 0.67.1) 150 | - React-jsi (= 0.67.1) 151 | - React-jsiexecutor (= 0.67.1) 152 | - React-perflogger (= 0.67.1) 153 | - Yoga 154 | - React-Core/RCTAnimationHeaders (0.67.1): 155 | - glog 156 | - RCT-Folly (= 2021.06.28.00-v2) 157 | - React-Core/Default 158 | - React-cxxreact (= 0.67.1) 159 | - React-jsi (= 0.67.1) 160 | - React-jsiexecutor (= 0.67.1) 161 | - React-perflogger (= 0.67.1) 162 | - Yoga 163 | - React-Core/RCTBlobHeaders (0.67.1): 164 | - glog 165 | - RCT-Folly (= 2021.06.28.00-v2) 166 | - React-Core/Default 167 | - React-cxxreact (= 0.67.1) 168 | - React-jsi (= 0.67.1) 169 | - React-jsiexecutor (= 0.67.1) 170 | - React-perflogger (= 0.67.1) 171 | - Yoga 172 | - React-Core/RCTImageHeaders (0.67.1): 173 | - glog 174 | - RCT-Folly (= 2021.06.28.00-v2) 175 | - React-Core/Default 176 | - React-cxxreact (= 0.67.1) 177 | - React-jsi (= 0.67.1) 178 | - React-jsiexecutor (= 0.67.1) 179 | - React-perflogger (= 0.67.1) 180 | - Yoga 181 | - React-Core/RCTLinkingHeaders (0.67.1): 182 | - glog 183 | - RCT-Folly (= 2021.06.28.00-v2) 184 | - React-Core/Default 185 | - React-cxxreact (= 0.67.1) 186 | - React-jsi (= 0.67.1) 187 | - React-jsiexecutor (= 0.67.1) 188 | - React-perflogger (= 0.67.1) 189 | - Yoga 190 | - React-Core/RCTNetworkHeaders (0.67.1): 191 | - glog 192 | - RCT-Folly (= 2021.06.28.00-v2) 193 | - React-Core/Default 194 | - React-cxxreact (= 0.67.1) 195 | - React-jsi (= 0.67.1) 196 | - React-jsiexecutor (= 0.67.1) 197 | - React-perflogger (= 0.67.1) 198 | - Yoga 199 | - React-Core/RCTSettingsHeaders (0.67.1): 200 | - glog 201 | - RCT-Folly (= 2021.06.28.00-v2) 202 | - React-Core/Default 203 | - React-cxxreact (= 0.67.1) 204 | - React-jsi (= 0.67.1) 205 | - React-jsiexecutor (= 0.67.1) 206 | - React-perflogger (= 0.67.1) 207 | - Yoga 208 | - React-Core/RCTTextHeaders (0.67.1): 209 | - glog 210 | - RCT-Folly (= 2021.06.28.00-v2) 211 | - React-Core/Default 212 | - React-cxxreact (= 0.67.1) 213 | - React-jsi (= 0.67.1) 214 | - React-jsiexecutor (= 0.67.1) 215 | - React-perflogger (= 0.67.1) 216 | - Yoga 217 | - React-Core/RCTVibrationHeaders (0.67.1): 218 | - glog 219 | - RCT-Folly (= 2021.06.28.00-v2) 220 | - React-Core/Default 221 | - React-cxxreact (= 0.67.1) 222 | - React-jsi (= 0.67.1) 223 | - React-jsiexecutor (= 0.67.1) 224 | - React-perflogger (= 0.67.1) 225 | - Yoga 226 | - React-Core/RCTWebSocket (0.67.1): 227 | - glog 228 | - RCT-Folly (= 2021.06.28.00-v2) 229 | - React-Core/Default (= 0.67.1) 230 | - React-cxxreact (= 0.67.1) 231 | - React-jsi (= 0.67.1) 232 | - React-jsiexecutor (= 0.67.1) 233 | - React-perflogger (= 0.67.1) 234 | - Yoga 235 | - React-CoreModules (0.67.1): 236 | - FBReactNativeSpec (= 0.67.1) 237 | - RCT-Folly (= 2021.06.28.00-v2) 238 | - RCTTypeSafety (= 0.67.1) 239 | - React-Core/CoreModulesHeaders (= 0.67.1) 240 | - React-jsi (= 0.67.1) 241 | - React-RCTImage (= 0.67.1) 242 | - ReactCommon/turbomodule/core (= 0.67.1) 243 | - React-cxxreact (0.67.1): 244 | - boost (= 1.76.0) 245 | - DoubleConversion 246 | - glog 247 | - RCT-Folly (= 2021.06.28.00-v2) 248 | - React-callinvoker (= 0.67.1) 249 | - React-jsi (= 0.67.1) 250 | - React-jsinspector (= 0.67.1) 251 | - React-logger (= 0.67.1) 252 | - React-perflogger (= 0.67.1) 253 | - React-runtimeexecutor (= 0.67.1) 254 | - React-jsi (0.67.1): 255 | - boost (= 1.76.0) 256 | - DoubleConversion 257 | - glog 258 | - RCT-Folly (= 2021.06.28.00-v2) 259 | - React-jsi/Default (= 0.67.1) 260 | - React-jsi/Default (0.67.1): 261 | - boost (= 1.76.0) 262 | - DoubleConversion 263 | - glog 264 | - RCT-Folly (= 2021.06.28.00-v2) 265 | - React-jsiexecutor (0.67.1): 266 | - DoubleConversion 267 | - glog 268 | - RCT-Folly (= 2021.06.28.00-v2) 269 | - React-cxxreact (= 0.67.1) 270 | - React-jsi (= 0.67.1) 271 | - React-perflogger (= 0.67.1) 272 | - React-jsinspector (0.67.1) 273 | - React-logger (0.67.1): 274 | - glog 275 | - react-native-safe-area-context (3.3.2): 276 | - React-Core 277 | - React-perflogger (0.67.1) 278 | - React-RCTActionSheet (0.67.1): 279 | - React-Core/RCTActionSheetHeaders (= 0.67.1) 280 | - React-RCTAnimation (0.67.1): 281 | - FBReactNativeSpec (= 0.67.1) 282 | - RCT-Folly (= 2021.06.28.00-v2) 283 | - RCTTypeSafety (= 0.67.1) 284 | - React-Core/RCTAnimationHeaders (= 0.67.1) 285 | - React-jsi (= 0.67.1) 286 | - ReactCommon/turbomodule/core (= 0.67.1) 287 | - React-RCTBlob (0.67.1): 288 | - FBReactNativeSpec (= 0.67.1) 289 | - RCT-Folly (= 2021.06.28.00-v2) 290 | - React-Core/RCTBlobHeaders (= 0.67.1) 291 | - React-Core/RCTWebSocket (= 0.67.1) 292 | - React-jsi (= 0.67.1) 293 | - React-RCTNetwork (= 0.67.1) 294 | - ReactCommon/turbomodule/core (= 0.67.1) 295 | - React-RCTImage (0.67.1): 296 | - FBReactNativeSpec (= 0.67.1) 297 | - RCT-Folly (= 2021.06.28.00-v2) 298 | - RCTTypeSafety (= 0.67.1) 299 | - React-Core/RCTImageHeaders (= 0.67.1) 300 | - React-jsi (= 0.67.1) 301 | - React-RCTNetwork (= 0.67.1) 302 | - ReactCommon/turbomodule/core (= 0.67.1) 303 | - React-RCTLinking (0.67.1): 304 | - FBReactNativeSpec (= 0.67.1) 305 | - React-Core/RCTLinkingHeaders (= 0.67.1) 306 | - React-jsi (= 0.67.1) 307 | - ReactCommon/turbomodule/core (= 0.67.1) 308 | - React-RCTNetwork (0.67.1): 309 | - FBReactNativeSpec (= 0.67.1) 310 | - RCT-Folly (= 2021.06.28.00-v2) 311 | - RCTTypeSafety (= 0.67.1) 312 | - React-Core/RCTNetworkHeaders (= 0.67.1) 313 | - React-jsi (= 0.67.1) 314 | - ReactCommon/turbomodule/core (= 0.67.1) 315 | - React-RCTSettings (0.67.1): 316 | - FBReactNativeSpec (= 0.67.1) 317 | - RCT-Folly (= 2021.06.28.00-v2) 318 | - RCTTypeSafety (= 0.67.1) 319 | - React-Core/RCTSettingsHeaders (= 0.67.1) 320 | - React-jsi (= 0.67.1) 321 | - ReactCommon/turbomodule/core (= 0.67.1) 322 | - React-RCTText (0.67.1): 323 | - React-Core/RCTTextHeaders (= 0.67.1) 324 | - React-RCTVibration (0.67.1): 325 | - FBReactNativeSpec (= 0.67.1) 326 | - RCT-Folly (= 2021.06.28.00-v2) 327 | - React-Core/RCTVibrationHeaders (= 0.67.1) 328 | - React-jsi (= 0.67.1) 329 | - ReactCommon/turbomodule/core (= 0.67.1) 330 | - React-runtimeexecutor (0.67.1): 331 | - React-jsi (= 0.67.1) 332 | - ReactCommon/turbomodule/core (0.67.1): 333 | - DoubleConversion 334 | - glog 335 | - RCT-Folly (= 2021.06.28.00-v2) 336 | - React-callinvoker (= 0.67.1) 337 | - React-Core (= 0.67.1) 338 | - React-cxxreact (= 0.67.1) 339 | - React-jsi (= 0.67.1) 340 | - React-logger (= 0.67.1) 341 | - React-perflogger (= 0.67.1) 342 | - Yoga (1.14.0) 343 | - YogaKit (1.18.1): 344 | - Yoga (~> 1.14) 345 | 346 | DEPENDENCIES: 347 | - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) 348 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 349 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 350 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) 351 | - Flipper (= 0.99.0) 352 | - Flipper-Boost-iOSX (= 1.76.0.1.11) 353 | - Flipper-DoubleConversion (= 3.1.7) 354 | - Flipper-Fmt (= 7.1.7) 355 | - Flipper-Folly (= 2.6.7) 356 | - Flipper-Glog (= 0.3.6) 357 | - Flipper-PeerTalk (= 0.0.4) 358 | - Flipper-RSocket (= 1.4.3) 359 | - FlipperKit (= 0.99.0) 360 | - FlipperKit/Core (= 0.99.0) 361 | - FlipperKit/CppBridge (= 0.99.0) 362 | - FlipperKit/FBCxxFollyDynamicConvert (= 0.99.0) 363 | - FlipperKit/FBDefines (= 0.99.0) 364 | - FlipperKit/FKPortForwarding (= 0.99.0) 365 | - FlipperKit/FlipperKitHighlightOverlay (= 0.99.0) 366 | - FlipperKit/FlipperKitLayoutPlugin (= 0.99.0) 367 | - FlipperKit/FlipperKitLayoutTextSearchable (= 0.99.0) 368 | - FlipperKit/FlipperKitNetworkPlugin (= 0.99.0) 369 | - FlipperKit/FlipperKitReactPlugin (= 0.99.0) 370 | - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.99.0) 371 | - FlipperKit/SKIOSNetworkPlugin (= 0.99.0) 372 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 373 | - OpenSSL-Universal (= 1.1.180) 374 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 375 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 376 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 377 | - React (from `../node_modules/react-native/`) 378 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 379 | - React-Core (from `../node_modules/react-native/`) 380 | - React-Core/DevSupport (from `../node_modules/react-native/`) 381 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 382 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 383 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 384 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 385 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 386 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 387 | - React-logger (from `../node_modules/react-native/ReactCommon/logger`) 388 | - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) 389 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) 390 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 391 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 392 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 393 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 394 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 395 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 396 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 397 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 398 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 399 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) 400 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 401 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 402 | 403 | SPEC REPOS: 404 | trunk: 405 | - CocoaAsyncSocket 406 | - Flipper 407 | - Flipper-Boost-iOSX 408 | - Flipper-DoubleConversion 409 | - Flipper-Fmt 410 | - Flipper-Folly 411 | - Flipper-Glog 412 | - Flipper-PeerTalk 413 | - Flipper-RSocket 414 | - FlipperKit 415 | - fmt 416 | - libevent 417 | - OpenSSL-Universal 418 | - YogaKit 419 | 420 | EXTERNAL SOURCES: 421 | boost: 422 | :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec" 423 | DoubleConversion: 424 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 425 | FBLazyVector: 426 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 427 | FBReactNativeSpec: 428 | :path: "../node_modules/react-native/React/FBReactNativeSpec" 429 | glog: 430 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 431 | RCT-Folly: 432 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" 433 | RCTRequired: 434 | :path: "../node_modules/react-native/Libraries/RCTRequired" 435 | RCTTypeSafety: 436 | :path: "../node_modules/react-native/Libraries/TypeSafety" 437 | React: 438 | :path: "../node_modules/react-native/" 439 | React-callinvoker: 440 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 441 | React-Core: 442 | :path: "../node_modules/react-native/" 443 | React-CoreModules: 444 | :path: "../node_modules/react-native/React/CoreModules" 445 | React-cxxreact: 446 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 447 | React-jsi: 448 | :path: "../node_modules/react-native/ReactCommon/jsi" 449 | React-jsiexecutor: 450 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 451 | React-jsinspector: 452 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 453 | React-logger: 454 | :path: "../node_modules/react-native/ReactCommon/logger" 455 | react-native-safe-area-context: 456 | :path: "../node_modules/react-native-safe-area-context" 457 | React-perflogger: 458 | :path: "../node_modules/react-native/ReactCommon/reactperflogger" 459 | React-RCTActionSheet: 460 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 461 | React-RCTAnimation: 462 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 463 | React-RCTBlob: 464 | :path: "../node_modules/react-native/Libraries/Blob" 465 | React-RCTImage: 466 | :path: "../node_modules/react-native/Libraries/Image" 467 | React-RCTLinking: 468 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 469 | React-RCTNetwork: 470 | :path: "../node_modules/react-native/Libraries/Network" 471 | React-RCTSettings: 472 | :path: "../node_modules/react-native/Libraries/Settings" 473 | React-RCTText: 474 | :path: "../node_modules/react-native/Libraries/Text" 475 | React-RCTVibration: 476 | :path: "../node_modules/react-native/Libraries/Vibration" 477 | React-runtimeexecutor: 478 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" 479 | ReactCommon: 480 | :path: "../node_modules/react-native/ReactCommon" 481 | Yoga: 482 | :path: "../node_modules/react-native/ReactCommon/yoga" 483 | 484 | SPEC CHECKSUMS: 485 | boost: a7c83b31436843459a1961bfd74b96033dc77234 486 | CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 487 | DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662 488 | FBLazyVector: cf409c74423d3507bda74bda1dc41e903ec2cd5b 489 | FBReactNativeSpec: ef0ce762fdb37900abb01e008cce5f0ef2cce6b7 490 | Flipper: 30e8eeeed6abdc98edaf32af0cda2f198be4b733 491 | Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c 492 | Flipper-DoubleConversion: 57ffbe81ef95306cc9e69c4aa3aeeeeb58a6a28c 493 | Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b 494 | Flipper-Folly: 83af37379faa69497529e414bd43fbfc7cae259a 495 | Flipper-Glog: 1dfd6abf1e922806c52ceb8701a3599a79a200a6 496 | Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 497 | Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 498 | FlipperKit: d8d346844eca5d9120c17d441a2f38596e8ed2b9 499 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 500 | glog: 85ecdd10ee8d8ec362ef519a6a45ff9aa27b2e85 501 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 502 | OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b 503 | RCT-Folly: 803a9cfd78114b2ec0f140cfa6fa2a6bafb2d685 504 | RCTRequired: e5dc0c44cb366fc93383a2bffbc190fe821e7293 505 | RCTTypeSafety: 6a4d0cfe070e7fd996e797f439b70878764a1ae0 506 | React: e194f6b2f0a4f8d24065f3ca0a6abe859694df65 507 | React-callinvoker: a9e7bd8d87147de3530007a3d74afd4b7dbaf57e 508 | React-Core: 4714b96060ccc19fdfbeec4e30c3b43ec82fb508 509 | React-CoreModules: fbf9a30fe25385428a57bea57d3d6d27830111da 510 | React-cxxreact: 4c8b1bfa89c6e98b8a05ebf0d9ba8d8e322e390c 511 | React-jsi: 1653dc43b537777e80f8e6c9e36aa803c698e4d3 512 | React-jsiexecutor: 1af5de75a4c834c05d53a77c1512e5aa6c18412f 513 | React-jsinspector: ab80bcdb02f28cdfc0dbbaea6db1241565d59002 514 | React-logger: b08f354e4c928ff794ca477347fea0922aaf11c3 515 | react-native-safe-area-context: 584dc04881deb49474363f3be89e4ca0e854c057 516 | React-perflogger: 9a6172711d9c4c8c7ac0a426717317c3c6ecf85c 517 | React-RCTActionSheet: ed408b54b08278e6af8a75e08679675041da61ae 518 | React-RCTAnimation: 0163b497a423a9576a776685c6e3fe276f934758 519 | React-RCTBlob: 40e9a2ba218218cc120d037408e6c1686036a3ad 520 | React-RCTImage: ae48901aecaf2b5a9f7f51cbb60fc36ff120115d 521 | React-RCTLinking: 1e25d97db107eea60657211f7ecc4509587f8d29 522 | React-RCTNetwork: 775383be87609cf2d7e182a9b967e51686f12b2f 523 | React-RCTSettings: 4581080369f65e5bc388061ff7b9cba9389936c4 524 | React-RCTText: 48df7f52519cfc6a9eb79a02acb3d33df04370a0 525 | React-RCTVibration: 19c012d1202df46bafbe49268a346f6b3edadfdd 526 | React-runtimeexecutor: 2c92a8bddd1a3e72c7513d1e74235c2d9c84875c 527 | ReactCommon: 2e816fad39f65f2a94a5999d5be463a6b620dcf6 528 | Yoga: 5cbf25add73edb290e1067017690f7ebf56c5468 529 | YogaKit: f782866e155069a2cca2517aafea43200b01fd5a 530 | 531 | PODFILE CHECKSUM: 9d2dead264e8a42ac453e46434ac53d9891db9dd 532 | 533 | COCOAPODS: 1.11.2 534 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 11 | 1FAD8CDA816C933E4A6364F5 /* libPods-example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F20035AA6C1E3A65073B294C /* libPods-example.a */; }; 12 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 13 | FAA6DE282607FC1C0044CA6D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAA6DE272607FC1C0044CA6D /* AppDelegate.swift */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXFileReference section */ 17 | 13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 18 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = ""; }; 19 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = ""; }; 20 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example/LaunchScreen.storyboard; sourceTree = ""; }; 21 | B5E5C4826EA8E6C4967B2200 /* Pods-example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.release.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.release.xcconfig"; sourceTree = ""; }; 22 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 23 | EEACD3DC47A1FD63CD1F41B0 /* Pods-example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example.debug.xcconfig"; path = "Target Support Files/Pods-example/Pods-example.debug.xcconfig"; sourceTree = ""; }; 24 | F20035AA6C1E3A65073B294C /* libPods-example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | FAA6DE272607FC1C0044CA6D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = example/AppDelegate.swift; sourceTree = ""; }; 26 | FAA6DE2A2607FC480044CA6D /* example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "example-Bridging-Header.h"; path = "example/example-Bridging-Header.h"; sourceTree = ""; }; 27 | /* End PBXFileReference section */ 28 | 29 | /* Begin PBXFrameworksBuildPhase section */ 30 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 31 | isa = PBXFrameworksBuildPhase; 32 | buildActionMask = 2147483647; 33 | files = ( 34 | 1FAD8CDA816C933E4A6364F5 /* libPods-example.a in Frameworks */, 35 | ); 36 | runOnlyForDeploymentPostprocessing = 0; 37 | }; 38 | /* End PBXFrameworksBuildPhase section */ 39 | 40 | /* Begin PBXGroup section */ 41 | 13B07FAE1A68108700A75B9A /* example */ = { 42 | isa = PBXGroup; 43 | children = ( 44 | FAA6DE272607FC1C0044CA6D /* AppDelegate.swift */, 45 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 46 | 13B07FB61A68108700A75B9A /* Info.plist */, 47 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 48 | FAA6DE2A2607FC480044CA6D /* example-Bridging-Header.h */, 49 | ); 50 | name = example; 51 | sourceTree = ""; 52 | }; 53 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 57 | F20035AA6C1E3A65073B294C /* libPods-example.a */, 58 | ); 59 | name = Frameworks; 60 | sourceTree = ""; 61 | }; 62 | 4B4D64BF1C1A5A4529CF1479 /* Pods */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | EEACD3DC47A1FD63CD1F41B0 /* Pods-example.debug.xcconfig */, 66 | B5E5C4826EA8E6C4967B2200 /* Pods-example.release.xcconfig */, 67 | ); 68 | name = Pods; 69 | path = Pods; 70 | sourceTree = ""; 71 | }; 72 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | ); 76 | name = Libraries; 77 | sourceTree = ""; 78 | }; 79 | 83CBB9F61A601CBA00E9B192 = { 80 | isa = PBXGroup; 81 | children = ( 82 | 13B07FAE1A68108700A75B9A /* example */, 83 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 84 | 83CBBA001A601CBA00E9B192 /* Products */, 85 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 86 | 4B4D64BF1C1A5A4529CF1479 /* Pods */, 87 | ); 88 | indentWidth = 2; 89 | sourceTree = ""; 90 | tabWidth = 2; 91 | usesTabs = 0; 92 | }; 93 | 83CBBA001A601CBA00E9B192 /* Products */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 13B07F961A680F5B00A75B9A /* example.app */, 97 | ); 98 | name = Products; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 13B07F861A680F5B00A75B9A /* example */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */; 107 | buildPhases = ( 108 | 69C82C9986D9CB87F0D0A07A /* [CP] Check Pods Manifest.lock */, 109 | FD10A7F022414F080027D42C /* Start Packager */, 110 | 13B07F871A680F5B00A75B9A /* Sources */, 111 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 112 | 13B07F8E1A680F5B00A75B9A /* Resources */, 113 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 114 | 9872B328FE01691B60DE5123 /* [CP] Embed Pods Frameworks */, 115 | D58FE6EBABBC61DFD1B4533A /* [CP] Copy Pods Resources */, 116 | ); 117 | buildRules = ( 118 | ); 119 | dependencies = ( 120 | ); 121 | name = example; 122 | productName = example; 123 | productReference = 13B07F961A680F5B00A75B9A /* example.app */; 124 | productType = "com.apple.product-type.application"; 125 | }; 126 | /* End PBXNativeTarget section */ 127 | 128 | /* Begin PBXProject section */ 129 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 130 | isa = PBXProject; 131 | attributes = { 132 | LastUpgradeCheck = 1240; 133 | TargetAttributes = { 134 | 13B07F861A680F5B00A75B9A = { 135 | LastSwiftMigration = 1240; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */; 140 | compatibilityVersion = "Xcode 12.0"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 83CBB9F61A601CBA00E9B192; 148 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 13B07F861A680F5B00A75B9A /* example */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 163 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 164 | ); 165 | runOnlyForDeploymentPostprocessing = 0; 166 | }; 167 | /* End PBXResourcesBuildPhase section */ 168 | 169 | /* Begin PBXShellScriptBuildPhase section */ 170 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 171 | isa = PBXShellScriptBuildPhase; 172 | buildActionMask = 2147483647; 173 | files = ( 174 | ); 175 | inputPaths = ( 176 | ); 177 | name = "Bundle React Native code and images"; 178 | outputPaths = ( 179 | ); 180 | runOnlyForDeploymentPostprocessing = 0; 181 | shellPath = /bin/sh; 182 | shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; 183 | }; 184 | 69C82C9986D9CB87F0D0A07A /* [CP] Check Pods Manifest.lock */ = { 185 | isa = PBXShellScriptBuildPhase; 186 | buildActionMask = 2147483647; 187 | files = ( 188 | ); 189 | inputFileListPaths = ( 190 | ); 191 | inputPaths = ( 192 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 193 | "${PODS_ROOT}/Manifest.lock", 194 | ); 195 | name = "[CP] Check Pods Manifest.lock"; 196 | outputFileListPaths = ( 197 | ); 198 | outputPaths = ( 199 | "$(DERIVED_FILE_DIR)/Pods-example-checkManifestLockResult.txt", 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | shellPath = /bin/sh; 203 | 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"; 204 | showEnvVarsInLog = 0; 205 | }; 206 | 9872B328FE01691B60DE5123 /* [CP] Embed Pods Frameworks */ = { 207 | isa = PBXShellScriptBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | ); 211 | inputFileListPaths = ( 212 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-input-files.xcfilelist", 213 | ); 214 | name = "[CP] Embed Pods Frameworks"; 215 | outputFileListPaths = ( 216 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks-${CONFIGURATION}-output-files.xcfilelist", 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | shellPath = /bin/sh; 220 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-frameworks.sh\"\n"; 221 | showEnvVarsInLog = 0; 222 | }; 223 | D58FE6EBABBC61DFD1B4533A /* [CP] Copy Pods Resources */ = { 224 | isa = PBXShellScriptBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | ); 228 | inputFileListPaths = ( 229 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-input-files.xcfilelist", 230 | ); 231 | name = "[CP] Copy Pods Resources"; 232 | outputFileListPaths = ( 233 | "${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources-${CONFIGURATION}-output-files.xcfilelist", 234 | ); 235 | runOnlyForDeploymentPostprocessing = 0; 236 | shellPath = /bin/sh; 237 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-example/Pods-example-resources.sh\"\n"; 238 | showEnvVarsInLog = 0; 239 | }; 240 | FD10A7F022414F080027D42C /* Start Packager */ = { 241 | isa = PBXShellScriptBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | ); 245 | inputFileListPaths = ( 246 | ); 247 | inputPaths = ( 248 | ); 249 | name = "Start Packager"; 250 | outputFileListPaths = ( 251 | ); 252 | outputPaths = ( 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | shellPath = /bin/sh; 256 | 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"; 257 | showEnvVarsInLog = 0; 258 | }; 259 | /* End PBXShellScriptBuildPhase section */ 260 | 261 | /* Begin PBXSourcesBuildPhase section */ 262 | 13B07F871A680F5B00A75B9A /* Sources */ = { 263 | isa = PBXSourcesBuildPhase; 264 | buildActionMask = 2147483647; 265 | files = ( 266 | FAA6DE282607FC1C0044CA6D /* AppDelegate.swift in Sources */, 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | /* End PBXSourcesBuildPhase section */ 271 | 272 | /* Begin XCBuildConfiguration section */ 273 | 13B07F941A680F5B00A75B9A /* Debug */ = { 274 | isa = XCBuildConfiguration; 275 | baseConfigurationReference = EEACD3DC47A1FD63CD1F41B0 /* Pods-example.debug.xcconfig */; 276 | buildSettings = { 277 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 278 | CLANG_ENABLE_MODULES = YES; 279 | CURRENT_PROJECT_VERSION = 1; 280 | ENABLE_BITCODE = NO; 281 | INFOPLIST_FILE = example/Info.plist; 282 | LD_RUNPATH_SEARCH_PATHS = ( 283 | "$(inherited)", 284 | "@executable_path/Frameworks", 285 | ); 286 | OTHER_LDFLAGS = ( 287 | "$(inherited)", 288 | "-ObjC", 289 | "-lc++", 290 | ); 291 | PRODUCT_BUNDLE_IDENTIFIER = "com.$(PRODUCT_NAME:rfc1034identifier:lower)"; 292 | PRODUCT_NAME = example; 293 | SWIFT_OBJC_BRIDGING_HEADER = "example/example-Bridging-Header.h"; 294 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 295 | SWIFT_VERSION = 5.0; 296 | VERSIONING_SYSTEM = "apple-generic"; 297 | }; 298 | name = Debug; 299 | }; 300 | 13B07F951A680F5B00A75B9A /* Release */ = { 301 | isa = XCBuildConfiguration; 302 | baseConfigurationReference = B5E5C4826EA8E6C4967B2200 /* Pods-example.release.xcconfig */; 303 | buildSettings = { 304 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 305 | CLANG_ENABLE_MODULES = YES; 306 | CURRENT_PROJECT_VERSION = 1; 307 | INFOPLIST_FILE = example/Info.plist; 308 | LD_RUNPATH_SEARCH_PATHS = ( 309 | "$(inherited)", 310 | "@executable_path/Frameworks", 311 | ); 312 | OTHER_LDFLAGS = ( 313 | "$(inherited)", 314 | "-ObjC", 315 | "-lc++", 316 | ); 317 | PRODUCT_BUNDLE_IDENTIFIER = "com.$(PRODUCT_NAME:rfc1034identifier:lower)"; 318 | PRODUCT_NAME = example; 319 | SWIFT_OBJC_BRIDGING_HEADER = "example/example-Bridging-Header.h"; 320 | SWIFT_VERSION = 5.0; 321 | VERSIONING_SYSTEM = "apple-generic"; 322 | }; 323 | name = Release; 324 | }; 325 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 326 | isa = XCBuildConfiguration; 327 | buildSettings = { 328 | ALWAYS_SEARCH_USER_PATHS = NO; 329 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 330 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 331 | CLANG_CXX_LIBRARY = "libc++"; 332 | CLANG_ENABLE_MODULES = YES; 333 | CLANG_ENABLE_OBJC_ARC = YES; 334 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 335 | CLANG_WARN_BOOL_CONVERSION = YES; 336 | CLANG_WARN_COMMA = YES; 337 | CLANG_WARN_CONSTANT_CONVERSION = YES; 338 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 339 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 340 | CLANG_WARN_EMPTY_BODY = YES; 341 | CLANG_WARN_ENUM_CONVERSION = YES; 342 | CLANG_WARN_INFINITE_RECURSION = YES; 343 | CLANG_WARN_INT_CONVERSION = YES; 344 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 345 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 346 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 347 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 348 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 349 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 350 | CLANG_WARN_STRICT_PROTOTYPES = YES; 351 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 352 | CLANG_WARN_UNREACHABLE_CODE = YES; 353 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 354 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 355 | COPY_PHASE_STRIP = NO; 356 | ENABLE_STRICT_OBJC_MSGSEND = YES; 357 | ENABLE_TESTABILITY = YES; 358 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 359 | GCC_C_LANGUAGE_STANDARD = gnu99; 360 | GCC_DYNAMIC_NO_PIC = NO; 361 | GCC_NO_COMMON_BLOCKS = YES; 362 | GCC_OPTIMIZATION_LEVEL = 0; 363 | GCC_PREPROCESSOR_DEFINITIONS = ( 364 | "DEBUG=1", 365 | "$(inherited)", 366 | ); 367 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 368 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 369 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 370 | GCC_WARN_UNDECLARED_SELECTOR = YES; 371 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 372 | GCC_WARN_UNUSED_FUNCTION = YES; 373 | GCC_WARN_UNUSED_VARIABLE = YES; 374 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 375 | LD_RUNPATH_SEARCH_PATHS = ( 376 | /usr/lib/swift, 377 | "$(inherited)", 378 | ); 379 | LIBRARY_SEARCH_PATHS = ( 380 | "\"$(SDKROOT)/usr/lib/swift\"", 381 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 382 | "\"$(inherited)\"", 383 | ); 384 | MTL_ENABLE_DEBUG_INFO = YES; 385 | ONLY_ACTIVE_ARCH = YES; 386 | OTHER_SWIFT_FLAGS = "-D DEBUG"; 387 | SDKROOT = iphoneos; 388 | }; 389 | name = Debug; 390 | }; 391 | 83CBBA211A601CBA00E9B192 /* Release */ = { 392 | isa = XCBuildConfiguration; 393 | buildSettings = { 394 | ALWAYS_SEARCH_USER_PATHS = NO; 395 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 396 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 397 | CLANG_CXX_LIBRARY = "libc++"; 398 | CLANG_ENABLE_MODULES = YES; 399 | CLANG_ENABLE_OBJC_ARC = YES; 400 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 401 | CLANG_WARN_BOOL_CONVERSION = YES; 402 | CLANG_WARN_COMMA = YES; 403 | CLANG_WARN_CONSTANT_CONVERSION = YES; 404 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 405 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 406 | CLANG_WARN_EMPTY_BODY = YES; 407 | CLANG_WARN_ENUM_CONVERSION = YES; 408 | CLANG_WARN_INFINITE_RECURSION = YES; 409 | CLANG_WARN_INT_CONVERSION = YES; 410 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 411 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 412 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 413 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 414 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 415 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 416 | CLANG_WARN_STRICT_PROTOTYPES = YES; 417 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 418 | CLANG_WARN_UNREACHABLE_CODE = YES; 419 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 420 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 421 | COPY_PHASE_STRIP = YES; 422 | ENABLE_NS_ASSERTIONS = NO; 423 | ENABLE_STRICT_OBJC_MSGSEND = YES; 424 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 425 | GCC_C_LANGUAGE_STANDARD = gnu99; 426 | GCC_NO_COMMON_BLOCKS = YES; 427 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 428 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 429 | GCC_WARN_UNDECLARED_SELECTOR = YES; 430 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 431 | GCC_WARN_UNUSED_FUNCTION = YES; 432 | GCC_WARN_UNUSED_VARIABLE = YES; 433 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 434 | LD_RUNPATH_SEARCH_PATHS = ( 435 | /usr/lib/swift, 436 | "$(inherited)", 437 | ); 438 | LIBRARY_SEARCH_PATHS = ( 439 | "\"$(SDKROOT)/usr/lib/swift\"", 440 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 441 | "\"$(inherited)\"", 442 | ); 443 | MTL_ENABLE_DEBUG_INFO = NO; 444 | SDKROOT = iphoneos; 445 | SWIFT_COMPILATION_MODE = wholemodule; 446 | VALIDATE_PRODUCT = YES; 447 | }; 448 | name = Release; 449 | }; 450 | /* End XCBuildConfiguration section */ 451 | 452 | /* Begin XCConfigurationList section */ 453 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */ = { 454 | isa = XCConfigurationList; 455 | buildConfigurations = ( 456 | 13B07F941A680F5B00A75B9A /* Debug */, 457 | 13B07F951A680F5B00A75B9A /* Release */, 458 | ); 459 | defaultConfigurationIsVisible = 0; 460 | defaultConfigurationName = Release; 461 | }; 462 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */ = { 463 | isa = XCConfigurationList; 464 | buildConfigurations = ( 465 | 83CBBA201A601CBA00E9B192 /* Debug */, 466 | 83CBBA211A601CBA00E9B192 /* Release */, 467 | ); 468 | defaultConfigurationIsVisible = 0; 469 | defaultConfigurationName = Release; 470 | }; 471 | /* End XCConfigurationList section */ 472 | }; 473 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 474 | } 475 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | #if DEBUG && FB_SONARKIT_ENABLED 3 | import FlipperKit 4 | #endif 5 | 6 | @UIApplicationMain 7 | class AppDelegate: UIResponder, UIApplicationDelegate, RCTBridgeDelegate { 8 | 9 | var window: UIWindow? 10 | 11 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 12 | initializeFlipper(with: application) 13 | 14 | let bridge = RCTBridge(delegate: self, launchOptions: launchOptions) 15 | let rootView = RCTRootView(bridge: bridge!, moduleName: "example", initialProperties: nil) 16 | 17 | if #available(iOS 13.0, *) { 18 | rootView.backgroundColor = UIColor.systemBackground 19 | } else { 20 | rootView.backgroundColor = UIColor.white 21 | } 22 | 23 | window = UIWindow(frame: UIScreen.main.bounds) 24 | let rootViewController = UIViewController() 25 | rootViewController.view = rootView 26 | window?.rootViewController = rootViewController 27 | window?.makeKeyAndVisible() 28 | 29 | return true 30 | } 31 | 32 | func sourceURL(for bridge: RCTBridge!) -> URL! { 33 | #if DEBUG 34 | return RCTBundleURLProvider.sharedSettings()?.jsBundleURL(forBundleRoot: "index", fallbackResource: nil) 35 | #else 36 | return Bundle.main.url(forResource: "main", withExtension: "jsbundle") 37 | #endif 38 | } 39 | 40 | private func initializeFlipper(with application: UIApplication) { 41 | #if DEBUG && FB_SONARKIT_ENABLED 42 | let client = FlipperClient.shared() 43 | let layoutDescriptionMapper = SKDescriptorMapper(defaults: ()) 44 | client?.add(FlipperKitLayoutPlugin(rootNode: application, with: layoutDescriptionMapper)) 45 | client?.add(FKUserDefaultsPlugin(suiteName: nil)) 46 | client?.add(FlipperKitReactPlugin()) 47 | client?.add(FlipperKitNetworkPlugin(networkAdapter: SKIOSNetworkAdapter())) 48 | client?.start() 49 | #endif 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | example 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 | $(CURRENT_PROJECT_VERSION) 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /example/ios/example/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/example/example-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import 6 | #import 7 | #import 8 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | const path = require('path') 9 | const exclusionList = require('metro-config/src/defaults/exclusionList') 10 | 11 | const moduleRoot = path.resolve(__dirname, '..') 12 | 13 | module.exports = { 14 | watchFolders: [moduleRoot], 15 | resolver: { 16 | extraNodeModules: { 17 | react: path.resolve(__dirname, 'node_modules/react'), 18 | 'react-native': path.resolve(__dirname, 'node_modules/react-native'), 19 | 'react-native-safe-area-context': path.resolve( 20 | __dirname, 21 | 'node_modules/react-native-safe-area-context' 22 | ), 23 | }, 24 | blockList: exclusionList([ 25 | new RegExp(`${moduleRoot}/node_modules/react/.*`), 26 | new RegExp(`${moduleRoot}/node_modules/react-native/.*`), 27 | new RegExp( 28 | `${moduleRoot}/node_modules/react-native-safe-area-context/.*` 29 | ), 30 | ]), 31 | }, 32 | transformer: { 33 | getTransformOptions: async () => ({ 34 | transform: { 35 | experimentalImportSupport: false, 36 | inlineRequires: true, 37 | }, 38 | }), 39 | }, 40 | } 41 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "compile": "tsc -p .", 8 | "ios": "react-native run-ios", 9 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx", 10 | "start": "react-native start", 11 | "test": "jest" 12 | }, 13 | "dependencies": { 14 | "react": "^17.0.2", 15 | "react-native": "^0.67.1", 16 | "react-native-safe-area-context": "^3.3.2" 17 | }, 18 | "devDependencies": { 19 | "@babel/core": "^7.16.12", 20 | "@babel/runtime": "^7.16.7", 21 | "@react-native-community/eslint-config": "^3.0.1", 22 | "@types/jest": "^27.4.0", 23 | "@types/react-native": "^0.66.15", 24 | "@types/react-test-renderer": "^17.0.1", 25 | "babel-jest": "^27.4.6", 26 | "eslint": "^7.32.0", 27 | "eslint-plugin-simple-import-sort": "^7.0.0", 28 | "jest": "^27.4.7", 29 | "metro-react-native-babel-preset": "^0.67.0", 30 | "react-test-renderer": "^17.0.2", 31 | "typescript": "^4.5.5" 32 | }, 33 | "resolutions": { 34 | "@types/react": "^17" 35 | }, 36 | "jest": { 37 | "preset": "react-native", 38 | "moduleFileExtensions": [ 39 | "ts", 40 | "tsx", 41 | "js", 42 | "jsx", 43 | "json", 44 | "node" 45 | ] 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /example/src/App.tsx: -------------------------------------------------------------------------------- 1 | import { KeyboardAccessoryView } from '@flyerhq/react-native-keyboard-accessory-view' 2 | import React from 'react' 3 | import { 4 | FlatList, 5 | GestureResponderHandlers, 6 | SafeAreaView, 7 | StyleSheet, 8 | Text, 9 | TextInput, 10 | } from 'react-native' 11 | import { SafeAreaProvider } from 'react-native-safe-area-context' 12 | 13 | interface Item { 14 | id: string 15 | message: string 16 | } 17 | 18 | const data: Item[] = [...Array(20).keys()].map((value) => ({ 19 | id: `${value + 1}`, 20 | message: `example${value + 1}`, 21 | })) 22 | 23 | const App = () => { 24 | const keyExtractor = (item: Item) => item.id 25 | 26 | const renderItem = ({ item }: { item: Item }) => ( 27 | {item.message} 28 | ) 29 | 30 | const renderScrollable = (panHandlers: GestureResponderHandlers) => ( 31 | 40 | ) 41 | 42 | return ( 43 | 44 | 45 | 49 | 50 | 51 | 52 | 53 | ) 54 | } 55 | 56 | const styles = StyleSheet.create({ 57 | container: { 58 | flex: 1, 59 | }, 60 | keyboardAccessoryView: { 61 | backgroundColor: 'black', 62 | }, 63 | text: { 64 | padding: 24, 65 | }, 66 | textInput: { 67 | color: 'white', 68 | flex: 1, 69 | height: 50, 70 | paddingHorizontal: 16, 71 | }, 72 | }) 73 | 74 | export default App 75 | -------------------------------------------------------------------------------- /example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "esModuleInterop": true, 5 | "jsx": "react-native", 6 | "lib": ["ESNext"], 7 | "module": "CommonJS", 8 | "noEmit": true, 9 | "paths": { 10 | "@flyerhq/react-native-keyboard-accessory-view": ["../src"] 11 | }, 12 | "skipLibCheck": true, 13 | "strict": true, 14 | "target": "ESNext", 15 | }, 16 | "include": ["src"] 17 | } 18 | -------------------------------------------------------------------------------- /jest/fixtures.ts: -------------------------------------------------------------------------------- 1 | import { KeyboardEvent, LayoutChangeEvent, ScaledSize } from 'react-native' 2 | 3 | export const keyboardHideEvent: KeyboardEvent = { 4 | duration: 10, 5 | easing: 'keyboard', 6 | endCoordinates: { 7 | height: 346, 8 | screenX: 0, 9 | screenY: 896, 10 | width: 414, 11 | }, 12 | isEventFromThisApp: true, 13 | startCoordinates: { 14 | height: 346, 15 | screenX: 0, 16 | screenY: 550, 17 | width: 414, 18 | }, 19 | } 20 | 21 | export const keyboardOpenEvent: KeyboardEvent = { 22 | duration: 250, 23 | easing: 'keyboard', 24 | endCoordinates: { 25 | height: 346, 26 | screenX: 0, 27 | screenY: 550, 28 | width: 414, 29 | }, 30 | isEventFromThisApp: true, 31 | startCoordinates: { 32 | height: 243, 33 | screenX: 0, 34 | screenY: 896, 35 | width: 414, 36 | }, 37 | } 38 | 39 | export const size = { 40 | height: 896, 41 | width: 414, 42 | } 43 | 44 | export const onLayoutEvent: LayoutChangeEvent = { 45 | bubbles: false, 46 | cancelable: false, 47 | currentTarget: undefined, 48 | defaultPrevented: false, 49 | eventPhase: 0, 50 | isDefaultPrevented: jest.fn(), 51 | isPropagationStopped: jest.fn(), 52 | isTrusted: false, 53 | nativeEvent: { 54 | layout: { x: 0, y: 0, ...size }, 55 | }, 56 | persist: jest.fn(), 57 | preventDefault: jest.fn(), 58 | stopPropagation: jest.fn(), 59 | target: undefined, 60 | timeStamp: 0, 61 | type: 'type', 62 | } 63 | 64 | export const scaledSize: ScaledSize = { 65 | fontScale: 1, 66 | height: 414, 67 | scale: 2, 68 | width: 896, 69 | } 70 | -------------------------------------------------------------------------------- /jest/setup.ts: -------------------------------------------------------------------------------- 1 | import { LayoutAnimation } from 'react-native' 2 | 3 | jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter') 4 | 5 | jest.spyOn(LayoutAnimation, 'configureNext').mockImplementation() 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@flyerhq/react-native-keyboard-accessory-view", 3 | "version": "2.4.0", 4 | "description": "Keyboard accessory (sticky) view for your React Native app. Supports interactive dismiss on iOS.", 5 | "homepage": "https://github.com/flyerhq/react-native-keyboard-accessory-view#readme", 6 | "main": "lib/index.js", 7 | "types": "lib/index.d.ts", 8 | "author": "Oleksandr Demchenko ", 9 | "license": "MIT", 10 | "keywords": [ 11 | "keyboard-accessory", 12 | "keyboard", 13 | "sticky", 14 | "react-component", 15 | "interactive", 16 | "react-native", 17 | "ios", 18 | "android", 19 | "typescript" 20 | ], 21 | "files": [ 22 | "lib" 23 | ], 24 | "publishConfig": { 25 | "access": "public" 26 | }, 27 | "scripts": { 28 | "compile": "rm -rf lib && tsc -p .", 29 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx", 30 | "prepare": "yarn compile", 31 | "test": "jest", 32 | "type-coverage": "type-coverage" 33 | }, 34 | "devDependencies": { 35 | "@babel/core": "^7.16.12", 36 | "@babel/runtime": "^7.16.7", 37 | "@react-native-community/eslint-config": "^3.0.1", 38 | "@testing-library/react-hooks": "^7.0.2", 39 | "@testing-library/react-native": "^9.0.0", 40 | "@types/jest": "^27.4.0", 41 | "@types/react-native": "^0.66.15", 42 | "@types/react-test-renderer": "^17.0.1", 43 | "babel-jest": "^27.4.6", 44 | "eslint": "^7.32.0", 45 | "eslint-plugin-jest": "^26.0.0", 46 | "eslint-plugin-simple-import-sort": "^7.0.0", 47 | "jest": "^27.4.7", 48 | "metro-react-native-babel-preset": "^0.67.0", 49 | "react": "^17.0.2", 50 | "react-native": "^0.67.1", 51 | "react-native-safe-area-context": "^3.3.2", 52 | "react-test-renderer": "^17.0.2", 53 | "type-coverage": "^2.20.0", 54 | "typescript": "^4.5.5" 55 | }, 56 | "peerDependencies": { 57 | "react": "*", 58 | "react-native": "*", 59 | "react-native-safe-area-context": "*" 60 | }, 61 | "jest": { 62 | "collectCoverage": true, 63 | "collectCoverageFrom": [ 64 | "src/**/*.{ts,tsx}", 65 | "!**/index.{ts,tsx}", 66 | "!**/styles.{ts,tsx}" 67 | ], 68 | "coverageThreshold": { 69 | "global": { 70 | "branches": 100, 71 | "functions": 100, 72 | "lines": 100, 73 | "statements": 100 74 | } 75 | }, 76 | "moduleFileExtensions": [ 77 | "ts", 78 | "tsx", 79 | "js", 80 | "jsx", 81 | "json", 82 | "node" 83 | ], 84 | "preset": "react-native", 85 | "setupFiles": [ 86 | "./jest/setup.ts" 87 | ] 88 | }, 89 | "typeCoverage": { 90 | "cache": true, 91 | "ignoreCatch": true, 92 | "ignoreNonNullAssertion": true, 93 | "ignoreUnread": true, 94 | "is": 100, 95 | "showRelativePath": true, 96 | "strict": true 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/KeyboardAccessoryView.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | import { 3 | Animated, 4 | GestureResponderHandlers, 5 | StyleProp, 6 | StyleSheet, 7 | View, 8 | ViewStyle, 9 | } from 'react-native' 10 | import { useSafeAreaInsets } from 'react-native-safe-area-context' 11 | 12 | import { 13 | useComponentSize, 14 | useKeyboardDimensions, 15 | usePanResponder, 16 | } from './hooks' 17 | 18 | interface Props { 19 | children?: React.ReactNode 20 | contentContainerStyle?: StyleProp 21 | contentOffsetKeyboardClosed?: number 22 | contentOffsetKeyboardOpened?: number 23 | renderBackground?: () => React.ReactNode 24 | renderScrollable: (panHandlers: GestureResponderHandlers) => React.ReactNode 25 | scrollableContainerStyle?: StyleProp 26 | spaceBetweenKeyboardAndAccessoryView?: number 27 | style?: StyleProp 28 | useListenersOnAndroid?: boolean 29 | } 30 | 31 | export const KeyboardAccessoryView = React.memo( 32 | ({ 33 | children, 34 | contentContainerStyle, 35 | contentOffsetKeyboardClosed, 36 | contentOffsetKeyboardOpened, 37 | renderBackground, 38 | renderScrollable, 39 | scrollableContainerStyle, 40 | spaceBetweenKeyboardAndAccessoryView, 41 | style, 42 | useListenersOnAndroid, 43 | }: Props) => { 44 | const { onLayout, size } = useComponentSize() 45 | const { keyboardEndPositionY, keyboardHeight } = useKeyboardDimensions( 46 | useListenersOnAndroid 47 | ) 48 | const { panHandlers, positionY } = usePanResponder() 49 | const { bottom, left, right } = useSafeAreaInsets() 50 | 51 | const deltaY = Animated.subtract( 52 | positionY, 53 | keyboardEndPositionY 54 | ).interpolate({ 55 | inputRange: [0, Number.MAX_SAFE_INTEGER], 56 | outputRange: [0, Number.MAX_SAFE_INTEGER], 57 | extrapolate: 'clamp', 58 | }) 59 | 60 | const offset = 61 | size.height + 62 | keyboardHeight + 63 | (keyboardHeight > 0 64 | ? (contentOffsetKeyboardOpened ?? 0) - bottom 65 | : contentOffsetKeyboardClosed ?? 0) 66 | 67 | return ( 68 | <> 69 | 79 | {renderScrollable(panHandlers)} 80 | 81 | 0 86 | ? keyboardHeight + (spaceBetweenKeyboardAndAccessoryView ?? 0) 87 | : 0, 88 | deltaY 89 | ), 90 | }, 91 | styles.container, 92 | style, 93 | ]} 94 | testID='container' 95 | > 96 | {renderBackground?.()} 97 | 0 ? 0 : bottom, 104 | marginLeft: left, 105 | marginRight: right, 106 | }, 107 | contentContainerStyle, 108 | ]} 109 | > 110 | {children} 111 | 112 | 113 | 114 | ) 115 | } 116 | ) 117 | 118 | const styles = StyleSheet.create({ 119 | container: { 120 | position: 'absolute', 121 | left: 0, 122 | right: 0, 123 | }, 124 | contentContainer: { 125 | flex: 1, 126 | }, 127 | }) 128 | -------------------------------------------------------------------------------- /src/__tests__/KeyboardAccessoryView.test.tsx: -------------------------------------------------------------------------------- 1 | import { act, render } from '@testing-library/react-native' 2 | import React from 'react' 3 | import { NativeEventEmitter, ScrollView } from 'react-native' 4 | 5 | import { keyboardOpenEvent } from '../../jest/fixtures' 6 | import { KeyboardAccessoryView } from '../KeyboardAccessoryView' 7 | 8 | const emitter = new NativeEventEmitter() 9 | 10 | describe('keyboard accessory view', () => { 11 | it('sticks to the bottom with a closed keyboard', () => { 12 | expect.assertions(1) 13 | const { getByTestId } = render( 14 | } /> 15 | ) 16 | const container = getByTestId('container') 17 | expect(container.props.style).toHaveProperty('bottom', 0) 18 | }) 19 | 20 | it('sticks to the keyboard top with an open keyboard', () => { 21 | expect.assertions(1) 22 | const { getByTestId } = render( 23 | } /> 24 | ) 25 | act(() => { 26 | emitter.emit('keyboardWillChangeFrame', keyboardOpenEvent) 27 | }) 28 | const container = getByTestId('container') 29 | expect(container.props.style).toHaveProperty('bottom', 346) 30 | }) 31 | }) 32 | -------------------------------------------------------------------------------- /src/hooks/__tests__/useComponentSize.test.tsx: -------------------------------------------------------------------------------- 1 | import { act, renderHook } from '@testing-library/react-hooks' 2 | 3 | import { onLayoutEvent, size } from '../../../jest/fixtures' 4 | import { useComponentSize } from '../useComponentSize' 5 | 6 | describe('useComponentSize', () => { 7 | it('returns correct size', () => { 8 | expect.assertions(1) 9 | const { result } = renderHook(() => useComponentSize()) 10 | act(() => { 11 | result.current.onLayout(onLayoutEvent) 12 | }) 13 | expect(result.current.size).toStrictEqual(size) 14 | }) 15 | }) 16 | -------------------------------------------------------------------------------- /src/hooks/__tests__/useKeyboardDimensions.test.tsx: -------------------------------------------------------------------------------- 1 | import { act, renderHook } from '@testing-library/react-hooks' 2 | import { NativeEventEmitter } from 'react-native' 3 | 4 | import { 5 | keyboardHideEvent, 6 | keyboardOpenEvent, 7 | scaledSize, 8 | } from '../../../jest/fixtures' 9 | import { useKeyboardDimensions } from '../useKeyboardDimensions' 10 | 11 | const emitter = new NativeEventEmitter() 12 | 13 | describe('useKeyboardDimensions', () => { 14 | it('returns correct dimensions', () => { 15 | expect.assertions(4) 16 | const { result, unmount } = renderHook(() => useKeyboardDimensions()) 17 | act(() => { 18 | emitter.emit('keyboardWillChangeFrame', keyboardOpenEvent) 19 | }) 20 | expect(result.current.keyboardEndPositionY).toBe(550) 21 | expect(result.current.keyboardHeight).toBe(346) 22 | act(() => { 23 | emitter.emit('keyboardWillChangeFrame', keyboardHideEvent) 24 | }) 25 | expect(result.current.keyboardEndPositionY).toBe(896) 26 | expect(result.current.keyboardHeight).toBe(0) 27 | unmount() 28 | }) 29 | 30 | it('returns correct dimensions with no animation duration', () => { 31 | expect.assertions(2) 32 | const event = { 33 | ...keyboardOpenEvent, 34 | duration: 0, 35 | } 36 | const { result } = renderHook(() => useKeyboardDimensions()) 37 | act(() => { 38 | emitter.emit('keyboardWillChangeFrame', event) 39 | }) 40 | expect(result.current.keyboardEndPositionY).toBe(550) 41 | expect(result.current.keyboardHeight).toBe(346) 42 | }) 43 | 44 | it('skips dimensions update if keyboard height does not change', () => { 45 | expect.assertions(2) 46 | const event = { 47 | ...keyboardOpenEvent, 48 | endCoordinates: { 49 | ...keyboardOpenEvent.endCoordinates, 50 | screenY: 896, 51 | }, 52 | } 53 | const { result } = renderHook(() => useKeyboardDimensions()) 54 | act(() => { 55 | emitter.emit('keyboardWillChangeFrame', event) 56 | }) 57 | expect(result.current.keyboardEndPositionY).toBe(896) 58 | expect(result.current.keyboardHeight).toBe(0) 59 | }) 60 | 61 | it('sets correct keyboardEndPositionY when device orientation changes', () => { 62 | expect.assertions(1) 63 | const { result } = renderHook(() => useKeyboardDimensions()) 64 | act(() => { 65 | emitter.emit('didUpdateDimensions', { 66 | screen: scaledSize, 67 | window: scaledSize, 68 | }) 69 | }) 70 | expect(result.current.keyboardEndPositionY).toBe(414) 71 | }) 72 | 73 | it('uses listeners on Android', () => { 74 | expect.assertions(4) 75 | jest.mock('react-native/Libraries/Utilities/Platform', () => ({ 76 | OS: 'android', 77 | select: jest.fn(), 78 | })) 79 | const { result, unmount } = renderHook(() => useKeyboardDimensions(true)) 80 | act(() => { 81 | emitter.emit('keyboardDidShow', keyboardOpenEvent) 82 | }) 83 | expect(result.current.keyboardEndPositionY).toBe(550) 84 | expect(result.current.keyboardHeight).toBe(346) 85 | act(() => { 86 | emitter.emit('keyboardDidHide', keyboardHideEvent) 87 | }) 88 | expect(result.current.keyboardEndPositionY).toBe(896) 89 | expect(result.current.keyboardHeight).toBe(0) 90 | unmount() 91 | }) 92 | }) 93 | -------------------------------------------------------------------------------- /src/hooks/__tests__/usePanResponder.test.tsx: -------------------------------------------------------------------------------- 1 | import { renderHook } from '@testing-library/react-hooks' 2 | 3 | import { usePanResponder } from '../usePanResponder' 4 | 5 | describe('usePanResponder', () => { 6 | it('returns default Y position', () => { 7 | expect.assertions(1) 8 | const { result } = renderHook(() => usePanResponder()) 9 | // Ignore `__getValue()` because it is a hidden property and 10 | // there is no other way to get a plain value from the Animated one 11 | // @ts-ignore 12 | expect(result.current.positionY.__getValue()).toBe(0) 13 | }) 14 | 15 | it('returns empty object instead of pan handlers on Android', () => { 16 | expect.assertions(1) 17 | jest.mock('react-native/Libraries/Utilities/Platform', () => ({ 18 | OS: 'android', 19 | })) 20 | const { result } = renderHook(() => usePanResponder()) 21 | expect(result.current.panHandlers).toStrictEqual({}) 22 | }) 23 | }) 24 | -------------------------------------------------------------------------------- /src/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export * from './useComponentSize' 2 | export * from './useKeyboardDimensions' 3 | export * from './usePanResponder' 4 | -------------------------------------------------------------------------------- /src/hooks/useComponentSize.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | import { LayoutChangeEvent } from 'react-native' 3 | 4 | /** 5 | * Calculates view's width & height based on the `onLayout` event. 6 | * @example 7 | * const [onLayout, size] = useComponentSize() 8 | * ... 9 | * // `size` will contain the size of this view 10 | */ 11 | export const useComponentSize = () => { 12 | const [size, setSize] = React.useState({ height: 0, width: 0 }) 13 | 14 | const onLayout = React.useCallback((event: LayoutChangeEvent) => { 15 | const { height, width } = event.nativeEvent.layout 16 | setSize({ height, width }) 17 | }, []) 18 | 19 | return { onLayout, size } 20 | } 21 | -------------------------------------------------------------------------------- /src/hooks/useKeyboardDimensions.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | import { 3 | Dimensions, 4 | EventSubscription, 5 | Keyboard, 6 | KeyboardEvent, 7 | LayoutAnimation, 8 | Platform, 9 | ScaledSize, 10 | } from 'react-native' 11 | import { useSafeAreaFrame } from 'react-native-safe-area-context' 12 | 13 | /** 14 | * Utility hook used to calculate keyboard dimensions. 15 | * 16 | * @param `useListenersOnAndroid` Will register keyboard listeners for Android 17 | * 18 | * ⚠️ You shouldn't use this hook on the same screen with `KeyboardAccessoryView` component, unexpected behavior might occur 19 | * @returns `keyboardEndPositionY` Keyboard's top line Y position 20 | * @returns `keyboardHeight` Keyboard's height 21 | */ 22 | export const useKeyboardDimensions = (useListenersOnAndroid?: boolean) => { 23 | const { height } = useSafeAreaFrame() 24 | const [state, setState] = React.useState({ 25 | keyboardEndPositionY: height, 26 | keyboardHeight: 0, 27 | }) 28 | 29 | React.useEffect(() => { 30 | const handleDimensionsChange = ({ window }: { window: ScaledSize }) => 31 | setState((current) => ({ 32 | ...current, 33 | keyboardEndPositionY: window.height, 34 | })) 35 | 36 | const resetKeyboardDimensions = () => 37 | setState({ 38 | keyboardEndPositionY: height, 39 | keyboardHeight: 0, 40 | }) 41 | 42 | const updateKeyboardDimensions = (event: KeyboardEvent) => 43 | setState((current) => { 44 | const { screenY: keyboardEndPositionY } = event.endCoordinates 45 | const keyboardHeight = height - keyboardEndPositionY 46 | 47 | if (keyboardHeight === current.keyboardHeight) { 48 | return current 49 | } 50 | 51 | const { duration, easing } = event 52 | 53 | if (duration && easing) { 54 | // We have to pass the duration equal to minimal 55 | // accepted duration defined here: RCTLayoutAnimation.m 56 | const animationDuration = Math.max(duration, 10) 57 | 58 | LayoutAnimation.configureNext({ 59 | duration: animationDuration, 60 | update: { 61 | duration: animationDuration, 62 | type: LayoutAnimation.Types[easing], 63 | }, 64 | }) 65 | } 66 | 67 | return { 68 | keyboardEndPositionY, 69 | keyboardHeight, 70 | } 71 | }) 72 | 73 | const dimensionsListener = Dimensions.addEventListener( 74 | 'change', 75 | handleDimensionsChange 76 | ) 77 | 78 | const keyboardListeners: EventSubscription[] = [] 79 | 80 | if (Platform.OS === 'android' && useListenersOnAndroid) { 81 | keyboardListeners.push( 82 | Keyboard.addListener('keyboardDidHide', resetKeyboardDimensions), 83 | Keyboard.addListener('keyboardDidShow', updateKeyboardDimensions) 84 | ) 85 | } else { 86 | keyboardListeners.push( 87 | Keyboard.addListener( 88 | 'keyboardWillChangeFrame', 89 | updateKeyboardDimensions 90 | ) 91 | ) 92 | } 93 | 94 | return () => { 95 | keyboardListeners.forEach((listener) => listener.remove()) 96 | // Since RN 0.65 we need to call `remove` on the listener, but on previous RN verisons it will result in a crash 97 | /* istanbul ignore next */ // @ts-ignore 98 | dimensionsListener 99 | ? // @ts-ignore 100 | dimensionsListener.remove() 101 | : Dimensions.removeEventListener('change', handleDimensionsChange) 102 | } 103 | }, [height, useListenersOnAndroid]) 104 | 105 | return state 106 | } 107 | -------------------------------------------------------------------------------- /src/hooks/usePanResponder.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | import { Animated, PanResponder, Platform } from 'react-native' 3 | 4 | /** 5 | * Returns `panHandlers` used to calculate Y finger position. 6 | * 7 | * Used to support interactive dismiss on iOS, on Android `panHandlers` is an empty object. 8 | * 9 | * ⚠️ You shouldn't use this hook if you don't use interactive dismiss on iOS. 10 | * @example 11 | * // `positionY` will be passed to the `KeyboardAccessoryView` component 12 | * const [panHandlers, positionY] = usePanResponder() 13 | * ... 14 | * 15 | */ 16 | export const usePanResponder = () => { 17 | const positionY = React.useRef(new Animated.Value(0)).current 18 | 19 | // Ignore PanResponder callbacks from the coverage since it is hard to simulate touches in a unit test 20 | /* istanbul ignore next */ 21 | const panResponder = React.useRef( 22 | PanResponder.create({ 23 | onPanResponderMove: Animated.event([null, { moveY: positionY }], { 24 | useNativeDriver: false, 25 | }), 26 | onPanResponderEnd: () => { 27 | setTimeout(() => { 28 | positionY.setValue(0) 29 | }, 10) 30 | }, 31 | }) 32 | ).current 33 | 34 | return { 35 | panHandlers: Platform.OS === 'android' ? {} : panResponder.panHandlers, 36 | positionY, 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './hooks' 2 | export * from './KeyboardAccessoryView' 3 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "esModuleInterop": true, 5 | "jsx": "react", 6 | "lib": ["ESNext"], 7 | "module": "ESNext", 8 | "moduleResolution": "Node", 9 | "noEmitOnError": true, 10 | "outDir": "./lib", 11 | "skipLibCheck": true, 12 | "sourceMap": true, 13 | "strict": true, 14 | "target": "ES2018", 15 | }, 16 | "exclude": ["**/__tests__/*"], 17 | "include": ["src"] 18 | } 19 | --------------------------------------------------------------------------------