├── .circleci └── config.yml ├── .editorconfig ├── .eslintignore ├── .gitattributes ├── .gitignore ├── Bubble-select-ios.gif ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── advanced-example.gif ├── android-example.gif ├── android ├── .project ├── .settings │ └── org.eclipse.buildship.core.prefs ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── reactnativebubbleselect.iml └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── reactnativebubbleselect │ │ ├── BubbleDeselectNodeEvent.kt │ │ ├── BubbleRemoveNodeEvent.kt │ │ ├── BubbleSelectNodeEvent.kt │ │ ├── BubbleSelectNodeView.kt │ │ ├── BubbleSelectNodeViewManager.kt │ │ ├── BubbleSelectPackage.kt │ │ ├── BubbleSelectView.kt │ │ └── BubbleSelectViewManager.kt │ └── res │ └── layout │ ├── bubble_node.xml │ └── bubble_view.xml ├── babel.config.js ├── bubble-min.mp4 ├── commitlint.config.js ├── example ├── android │ ├── .project │ ├── .settings │ │ └── org.eclipse.buildship.core.prefs │ ├── BubbleSelectExample.iml │ ├── app │ │ ├── app.iml │ │ ├── build.gradle │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── BubbleSelectExample │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── index.tsx ├── ios │ ├── BubbleSelectExample.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── BubbleSelectExample.xcscheme │ ├── BubbleSelectExample.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── BubbleSelectExample │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ ├── Podfile │ └── Podfile.lock ├── metro.config.js ├── package.json ├── src │ ├── App.tsx │ ├── cities.json │ ├── randomCity.ts │ └── randomColor.ts └── yarn.lock ├── ios ├── BubbleSelect-Bridging-Header.h ├── BubbleSelect.xcodeproj │ └── project.pbxproj ├── BubbleSelect.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Magnetic │ ├── Extensions.swift │ ├── Magnetic.swift │ ├── MagneticView.swift │ ├── Node.swift │ ├── SKAction+Color.swift │ └── SKMultilineLabelNode.swift ├── MagneticViewExtension.swift ├── RNBubbleMagneticView.swift ├── RNBubbleSelectNode.swift ├── RNBubbleSelectNodeViewManager.m ├── RNBubbleSelectNodeViewManager.swift ├── RNBubbleSelectViewManager.m └── RNBubbleSelectViewManager.swift ├── package.json ├── react-native-bubble-select.podspec ├── screenshot.png ├── src ├── Bubble.tsx ├── BubbleSelect.tsx ├── __tests__ │ └── index.test.tsx └── index.ts ├── swift-error.png ├── tsconfig.json └── yarn.lock /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | defaults: &defaults 4 | docker: 5 | - image: circleci/node:10 6 | working_directory: ~/project 7 | 8 | jobs: 9 | install-dependencies: 10 | <<: *defaults 11 | steps: 12 | - checkout 13 | - attach_workspace: 14 | at: ~/project 15 | - restore_cache: 16 | keys: 17 | - dependencies-{{ checksum "package.json" }} 18 | - dependencies- 19 | - restore_cache: 20 | keys: 21 | - dependencies-example-{{ checksum "example/package.json" }} 22 | - dependencies-example- 23 | - run: | 24 | yarn install --cwd example --frozen-lockfile 25 | yarn install --frozen-lockfile 26 | - save_cache: 27 | key: dependencies-{{ checksum "package.json" }} 28 | paths: node_modules 29 | - save_cache: 30 | key: dependencies-example-{{ checksum "example/package.json" }} 31 | paths: example/node_modules 32 | - persist_to_workspace: 33 | root: . 34 | paths: . 35 | lint: 36 | <<: *defaults 37 | steps: 38 | - attach_workspace: 39 | at: ~/project 40 | - run: | 41 | yarn lint 42 | typescript: 43 | <<: *defaults 44 | steps: 45 | - attach_workspace: 46 | at: ~/project 47 | - run: yarn typescript 48 | unit-tests: 49 | <<: *defaults 50 | steps: 51 | - attach_workspace: 52 | at: ~/project 53 | - run: yarn test --coverage 54 | - store_artifacts: 55 | path: coverage 56 | destination: coverage 57 | build-package: 58 | <<: *defaults 59 | steps: 60 | - attach_workspace: 61 | at: ~/project 62 | - run: yarn prepare 63 | 64 | 65 | workflows: 66 | version: 2 67 | build-and-test: 68 | jobs: 69 | - install-dependencies 70 | - lint: 71 | requires: 72 | - install-dependencies 73 | - typescript: 74 | requires: 75 | - install-dependencies 76 | - unit-tests: 77 | requires: 78 | - install-dependencies 79 | - build-package: 80 | requires: 81 | - install-dependencies 82 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | indent_style = space 10 | indent_size = 2 11 | 12 | end_of_line = lf 13 | charset = utf-8 14 | trim_trailing_whitespace = true 15 | insert_final_newline = true 16 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | example/ios/Pods 2 | example/node_modules 3 | lib -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # XDE 6 | .expo/ 7 | 8 | # VSCode 9 | .vscode/ 10 | jsconfig.json 11 | 12 | # Xcode 13 | # 14 | build/ 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | *.xccheckout 25 | *.moved-aside 26 | DerivedData 27 | *.hmap 28 | *.ipa 29 | *.xcuserstate 30 | project.xcworkspace 31 | 32 | # Android/IJ 33 | # 34 | .idea 35 | .gradle 36 | local.properties 37 | android.iml 38 | 39 | # Cocoapods 40 | # 41 | example/ios/Pods 42 | 43 | # node.js 44 | # 45 | node_modules/ 46 | npm-debug.log 47 | yarn-debug.log 48 | yarn-error.log 49 | 50 | # BUCK 51 | buck-out/ 52 | \.buckd/ 53 | android/app/libs 54 | android/keystores/debug.keystore 55 | 56 | # generated by bob 57 | lib/ 58 | -------------------------------------------------------------------------------- /Bubble-select-ios.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/Bubble-select-ios.gif -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. 4 | 5 | ## Development workflow 6 | 7 | To get started with the project, run `yarn bootstrap` in the root directory to install the required dependencies for each package: 8 | 9 | ```sh 10 | yarn bootstrap 11 | ``` 12 | 13 | While developing, you can run the [example app](/example/) to test your changes. 14 | 15 | To start the packager: 16 | 17 | ```sh 18 | yarn example start 19 | ``` 20 | 21 | To run the example app on Android: 22 | 23 | ```sh 24 | yarn example android 25 | ``` 26 | 27 | To run the example app on iOS: 28 | 29 | ```sh 30 | yarn example android 31 | ``` 32 | 33 | Make sure your code passes TypeScript and ESLint. Run the following to verify: 34 | 35 | ```sh 36 | yarn typescript 37 | yarn lint 38 | ``` 39 | 40 | To fix formatting errors, run the following: 41 | 42 | ```sh 43 | yarn lint --fix 44 | ``` 45 | 46 | Remember to add tests for your change if possible. Run the unit tests by: 47 | 48 | ```sh 49 | yarn test 50 | ``` 51 | 52 | ### Commit message convention 53 | 54 | We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages: 55 | 56 | - `fix`: bug fixes, e.g. fix crash due to deprecated method. 57 | - `feat`: new features, e.g. add new method to the module. 58 | - `refactor`: code refactor, e.g. migrate from class components to hooks. 59 | - `docs`: changes into documentation, e.g. add usage example for the module.. 60 | - `test`: adding or updating tests, eg add integration tests using detox. 61 | - `chore`: tooling changes, e.g. change CI config. 62 | 63 | Our pre-commit hooks verify that your commit message matches this format when committing. 64 | 65 | ### Linting and tests 66 | 67 | [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/) 68 | 69 | We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing. 70 | 71 | Our pre-commit hooks verify that the linter and tests pass when committing. 72 | 73 | ### Scripts 74 | 75 | The `package.json` file contains various scripts for common tasks: 76 | 77 | - `yarn bootstrap`: setup project by installing all dependencies and pods. 78 | - `yarn typescript`: type-check files with TypeScript. 79 | - `yarn lint`: lint files with ESLint. 80 | - `yarn test`: run unit tests with Jest. 81 | - `yarn example start`: start the Metro server for the example app. 82 | - `yarn example android`: run the example app on Android. 83 | - `yarn example ios`: run the example app on iOS. 84 | 85 | ### Sending a pull request 86 | 87 | > **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github). 88 | 89 | When you're sending a pull request: 90 | 91 | - Prefer small pull requests focused on one change. 92 | - Verify that linters and tests are passing. 93 | - Review the documentation to make sure it looks good. 94 | - Follow the pull request template when opening a pull request. 95 | - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue. 96 | 97 | ## Code of Conduct 98 | 99 | ### Our Pledge 100 | 101 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. 102 | 103 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. 104 | 105 | ### Our Standards 106 | 107 | Examples of behavior that contributes to a positive environment for our community include: 108 | 109 | - Demonstrating empathy and kindness toward other people 110 | - Being respectful of differing opinions, viewpoints, and experiences 111 | - Giving and gracefully accepting constructive feedback 112 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience 113 | - Focusing on what is best not just for us as individuals, but for the overall community 114 | 115 | Examples of unacceptable behavior include: 116 | 117 | - The use of sexualized language or imagery, and sexual attention or 118 | advances of any kind 119 | - Trolling, insulting or derogatory comments, and personal or political attacks 120 | - Public or private harassment 121 | - Publishing others' private information, such as a physical or email 122 | address, without their explicit permission 123 | - Other conduct which could reasonably be considered inappropriate in a 124 | professional setting 125 | 126 | ### Enforcement Responsibilities 127 | 128 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. 129 | 130 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. 131 | 132 | ### Scope 133 | 134 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. 135 | 136 | ### Enforcement 137 | 138 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly. 139 | 140 | All community leaders are obligated to respect the privacy and security of the reporter of any incident. 141 | 142 | ### Enforcement Guidelines 143 | 144 | Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: 145 | 146 | #### 1. Correction 147 | 148 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. 149 | 150 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. 151 | 152 | #### 2. Warning 153 | 154 | **Community Impact**: A violation through a single incident or series of actions. 155 | 156 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. 157 | 158 | #### 3. Temporary Ban 159 | 160 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. 161 | 162 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. 163 | 164 | #### 4. Permanent Ban 165 | 166 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. 167 | 168 | **Consequence**: A permanent ban from any sort of public interaction within the community. 169 | 170 | ### Attribution 171 | 172 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, 173 | available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 174 | 175 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). 176 | 177 | [homepage]: https://www.contributor-covenant.org 178 | 179 | For answers to common questions about this code of conduct, see the FAQ at 180 | https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. 181 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Jesse Onolememen 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 Bubble Select 2 | 3 | > This project is mostly `stale` at the moment. I haven't had time to maintain it, so the code is outdated. Feel free to open a pull request though and I will try review it once I get the chance to 4 | 5 | An easy-to-use customizable bubble animation picker, similar to the Apple Music genre selection 6 | 7 | ![Screenshot](./screenshot.png) 8 | 9 | ## Features 10 | 11 | - iOS & Android Support (In beta) 12 | - Typescript Support 13 | - Customizable 14 | 15 | ## iOS Example 16 | 17 | ![iOS Demo](./Bubble-select-ios.gif) 18 | 19 | Advanced Example 20 | 21 | ![Advanced iOS Demo](./advanced-example.gif) 22 | 23 | ## Android Example 24 | 25 | ![Android Demo](./android-example.gif) 26 | 27 | ## Installation 28 | 29 | Install the library using either yarn or npm like so: 30 | 31 | ```sh 32 | yarn add react-native-bubble-select 33 | ``` 34 | 35 | ```sh 36 | npm install --save react-native-bubble-select 37 | ``` 38 | 39 | ### iOS Installation 40 | 41 | If you're using React Native versions > 60.0, it's relatively straightforward. 42 | 43 | ```sh 44 | cd ios && pod install 45 | ``` 46 | 47 | For versions below 0.60.0, use rnpm links 48 | 49 | - Run `react-native link react-native-bubble-select` 50 | - If linking fails, follow the 51 | [manual linking steps](https://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking) 52 | 53 | #### Additional Steps 54 | 55 | This library was written in Swift, so in-order for you app to compile, you need to have at least on .swift file in your source code a bridging header to avoid a runtime error like so: 56 | 57 | ![swift error](./swift-error.png) 58 | 59 | All you have to do is: 60 | 61 | - File > New > File 62 | - Swift File 63 | - Name the file whatever you wish 64 | - When prompted to create a bridging header, do so 65 | 66 | You must also include `use_frameworks!` at the top of your `Podfile` 67 | 68 | ### Android Installation 69 | 70 | > **Note** as of version 0.5.0, android support is experimental. 71 | 72 | For versions below 0.60.0, follow the linking instructions above. 73 | 74 | ## Usage 75 | 76 | You can view the [example project](./example/src/App.tsx) for more usage. 77 | 78 | ### Simple Usage 79 | 80 | ```js 81 | import React from 'react'; 82 | import BubbleSelect, { Bubble } from 'react-native-bubble-select'; 83 | import { Dimensions } from 'react-native'; 84 | 85 | const { width, height } = Dimensions.get('window'); 86 | 87 | const App = () => { 88 | return ( 89 | console.log('Selected: ', bubble.id)} 91 | onDeselect={bubble => console.log('Deselected: ', bubble.id)} 92 | width={width} 93 | height={height} 94 | > 95 | 96 | 97 | 98 | 99 | 100 | ); 101 | }; 102 | ``` 103 | 104 | ### Advanced Usage 105 | 106 | ```tsx 107 | import React from 'react'; 108 | import { Platform, Dimensions } from 'react-native'; 109 | import BubbleSelect, { Bubble, BubbleNode } from 'react-native-bubble-select'; 110 | import randomCities from './randomCities'; 111 | 112 | const { width, height } = Dimensions.get('window'); 113 | 114 | const App = () => { 115 | const [cities, setCities] = React.useState(randomCities()); 116 | const [selectedCites, setSelectedCities] = React.useState([]); 117 | const [removedCities, setRemovedCities] = React.useState([]); 118 | 119 | const addCity = () => { 120 | setCities([...cities, randomCity()]); 121 | }; 122 | 123 | const handleSelect = (bubble: BubbleNode) => { 124 | setSelectedCities([...selectedCites, bubble]); 125 | }; 126 | 127 | const handleDeselect = (bubble: BubbleNode) => { 128 | setSelectedCities(selectedCites.filter(({ id }) => id !== bubble.id)); 129 | }; 130 | 131 | const handleRemove = (bubble: BubbleNode) => { 132 | setRemovedCities([...removedCities, bubble]); 133 | }; 134 | 135 | return ( 136 | 147 | {cities.map(city => ( 148 | 156 | ))} 157 | 158 | ); 159 | }; 160 | ``` 161 | 162 | ## Props 163 | 164 | ### Common Props 165 | 166 | | property | type | required | description | default | 167 | | --------------- | ------ | -------- | ---------------------------------------------------------------------- | ------------ | 168 | | id | string | TRUE | A custom identifier used for identifying the node | - | 169 | | text | string | TRUE | The text of the bubble. **Note: on android the text must be unique** | - | 170 | | color | string | FALSE | The background color of the bubble | black | 171 | | radius | number | FALSE | The radius of the bubble. This value is ignored if autoSize is enabled | 30 | 172 | | fontName | string | FALSE | The name of the custom font applied to the bubble | Avenir-Black | 173 | | fontSize | number | FALSE | The size of the custom font applied to the bubble | 13 | 174 | | fontColor | string | FALSE | The color of the bubble text | white | 175 | | backgroundColor | string | FALSE | The background color of the picker | white | 176 | 177 | ### iOS Only Props 178 | 179 | | property | type | required | description | default | 180 | | ----------------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | 181 | | id | string | TRUE | A custom identifier used for identifying the node | - | 182 | | text | string | TRUE | The text of the bubble. **Note: on android the text must be unique** | - | 183 | | color | string | FALSE | The background color of the bubble | black | 184 | | radius | number | FALSE | The radius of the bubble. This value is ignored if autoSize is enabled | 30 | 185 | | marginScale | number | FALSE | The margin scale applied to the physics body of the bubble. **recommend that you do not change this value unless you know what you are doing** | 1.01 | 186 | | fontName | string | FALSE | The name of the custom font applied to the bubble | Avenir-Black | 187 | | fontSize | number | FALSE | The size of the custom font applied to the bubble | 13 | 188 | | fontColor | string | FALSE | The color of the bubble text | white | 189 | | lineHeight | number | FALSE | The line height of the bubble. This value is ignored if autoSize is enabled | 1.5 | 190 | | borderColor | string | FALSE | The border color of the buble | - | 191 | | borderWidth | number | FALSE | The border width of the bubble | - | 192 | | padding | number | FALSE | Extra padding applied to the bubble contents, if autoSize is enabled | 20 | 193 | | selectedScale | number | FALSE | The scale of the selected bubble | 1.33 | 194 | | deselectedScale | number | FALSE | The scale of the deselected bubble | 1 | 195 | | animationDuration | number | FALSE | The duration of the scale animation | 0.2 | 196 | | selectedColor | string | FALSE | The background color of the selected bubble | - | 197 | | selectedFontColor | string | FALSE | The color of the selected bubble text | - | 198 | | autoSize | boolean | FALSE | Whether or not the bubble should resize to fit its content | TRUE | 199 | | initialSelection | string[] | FALSE | An id array of the initially selected nodes | - | 200 | 201 | ### Android Only Props 202 | 203 | | property | type | required | description | default | 204 | | ----------------- | -------- | -------- | ---------------------------------------------- | ------- | 205 | | bubbleSize | number | FALSE | The size of all the bubbles | - | 206 | | gradient | Gradient | FALSE | A custom gradient to be applied to the bubbles | - | 207 | | maxSelectionCount | number | FALSE | The max number of selected bubbles | - | 208 | 209 | #### Gradient 210 | 211 | | property | type | required | description | default | 212 | | ---------- | ------------------------------ | -------- | ---------------------------------------------- | ------- | 213 | | startColor | string | TRUE | The size of all the bubbles | - | 214 | | endColor | string | TRUE | A custom gradient to be applied to the bubbles | - | 215 | | direction | enum('vertical', 'horizontal') | TRUE | The direction of the gradient | - | 216 | 217 | > **Note** all required fields must be provided else the application will crash. 218 | 219 | ## Acknowledgments 220 | 221 | - The iOS version is based off of [Magnetic](https://github.com/efremidze/Magnetic) 222 | - The Android version is based off of [Bubble-Picker](https://github.com/igalata/Bubble-Picker) 223 | 224 | ## Known Issues 225 | 226 | ### iOS 227 | 228 | - on certain occasions only half of the bubbles are shown on the screen #2 229 | 230 | ### Android 231 | 232 | - the title of each bubble must be unique else the wrong element may be returned 233 | - hot reloading does not work #3 234 | - selection handlers are not triggered 235 | - after 5 items are selected, the picker rests, likewise with removed. 236 | 237 | ## Roadmap 238 | 239 | ### iOS 240 | 241 | - [ ] enable support for images 242 | 243 | ### Android 244 | 245 | - [ ] enable long press to remove 246 | - [ ] auto size bubble based on content 247 | - [ ] enable support for images 248 | 249 | ### General 250 | 251 | - [ ] Improve documentation 252 | - [ ] Unit tests 253 | - [ ] Flow support 254 | 255 | ## License 256 | 257 | MIT 258 | -------------------------------------------------------------------------------- /advanced-example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/advanced-example.gif -------------------------------------------------------------------------------- /android-example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/android-example.gif -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android_ 4 | Project android_ created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | arguments= 2 | auto.sync=false 3 | build.scans.enabled=false 4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.0)) 5 | connection.project.dir= 6 | eclipse.preferences.version=1 7 | gradle.user.home= 8 | java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home 9 | jvm.arguments= 10 | offline.mode=false 11 | override.workspace.settings=true 12 | show.console.view=true 13 | show.executions.view=true 14 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | // Buildscript is evaluated before everything else so we can't use getExtOrDefault 3 | def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['BubbleSelect_kotlinVersion'] 4 | 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.2.1' 12 | // noinspection DifferentKotlinGradleVersion 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | apply plugin: 'com.android.library' 18 | apply plugin: 'kotlin-android' 19 | 20 | def getExtOrDefault(name) { 21 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['BubbleSelect_' + name] 22 | } 23 | 24 | def getExtOrIntegerDefault(name) { 25 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['BubbleSelect_' + name]).toInteger() 26 | } 27 | 28 | android { 29 | compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') 30 | buildToolsVersion getExtOrDefault('buildToolsVersion') 31 | defaultConfig { 32 | minSdkVersion 23 33 | targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') 34 | versionCode 1 35 | versionName "1.0" 36 | } 37 | buildTypes { 38 | release { 39 | minifyEnabled false 40 | } 41 | } 42 | lintOptions { 43 | disable 'GradleCompatible' 44 | } 45 | compileOptions { 46 | sourceCompatibility JavaVersion.VERSION_1_8 47 | targetCompatibility JavaVersion.VERSION_1_8 48 | } 49 | } 50 | 51 | repositories { 52 | mavenCentral() 53 | jcenter() 54 | google() 55 | maven { url "https://jitpack.io" } 56 | 57 | def found = false 58 | def defaultDir = null 59 | def androidSourcesName = 'React Native sources' 60 | 61 | if (rootProject.ext.has('reactNativeAndroidRoot')) { 62 | defaultDir = rootProject.ext.get('reactNativeAndroidRoot') 63 | } else { 64 | defaultDir = new File( 65 | projectDir, 66 | '/../../../node_modules/react-native/android' 67 | ) 68 | } 69 | 70 | if (defaultDir.exists()) { 71 | maven { 72 | url defaultDir.toString() 73 | name androidSourcesName 74 | } 75 | 76 | logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}") 77 | found = true 78 | } else { 79 | def parentDir = rootProject.projectDir 80 | 81 | 1.upto(5, { 82 | if (found) return true 83 | parentDir = parentDir.parentFile 84 | 85 | def androidSourcesDir = new File( 86 | parentDir, 87 | 'node_modules/react-native' 88 | ) 89 | 90 | def androidPrebuiltBinaryDir = new File( 91 | parentDir, 92 | 'node_modules/react-native/android' 93 | ) 94 | 95 | if (androidPrebuiltBinaryDir.exists()) { 96 | maven { 97 | url androidPrebuiltBinaryDir.toString() 98 | name androidSourcesName 99 | } 100 | 101 | logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}") 102 | found = true 103 | } else if (androidSourcesDir.exists()) { 104 | maven { 105 | url androidSourcesDir.toString() 106 | name androidSourcesName 107 | } 108 | 109 | logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}") 110 | found = true 111 | } 112 | }) 113 | } 114 | 115 | if (!found) { 116 | throw new GradleException( 117 | "${project.name}: unable to locate React Native android sources. " + 118 | "Ensure you have you installed React Native as a dependency in your project and try again." 119 | ) 120 | } 121 | } 122 | 123 | def kotlin_version = getExtOrDefault('kotlinVersion') 124 | 125 | dependencies { 126 | // noinspection GradleDynamicVersion 127 | api 'com.facebook.react:react-native:+' 128 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 129 | implementation 'com.github.jesster2k10:Bubble-Picker:v0.3-beta' 130 | } 131 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | BubbleSelect_kotlinVersion=1.3.50 2 | BubbleSelect_compileSdkVersion=28 3 | BubbleSelect_buildToolsVersion=28.0.3 4 | BubbleSelect_targetSdkVersion=28 5 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Mar 29 17:44:13 IST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativebubbleselect/BubbleDeselectNodeEvent.kt: -------------------------------------------------------------------------------- 1 | package com.reactnativebubbleselect 2 | 3 | import com.facebook.react.bridge.Arguments 4 | import com.facebook.react.uimanager.events.Event 5 | import com.facebook.react.uimanager.events.RCTEventEmitter 6 | 7 | class BubbleDeselectNodeEvent(viewId: Int): Event(viewId) { 8 | companion object { 9 | const val EVENT_NAME = "onDeselectNode" 10 | } 11 | 12 | lateinit var node: BubbleSelectNodeView 13 | 14 | override fun getEventName(): String { 15 | return EVENT_NAME 16 | } 17 | 18 | override fun getCoalescingKey(): Short { 19 | return 0 20 | } 21 | 22 | override fun canCoalesce(): Boolean { 23 | return false 24 | } 25 | 26 | override fun dispatch(rctEventEmitter: RCTEventEmitter?) { 27 | val eventData = Arguments.createMap() 28 | eventData.putString("text", node.text) 29 | eventData.putString("id", node.id) 30 | eventData.putInt("target", viewTag) 31 | 32 | rctEventEmitter?.receiveEvent(viewTag, eventName, eventData) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativebubbleselect/BubbleRemoveNodeEvent.kt: -------------------------------------------------------------------------------- 1 | package com.reactnativebubbleselect 2 | 3 | import com.facebook.react.bridge.Arguments 4 | import com.facebook.react.uimanager.events.Event 5 | import com.facebook.react.uimanager.events.RCTEventEmitter 6 | 7 | class BubbleRemoveNodeEvent(viewId: Int): Event(viewId) { 8 | companion object { 9 | var EVENT_NAME = "onRemoveNode" 10 | } 11 | 12 | lateinit var item: BubbleSelectNodeView 13 | 14 | override fun getEventName(): String { 15 | return EVENT_NAME; 16 | } 17 | 18 | override fun getCoalescingKey(): Short { 19 | return 0 20 | } 21 | 22 | override fun canCoalesce(): Boolean { 23 | return false 24 | } 25 | 26 | override fun dispatch(rctEventEmitter: RCTEventEmitter?) { 27 | val eventData = Arguments.createMap() 28 | eventData.putString("id", item.id) 29 | eventData.putString("text", item.text) 30 | eventData.putInt("target", viewTag) 31 | 32 | rctEventEmitter?.receiveEvent(viewTag, eventName, eventData) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativebubbleselect/BubbleSelectNodeEvent.kt: -------------------------------------------------------------------------------- 1 | package com.reactnativebubbleselect 2 | 3 | import com.facebook.react.bridge.Arguments 4 | import com.facebook.react.uimanager.events.Event 5 | import com.facebook.react.uimanager.events.RCTEventEmitter 6 | 7 | class BubbleSelectNodeEvent(viewId: Int): Event(viewId) { 8 | companion object { 9 | const val EVENT_NAME = "onSelectNode" 10 | } 11 | 12 | lateinit var node: BubbleSelectNodeView 13 | 14 | override fun getEventName(): String { 15 | return EVENT_NAME 16 | } 17 | 18 | override fun getCoalescingKey(): Short { 19 | return 0 20 | } 21 | 22 | override fun canCoalesce(): Boolean { 23 | return false 24 | } 25 | 26 | override fun dispatch(rctEventEmitter: RCTEventEmitter?) { 27 | val eventData = Arguments.createMap() 28 | eventData.putString("text", node.text) 29 | eventData.putString("id", node.id) 30 | eventData.putInt("target", viewTag) 31 | 32 | rctEventEmitter?.receiveEvent(viewTag, eventName, eventData) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativebubbleselect/BubbleSelectNodeView.kt: -------------------------------------------------------------------------------- 1 | package com.reactnativebubbleselect 2 | 3 | import android.graphics.Color 4 | import android.graphics.Typeface 5 | import android.widget.LinearLayout 6 | import com.facebook.react.bridge.ReactContext 7 | import com.facebook.react.bridge.ReadableMap 8 | import com.igalata.bubblepicker.model.BubbleGradient 9 | 10 | class BubbleSelectNodeView(context: ReactContext): LinearLayout(context) { 11 | lateinit var id: String 12 | lateinit var text: String 13 | var fontFamily: String? = null 14 | var fontStyle: Int = Typeface.NORMAL 15 | var fontSize: Float = 14f 16 | var fontColor: String = "#ffffff" 17 | var color: String? = null 18 | var gradient: ReadableMap? = null 19 | 20 | init { 21 | inflate(context, R.layout.bubble_node, this) 22 | } 23 | 24 | fun setFontStyle(style: String?) { 25 | fontStyle = when (style) { 26 | "bold-italic" -> Typeface.BOLD_ITALIC 27 | "italic" -> Typeface.ITALIC 28 | "bold" -> Typeface.BOLD 29 | else -> Typeface.NORMAL 30 | } 31 | } 32 | 33 | fun getGradient(): BubbleGradient? { 34 | val mGradient = this.gradient; 35 | if (mGradient === null) { 36 | return null 37 | } 38 | 39 | val startColor = mGradient.getString("startColor"); 40 | val endColor = mGradient.getString("endColor"); 41 | val direction = when (mGradient.getString("direction")) { 42 | "horizontal" -> BubbleGradient.HORIZONTAL 43 | else -> BubbleGradient.VERTICAL 44 | } 45 | 46 | if (startColor === null || endColor === null) { 47 | return null 48 | } 49 | 50 | return BubbleGradient( 51 | Color.parseColor(startColor), 52 | Color.parseColor(endColor), 53 | direction 54 | ) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativebubbleselect/BubbleSelectNodeViewManager.kt: -------------------------------------------------------------------------------- 1 | package com.reactnativebubbleselect 2 | 3 | import com.facebook.react.bridge.ReadableMap 4 | import com.facebook.react.uimanager.SimpleViewManager 5 | import com.facebook.react.uimanager.ThemedReactContext 6 | import com.facebook.react.uimanager.annotations.ReactProp 7 | 8 | class BubbleSelectNodeViewManager: SimpleViewManager() { 9 | override fun getName(): String { 10 | return "RNBubbleSelectNodeView" 11 | } 12 | 13 | override fun createViewInstance(reactContext: ThemedReactContext): BubbleSelectNodeView { 14 | return BubbleSelectNodeView(reactContext) 15 | } 16 | 17 | @ReactProp(name = "text") 18 | fun setText(view: BubbleSelectNodeView, text: String?) { 19 | if (text == null) return 20 | view.text = text 21 | } 22 | 23 | @ReactProp(name = "id") 24 | fun setId(view: BubbleSelectNodeView, id: String?) { 25 | if (id == null) return 26 | view.id = id 27 | } 28 | 29 | @ReactProp(name = "fontFamily") 30 | fun setFontFamily(view: BubbleSelectNodeView, fontFamily: String?) { 31 | view.fontFamily = fontFamily 32 | } 33 | 34 | @ReactProp(name = "fontStyle") 35 | fun setFontStyle(view: BubbleSelectNodeView, fontStyle: String?) { 36 | view.run { setFontStyle(fontStyle) } 37 | } 38 | 39 | @ReactProp(name = "fontColor") 40 | fun setFontColor(view: BubbleSelectNodeView, fontColor: String?) { 41 | if (fontColor == null) return; 42 | view.fontColor = fontColor 43 | } 44 | 45 | @ReactProp(name = "color") 46 | fun setColor(view: BubbleSelectNodeView, color: String?) { 47 | view.color = color 48 | } 49 | 50 | @ReactProp(name = "gradient") 51 | fun setGradient(view: BubbleSelectNodeView, gradient: ReadableMap?) { 52 | view.gradient = gradient 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativebubbleselect/BubbleSelectPackage.kt: -------------------------------------------------------------------------------- 1 | package com.reactnativebubbleselect 2 | 3 | import java.util.Arrays 4 | import java.util.Collections 5 | 6 | import com.facebook.react.ReactPackage 7 | import com.facebook.react.bridge.NativeModule 8 | import com.facebook.react.bridge.ReactApplicationContext 9 | import com.facebook.react.uimanager.ViewManager 10 | import com.facebook.react.bridge.JavaScriptModule 11 | 12 | class BubbleSelectPackage : ReactPackage { 13 | override fun createNativeModules(reactContext: ReactApplicationContext): List { 14 | return emptyList() 15 | } 16 | 17 | override fun createViewManagers(reactContext: ReactApplicationContext): List> { 18 | return listOf( 19 | BubbleSelectViewManager(), 20 | BubbleSelectNodeViewManager() 21 | ) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativebubbleselect/BubbleSelectView.kt: -------------------------------------------------------------------------------- 1 | package com.reactnativebubbleselect 2 | 3 | import android.graphics.Color 4 | import android.graphics.Typeface 5 | import android.widget.FrameLayout 6 | import com.facebook.react.bridge.LifecycleEventListener 7 | import com.facebook.react.bridge.ReactContext 8 | import com.facebook.react.uimanager.UIManagerModule 9 | import com.facebook.react.uimanager.events.RCTEventEmitter 10 | import com.igalata.bubblepicker.adapter.BubblePickerAdapter 11 | import com.igalata.bubblepicker.model.BubbleGradient 12 | import com.igalata.bubblepicker.model.PickerItem 13 | import com.igalata.bubblepicker.rendering.BubblePicker 14 | import com.igalata.bubblepicker.BubblePickerListener 15 | 16 | class BubbleSelectView(context: ReactContext): FrameLayout(context), LifecycleEventListener, BubblePickerListener { 17 | val bubblePicker: BubblePicker 18 | val nodes: ArrayList = ArrayList() 19 | 20 | init { 21 | inflate(context, R.layout.bubble_view, this) 22 | bubblePicker = findViewById(R.id.bubble_picker); 23 | bubblePicker.listener = this; 24 | bubblePicker.maxSelectedCount = 10000 25 | context.addLifecycleEventListener(this); 26 | setupBubblePickerAdapter() 27 | } 28 | 29 | private fun setupBubblePickerAdapter() { 30 | bubblePicker.adapter = object : BubblePickerAdapter { 31 | override val totalCount: Int = nodes.size 32 | 33 | override fun getItem(position: Int): PickerItem { 34 | return PickerItem().apply { 35 | val node = nodes[position] 36 | title = node.text 37 | id = node.id 38 | if (node.fontFamily !== null) { 39 | typeface = Typeface.create(node.fontFamily, node.fontStyle) 40 | } 41 | textColor = Color.parseColor(node.fontColor) 42 | 43 | if (node.gradient !== null) { 44 | gradient = node.getGradient(); 45 | } else if (node.color !== null) { 46 | gradient = BubbleGradient( 47 | Color.parseColor(node.color), 48 | Color.parseColor(node.color), 49 | BubbleGradient.VERTICAL 50 | ) 51 | } 52 | } 53 | } 54 | } 55 | } 56 | 57 | fun addNode(node: BubbleSelectNodeView) { 58 | nodes.add(node) 59 | bubblePicker.addedItem(nodes.size - 1) 60 | } 61 | 62 | // fun removeNode(node: BubbleSelectNodeView) { 63 | // nodes.remove(node) 64 | // setupBubblePickerAdapter() 65 | // } 66 | 67 | override fun onHostPause() { 68 | bubblePicker.onPause() 69 | } 70 | 71 | override fun onHostResume() { 72 | bubblePicker.onResume() 73 | } 74 | 75 | override fun onHostDestroy() {} 76 | 77 | private fun findNode(item: PickerItem): BubbleSelectNodeView? { 78 | return nodes.find { 79 | it.id == item.id 80 | } 81 | } 82 | 83 | override fun onBubbleDeselected(item: PickerItem) { 84 | val node = findNode(item) ?: return 85 | val event = BubbleDeselectNodeEvent(id) 86 | event.node = node 87 | 88 | val reactContext = context as ReactContext 89 | reactContext.getNativeModule(UIManagerModule::class.java)?.eventDispatcher?.dispatchEvent(event) 90 | } 91 | 92 | override fun onBubbleSelected(item: PickerItem) { 93 | val node = findNode(item) ?: return 94 | val event = BubbleSelectNodeEvent(id) 95 | event.node = node 96 | 97 | val reactContext = context as ReactContext 98 | reactContext.getNativeModule(UIManagerModule::class.java)?.eventDispatcher?.dispatchEvent(event) 99 | } 100 | 101 | override fun onBubbleRemoved(item: PickerItem) { 102 | val node = findNode(item) ?: return 103 | val event = BubbleRemoveNodeEvent(id) 104 | event.item = node 105 | 106 | val reactContext = context as ReactContext 107 | reactContext.getNativeModule(UIManagerModule::class.java)?.eventDispatcher?.dispatchEvent(event) 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /android/src/main/java/com/reactnativebubbleselect/BubbleSelectViewManager.kt: -------------------------------------------------------------------------------- 1 | package com.reactnativebubbleselect 2 | 3 | import android.graphics.Color 4 | import android.graphics.drawable.ColorDrawable 5 | import android.view.View 6 | import com.facebook.react.common.MapBuilder 7 | import com.facebook.react.uimanager.ThemedReactContext 8 | import com.facebook.react.uimanager.ViewGroupManager 9 | import com.facebook.react.uimanager.annotations.ReactProp 10 | 11 | class BubbleSelectViewManager: ViewGroupManager() { 12 | override fun getName(): String { 13 | return "RNBubbleSelectView" 14 | } 15 | 16 | override fun createViewInstance(reactContext: ThemedReactContext): BubbleSelectView { 17 | return BubbleSelectView(reactContext) 18 | } 19 | 20 | @ReactProp(name = "maxSelectedItems") 21 | fun setMaxSelectedItems(view: BubbleSelectView, max: Int?) { 22 | if (max == null) return; 23 | view.bubblePicker.maxSelectedCount = max 24 | } 25 | 26 | @ReactProp(name = "bubbleSize") 27 | fun setBubbleSize(view: BubbleSelectView, size: Int?) { 28 | if (size == null) return 29 | view.bubblePicker.bubbleSize = size 30 | } 31 | 32 | @ReactProp(name = "backgroundColor") 33 | fun setBackgroundColor(view: BubbleSelectView, color: String?) { 34 | if (color == null) return 35 | view.background = ColorDrawable(Color.parseColor(color)) 36 | } 37 | 38 | override fun addView(parent: BubbleSelectView?, child: View?, index: Int) { 39 | if (child is BubbleSelectNodeView && parent !== null) { 40 | parent.addNode(child) 41 | } 42 | } 43 | 44 | override fun removeView(parent: BubbleSelectView?, child: View?) { 45 | if (child is BubbleSelectNodeView && parent !== null) { 46 | // parent.removeNode(child) 47 | } 48 | } 49 | 50 | override fun getExportedCustomDirectEventTypeConstants(): MutableMap { 51 | return MapBuilder.builder() 52 | .put(BubbleSelectNodeEvent.EVENT_NAME, MapBuilder.of( 53 | "registrationName", "onSelectNode" 54 | )) 55 | .put(BubbleDeselectNodeEvent.EVENT_NAME, MapBuilder.of( 56 | "registrationName", "onDeselectNode" 57 | )) 58 | .put(BubbleRemoveNodeEvent.EVENT_NAME, MapBuilder.of( 59 | "registrationName", "onRemoveNode" 60 | )) 61 | .build() 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /android/src/main/res/layout/bubble_node.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/src/main/res/layout/bubble_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /bubble-min.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/bubble-min.mp4 -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'], 3 | }; 4 | -------------------------------------------------------------------------------- /example/android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /example/android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir= 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /example/android/BubbleSelectExample.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 12 | 13 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format 22 | * bundleCommand: "ram-bundle", 23 | * 24 | * // whether to bundle JS and assets in debug mode 25 | * bundleInDebug: false, 26 | * 27 | * // whether to bundle JS and assets in release mode 28 | * bundleInRelease: true, 29 | * 30 | * // whether to bundle JS and assets in another build variant (if configured). 31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 32 | * // The configuration property can be in the following formats 33 | * // 'bundleIn${productFlavor}${buildType}' 34 | * // 'bundleIn${buildType}' 35 | * // bundleInFreeDebug: true, 36 | * // bundleInPaidRelease: true, 37 | * // bundleInBeta: true, 38 | * 39 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 40 | * // for BubbleSelectExample: to disable dev mode in the staging build type (if configured) 41 | * devDisabledInStaging: true, 42 | * // The configuration property can be in the following formats 43 | * // 'devDisabledIn${productFlavor}${buildType}' 44 | * // 'devDisabledIn${buildType}' 45 | * 46 | * // the root of your project, i.e. where "package.json" lives 47 | * root: "../../", 48 | * 49 | * // where to put the JS bundle asset in debug mode 50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 51 | * 52 | * // where to put the JS bundle asset in release mode 53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 54 | * 55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 56 | * // require('./image.png')), in debug mode 57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 58 | * 59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 60 | * // require('./image.png')), in release mode 61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 62 | * 63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 67 | * // for BubbleSelectExample, you might want to remove it from here. 68 | * inputExcludes: ["android/**", "ios/**"], 69 | * 70 | * // override which node gets called and with what additional arguments 71 | * nodeExecutableAndArgs: ["node"], 72 | * 73 | * // supply additional arguments to the packager 74 | * extraPackagerArgs: [] 75 | * ] 76 | */ 77 | 78 | project.ext.react = [ 79 | entryFile: "index.js", 80 | enableHermes: false, // clean and rebuild if changing 81 | ] 82 | 83 | apply from: "../../node_modules/react-native/react.gradle" 84 | 85 | /** 86 | * Set this to true to create two separate APKs instead of one: 87 | * - An APK that only works on ARM devices 88 | * - An APK that only works on x86 devices 89 | * The advantage is the size of the APK is reduced by about 4MB. 90 | * Upload all the APKs to the Play Store and people will download 91 | * the correct one based on the CPU architecture of their device. 92 | */ 93 | def enableSeparateBuildPerCPUArchitecture = false 94 | 95 | /** 96 | * Run Proguard to shrink the Java bytecode in release builds. 97 | */ 98 | def enableProguardInReleaseBuilds = false 99 | 100 | /** 101 | * The preferred build flavor of JavaScriptCore. 102 | * 103 | * For BubbleSelectExample, to use the international variant, you can use: 104 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 105 | * 106 | * The international variant includes ICU i18n library and necessary data 107 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 108 | * give correct results when using with locales other than en-US. Note that 109 | * this variant is about 6MiB larger per architecture than default. 110 | */ 111 | def jscFlavor = 'org.webkit:android-jsc:+' 112 | 113 | /** 114 | * Whether to enable the Hermes VM. 115 | * 116 | * This should be set on project.ext.react and mirrored here. If it is not set 117 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 118 | * and the benefits of using Hermes will therefore be sharply reduced. 119 | */ 120 | def enableHermes = project.ext.react.get("enableHermes", false); 121 | 122 | android { 123 | compileSdkVersion rootProject.ext.compileSdkVersion 124 | 125 | compileOptions { 126 | sourceCompatibility JavaVersion.VERSION_1_8 127 | targetCompatibility JavaVersion.VERSION_1_8 128 | } 129 | 130 | defaultConfig { 131 | applicationId "com.BubbleSelectExample" 132 | minSdkVersion rootProject.ext.minSdkVersion 133 | targetSdkVersion rootProject.ext.targetSdkVersion 134 | versionCode 1 135 | versionName "1.0" 136 | } 137 | splits { 138 | abi { 139 | reset() 140 | enable enableSeparateBuildPerCPUArchitecture 141 | universalApk false // If true, also generate a universal APK 142 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 143 | } 144 | } 145 | signingConfigs { 146 | debug { 147 | storeFile file('debug.keystore') 148 | storePassword 'android' 149 | keyAlias 'androiddebugkey' 150 | keyPassword 'android' 151 | } 152 | } 153 | buildTypes { 154 | debug { 155 | signingConfig signingConfigs.debug 156 | } 157 | release { 158 | // Caution! In production, you need to generate your own keystore file. 159 | // see https://facebook.github.io/react-native/docs/signed-apk-android. 160 | signingConfig signingConfigs.debug 161 | minifyEnabled enableProguardInReleaseBuilds 162 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 163 | } 164 | } 165 | // applicationVariants are e.g. debug, release 166 | applicationVariants.all { variant -> 167 | variant.outputs.each { output -> 168 | // For each separate APK per architecture, set a unique version code as described here: 169 | // https://developer.android.com/studio/build/configure-apk-splits.html 170 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 171 | def abi = output.getFilter(OutputFile.ABI) 172 | if (abi != null) { // null for the universal-debug, universal-release variants 173 | output.versionCodeOverride = 174 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 175 | } 176 | 177 | } 178 | } 179 | } 180 | 181 | dependencies { 182 | implementation fileTree(dir: "libs", include: ["*.jar"]) 183 | implementation "com.facebook.react:react-native:+" // From node_modules 184 | 185 | if (enableHermes) { 186 | def hermesPath = "../../node_modules/hermes-engine/android/"; 187 | debugImplementation files(hermesPath + "hermes-debug.aar") 188 | releaseImplementation files(hermesPath + "hermes-release.aar") 189 | } else { 190 | implementation jscFlavor 191 | } 192 | 193 | compile project(':reactnativebubbleselect') 194 | } 195 | 196 | // Run this once to be able to run the application with BUCK 197 | // puts all compile dependencies into folder libs for BUCK to use 198 | task copyDownloadableDepsToLibs(type: Copy) { 199 | from configurations.compile 200 | into 'libs' 201 | } 202 | 203 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 204 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/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 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/BubbleSelectExample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.BubbleSelectExample; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "BubbleSelectExample"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/BubbleSelectExample/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.BubbleSelectExample; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.soloader.SoLoader; 10 | import java.lang.reflect.InvocationTargetException; 11 | import java.util.List; 12 | 13 | import com.reactnativebubbleselect.BubbleSelectPackage; 14 | 15 | public class MainApplication extends Application implements ReactApplication { 16 | 17 | private final ReactNativeHost mReactNativeHost = 18 | new ReactNativeHost(this) { 19 | @Override 20 | public boolean getUseDeveloperSupport() { 21 | return BuildConfig.DEBUG; 22 | } 23 | 24 | @Override 25 | protected List getPackages() { 26 | @SuppressWarnings("UnnecessaryLocalVariable") 27 | List packages = new PackageList(this).getPackages(); 28 | // Packages that cannot be autolinked yet can be added manually here, for BubbleSelectExample: 29 | // packages.add(new MyReactNativePackage()); 30 | packages.add(new BubbleSelectPackage()); 31 | 32 | return packages; 33 | } 34 | 35 | @Override 36 | protected String getJSMainModuleName() { 37 | return "index"; 38 | } 39 | }; 40 | 41 | @Override 42 | public ReactNativeHost getReactNativeHost() { 43 | return mReactNativeHost; 44 | } 45 | 46 | @Override 47 | public void onCreate() { 48 | super.onCreate(); 49 | SoLoader.init(this, /* native exopackage */ false); 50 | initializeFlipper(this); // Remove this line if you don't want Flipper enabled 51 | } 52 | 53 | /** 54 | * Loads Flipper in React Native templates. 55 | * 56 | * @param context 57 | */ 58 | private static void initializeFlipper(Context context) { 59 | if (BuildConfig.DEBUG) { 60 | try { 61 | /* 62 | We use reflection here to pick up the class that initializes Flipper, 63 | since Flipper library is not available in release mode 64 | */ 65 | Class aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper"); 66 | aClass.getMethod("initializeFlipper", Context.class).invoke(null, context); 67 | } catch (ClassNotFoundException e) { 68 | e.printStackTrace(); 69 | } catch (NoSuchMethodException e) { 70 | e.printStackTrace(); 71 | } catch (IllegalAccessException e) { 72 | e.printStackTrace(); 73 | } catch (InvocationTargetException e) { 74 | e.printStackTrace(); 75 | } 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/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/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/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/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/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/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/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/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/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/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/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/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/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/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/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/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/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/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | BubbleSelect 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 = "28.0.3" 6 | minSdkVersion = 23 7 | compileSdkVersion = 28 8 | targetSdkVersion = 28 9 | } 10 | repositories { 11 | google() 12 | jcenter() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle:3.4.2") 16 | 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | mavenLocal() 25 | maven { 26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 27 | url("$rootDir/../node_modules/react-native/android") 28 | } 29 | maven { 30 | // Android JSC is installed from npm 31 | url("$rootDir/../node_modules/jsc-android/dist") 32 | } 33 | 34 | google() 35 | jcenter() 36 | maven { url 'https://jitpack.io' } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useAndroidX=true 21 | android.enableJetifier=true 22 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jesster2k10/react-native-bubble-select/5e6b091e3ed7f243d87ded8b85880a7dbf68de89/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin, switch paths to Windows format before running java 129 | if $cygwin ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=$((i+1)) 158 | done 159 | case $i in 160 | (0) set -- ;; 161 | (1) set -- "$args0" ;; 162 | (2) set -- "$args0" "$args1" ;; 163 | (3) set -- "$args0" "$args1" "$args2" ;; 164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=$(save "$@") 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 185 | cd "$(dirname "$0")" 186 | fi 187 | 188 | exec "$JAVACMD" "$@" 189 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem http://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 34 | 35 | @rem Find java.exe 36 | if defined JAVA_HOME goto findJavaFromJavaHome 37 | 38 | set JAVA_EXE=java.exe 39 | %JAVA_EXE% -version >NUL 2>&1 40 | if "%ERRORLEVEL%" == "0" goto init 41 | 42 | echo. 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 44 | echo. 45 | echo Please set the JAVA_HOME variable in your environment to match the 46 | echo location of your Java installation. 47 | 48 | goto fail 49 | 50 | :findJavaFromJavaHome 51 | set JAVA_HOME=%JAVA_HOME:"=% 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 53 | 54 | if exist "%JAVA_EXE%" goto init 55 | 56 | echo. 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 58 | echo. 59 | echo Please set the JAVA_HOME variable in your environment to match the 60 | echo location of your Java installation. 61 | 62 | goto fail 63 | 64 | :init 65 | @rem Get command-line arguments, handling Windows variants 66 | 67 | if not "%OS%" == "Windows_NT" goto win9xME_args 68 | 69 | :win9xME_args 70 | @rem Slurp the command line arguments. 71 | set CMD_LINE_ARGS= 72 | set _SKIP=2 73 | 74 | :win9xME_args_slurp 75 | if "x%~1" == "x" goto execute 76 | 77 | set CMD_LINE_ARGS=%* 78 | 79 | :execute 80 | @rem Setup the command line 81 | 82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 83 | 84 | @rem Execute Gradle 85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 86 | 87 | :end 88 | @rem End local scope for the variables with windows NT shell 89 | if "%ERRORLEVEL%"=="0" goto mainEnd 90 | 91 | :fail 92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 93 | rem the _cmd.exe /c_ return code! 94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 95 | exit /b 1 96 | 97 | :mainEnd 98 | if "%OS%"=="Windows_NT" endlocal 99 | 100 | :omega 101 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'BubbleSelectExample' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | 5 | include ':reactnativebubbleselect' 6 | project(':reactnativebubbleselect').projectDir = new File(rootProject.projectDir, '../../android') 7 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "BubbleSelectExample", 3 | "displayName": "BubbleSelect Example" 4 | } 5 | -------------------------------------------------------------------------------- /example/index.tsx: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import App from './src/App'; 3 | import { name as appName } from './app.json'; 4 | 5 | AppRegistry.registerComponent(appName, () => App); 6 | -------------------------------------------------------------------------------- /example/ios/BubbleSelectExample.xcodeproj/xcshareddata/xcschemes/BubbleSelectExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 81 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /example/ios/BubbleSelectExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/BubbleSelectExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/BubbleSelectExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (nonatomic, strong) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /example/ios/BubbleSelectExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 19 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 20 | moduleName:@"BubbleSelectExample" 21 | initialProperties:nil]; 22 | 23 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 24 | 25 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 26 | UIViewController *rootViewController = [UIViewController new]; 27 | rootViewController.view = rootView; 28 | self.window.rootViewController = rootViewController; 29 | [self.window makeKeyAndVisible]; 30 | return YES; 31 | } 32 | 33 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 34 | { 35 | #if DEBUG 36 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 37 | #else 38 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 39 | #endif 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /example/ios/BubbleSelectExample/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/ios/BubbleSelectExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /example/ios/BubbleSelectExample/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/BubbleSelectExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | BubbleSelect 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 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSExceptionDomains 32 | 33 | localhost 34 | 35 | NSExceptionAllowsInsecureHTTPLoads 36 | 37 | 38 | 39 | 40 | NSLocationWhenInUseUsageDescription 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UIViewControllerBasedStatusBarAppearance 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /example/ios/BubbleSelectExample/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | use_frameworks! 4 | 5 | target 'BubbleSelectExample' do 6 | # Pods for BubbleSelectExample 7 | pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" 8 | pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" 9 | pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" 10 | pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" 11 | pod 'React', :path => '../node_modules/react-native/' 12 | pod 'React-Core', :path => '../node_modules/react-native/' 13 | pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules' 14 | pod 'React-Core/DevSupport', :path => '../node_modules/react-native/' 15 | pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' 16 | pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' 17 | pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' 18 | pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' 19 | pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' 20 | pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' 21 | pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' 22 | pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' 23 | pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' 24 | pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/' 25 | 26 | pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' 27 | pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' 28 | pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' 29 | pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' 30 | pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon" 31 | pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" 32 | pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga' 33 | 34 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' 35 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' 36 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' 37 | 38 | pod 'react-native-bubble-select', :path => '../..' 39 | 40 | use_native_modules! 41 | end 42 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost-for-react-native (1.63.0) 3 | - DoubleConversion (1.1.6) 4 | - FBLazyVector (0.61.5) 5 | - FBReactNativeSpec (0.61.5): 6 | - Folly (= 2018.10.22.00) 7 | - RCTRequired (= 0.61.5) 8 | - RCTTypeSafety (= 0.61.5) 9 | - React-Core (= 0.61.5) 10 | - React-jsi (= 0.61.5) 11 | - ReactCommon/turbomodule/core (= 0.61.5) 12 | - Folly (2018.10.22.00): 13 | - boost-for-react-native 14 | - DoubleConversion 15 | - Folly/Default (= 2018.10.22.00) 16 | - glog 17 | - Folly/Default (2018.10.22.00): 18 | - boost-for-react-native 19 | - DoubleConversion 20 | - glog 21 | - glog (0.3.5) 22 | - RCTRequired (0.61.5) 23 | - RCTTypeSafety (0.61.5): 24 | - FBLazyVector (= 0.61.5) 25 | - Folly (= 2018.10.22.00) 26 | - RCTRequired (= 0.61.5) 27 | - React-Core (= 0.61.5) 28 | - React (0.61.5): 29 | - React-Core (= 0.61.5) 30 | - React-Core/DevSupport (= 0.61.5) 31 | - React-Core/RCTWebSocket (= 0.61.5) 32 | - React-RCTActionSheet (= 0.61.5) 33 | - React-RCTAnimation (= 0.61.5) 34 | - React-RCTBlob (= 0.61.5) 35 | - React-RCTImage (= 0.61.5) 36 | - React-RCTLinking (= 0.61.5) 37 | - React-RCTNetwork (= 0.61.5) 38 | - React-RCTSettings (= 0.61.5) 39 | - React-RCTText (= 0.61.5) 40 | - React-RCTVibration (= 0.61.5) 41 | - React-Core (0.61.5): 42 | - Folly (= 2018.10.22.00) 43 | - glog 44 | - React-Core/Default (= 0.61.5) 45 | - React-cxxreact (= 0.61.5) 46 | - React-jsi (= 0.61.5) 47 | - React-jsiexecutor (= 0.61.5) 48 | - Yoga 49 | - React-Core/CoreModulesHeaders (0.61.5): 50 | - Folly (= 2018.10.22.00) 51 | - glog 52 | - React-Core/Default 53 | - React-cxxreact (= 0.61.5) 54 | - React-jsi (= 0.61.5) 55 | - React-jsiexecutor (= 0.61.5) 56 | - Yoga 57 | - React-Core/Default (0.61.5): 58 | - Folly (= 2018.10.22.00) 59 | - glog 60 | - React-cxxreact (= 0.61.5) 61 | - React-jsi (= 0.61.5) 62 | - React-jsiexecutor (= 0.61.5) 63 | - Yoga 64 | - React-Core/DevSupport (0.61.5): 65 | - Folly (= 2018.10.22.00) 66 | - glog 67 | - React-Core/Default (= 0.61.5) 68 | - React-Core/RCTWebSocket (= 0.61.5) 69 | - React-cxxreact (= 0.61.5) 70 | - React-jsi (= 0.61.5) 71 | - React-jsiexecutor (= 0.61.5) 72 | - React-jsinspector (= 0.61.5) 73 | - Yoga 74 | - React-Core/RCTActionSheetHeaders (0.61.5): 75 | - Folly (= 2018.10.22.00) 76 | - glog 77 | - React-Core/Default 78 | - React-cxxreact (= 0.61.5) 79 | - React-jsi (= 0.61.5) 80 | - React-jsiexecutor (= 0.61.5) 81 | - Yoga 82 | - React-Core/RCTAnimationHeaders (0.61.5): 83 | - Folly (= 2018.10.22.00) 84 | - glog 85 | - React-Core/Default 86 | - React-cxxreact (= 0.61.5) 87 | - React-jsi (= 0.61.5) 88 | - React-jsiexecutor (= 0.61.5) 89 | - Yoga 90 | - React-Core/RCTBlobHeaders (0.61.5): 91 | - Folly (= 2018.10.22.00) 92 | - glog 93 | - React-Core/Default 94 | - React-cxxreact (= 0.61.5) 95 | - React-jsi (= 0.61.5) 96 | - React-jsiexecutor (= 0.61.5) 97 | - Yoga 98 | - React-Core/RCTImageHeaders (0.61.5): 99 | - Folly (= 2018.10.22.00) 100 | - glog 101 | - React-Core/Default 102 | - React-cxxreact (= 0.61.5) 103 | - React-jsi (= 0.61.5) 104 | - React-jsiexecutor (= 0.61.5) 105 | - Yoga 106 | - React-Core/RCTLinkingHeaders (0.61.5): 107 | - Folly (= 2018.10.22.00) 108 | - glog 109 | - React-Core/Default 110 | - React-cxxreact (= 0.61.5) 111 | - React-jsi (= 0.61.5) 112 | - React-jsiexecutor (= 0.61.5) 113 | - Yoga 114 | - React-Core/RCTNetworkHeaders (0.61.5): 115 | - Folly (= 2018.10.22.00) 116 | - glog 117 | - React-Core/Default 118 | - React-cxxreact (= 0.61.5) 119 | - React-jsi (= 0.61.5) 120 | - React-jsiexecutor (= 0.61.5) 121 | - Yoga 122 | - React-Core/RCTSettingsHeaders (0.61.5): 123 | - Folly (= 2018.10.22.00) 124 | - glog 125 | - React-Core/Default 126 | - React-cxxreact (= 0.61.5) 127 | - React-jsi (= 0.61.5) 128 | - React-jsiexecutor (= 0.61.5) 129 | - Yoga 130 | - React-Core/RCTTextHeaders (0.61.5): 131 | - Folly (= 2018.10.22.00) 132 | - glog 133 | - React-Core/Default 134 | - React-cxxreact (= 0.61.5) 135 | - React-jsi (= 0.61.5) 136 | - React-jsiexecutor (= 0.61.5) 137 | - Yoga 138 | - React-Core/RCTVibrationHeaders (0.61.5): 139 | - Folly (= 2018.10.22.00) 140 | - glog 141 | - React-Core/Default 142 | - React-cxxreact (= 0.61.5) 143 | - React-jsi (= 0.61.5) 144 | - React-jsiexecutor (= 0.61.5) 145 | - Yoga 146 | - React-Core/RCTWebSocket (0.61.5): 147 | - Folly (= 2018.10.22.00) 148 | - glog 149 | - React-Core/Default (= 0.61.5) 150 | - React-cxxreact (= 0.61.5) 151 | - React-jsi (= 0.61.5) 152 | - React-jsiexecutor (= 0.61.5) 153 | - Yoga 154 | - React-CoreModules (0.61.5): 155 | - FBReactNativeSpec (= 0.61.5) 156 | - Folly (= 2018.10.22.00) 157 | - RCTTypeSafety (= 0.61.5) 158 | - React-Core/CoreModulesHeaders (= 0.61.5) 159 | - React-RCTImage (= 0.61.5) 160 | - ReactCommon/turbomodule/core (= 0.61.5) 161 | - React-cxxreact (0.61.5): 162 | - boost-for-react-native (= 1.63.0) 163 | - DoubleConversion 164 | - Folly (= 2018.10.22.00) 165 | - glog 166 | - React-jsinspector (= 0.61.5) 167 | - React-jsi (0.61.5): 168 | - boost-for-react-native (= 1.63.0) 169 | - DoubleConversion 170 | - Folly (= 2018.10.22.00) 171 | - glog 172 | - React-jsi/Default (= 0.61.5) 173 | - React-jsi/Default (0.61.5): 174 | - boost-for-react-native (= 1.63.0) 175 | - DoubleConversion 176 | - Folly (= 2018.10.22.00) 177 | - glog 178 | - React-jsiexecutor (0.61.5): 179 | - DoubleConversion 180 | - Folly (= 2018.10.22.00) 181 | - glog 182 | - React-cxxreact (= 0.61.5) 183 | - React-jsi (= 0.61.5) 184 | - React-jsinspector (0.61.5) 185 | - react-native-bubble-select (0.4.1): 186 | - React 187 | - React-RCTActionSheet (0.61.5): 188 | - React-Core/RCTActionSheetHeaders (= 0.61.5) 189 | - React-RCTAnimation (0.61.5): 190 | - React-Core/RCTAnimationHeaders (= 0.61.5) 191 | - React-RCTBlob (0.61.5): 192 | - React-Core/RCTBlobHeaders (= 0.61.5) 193 | - React-Core/RCTWebSocket (= 0.61.5) 194 | - React-jsi (= 0.61.5) 195 | - React-RCTNetwork (= 0.61.5) 196 | - React-RCTImage (0.61.5): 197 | - React-Core/RCTImageHeaders (= 0.61.5) 198 | - React-RCTNetwork (= 0.61.5) 199 | - React-RCTLinking (0.61.5): 200 | - React-Core/RCTLinkingHeaders (= 0.61.5) 201 | - React-RCTNetwork (0.61.5): 202 | - React-Core/RCTNetworkHeaders (= 0.61.5) 203 | - React-RCTSettings (0.61.5): 204 | - React-Core/RCTSettingsHeaders (= 0.61.5) 205 | - React-RCTText (0.61.5): 206 | - React-Core/RCTTextHeaders (= 0.61.5) 207 | - React-RCTVibration (0.61.5): 208 | - React-Core/RCTVibrationHeaders (= 0.61.5) 209 | - ReactCommon/jscallinvoker (0.61.5): 210 | - DoubleConversion 211 | - Folly (= 2018.10.22.00) 212 | - glog 213 | - React-cxxreact (= 0.61.5) 214 | - ReactCommon/turbomodule/core (0.61.5): 215 | - DoubleConversion 216 | - Folly (= 2018.10.22.00) 217 | - glog 218 | - React-Core (= 0.61.5) 219 | - React-cxxreact (= 0.61.5) 220 | - React-jsi (= 0.61.5) 221 | - ReactCommon/jscallinvoker (= 0.61.5) 222 | - Yoga (1.14.0) 223 | 224 | DEPENDENCIES: 225 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 226 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 227 | - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`) 228 | - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) 229 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 230 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 231 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 232 | - React (from `../node_modules/react-native/`) 233 | - React-Core (from `../node_modules/react-native/`) 234 | - React-Core/DevSupport (from `../node_modules/react-native/`) 235 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 236 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 237 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 238 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 239 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 240 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 241 | - react-native-bubble-select (from `../..`) 242 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 243 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 244 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 245 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 246 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 247 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 248 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 249 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 250 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 251 | - ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`) 252 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 253 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 254 | 255 | SPEC REPOS: 256 | trunk: 257 | - boost-for-react-native 258 | 259 | EXTERNAL SOURCES: 260 | DoubleConversion: 261 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 262 | FBLazyVector: 263 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 264 | FBReactNativeSpec: 265 | :path: "../node_modules/react-native/Libraries/FBReactNativeSpec" 266 | Folly: 267 | :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec" 268 | glog: 269 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 270 | RCTRequired: 271 | :path: "../node_modules/react-native/Libraries/RCTRequired" 272 | RCTTypeSafety: 273 | :path: "../node_modules/react-native/Libraries/TypeSafety" 274 | React: 275 | :path: "../node_modules/react-native/" 276 | React-Core: 277 | :path: "../node_modules/react-native/" 278 | React-CoreModules: 279 | :path: "../node_modules/react-native/React/CoreModules" 280 | React-cxxreact: 281 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 282 | React-jsi: 283 | :path: "../node_modules/react-native/ReactCommon/jsi" 284 | React-jsiexecutor: 285 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 286 | React-jsinspector: 287 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 288 | react-native-bubble-select: 289 | :path: "../.." 290 | React-RCTActionSheet: 291 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 292 | React-RCTAnimation: 293 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 294 | React-RCTBlob: 295 | :path: "../node_modules/react-native/Libraries/Blob" 296 | React-RCTImage: 297 | :path: "../node_modules/react-native/Libraries/Image" 298 | React-RCTLinking: 299 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 300 | React-RCTNetwork: 301 | :path: "../node_modules/react-native/Libraries/Network" 302 | React-RCTSettings: 303 | :path: "../node_modules/react-native/Libraries/Settings" 304 | React-RCTText: 305 | :path: "../node_modules/react-native/Libraries/Text" 306 | React-RCTVibration: 307 | :path: "../node_modules/react-native/Libraries/Vibration" 308 | ReactCommon: 309 | :path: "../node_modules/react-native/ReactCommon" 310 | Yoga: 311 | :path: "../node_modules/react-native/ReactCommon/yoga" 312 | 313 | SPEC CHECKSUMS: 314 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c 315 | DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2 316 | FBLazyVector: aaeaf388755e4f29cd74acbc9e3b8da6d807c37f 317 | FBReactNativeSpec: 118d0d177724c2d67f08a59136eb29ef5943ec75 318 | Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51 319 | glog: 1f3da668190260b06b429bb211bfbee5cd790c28 320 | RCTRequired: b153add4da6e7dbc44aebf93f3cf4fcae392ddf1 321 | RCTTypeSafety: 9aa1b91d7f9310fc6eadc3cf95126ffe818af320 322 | React: b6a59ef847b2b40bb6e0180a97d0ca716969ac78 323 | React-Core: 688b451f7d616cc1134ac95295b593d1b5158a04 324 | React-CoreModules: d04f8494c1a328b69ec11db9d1137d667f916dcb 325 | React-cxxreact: d0f7bcafa196ae410e5300736b424455e7fb7ba7 326 | React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7 327 | React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386 328 | React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0 329 | react-native-bubble-select: a442625a79e6bfc7b1d59915bf97497045e7fa33 330 | React-RCTActionSheet: 600b4d10e3aea0913b5a92256d2719c0cdd26d76 331 | React-RCTAnimation: 791a87558389c80908ed06cc5dfc5e7920dfa360 332 | React-RCTBlob: d89293cc0236d9cb0933d85e430b0bbe81ad1d72 333 | React-RCTImage: 6b8e8df449eb7c814c99a92d6b52de6fe39dea4e 334 | React-RCTLinking: 121bb231c7503cf9094f4d8461b96a130fabf4a5 335 | React-RCTNetwork: fb353640aafcee84ca8b78957297bd395f065c9a 336 | React-RCTSettings: 8db258ea2a5efee381fcf7a6d5044e2f8b68b640 337 | React-RCTText: 9ccc88273e9a3aacff5094d2175a605efa854dbe 338 | React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad 339 | ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd 340 | Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b 341 | 342 | PODFILE CHECKSUM: 03bd40bb176112a5301efe775fc68a96aaa45413 343 | 344 | COCOAPODS: 1.8.4 345 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const fs = require('fs'); 3 | const blacklist = require('metro-config/src/defaults/blacklist'); 4 | const escape = require('escape-string-regexp'); 5 | 6 | const root = path.resolve(__dirname, '..'); 7 | const pak = JSON.parse( 8 | fs.readFileSync(path.join(root, 'package.json'), 'utf8') 9 | ); 10 | 11 | const modules = [ 12 | '@babel/runtime', 13 | ...Object.keys({ 14 | ...pak.dependencies, 15 | ...pak.peerDependencies, 16 | }), 17 | ]; 18 | 19 | module.exports = { 20 | projectRoot: __dirname, 21 | watchFolders: [root], 22 | 23 | resolver: { 24 | blacklistRE: blacklist([ 25 | new RegExp(`^${escape(path.join(root, 'node_modules'))}\\/.*$`), 26 | ]), 27 | 28 | extraNodeModules: modules.reduce((acc, name) => { 29 | acc[name] = path.join(__dirname, 'node_modules', name); 30 | return acc; 31 | }, {}), 32 | }, 33 | 34 | transformer: { 35 | getTransformOptions: async () => ({ 36 | transform: { 37 | experimentalImportSupport: false, 38 | inlineRequires: true, 39 | }, 40 | }), 41 | }, 42 | }; 43 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-bubble-select-example", 3 | "description": "Example app for react-native-bubble-select", 4 | "version": "0.0.1", 5 | "private": true, 6 | "scripts": { 7 | "android": "react-native run-android", 8 | "ios": "react-native run-ios", 9 | "start": "react-native start" 10 | }, 11 | "dependencies": { 12 | "react": "16.9.0", 13 | "react-native": "0.61.5" 14 | }, 15 | "devDependencies": { 16 | "@babel/core": "^7.8.4", 17 | "@babel/runtime": "^7.8.4", 18 | "metro-react-native-babel-preset": "^0.58.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /example/src/App.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { 3 | StyleSheet, 4 | View, 5 | Text, 6 | SafeAreaView, 7 | Button, 8 | Platform, 9 | Dimensions, 10 | } from 'react-native'; 11 | import BubbleSelect, { Bubble, BubbleNode } from 'react-native-bubble-select'; 12 | import randomCity, { randomCities } from './randomCity'; 13 | 14 | const { width, height } = Dimensions.get('window'); 15 | 16 | export default function App() { 17 | const [cities, setCities] = React.useState([]); 18 | const [force, setForce] = React.useState(false); 19 | const [selectedCites, setSelectedCities] = React.useState([]); 20 | const [removedCities, setRemovedCities] = React.useState([]); 21 | 22 | React.useEffect(() => { 23 | if (force) { 24 | setCities(randomCities()); 25 | } 26 | }, [force]); 27 | 28 | React.useEffect(() => { 29 | if (Platform.OS === 'ios') { 30 | setForce(true); 31 | } else { 32 | setCities(randomCities()); 33 | } 34 | }, []); 35 | 36 | const addCity = () => { 37 | setCities([...cities, randomCity()]); 38 | }; 39 | 40 | const handleSelect = (bubble: BubbleNode) => { 41 | setSelectedCities([...selectedCites, bubble]); 42 | }; 43 | 44 | const handleDeselect = (bubble: BubbleNode) => { 45 | setSelectedCities(selectedCites.filter(({ id }) => id !== bubble.id)); 46 | }; 47 | 48 | const handleRemove = (bubble: BubbleNode) => { 49 | console.log(bubble); 50 | setRemovedCities([...removedCities, bubble]); 51 | }; 52 | 53 | return ( 54 | 55 | 56 | 57 | Discover New Cities 58 | 59 | Tap on the places you love, hold on the places you don't. 60 | 61 | {selectedCites.length > 0 ? ( 62 | 63 | Selected: {selectedCites.map(city => city.text).join(', ')} 64 | 65 | ) : null} 66 | {removedCities.length > 0 ? ( 67 | 68 | Removed: {removedCities.map(city => city.text).join(', ')} 69 | 70 | ) : null} 71 | 72 | 85 | {cities.map(city => ( 86 | 95 | ))} 96 | 97 | 98 |