diff --git a/.gitignore b/.gitignore index eb1535e4..8cf2d1ee 100644 --- a/.gitignore +++ b/.gitignore @@ -28,14 +28,33 @@ project.xcworkspace .idea .gradle local.properties +android/.settings/* +android/.project +lib/android/.project +playground/android/app/.project +playground/android/.project # node.js # node_modules/ npm-debug.log +# npm +package-lock.json + +# yarn +yarn.lock +yarn-error.log + # BUCK buck-out/ \.buckd/ android/app/libs -android/keystores/debug.keystore +*.keystore +!debug.keystore + +# Bundle artifact +*.jsbundle + +# CocoaPods +playground/ios/Pods diff --git a/.npmignore b/.npmignore index 649af0f2..9a70e78a 100644 --- a/.npmignore +++ b/.npmignore @@ -1,8 +1,12 @@ -example -real-life-example +.ghp/ + + +playground +e2e logos ./index.ios.js ./index.android.js +./rn-cli.config.js ################# # from .gitignore: @@ -83,6 +87,9 @@ fabric.properties # # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore +#Cocoapods +# *.podspec + ## Build generated ios/build/ ios/DerivedData/ @@ -152,6 +159,7 @@ android/bin/ android/gen/ android/out/ android/app/build/ +lib/android/gradle/ # Gradle files android/.gradle/ diff --git a/Interactable.podspec b/Interactable.podspec index b0ddb442..c97031ab 100644 --- a/Interactable.podspec +++ b/Interactable.podspec @@ -10,7 +10,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/wix/react-native-interactable" s.license = "MIT" - s.authors = { "Tal Kol" => "talkol@gmail.com" } + s.authors = package["author"] s.platform = :ios, "7.0" s.source = { :git => "https://github.com/wix/react-native-interactable.git" } diff --git a/PROPS.md b/PROPS.md index d69ef7f4..abfba2c4 100644 --- a/PROPS.md +++ b/PROPS.md @@ -102,6 +102,15 @@ horizontalOnly={true} Optional, whether the view should be locked to horizontal movement only. Default `false`. +#### `startOnFront` (boolean) **[Android Only]** + +```jsx +startOnFront +``` + +Optional, whether the view should call `view.bringToFront()` when the view is first loaded. +*Usually using zIndex does the trick. Use this in cases it doesn't* + #### `verticalOnly` (boolean) ```jsx @@ -131,7 +140,18 @@ Optional, an object providing limits to movement relative to the view's center ( onSnap={this.onDrawerSnap} ``` -Optional, a function called whenever the view snaps to a `snapPoints` point (after being dragged). Example for [drawer](https://github.com/wix/react-native-interactable/blob/b72eff0649b48dd50548593e5ecfe4c42b026a02/example/src/IconDrawer.js#L63). When the function is called, an event object is passed as argument, containing the following properties: +Optional, a function called whenever the view finishes snapping to a `snapPoints` point (after being dragged). Example for [drawer](https://github.com/wix/react-native-interactable/blob/b72eff0649b48dd50548593e5ecfe4c42b026a02/example/src/IconDrawer.js#L63). When the function is called, an event object is passed as argument, containing the following properties: + +* `index` - The zero-based index of the point in the `snapPoints` array. +* `id` - The string `id` of the point in the `snapPoints` array (assuming it was provided). + +#### `onSnapStart` (function) + +```jsx +onSnapStart={this.onDrawerSnapStart} +``` + +Optional, a function called whenever the view starts snapping to a `snapPoints` point (after being dragged). When the function is called, an event object is passed as argument, containing the following properties: * `index` - The zero-based index of the point in the `snapPoints` array. * `id` - The string `id` of the point in the `snapPoints` array (assuming it was provided). @@ -158,7 +178,7 @@ Optional, a function called whenever the user starts or stops dragging the view. * `state` - `start` or `end`, whether the user started or finished dragging. * `x` - The horizontal position of the view (relative to the center). * `y` - The vertical position of the view (relative to the center). -* `targetSnapPointId` - For `end` state, the string `id` of the target point in the `snapPoints` array (assuming it was provided). Otherwise, empty string. +* `targetSnapPointId` - For `end` state, the string `id` of the target point in the `snapPoints` array (assuming it was provided). #### `onAlert` (function) diff --git a/README.md b/README.md index 45959270..becb5c54 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,13 @@
+[![NPM Version](https://img.shields.io/npm/v/react-native-interactable.svg?style=flat)](https://www.npmjs.com/package/react-native-interactable) +[![Build Status](https://img.shields.io/jenkins/s/http/jenkins-oss.wixpress.com:8080/job/multi-react-native-interactable-master.svg)](https://jenkins-oss.wixpress.com/job/multi-react-native-interactable-master/) +[![NPM Downloads](https://img.shields.io/npm/dm/react-native-interactable.svg?style=flat)](https://www.npmjs.com/package/react-native-interactable) ### LOOKING FOR A MAINTAINER -We love this project, but currently we don’t have enough time to work on it. So we are looking for a maintainer. If you have enough time and knowledge and want to become one - please let us know (levv@wix.com, sergeyi@wix.com) +We love this project, but currently we don’t have enough time to work on it. So we are looking for a maintainer. If you have enough time and knowledge and want to become one - please let us know (levv@wix.com)
@@ -80,36 +83,18 @@ pod 'Interactable', :path => '../node_modules/react-native-interactable' ## Example -To see the library in action you have several options: +

The [playground](https://github.com/wix/react-native-interactable/tree/master/playground) project has few use-cases implemented like: *swipeable card*, *drawer*, *collapsible header* and *chat heads* under the "Basic examples" section. It's simplistic but easy to learn from. +

Under the "Real life example" you'll find more complex demonstrations. They're harder to learn from, but they're cool to watch. More info about the [UX inspirations](https://github.com/wix/react-native-interactable/blob/master/UX-INSPIRATIONS.md) for the demo app. -* **Build and run the example project on your computer** -

The [example](example) project has 4 use-cases implemented: *swipeable card*, *drawer*, *collapsible header* and *chat heads*. It's simplistic but easy to learn from. -

*Note: It's recommended to experience it on a [real device](http://facebook.github.io/react-native/docs/running-on-device.html) and not on a simulator. The simulator has poor performance so the framerate isn't like the real thing.* -

-To run the example, clone the repo and run from the root folder:
+* **Build and run the example project** +To see the library in action, clone the repo and run the playground from the root folder:
``` - cd real-life-example - npm install - react-native run-ios + npm start + npm run ios ``` - -* **Install and run the demo app from the App Store/Google Play on your phone** -

If you don't want to mess with building yourself, you can play with a pre-built demo on your phone. -

Download from [Apple App Store (iOS)](https://itunes.apple.com/us/app/react-native-interactions/id1209875831?ls=1&mt=8)
Download from [Google Play Store (Android)](https://play.google.com/store/apps/details?id=com.wix.interactions&hl=en) -

         - -* **Build and run the demo app on your computer** -

The [demo app](real-life-example) contains more complex demonstrations than the [example](example) project. They're harder to learn from, but they're cool to watch. More info about the [UX inspirations](https://github.com/wix/react-native-interactable/blob/master/UX-INSPIRATIONS.md) for the demo app.

*Note: It's recommended to experience it on a [real device](http://facebook.github.io/react-native/docs/running-on-device.html) and not on a simulator. The simulator has poor performance so the framerate isn't like the real thing.*

-To run the demo app, clone the repo and run from the root folder: -``` - cd real-life-example - npm install - react-native run-ios -``` -
## Usage @@ -169,6 +154,12 @@ alertAreas={[{id: 'myArea', influenceArea: {top: 0}}]} horizontalOnly={true} ``` +* [`startOnFront`](https://github.com/wix/react-native-interactable/blob/master/PROPS.md#startOnFront-boolean) - [ANDROID ONLY] whether the view should call `bringToFront` + +```jsx +startOnFront +``` + * [`verticalOnly`](https://github.com/wix/react-native-interactable/blob/master/PROPS.md#verticalonly-boolean) - whether the view should be locked to vertical movement only ```jsx @@ -181,12 +172,18 @@ verticalOnly={true} boundaries={{left: -100, right: 100, bounce: 0.5}} ``` -* [`onSnap`](https://github.com/wix/react-native-interactable/blob/master/PROPS.md#onsnap-function) - a function called whenever the view snaps to a `snapPoints` point (after dragging) +* [`onSnap`](https://github.com/wix/react-native-interactable/blob/master/PROPS.md#onsnap-function) - a function called whenever the view finishes snapping to a `snapPoints` point (after dragging) ```jsx onSnap={this.onDrawerSnap} ``` +* [`onSnapStart`](https://github.com/wix/react-native-interactable/blob/master/PROPS.md#onsnapstart-function) - a function called whenever the view starts snapping to a `snapPoints` point (after dragging) + +```jsx +onSnapStart={this.onDrawerSnapStart} +``` + * [`onStop`](https://github.com/wix/react-native-interactable/blob/master/PROPS.md#onstop-function) - a function called whenever the interaction stops (views freeze momentarily) ```jsx @@ -273,7 +270,7 @@ Takes a single argument, which is a params object containing: ##### `changePosition(params)` - used to imperatively set the view's position ```jsx -instance.setPosition({x: 120, y: 40}); +instance.changePosition({x: 120, y: 40}); ``` Takes a single argument, which is a params object containing: @@ -282,6 +279,12 @@ Takes a single argument, which is a params object containing:
+##### `bringToFront()` - bring view to front (Android Only) + +```jsx +instance.bringToFront(); +``` + ## Animating other views according to `Interactable.View` position This library is integrated with the [Animated](https://facebook.github.io/react-native/docs/animated.html) library in order to support performant animations of other views according to the movement of the `Interactable.View`. diff --git a/android b/android new file mode 120000 index 00000000..92be4bb0 --- /dev/null +++ b/android @@ -0,0 +1 @@ +lib/android \ No newline at end of file diff --git a/e2e/firstTest.spec.js b/e2e/firstTest.spec.js new file mode 100644 index 00000000..e697e0d7 --- /dev/null +++ b/e2e/firstTest.spec.js @@ -0,0 +1,14 @@ +describe('Example', () => { + beforeEach(async () => { + await device.reloadReactNative(); + }); + + it('should show Overview screen', async () => { + await expect(element(by.id('Overview'))).toBeVisible(); + }); + + it('Chat Heads is clickable', async () => { + await element(by.text('Chat Heads')).tap(); + }); + +}) diff --git a/e2e/init.js b/e2e/init.js new file mode 100644 index 00000000..b7b58350 --- /dev/null +++ b/e2e/init.js @@ -0,0 +1,19 @@ +const detox = require('detox'); +const config = require('../package.json').detox; +const adapter = require('detox/runners/mocha/adapter'); + +before(async () => { + await detox.init(config); +}); + +beforeEach(async function () { + await adapter.beforeEach(this); +}); + +afterEach(async function () { + await adapter.afterEach(this); +}); + +after(async () => { + await detox.cleanup(); +}); diff --git a/e2e/mocha.opts b/e2e/mocha.opts new file mode 100644 index 00000000..dcff2e92 --- /dev/null +++ b/e2e/mocha.opts @@ -0,0 +1 @@ +--recursive --timeout 120000 --bail \ No newline at end of file diff --git a/example/.babelrc b/example/.babelrc deleted file mode 100644 index 8df53fe4..00000000 --- a/example/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ -"presets": ["react-native"] -} \ No newline at end of file diff --git a/example/.flowconfig b/example/.flowconfig deleted file mode 100644 index 876e701f..00000000 --- a/example/.flowconfig +++ /dev/null @@ -1,44 +0,0 @@ -[ignore] -; We fork some components by platform -.*/*[.]android.js - -; Ignore "BUCK" generated dirs -/\.buckd/ - -; Ignore unexpected extra "@providesModule" -.*/node_modules/.*/node_modules/fbjs/.* - -; Ignore duplicate module providers -; For RN Apps installed via npm, "Libraries" folder is inside -; "node_modules/react-native" but in the source repo it is in the root -.*/Libraries/react-native/React.js -.*/Libraries/react-native/ReactNative.js - -[include] - -[libs] -node_modules/react-native/Libraries/react-native/react-native-interface.js -node_modules/react-native/flow -flow/ - -[options] -module.system=haste - -experimental.strict_type_args=true - -munge_underscores=true - -module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' - -suppress_type=$FlowIssue -suppress_type=$FlowFixMe -suppress_type=$FixMe - -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-6]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-6]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ -suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy - -unsafe.enable_getters_and_setters=true - -[version] -^0.36.0 diff --git a/example/.gitattributes b/example/.gitattributes deleted file mode 100644 index d42ff183..00000000 --- a/example/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.pbxproj -text diff --git a/example/.gitignore b/example/.gitignore deleted file mode 100644 index fc13f169..00000000 --- a/example/.gitignore +++ /dev/null @@ -1,53 +0,0 @@ -# OSX -# -.DS_Store - -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate -project.xcworkspace - -# Android/IntelliJ -# -build/ -.idea -.gradle -local.properties -*.iml - -# node.js -# -node_modules/ -npm-debug.log - -# BUCK -buck-out/ -\.buckd/ -android/app/libs -*.keystore - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots diff --git a/example/.watchmanconfig b/example/.watchmanconfig deleted file mode 100644 index 9e26dfee..00000000 --- a/example/.watchmanconfig +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/example/__tests__/index.android.js b/example/__tests__/index.android.js deleted file mode 100644 index b49b9087..00000000 --- a/example/__tests__/index.android.js +++ /dev/null @@ -1,12 +0,0 @@ -import 'react-native'; -import React from 'react'; -import Index from '../index.android.js'; - -// Note: test renderer must be required after react-native. -import renderer from 'react-test-renderer'; - -it('renders correctly', () => { - const tree = renderer.create( - - ); -}); diff --git a/example/__tests__/index.ios.js b/example/__tests__/index.ios.js deleted file mode 100644 index ba7c5b5e..00000000 --- a/example/__tests__/index.ios.js +++ /dev/null @@ -1,12 +0,0 @@ -import 'react-native'; -import React from 'react'; -import Index from '../index.ios.js'; - -// Note: test renderer must be required after react-native. -import renderer from 'react-test-renderer'; - -it('renders correctly', () => { - const tree = renderer.create( - - ); -}); diff --git a/example/android/app/BUCK b/example/android/app/BUCK deleted file mode 100644 index 2ebdb984..00000000 --- a/example/android/app/BUCK +++ /dev/null @@ -1,66 +0,0 @@ -import re - -# To learn about Buck see [Docs](https://buckbuild.com/). -# To run your application with Buck: -# - install Buck -# - `npm start` - to start the packager -# - `cd android` -# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` -# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck -# - `buck install -r android/app` - compile, install and run application -# - -lib_deps = [] -for jarfile in glob(['libs/*.jar']): - name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) - lib_deps.append(':' + name) - prebuilt_jar( - name = name, - binary_jar = jarfile, - ) - -for aarfile in glob(['libs/*.aar']): - name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) - lib_deps.append(':' + name) - android_prebuilt_aar( - name = name, - aar = aarfile, - ) - -android_library( - name = 'all-libs', - exported_deps = lib_deps -) - -android_library( - name = 'app-code', - srcs = glob([ - 'src/main/java/**/*.java', - ]), - deps = [ - ':all-libs', - ':build_config', - ':res', - ], -) - -android_build_config( - name = 'build_config', - package = 'com.example', -) - -android_resource( - name = 'res', - res = 'src/main/res', - package = 'com.example', -) - -android_binary( - name = 'app', - package_type = 'debug', - manifest = 'src/main/AndroidManifest.xml', - keystore = '//android/keystores:debug', - deps = [ - ':app-code', - ], -) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle deleted file mode 100644 index c91f8795..00000000 --- a/example/android/app/build.gradle +++ /dev/null @@ -1,61 +0,0 @@ -apply plugin: "com.android.application" - -import com.android.build.OutputFile -apply from: "../../../node_modules/react-native/react.gradle" - -android { - compileSdkVersion 25 - buildToolsVersion "25.0.1" - - defaultConfig { - applicationId "com.example" - minSdkVersion 16 - targetSdkVersion 22 - versionCode 1 - versionName "1.0" - ndk { - abiFilters "armeabi-v7a", "x86" - } - } - splits { - abi { - reset() - enable false - universalApk false // If true, also generate a universal APK - include "armeabi-v7a", "x86" - } - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" - } - } - // applicationVariants are e.g. debug, release - applicationVariants.all { variant -> - variant.outputs.each { output -> - // For each separate APK per architecture, set a unique version code as described here: - // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits - def versionCodes = ["armeabi-v7a":1, "x86":2] - def abi = output.getFilter(OutputFile.ABI) - if (abi != null) { // null for the universal-debug, universal-release variants - output.versionCodeOverride = - versionCodes.get(abi) * 1048576 + defaultConfig.versionCode - } - } - } -} - -dependencies { - compile fileTree(dir: "libs", include: ["*.jar"]) - compile "com.android.support:appcompat-v7:25.1.1" - compile "com.facebook.react:react-native:+" // From node_modules - compile project(path: ':react-native-interactable') -} - -// Run this once to be able to run the application with BUCK -// puts all compile dependencies into folder libs for BUCK to use -task copyDownloadableDepsToLibs(type: Copy) { - from configurations.compile - into 'libs' -} diff --git a/example/android/app/proguard-rules.pro b/example/android/app/proguard-rules.pro deleted file mode 100644 index 48361a90..00000000 --- a/example/android/app/proguard-rules.pro +++ /dev/null @@ -1,66 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Disabling obfuscation is useful if you collect stack traces from production crashes -# (unless you are using a system that supports de-obfuscate the stack traces). --dontobfuscate - -# React Native - -# Keep our interfaces so they can be used by other ProGuard rules. -# See http://sourceforge.net/p/proguard/bugs/466/ --keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip --keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters --keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip - -# Do not strip any method/class that is annotated with @DoNotStrip --keep @com.facebook.proguard.annotations.DoNotStrip class * --keep @com.facebook.common.internal.DoNotStrip class * --keepclassmembers class * { - @com.facebook.proguard.annotations.DoNotStrip *; - @com.facebook.common.internal.DoNotStrip *; -} - --keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { - void set*(***); - *** get*(); -} - --keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } --keep class * extends com.facebook.react.bridge.NativeModule { *; } --keepclassmembers,includedescriptorclasses class * { native ; } --keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } --keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } --keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } - --dontwarn com.facebook.react.** - -# okhttp - --keepattributes Signature --keepattributes *Annotation* --keep class okhttp3.** { *; } --keep interface okhttp3.** { *; } --dontwarn okhttp3.** - -# okio - --keep class sun.misc.Unsafe { *; } --dontwarn java.nio.file.* --dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement --dontwarn okio.** diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 802178cc..00000000 --- a/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/example/android/app/src/main/java/com/example/MainApplication.java b/example/android/app/src/main/java/com/example/MainApplication.java deleted file mode 100644 index 902e732e..00000000 --- a/example/android/app/src/main/java/com/example/MainApplication.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.example; - -import android.app.Application; - -import com.facebook.react.ReactApplication; -import com.facebook.react.ReactNativeHost; -import com.facebook.react.ReactPackage; -import com.facebook.react.shell.MainReactPackage; -import com.facebook.soloader.SoLoader; -import com.wix.interactable.Interactable; - -import java.util.Arrays; -import java.util.List; - -public class MainApplication extends Application implements ReactApplication { - - private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { - @Override - public boolean getUseDeveloperSupport() { - return BuildConfig.DEBUG; - } - - @Override - protected List getPackages() { - return Arrays.asList( - new MainReactPackage(), - new Interactable() - ); - } - }; - - @Override - public ReactNativeHost getReactNativeHost() { - return mReactNativeHost; - } - - @Override - public void onCreate() { - super.onCreate(); - SoLoader.init(this, /* native exopackage */ false); - } -} diff --git a/example/android/app/src/main/res/values/strings.xml b/example/android/app/src/main/res/values/strings.xml deleted file mode 100644 index 5e81c913..00000000 --- a/example/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Interactable - diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 25fe7ea9..00000000 --- a/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/example/android/build.gradle b/example/android/build.gradle deleted file mode 100644 index 0d911f26..00000000 --- a/example/android/build.gradle +++ /dev/null @@ -1,24 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.0' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenLocal() - jcenter() - maven { - // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url "$rootDir/../../node_modules/react-native/android" - } - } -} diff --git a/example/android/gradle.properties b/example/android/gradle.properties deleted file mode 100644 index 21edee9d..00000000 --- a/example/android/gradle.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m - org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true - -android.useDeprecatedNdk=true diff --git a/example/android/gradle/wrapper/gradle-wrapper.jar b/example/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index b5166dad..00000000 Binary files a/example/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/example/android/keystores/BUCK b/example/android/keystores/BUCK deleted file mode 100644 index 15da20e6..00000000 --- a/example/android/keystores/BUCK +++ /dev/null @@ -1,8 +0,0 @@ -keystore( - name = 'debug', - store = 'debug.keystore', - properties = 'debug.keystore.properties', - visibility = [ - 'PUBLIC', - ], -) diff --git a/example/android/keystores/debug.keystore.properties b/example/android/keystores/debug.keystore.properties deleted file mode 100644 index 121bfb49..00000000 --- a/example/android/keystores/debug.keystore.properties +++ /dev/null @@ -1,4 +0,0 @@ -key.store=debug.keystore -key.alias=androiddebugkey -key.store.password=android -key.alias.password=android diff --git a/example/android/settings.gradle b/example/android/settings.gradle deleted file mode 100644 index 59a97039..00000000 --- a/example/android/settings.gradle +++ /dev/null @@ -1,6 +0,0 @@ -rootProject.name = 'example' - -include ':app' - -include ':react-native-interactable' -project(':react-native-interactable').projectDir = new File(rootProject.projectDir, '../../lib/android') diff --git a/example/index.android.js b/example/index.android.js deleted file mode 100644 index 89a61f8b..00000000 --- a/example/index.android.js +++ /dev/null @@ -1 +0,0 @@ -require('./src/app'); \ No newline at end of file diff --git a/example/index.ios.js b/example/index.ios.js deleted file mode 100644 index 89a61f8b..00000000 --- a/example/index.ios.js +++ /dev/null @@ -1 +0,0 @@ -require('./src/app'); \ No newline at end of file diff --git a/example/ios/example/AppDelegate.m b/example/ios/example/AppDelegate.m deleted file mode 100644 index 0f5c06b3..00000000 --- a/example/ios/example/AppDelegate.m +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import "AppDelegate.h" - -#import -#import - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - NSURL *jsCodeLocation; - - jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; - - RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation - moduleName:@"example" - initialProperties:nil - launchOptions:launchOptions]; - rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; - - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - UIViewController *rootViewController = [UIViewController new]; - rootViewController.view = rootView; - self.window.rootViewController = rootViewController; - [self.window makeKeyAndVisible]; - return YES; -} - -@end diff --git a/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json b/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 118c98f7..00000000 --- a/example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/example/src/TouchesInside.js b/example/src/TouchesInside.js deleted file mode 100644 index 033e3ad4..00000000 --- a/example/src/TouchesInside.js +++ /dev/null @@ -1,81 +0,0 @@ -import React, { Component } from 'react'; -import { StyleSheet, View, Text, Switch, Button, Picker, Slider, WebView } from 'react-native'; -import Interactable from 'react-native-interactable'; - -export default class TouchesInside extends Component { - constructor(props) { - super(props); - this.state = { - vertical: true, - dragEnabled: true, - language: 'java', - switch: true - }; - } - render() { - return ( - - - - Vertical: - this.setState({vertical: value})} /> - Can drag: - this.setState({dragEnabled: value})} /> - - - - - -