From 92dfa158214e840622b57765302125ccbbb0ed0c Mon Sep 17 00:00:00 2001 From: Gabe Boning Date: Thu, 31 Aug 2017 12:44:04 -0400 Subject: [PATCH 01/77] add onSnapStart event --- lib/ios/Interactable/InteractableView.h | 1 + lib/ios/Interactable/InteractableView.m | 13 ++++++++++++- lib/ios/Interactable/InteractableViewManager.m | 1 + typings/react-native-interactable.d.ts | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/ios/Interactable/InteractableView.h b/lib/ios/Interactable/InteractableView.h index 2b3b418b..86bb92b4 100644 --- a/lib/ios/Interactable/InteractableView.h +++ b/lib/ios/Interactable/InteractableView.h @@ -29,6 +29,7 @@ @property (nonatomic, copy) InteractableSpring *dragWithSpring; @property (nonatomic, assign) CGFloat dragToss; @property (nonatomic, copy) RCTDirectEventBlock onSnap; +@property (nonatomic, copy) RCTDirectEventBlock onSnapStart; @property (nonatomic, copy) RCTDirectEventBlock onStop; @property (nonatomic, copy) RCTDirectEventBlock onAlert; @property (nonatomic, copy) RCTDirectEventBlock onDrag; diff --git a/lib/ios/Interactable/InteractableView.m b/lib/ios/Interactable/InteractableView.m index 0e613237..016f8410 100644 --- a/lib/ios/Interactable/InteractableView.m +++ b/lib/ios/Interactable/InteractableView.m @@ -415,7 +415,18 @@ - (void)setTempBehaviorsForDragEnd CGPoint projectedCenter = CGPointMake(self.center.x + toss*velocity.x, self.center.y + toss*velocity.y); InteractablePoint *snapPoint = [InteractablePoint findClosestPoint:self.snapPoints toPoint:projectedCenter withOrigin:self.origin]; - if (snapPoint) [self addTempSnapToPointBehavior:snapPoint]; + if (snapPoint) + { + [self addTempSnapToPointBehavior:snapPoint]; + if (self.onSnapStart) + { + self.onSnapStart(@ + { + @"index": @([self.snapPoints indexOfObject:snapPoint]), + @"id": snapPoint.id + }); + } + } [self addTempBounceBehaviorWithBoundaries:self.boundaries]; } diff --git a/lib/ios/Interactable/InteractableViewManager.m b/lib/ios/Interactable/InteractableViewManager.m index 3634611a..5466cc48 100644 --- a/lib/ios/Interactable/InteractableViewManager.m +++ b/lib/ios/Interactable/InteractableViewManager.m @@ -36,6 +36,7 @@ - (UIView *)view RCT_EXPORT_VIEW_PROPERTY(dragWithSpring, InteractableSpring) RCT_EXPORT_VIEW_PROPERTY(dragToss, CGFloat) RCT_EXPORT_VIEW_PROPERTY(onSnap, RCTDirectEventBlock) +RCT_EXPORT_VIEW_PROPERTY(onSnapStart, RCTDirectEventBlock) RCT_EXPORT_VIEW_PROPERTY(onStop, RCTDirectEventBlock) RCT_EXPORT_VIEW_PROPERTY(onAlert, RCTDirectEventBlock) RCT_EXPORT_VIEW_PROPERTY(onDrag, RCTDirectEventBlock) diff --git a/typings/react-native-interactable.d.ts b/typings/react-native-interactable.d.ts index ae908c44..d26f1964 100644 --- a/typings/react-native-interactable.d.ts +++ b/typings/react-native-interactable.d.ts @@ -122,6 +122,7 @@ declare module 'react-native-interactable' { verticalOnly?: boolean; boundaries?: IBoundaries; onSnap?: (event: ISnapEvent) => void; + onSnapStart?: (event: ISnapEvent) => void; onStop?: (event: IStopEvent) => void; onDrag?: (event: IDragEvent) => void; onAlert?: (event: IAlertEvent) => void; From 063de0d99ed12c89c2c708c8a29e5ab5e7aa0ada Mon Sep 17 00:00:00 2001 From: Gabe Boning Date: Thu, 31 Aug 2017 13:10:43 -0400 Subject: [PATCH 02/77] update docs --- PROPS.md | 13 ++++++++++++- README.md | 8 +++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/PROPS.md b/PROPS.md index 1f57a327..0aec4d50 100644 --- a/PROPS.md +++ b/PROPS.md @@ -131,7 +131,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). diff --git a/README.md b/README.md index e5b5a074..86faa480 100644 --- a/README.md +++ b/README.md @@ -170,12 +170,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 From a67237c8f68527acbed814d2f3cc1f2a25e0f8f4 Mon Sep 17 00:00:00 2001 From: Bhavik Patel Date: Fri, 27 Oct 2017 16:23:23 -0400 Subject: [PATCH 03/77] Add onSnapStart event --- .../java/com/wix/interactable/Events.java | 20 +++++++++++++++++++ .../wix/interactable/InteractableView.java | 1 + .../interactable/InteractableViewManager.java | 6 +++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/android/src/main/java/com/wix/interactable/Events.java b/lib/android/src/main/java/com/wix/interactable/Events.java index edd64289..6d269292 100644 --- a/lib/android/src/main/java/com/wix/interactable/Events.java +++ b/lib/android/src/main/java/com/wix/interactable/Events.java @@ -34,6 +34,26 @@ public void dispatch(RCTEventEmitter rctEventEmitter) { } } + public static class OnSnapStartEvent extends Event { + + WritableMap eventData; + + public OnSnapStartEvent(int viewTag) { + super(viewTag); + eventData = Arguments.createMap(); + } + + @Override + public String getEventName() { + return "onSnapStart"; + } + + @Override + public void dispatch(RCTEventEmitter rctEventEmitter) { + rctEventEmitter.receiveEvent(getViewTag(), getEventName(), eventData); + } + } + public static class OnAnimatedEvent extends Event { WritableMap eventData; diff --git a/lib/android/src/main/java/com/wix/interactable/InteractableView.java b/lib/android/src/main/java/com/wix/interactable/InteractableView.java index 8c1c491b..3d47daef 100644 --- a/lib/android/src/main/java/com/wix/interactable/InteractableView.java +++ b/lib/android/src/main/java/com/wix/interactable/InteractableView.java @@ -545,6 +545,7 @@ public void changePosition(PointF position) { public interface InteractionListener { void onSnap(int indexOfSnapPoint, String snapPointId); + void onSnapStart(); void onAlert(String alertAreaId, String alertType); void onAnimatedEvent(float x, float y); void onDrag(String state, float x, float y); diff --git a/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java b/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java index f5ade08f..73efe0cf 100644 --- a/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java +++ b/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java @@ -148,6 +148,7 @@ protected void addEventEmitters(ThemedReactContext reactContext, InteractableVie public Map getExportedCustomDirectEventTypeConstants() { return MapBuilder.builder() .put("onSnap", MapBuilder.of("registrationName", "onSnap")) + .put("onSnapStart", MapBuilder.of("registrationName", "onSnapStart")) .put("onAlert", MapBuilder.of("registrationName", "onAlert")) .put("onAnimatedEvent", MapBuilder.of("registrationName", "onAnimatedEvent")) .put("onDrag", MapBuilder.of("registrationName", "onDrag")) @@ -168,6 +169,10 @@ public void onSnap(int indexOfSnapPoint, String snapPointId) { eventDispatcher.dispatchEvent(new Events.OnSnapEvent(interactableView.getId(), indexOfSnapPoint, snapPointId)); } + public void onSnapStart() { + eventDispatcher.dispatchEvent(new Events.OnSnapStartEvent(interactableView.getId())); + } + @Override public void onAlert(String alertAreaId, String alertType) { eventDispatcher.dispatchEvent(new Events.OnAlertEvent(interactableView.getId(), alertAreaId, alertType)); @@ -184,4 +189,3 @@ public void onDrag(String state, float x, float y) { } } } - From 431d0ee16dbdb8fc1aa4fd46379d53e52ba64102 Mon Sep 17 00:00:00 2001 From: Bhavik Patel Date: Fri, 27 Oct 2017 16:50:23 -0400 Subject: [PATCH 04/77] call onSnapStart event --- .../src/main/java/com/wix/interactable/InteractableView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/android/src/main/java/com/wix/interactable/InteractableView.java b/lib/android/src/main/java/com/wix/interactable/InteractableView.java index 3d47daef..f028c64b 100644 --- a/lib/android/src/main/java/com/wix/interactable/InteractableView.java +++ b/lib/android/src/main/java/com/wix/interactable/InteractableView.java @@ -320,6 +320,7 @@ private void addTempSnapToPointBehavior(InteractablePoint snapPoint) { return; } listener.onSnap(snapPoints.indexOf(snapPoint), snapPoint.id); + listener.onSnapStart(); PhysicsSpringBehavior snapBehavior = new PhysicsSpringBehavior(this,snapPoint.positionWithOrigin()); snapBehavior.tension = snapPoint.tension; @@ -454,7 +455,7 @@ public void setHorizontalOnly(boolean horizontalOnly) { public void setDragEnabled(boolean dragEnabled) { this.dragEnabled = dragEnabled; - + if (this.dragBehavior != null && !dragEnabled) { handleEndOfDrag(); } From a75bb48e30fee0b65356c3d616df58babe43f1aa Mon Sep 17 00:00:00 2001 From: Gabe Boning Date: Sat, 28 Oct 2017 22:18:42 -0400 Subject: [PATCH 05/77] add snapstart data --- lib/android/src/main/java/com/wix/interactable/Events.java | 4 +++- .../src/main/java/com/wix/interactable/InteractableView.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/android/src/main/java/com/wix/interactable/Events.java b/lib/android/src/main/java/com/wix/interactable/Events.java index 6d269292..8b1d8bc6 100644 --- a/lib/android/src/main/java/com/wix/interactable/Events.java +++ b/lib/android/src/main/java/com/wix/interactable/Events.java @@ -38,9 +38,11 @@ public static class OnSnapStartEvent extends Event { WritableMap eventData; - public OnSnapStartEvent(int viewTag) { + public OnSnapStartEvent(int viewTag, int indexOfSnapPoint, String snapPointId) { super(viewTag); eventData = Arguments.createMap(); + eventData.putInt("index",indexOfSnapPoint); + eventData.putString("id", snapPointId); } @Override diff --git a/lib/android/src/main/java/com/wix/interactable/InteractableView.java b/lib/android/src/main/java/com/wix/interactable/InteractableView.java index f028c64b..5fc8ea78 100644 --- a/lib/android/src/main/java/com/wix/interactable/InteractableView.java +++ b/lib/android/src/main/java/com/wix/interactable/InteractableView.java @@ -320,7 +320,7 @@ private void addTempSnapToPointBehavior(InteractablePoint snapPoint) { return; } listener.onSnap(snapPoints.indexOf(snapPoint), snapPoint.id); - listener.onSnapStart(); + listener.onSnapStart(snapPoints.indexOf(snapPoint), snapPoint.id); PhysicsSpringBehavior snapBehavior = new PhysicsSpringBehavior(this,snapPoint.positionWithOrigin()); snapBehavior.tension = snapPoint.tension; From 4f33c89b0a74a653c7173328434ce407c30bdc04 Mon Sep 17 00:00:00 2001 From: Gabe Boning Date: Sat, 28 Oct 2017 22:28:52 -0400 Subject: [PATCH 06/77] snap data --- .../src/main/java/com/wix/interactable/InteractableView.java | 2 +- .../java/com/wix/interactable/InteractableViewManager.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/android/src/main/java/com/wix/interactable/InteractableView.java b/lib/android/src/main/java/com/wix/interactable/InteractableView.java index 5fc8ea78..ceb9d439 100644 --- a/lib/android/src/main/java/com/wix/interactable/InteractableView.java +++ b/lib/android/src/main/java/com/wix/interactable/InteractableView.java @@ -546,7 +546,7 @@ public void changePosition(PointF position) { public interface InteractionListener { void onSnap(int indexOfSnapPoint, String snapPointId); - void onSnapStart(); + void onSnapStart(int indexOfSnapPoint, String snapPointId); void onAlert(String alertAreaId, String alertType); void onAnimatedEvent(float x, float y); void onDrag(String state, float x, float y); diff --git a/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java b/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java index 73efe0cf..bb583362 100644 --- a/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java +++ b/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java @@ -169,8 +169,9 @@ public void onSnap(int indexOfSnapPoint, String snapPointId) { eventDispatcher.dispatchEvent(new Events.OnSnapEvent(interactableView.getId(), indexOfSnapPoint, snapPointId)); } - public void onSnapStart() { - eventDispatcher.dispatchEvent(new Events.OnSnapStartEvent(interactableView.getId())); + @Override + public void onSnapStart(int indexOfSnapPoint, String snapPointId) { + eventDispatcher.dispatchEvent(new Events.OnSnapStartEvent(interactableView.getId(), indexOfSnapPoint, snapPointId)); } @Override From 9375d1301596eb9edf71ff843980b27f6c96b364 Mon Sep 17 00:00:00 2001 From: Rotem Mizrachi-Meidan Date: Thu, 8 Feb 2018 18:16:10 +0200 Subject: [PATCH 07/77] added bringToFront to Android (#184) --- README.md | 6 ++++++ .../com/wix/interactable/InteractableViewManager.java | 9 +++++++-- lib/ios/Interactable/InteractableView.h | 1 + lib/ios/Interactable/InteractableView.m | 5 +++++ lib/ios/Interactable/InteractableViewManager.m | 6 ++++++ 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 45959270..60bd87d5 100644 --- a/README.md +++ b/README.md @@ -282,6 +282,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/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java b/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java index 5c72bae7..df4230e0 100644 --- a/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java +++ b/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java @@ -1,7 +1,6 @@ package com.wix.interactable; import android.support.annotation.Nullable; -import android.util.Log; import com.facebook.infer.annotation.Assertions; import com.facebook.react.bridge.ReadableArray; @@ -22,6 +21,7 @@ public class InteractableViewManager extends ViewGroupManager public static final int COMMAND_SET_VELOCITY = 1; public static final int COMMAND_SNAP_TO = 2; public static final int COMMAND_CHANGE_POSITION = 3; + public static final int COMMAND_BRING_TO_FRONT = 4; @Override @@ -39,7 +39,8 @@ public Map getCommandsMap() { return MapBuilder.of( "setVelocity", COMMAND_SET_VELOCITY, "snapTo", COMMAND_SNAP_TO, - "changePosition", COMMAND_CHANGE_POSITION + "changePosition", COMMAND_CHANGE_POSITION, + "bringToFront", COMMAND_BRING_TO_FRONT ); } @@ -64,6 +65,10 @@ public void receiveCommand( view.changePosition(RNConvert.pointF(args.getMap(0))); return; } + case COMMAND_BRING_TO_FRONT: { + view.bringToFront(); + return; + } default: throw new IllegalArgumentException(String.format( "Unsupported command %d received by %s.", diff --git a/lib/ios/Interactable/InteractableView.h b/lib/ios/Interactable/InteractableView.h index 2b3b418b..720714be 100644 --- a/lib/ios/Interactable/InteractableView.h +++ b/lib/ios/Interactable/InteractableView.h @@ -40,5 +40,6 @@ - (void)setVelocity:(NSDictionary*)params; - (void)snapTo:(NSDictionary*)params; - (void)changePosition:(NSDictionary*)params; +- (void)bringToFront:(NSDictionary*)params; @end diff --git a/lib/ios/Interactable/InteractableView.m b/lib/ios/Interactable/InteractableView.m index 2472e07e..58ddb0e7 100644 --- a/lib/ios/Interactable/InteractableView.m +++ b/lib/ios/Interactable/InteractableView.m @@ -597,6 +597,11 @@ - (void)changePosition:(NSDictionary*)params [self.animator ensureRunning]; } +- (void)bringToFront:(NSDictionary*)params +{ + +} + @end diff --git a/lib/ios/Interactable/InteractableViewManager.m b/lib/ios/Interactable/InteractableViewManager.m index 3634611a..289abb00 100644 --- a/lib/ios/Interactable/InteractableViewManager.m +++ b/lib/ios/Interactable/InteractableViewManager.m @@ -62,6 +62,12 @@ - (UIView *)view }]; } +RCT_EXPORT_METHOD(bringToFront:(nonnull NSNumber *)reactTag + params:(NSDictionary*)params) +{ + +} + RCT_EXPORT_METHOD(snapTo:(nonnull NSNumber *)reactTag params:(NSDictionary*)params) { From d45aa25a27b736b979e9ab49641c85f4e38095c7 Mon Sep 17 00:00:00 2001 From: Rotem M Date: Thu, 8 Feb 2018 18:22:36 +0200 Subject: [PATCH 08/77] 0.1.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b9e87fa9..db8f050c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-interactable", - "version": "0.1.6", + "version": "0.1.8", "description": "High performance interactable views in React Native", "license": "MIT", "author": "Tal Kol ", From 162ebe78318bab64df2b493a9c15e70b31f8a3c4 Mon Sep 17 00:00:00 2001 From: Rotem M Date: Thu, 8 Feb 2018 19:02:58 +0200 Subject: [PATCH 09/77] export bringToFront to JS --- lib/src/InteractableView.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/src/InteractableView.js b/lib/src/InteractableView.js index 92f4fe76..2b135655 100644 --- a/lib/src/InteractableView.js +++ b/lib/src/InteractableView.js @@ -102,6 +102,15 @@ class WrappedAnimatedInteractableView extends Component { ); } } -} + + bringToFront() { + if (Platform.OS === 'android') { + UIManager.dispatchViewManagerCommand( + ReactNative.findNodeHandle(this), + UIManager.InteractableView.Commands.bringToFront, + [], + ); + } + } export default WrappedAnimatedInteractableView; From 679ba98e901d316ba11fc4df31f96e4659b8ebb0 Mon Sep 17 00:00:00 2001 From: Ofir Dagan Date: Thu, 8 Feb 2018 19:07:47 +0200 Subject: [PATCH 10/77] fix(interactableView): expose bringToFront to js (#183) * fix(interactableView): expose bringToFront to js * chore(docs): add alwaysOnFront * rename to startOnFront --- PROPS.md | 9 +++++++++ README.md | 6 ++++++ .../com/wix/interactable/InteractableViewManager.java | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/PROPS.md b/PROPS.md index d69ef7f4..48f91262 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 diff --git a/README.md b/README.md index 60bd87d5..f403af41 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,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 diff --git a/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java b/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java index df4230e0..f5ea657d 100644 --- a/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java +++ b/lib/android/src/main/java/com/wix/interactable/InteractableViewManager.java @@ -82,6 +82,11 @@ public void setVerticalOnly(InteractableView view, @Nullable boolean verticalOnl view.setVerticalOnly(verticalOnly); } + @ReactProp(name = "startOnFront") + public void setStartOnFront(InteractableView view, @Nullable boolean startOnFront) { + view.bringToFront(); + } + @ReactProp(name = "horizontalOnly") public void setHorizontalOnly(InteractableView view, @Nullable boolean horizontalOnly) { view.setHorizontalOnly(horizontalOnly); From ba04e1b14b04cb3e4383b185668cc386e7fee9dd Mon Sep 17 00:00:00 2001 From: Rotem M Date: Thu, 8 Feb 2018 19:08:07 +0200 Subject: [PATCH 11/77] 0.1.9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index db8f050c..ca37afa3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-interactable", - "version": "0.1.8", + "version": "0.1.9", "description": "High performance interactable views in React Native", "license": "MIT", "author": "Tal Kol ", From 1c89628c769b477dbd54ad590827fb0530f1947d Mon Sep 17 00:00:00 2001 From: Rotem M Date: Thu, 8 Feb 2018 19:55:02 +0200 Subject: [PATCH 12/77] OMG --- lib/src/InteractableView.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/InteractableView.js b/lib/src/InteractableView.js index 2b135655..acad28ac 100644 --- a/lib/src/InteractableView.js +++ b/lib/src/InteractableView.js @@ -112,5 +112,6 @@ class WrappedAnimatedInteractableView extends Component { ); } } +} export default WrappedAnimatedInteractableView; From b1e5352331577197d7969ce1e4b6e12b6c246b02 Mon Sep 17 00:00:00 2001 From: Rotem M Date: Thu, 8 Feb 2018 19:55:47 +0200 Subject: [PATCH 13/77] 0.1.10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ca37afa3..af04999e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-interactable", - "version": "0.1.9", + "version": "0.1.10", "description": "High performance interactable views in React Native", "license": "MIT", "author": "Tal Kol ", From 66d0913bbaf505b5330c412dc371bbf7176bf42b Mon Sep 17 00:00:00 2001 From: Luke Fanning Date: Mon, 19 Feb 2018 16:20:52 +0000 Subject: [PATCH 14/77] Fixes onSnapStart() not being called on snapTo() for iOS --- lib/ios/Interactable/InteractableView.m | 81 ++++++++++++++----------- 1 file changed, 44 insertions(+), 37 deletions(-) diff --git a/lib/ios/Interactable/InteractableView.m b/lib/ios/Interactable/InteractableView.m index 016f8410..041abad8 100644 --- a/lib/ios/Interactable/InteractableView.m +++ b/lib/ios/Interactable/InteractableView.m @@ -67,7 +67,7 @@ - (BOOL)canCoalesce - (InteractableEvent *)coalesceWithEvent:(InteractableEvent *)newEvent { newEvent->_userData = _userData; - + return newEvent; } @@ -113,7 +113,7 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge self.insideAlertAreas = [NSMutableSet set]; self.dragEnabled = YES; self.bridge = bridge; - + // pan gesture recognizer for touches self.pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; self.pan.delegate = self; @@ -126,14 +126,14 @@ - (void)reactSetFrame:(CGRect)frame { // to handle the react relayout we need to remember the delta from previous origin self.reactRelayoutCenterDeltaFromOrigin = CGPointMake(self.origin.x - self.center.x, self.origin.y - self.center.y); - + self.origin = CGPointMake(CGRectGetMidX(frame), CGRectGetMidY(frame)); self.originSet = YES; - + self.reactRelayoutHappening = YES; [super reactSetFrame:frame]; self.reactRelayoutHappening = NO; - + // initial position if (!self.initialPositionSet) { @@ -142,7 +142,7 @@ - (void)reactSetFrame:(CGRect)frame { self.center = CGPointMake(self.origin.x + self.initialPosition.x, self.origin.y + self.initialPosition.y); } - + // make sure this is after origin is set and happens once [self initializeAnimator]; } @@ -155,12 +155,12 @@ - (void)setCenter:(CGPoint)center // to handle a react relayout we maintain the same delta but now with the new origin center = CGPointMake(self.origin.x - self.reactRelayoutCenterDeltaFromOrigin.x, self.origin.y - self.reactRelayoutCenterDeltaFromOrigin.y); } - + if (self.originSet) { if (self.horizontalOnly) center.y = self.origin.y; if (self.verticalOnly) center.x = self.origin.x; - + if (self.boundaries) { if (center.x - self.origin.x < self.boundaries.left) center.x = self.boundaries.left + self.origin.x; @@ -169,7 +169,7 @@ - (void)setCenter:(CGPoint)center if (center.y - self.origin.y > self.boundaries.bottom) center.y = self.boundaries.bottom + self.origin.y; } } - + [super setCenter:center]; [self reportAnimatedEvent]; [self reportAlertEvent]; @@ -185,7 +185,7 @@ - (void)initializeAnimator { self.animator = [[PhysicsAnimator alloc] init]; self.animator.delegate = self; - + // initialize constant behaviors if (self.springPoints) { @@ -215,7 +215,7 @@ - (void)physicsAnimatorDidPause:(PhysicsAnimator *)animator }); } } - + if (self.onStop) { CGPoint deltaFromOrigin = [InteractablePoint deltaBetweenPoint:self.center andOrigin:self.origin]; @@ -232,12 +232,12 @@ - (void)reportAnimatedEvent if (self.reportOnAnimatedEvents && self.originSet) { CGPoint deltaFromOrigin = [InteractablePoint deltaBetweenPoint:self.center andOrigin:self.origin]; - + if (![self.lastEmittedEventName isEqualToString:@"onAnimatedEvent"]) { self.coalescingKey++; self.lastEmittedEventName = @"onAnimatedEvent"; } - + InteractableEvent *event = [[InteractableEvent alloc] initWithEventName:@"onAnimatedEvent" reactTag:self.reactTag interactableView:self @@ -246,7 +246,7 @@ - (void)reportAnimatedEvent coalescingKey:self.coalescingKey]; [[self.bridge eventDispatcher] sendEvent:event]; - + // self.onAnimatedEvent(@ // { // @"x": @(deltaFromOrigin.x), @@ -310,11 +310,11 @@ - (void)handlePan:(UIPanGestureRecognizer *)pan [self setTempBehaviorsForDragStart]; [self reportDragEvent:@"start"]; } - + CGPoint translation = [pan translationInView:self]; self.dragBehavior.anchorPoint = CGPointMake(self.dragStartCenter.x + translation.x, self.dragStartCenter.y + translation.y); [self.animator ensureRunning]; - + if (pan.state == UIGestureRecognizerStateEnded || pan.state == UIGestureRecognizerStateFailed || pan.state == UIGestureRecognizerStateCancelled) @@ -355,7 +355,7 @@ - (RCTRootView*)getRootView view = view.superview; if ([view isKindOfClass:[RCTRootView class]]) break; } - + if ([view isKindOfClass:[RCTRootView class]]) { return view; @@ -369,26 +369,26 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event UITouch *touch = [[event allTouches] anyObject]; self.dragStartCenter = self.center; self.dragStartLocation = [touch locationInView:self.superview]; - + [self setTempBehaviorsForDragStart]; } - + - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:self.superview]; CGFloat newCenterX = self.dragStartCenter.x + location.x - self.dragStartLocation.x; CGFloat newCenterY = self.dragStartCenter.y + location.y - self.dragStartLocation.y; - + self.dragBehavior.anchorPoint = CGPointMake(newCenterX, newCenterY); [self.animator ensureRunning]; } - + - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [self setTempBehaviorsForDragEnd]; } - + - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { [self setTempBehaviorsForDragEnd]; @@ -399,7 +399,7 @@ - (void)setTempBehaviorsForDragStart { [self.animator removeTempBehaviors]; self.dragBehavior = nil; - + self.dragBehavior = [self addTempDragBehavior:self.dragWithSpring]; } @@ -407,13 +407,13 @@ - (void)setTempBehaviorsForDragEnd { [self.animator removeTempBehaviors]; self.dragBehavior = nil; - + CGPoint velocity = [self.animator getTargetVelocity:self]; if (self.horizontalOnly) velocity.y = 0; if (self.verticalOnly) velocity.x = 0; CGFloat toss = self.dragToss; CGPoint projectedCenter = CGPointMake(self.center.x + toss*velocity.x, self.center.y + toss*velocity.y); - + InteractablePoint *snapPoint = [InteractablePoint findClosestPoint:self.snapPoints toPoint:projectedCenter withOrigin:self.origin]; if (snapPoint) { @@ -427,7 +427,7 @@ - (void)setTempBehaviorsForDragEnd }); } } - + [self addTempBounceBehaviorWithBoundaries:self.boundaries]; } @@ -436,7 +436,7 @@ - (void)setTempBehaviorsForDragEnd - (PhysicsBehavior*)addTempDragBehavior:(InteractableSpring*)spring { PhysicsBehavior *res = nil; - + if (!spring || spring.tension == CGFLOAT_MAX) { PhysicsAnchorBehavior *anchorBehavior = [[PhysicsAnchorBehavior alloc] initWithTarget:self anchorPoint:self.center]; @@ -450,14 +450,14 @@ - (PhysicsBehavior*)addTempDragBehavior:(InteractableSpring*)spring res = springBehavior; [self.animator addTempBehavior:springBehavior]; } - + if (spring && spring.damping > 0.0) { PhysicsFrictionBehavior *frictionBehavior = [[PhysicsFrictionBehavior alloc] initWithTarget:self]; frictionBehavior.friction = spring.damping; [self.animator addTempBehavior:frictionBehavior]; } - + return res; } @@ -466,7 +466,7 @@ - (void)addTempSnapToPointBehavior:(InteractablePoint*)snapPoint PhysicsSpringBehavior *snapBehavior = [[PhysicsSpringBehavior alloc] initWithTarget:self anchorPoint:[snapPoint positionWithOrigin:self.origin]]; snapBehavior.tension = snapPoint.tension; [self.animator addTempBehavior:snapBehavior]; - + CGFloat damping = 0.7; if (snapPoint.damping > 0.0) damping = snapPoint.damping; PhysicsFrictionBehavior *frictionBehavior = [[PhysicsFrictionBehavior alloc] initWithTarget:self]; @@ -496,13 +496,13 @@ - (void)addConstantSpringBehavior:(InteractablePoint*)point CGPoint anchor = self.origin; if (point.x != CGFLOAT_MAX) anchor.x = self.origin.x + point.x; if (point.y != CGFLOAT_MAX) anchor.y = self.origin.y + point.y; - + PhysicsSpringBehavior *springBehavior = [[PhysicsSpringBehavior alloc] initWithTarget:self anchorPoint:anchor]; springBehavior.tension = point.tension; springBehavior.haptics = point.haptics; springBehavior.influence = [self influenceAreaFromPoint:point]; [self.animator addBehavior:springBehavior]; - + if (point.damping > 0.0) { PhysicsFrictionBehavior *frictionBehavior = [[PhysicsFrictionBehavior alloc] initWithTarget:self]; @@ -517,13 +517,13 @@ - (void)addConstantGravityBehavior:(InteractablePoint*)point CGPoint anchor = self.origin; if (point.x != CGFLOAT_MAX) anchor.x = self.origin.x + point.x; if (point.y != CGFLOAT_MAX) anchor.y = self.origin.y + point.y; - + PhysicsGravityWellBehavior *gravityBehavior = [[PhysicsGravityWellBehavior alloc] initWithTarget:self anchorPoint:anchor]; gravityBehavior.strength = point.strength; gravityBehavior.falloff = point.falloff; gravityBehavior.influence = [self influenceAreaFromPoint:point]; [self.animator addBehavior:gravityBehavior]; - + if (point.damping > 0.0) { PhysicsFrictionBehavior *frictionBehavior = [[PhysicsFrictionBehavior alloc] initWithTarget:self]; @@ -586,10 +586,17 @@ - (void)snapTo:(NSDictionary*)params { [self.animator removeTempBehaviors]; self.dragBehavior = nil; - + InteractablePoint *snapPoint = [self.snapPoints objectAtIndex:index]; - if (snapPoint) [self addTempSnapToPointBehavior:snapPoint]; - + if (snapPoint) { + [self addTempSnapToPointBehavior:snapPoint]; + self.onSnapStart(@ + { + @"index": @([self.snapPoints indexOfObject:snapPoint]), + @"id": snapPoint.id + }); + } + [self addTempBounceBehaviorWithBoundaries:self.boundaries]; [self.animator ensureRunning]; } From f3a6ac534f366845bf0d6b236ab18d2609e1f08e Mon Sep 17 00:00:00 2001 From: Luke Fanning Date: Tue, 20 Feb 2018 10:33:07 +0000 Subject: [PATCH 15/77] Wrap self.onSnapStart with if --- lib/ios/Interactable/InteractableView.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/ios/Interactable/InteractableView.m b/lib/ios/Interactable/InteractableView.m index 041abad8..86828bcb 100644 --- a/lib/ios/Interactable/InteractableView.m +++ b/lib/ios/Interactable/InteractableView.m @@ -590,11 +590,13 @@ - (void)snapTo:(NSDictionary*)params InteractablePoint *snapPoint = [self.snapPoints objectAtIndex:index]; if (snapPoint) { [self addTempSnapToPointBehavior:snapPoint]; - self.onSnapStart(@ - { - @"index": @([self.snapPoints indexOfObject:snapPoint]), - @"id": snapPoint.id - }); + if (self.onSnapStart) { + self.onSnapStart(@ + { + @"index": @([self.snapPoints indexOfObject:snapPoint]), + @"id": snapPoint.id + }); + } } [self addTempBounceBehaviorWithBoundaries:self.boundaries]; From 6f606540c3a1ae80de4a0b99c00c83b86c544330 Mon Sep 17 00:00:00 2001 From: Luke Fanning Date: Tue, 20 Feb 2018 15:36:56 +0000 Subject: [PATCH 16/77] Adds wix style spacing back in --- lib/ios/Interactable/InteractableView.m | 72 ++++++++++++------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/lib/ios/Interactable/InteractableView.m b/lib/ios/Interactable/InteractableView.m index 86828bcb..18e25518 100644 --- a/lib/ios/Interactable/InteractableView.m +++ b/lib/ios/Interactable/InteractableView.m @@ -67,7 +67,7 @@ - (BOOL)canCoalesce - (InteractableEvent *)coalesceWithEvent:(InteractableEvent *)newEvent { newEvent->_userData = _userData; - + return newEvent; } @@ -113,7 +113,7 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge self.insideAlertAreas = [NSMutableSet set]; self.dragEnabled = YES; self.bridge = bridge; - + // pan gesture recognizer for touches self.pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; self.pan.delegate = self; @@ -126,14 +126,14 @@ - (void)reactSetFrame:(CGRect)frame { // to handle the react relayout we need to remember the delta from previous origin self.reactRelayoutCenterDeltaFromOrigin = CGPointMake(self.origin.x - self.center.x, self.origin.y - self.center.y); - + self.origin = CGPointMake(CGRectGetMidX(frame), CGRectGetMidY(frame)); self.originSet = YES; - + self.reactRelayoutHappening = YES; [super reactSetFrame:frame]; self.reactRelayoutHappening = NO; - + // initial position if (!self.initialPositionSet) { @@ -142,7 +142,7 @@ - (void)reactSetFrame:(CGRect)frame { self.center = CGPointMake(self.origin.x + self.initialPosition.x, self.origin.y + self.initialPosition.y); } - + // make sure this is after origin is set and happens once [self initializeAnimator]; } @@ -155,12 +155,12 @@ - (void)setCenter:(CGPoint)center // to handle a react relayout we maintain the same delta but now with the new origin center = CGPointMake(self.origin.x - self.reactRelayoutCenterDeltaFromOrigin.x, self.origin.y - self.reactRelayoutCenterDeltaFromOrigin.y); } - + if (self.originSet) { if (self.horizontalOnly) center.y = self.origin.y; if (self.verticalOnly) center.x = self.origin.x; - + if (self.boundaries) { if (center.x - self.origin.x < self.boundaries.left) center.x = self.boundaries.left + self.origin.x; @@ -169,7 +169,7 @@ - (void)setCenter:(CGPoint)center if (center.y - self.origin.y > self.boundaries.bottom) center.y = self.boundaries.bottom + self.origin.y; } } - + [super setCenter:center]; [self reportAnimatedEvent]; [self reportAlertEvent]; @@ -185,7 +185,7 @@ - (void)initializeAnimator { self.animator = [[PhysicsAnimator alloc] init]; self.animator.delegate = self; - + // initialize constant behaviors if (self.springPoints) { @@ -215,7 +215,7 @@ - (void)physicsAnimatorDidPause:(PhysicsAnimator *)animator }); } } - + if (self.onStop) { CGPoint deltaFromOrigin = [InteractablePoint deltaBetweenPoint:self.center andOrigin:self.origin]; @@ -232,12 +232,12 @@ - (void)reportAnimatedEvent if (self.reportOnAnimatedEvents && self.originSet) { CGPoint deltaFromOrigin = [InteractablePoint deltaBetweenPoint:self.center andOrigin:self.origin]; - + if (![self.lastEmittedEventName isEqualToString:@"onAnimatedEvent"]) { self.coalescingKey++; self.lastEmittedEventName = @"onAnimatedEvent"; } - + InteractableEvent *event = [[InteractableEvent alloc] initWithEventName:@"onAnimatedEvent" reactTag:self.reactTag interactableView:self @@ -246,7 +246,7 @@ - (void)reportAnimatedEvent coalescingKey:self.coalescingKey]; [[self.bridge eventDispatcher] sendEvent:event]; - + // self.onAnimatedEvent(@ // { // @"x": @(deltaFromOrigin.x), @@ -310,11 +310,11 @@ - (void)handlePan:(UIPanGestureRecognizer *)pan [self setTempBehaviorsForDragStart]; [self reportDragEvent:@"start"]; } - + CGPoint translation = [pan translationInView:self]; self.dragBehavior.anchorPoint = CGPointMake(self.dragStartCenter.x + translation.x, self.dragStartCenter.y + translation.y); [self.animator ensureRunning]; - + if (pan.state == UIGestureRecognizerStateEnded || pan.state == UIGestureRecognizerStateFailed || pan.state == UIGestureRecognizerStateCancelled) @@ -355,7 +355,7 @@ - (RCTRootView*)getRootView view = view.superview; if ([view isKindOfClass:[RCTRootView class]]) break; } - + if ([view isKindOfClass:[RCTRootView class]]) { return view; @@ -369,26 +369,26 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event UITouch *touch = [[event allTouches] anyObject]; self.dragStartCenter = self.center; self.dragStartLocation = [touch locationInView:self.superview]; - + [self setTempBehaviorsForDragStart]; } - + - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; CGPoint location = [touch locationInView:self.superview]; CGFloat newCenterX = self.dragStartCenter.x + location.x - self.dragStartLocation.x; CGFloat newCenterY = self.dragStartCenter.y + location.y - self.dragStartLocation.y; - + self.dragBehavior.anchorPoint = CGPointMake(newCenterX, newCenterY); [self.animator ensureRunning]; } - + - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [self setTempBehaviorsForDragEnd]; } - + - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { [self setTempBehaviorsForDragEnd]; @@ -399,7 +399,7 @@ - (void)setTempBehaviorsForDragStart { [self.animator removeTempBehaviors]; self.dragBehavior = nil; - + self.dragBehavior = [self addTempDragBehavior:self.dragWithSpring]; } @@ -407,13 +407,13 @@ - (void)setTempBehaviorsForDragEnd { [self.animator removeTempBehaviors]; self.dragBehavior = nil; - + CGPoint velocity = [self.animator getTargetVelocity:self]; if (self.horizontalOnly) velocity.y = 0; if (self.verticalOnly) velocity.x = 0; CGFloat toss = self.dragToss; CGPoint projectedCenter = CGPointMake(self.center.x + toss*velocity.x, self.center.y + toss*velocity.y); - + InteractablePoint *snapPoint = [InteractablePoint findClosestPoint:self.snapPoints toPoint:projectedCenter withOrigin:self.origin]; if (snapPoint) { @@ -427,7 +427,7 @@ - (void)setTempBehaviorsForDragEnd }); } } - + [self addTempBounceBehaviorWithBoundaries:self.boundaries]; } @@ -436,7 +436,7 @@ - (void)setTempBehaviorsForDragEnd - (PhysicsBehavior*)addTempDragBehavior:(InteractableSpring*)spring { PhysicsBehavior *res = nil; - + if (!spring || spring.tension == CGFLOAT_MAX) { PhysicsAnchorBehavior *anchorBehavior = [[PhysicsAnchorBehavior alloc] initWithTarget:self anchorPoint:self.center]; @@ -450,14 +450,14 @@ - (PhysicsBehavior*)addTempDragBehavior:(InteractableSpring*)spring res = springBehavior; [self.animator addTempBehavior:springBehavior]; } - + if (spring && spring.damping > 0.0) { PhysicsFrictionBehavior *frictionBehavior = [[PhysicsFrictionBehavior alloc] initWithTarget:self]; frictionBehavior.friction = spring.damping; [self.animator addTempBehavior:frictionBehavior]; } - + return res; } @@ -466,7 +466,7 @@ - (void)addTempSnapToPointBehavior:(InteractablePoint*)snapPoint PhysicsSpringBehavior *snapBehavior = [[PhysicsSpringBehavior alloc] initWithTarget:self anchorPoint:[snapPoint positionWithOrigin:self.origin]]; snapBehavior.tension = snapPoint.tension; [self.animator addTempBehavior:snapBehavior]; - + CGFloat damping = 0.7; if (snapPoint.damping > 0.0) damping = snapPoint.damping; PhysicsFrictionBehavior *frictionBehavior = [[PhysicsFrictionBehavior alloc] initWithTarget:self]; @@ -496,13 +496,13 @@ - (void)addConstantSpringBehavior:(InteractablePoint*)point CGPoint anchor = self.origin; if (point.x != CGFLOAT_MAX) anchor.x = self.origin.x + point.x; if (point.y != CGFLOAT_MAX) anchor.y = self.origin.y + point.y; - + PhysicsSpringBehavior *springBehavior = [[PhysicsSpringBehavior alloc] initWithTarget:self anchorPoint:anchor]; springBehavior.tension = point.tension; springBehavior.haptics = point.haptics; springBehavior.influence = [self influenceAreaFromPoint:point]; [self.animator addBehavior:springBehavior]; - + if (point.damping > 0.0) { PhysicsFrictionBehavior *frictionBehavior = [[PhysicsFrictionBehavior alloc] initWithTarget:self]; @@ -517,13 +517,13 @@ - (void)addConstantGravityBehavior:(InteractablePoint*)point CGPoint anchor = self.origin; if (point.x != CGFLOAT_MAX) anchor.x = self.origin.x + point.x; if (point.y != CGFLOAT_MAX) anchor.y = self.origin.y + point.y; - + PhysicsGravityWellBehavior *gravityBehavior = [[PhysicsGravityWellBehavior alloc] initWithTarget:self anchorPoint:anchor]; gravityBehavior.strength = point.strength; gravityBehavior.falloff = point.falloff; gravityBehavior.influence = [self influenceAreaFromPoint:point]; [self.animator addBehavior:gravityBehavior]; - + if (point.damping > 0.0) { PhysicsFrictionBehavior *frictionBehavior = [[PhysicsFrictionBehavior alloc] initWithTarget:self]; @@ -586,7 +586,7 @@ - (void)snapTo:(NSDictionary*)params { [self.animator removeTempBehaviors]; self.dragBehavior = nil; - + InteractablePoint *snapPoint = [self.snapPoints objectAtIndex:index]; if (snapPoint) { [self addTempSnapToPointBehavior:snapPoint]; @@ -598,7 +598,7 @@ - (void)snapTo:(NSDictionary*)params }); } } - + [self addTempBounceBehaviorWithBoundaries:self.boundaries]; [self.animator ensureRunning]; } From 8b6c2c884cbbba16bd3711fdade23bd8a796597b Mon Sep 17 00:00:00 2001 From: Guillaume Laudet Date: Thu, 1 Mar 2018 16:10:32 +0200 Subject: [PATCH 17/77] Update README.md for install of real life example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f403af41..34495f20 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ To see the library in action you have several options: To run the example, clone the repo and run from the root folder:
``` cd real-life-example - npm install + yarn react-native run-ios ``` From fee2bf5a27efcf8302a788e9b5f1f878c68dd233 Mon Sep 17 00:00:00 2001 From: Dima Grossman Date: Fri, 23 Mar 2018 19:45:07 +0300 Subject: [PATCH 18/77] Fix setPosition to changePosition (#163) Changed the name of the method in the code example to the correct method name. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34495f20..687bea9a 100644 --- a/README.md +++ b/README.md @@ -279,7 +279,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: From a1477549909ecd8f4dc4a0f7e9b898587f48d7c1 Mon Sep 17 00:00:00 2001 From: Michael Kuczera Date: Sat, 14 Apr 2018 12:54:36 +0200 Subject: [PATCH 19/77] Maintenance: Unify examples (#198) * [UNIFY] - move examples * [UNIFY] - move real life examples to playground * [UNIFY] - fix android build process * [MAINTENANCE] - bump gradle versions, set peer RN 40 again * [UNIFY] - fix android gradle version * [UNIFY] - update npmignore, update gitignore --- .gitignore | 7 + .npmignore | 4 +- android | 1 + e2e/firstTest.spec.js | 14 + e2e/init.js | 10 + e2e/mocha.opts | 1 + example/.babelrc | 3 - example/.gitattributes | 1 - example/.gitignore | 53 - example/.watchmanconfig | 1 - example/__tests__/index.android.js | 12 - example/__tests__/index.ios.js | 12 - example/android/app/build.gradle | 61 - example/android/app/proguard-rules.pro | 66 - .../android/app/src/main/AndroidManifest.xml | 32 - .../java/com/example/MainApplication.java | 42 - .../app/src/main/res/values/strings.xml | 3 - .../app/src/main/res/values/styles.xml | 4 - example/android/gradle.properties | 20 - example/android/keystores/BUCK | 8 - example/android/settings.gradle | 6 - example/index.android.js | 1 - example/index.ios.js | 1 - .../xcshareddata/xcschemes/example.xcscheme | 115 - .../AppIcon.appiconset/Contents.json | 38 - example/ios/exampleTests/Info.plist | 24 - example/ios/exampleTests/exampleTests.m | 70 - index.android.js | 1 - index.ios.js | 1 - index.js | 1 + ios | 1 + package.json | 45 +- playground/.babelrc | 3 + {example => playground}/.buckconfig | 0 {example => playground}/.flowconfig | 32 +- {example => playground}/android/app/BUCK | 53 +- playground/android/app/build.gradle | 151 + .../android/app/proguard-rules.pro | 4 + .../android/app/src/main/AndroidManifest.xml | 14 +- .../java/com/playground}/MainActivity.java | 4 +- .../java/com/playground}/MainApplication.java | 7 +- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../app/src/main/res/values/strings.xml | 3 + .../app/src/main/res/values/styles.xml | 8 + {example => playground}/android/build.gradle | 3 +- .../android/gradle.properties | 2 +- .../android/gradle/wrapper/gradle-wrapper.jar | Bin .../gradle/wrapper/gradle-wrapper.properties | 3 +- {example => playground}/android/gradlew | 0 {example => playground}/android/gradlew.bat | 0 playground/android/keystores/BUCK | 8 + .../keystores/debug.keystore.properties | 0 .../android/settings.gradle | 4 +- playground/app.json | 4 + .../assets}/airport-photo.jpg | Bin .../assets}/calendar-body.png | Bin .../assets}/calendar-header.png | Bin .../img => playground/assets}/card-photo.jpg | Bin .../assets}/chatheads-delete.png | Bin .../assets}/chatheads-face1.jpg | Bin .../assets}/chatheads-face2.jpg | Bin .../img => playground/assets}/icon-check.png | Bin .../img => playground/assets}/icon-clock.png | Bin .../img => playground/assets}/icon-menu.png | Bin .../img => playground/assets}/icon-trash.png | Bin .../img => playground/assets}/icon-up.png | Bin .../img => playground/assets}/map-bg.jpg | Bin .../assets}/tinder-photo.jpg | Bin playground/index.js | 4 + .../ios/playground.xcodeproj}/project.pbxproj | 424 +- .../xcschemes/playground-tvOS.xcscheme | 54 +- .../xcschemes/playground.xcscheme | 36 +- .../ios/playground}/AppDelegate.h | 0 .../ios/playground}/AppDelegate.m | 4 +- .../playground}/Base.lproj/LaunchScreen.xib | 2 +- .../AppIcon.appiconset/Contents.json | 11 +- .../playground/Images.xcassets/Contents.json | 6 + .../ios/playground}/Info.plist | 33 +- .../ios/playground}/main.m | 0 {example => playground}/src/app.js | 97 +- .../src/examples}/AlertAreas.js | 0 .../src/examples}/ChangePosition.js | 0 .../src/examples}/ChatHeads.js | 0 .../src/examples}/CollapsingHeader.js | 0 .../examples}/CollapsingHeaderWithScroll.js | 0 .../src/examples}/HandleRelayout.js | 0 .../src/examples}/HandleTouches.js | 0 .../src/examples}/IconDrawer.js | 0 .../src/examples}/MoreChatHeads.js | 0 .../src/examples}/MoreDrawers.js | 0 .../src/examples}/SideMenu.js | 2 +- .../src => playground/src/examples}/SnapTo.js | 0 .../src/examples}/SwipeableCard.js | 0 .../src/examples}/TouchesInside.js | 0 .../src/examples}/TouchesInsideStatic.js | 0 .../CollapsibleCalendar.js | 4 +- .../real-life-examples}/CollapsibleFilter.js | 4 +- .../src/real-life-examples}/Documentation.js | 0 .../src/real-life-examples}/MapPanel.js | 4 +- .../src/real-life-examples}/NotifPanel.js | 2 +- .../src/real-life-examples}/NowCard.js | 2 +- .../src/real-life-examples/RealChatHeads.js | 6 +- .../src/real-life-examples}/RowActions1.js | 6 +- .../src/real-life-examples}/RowActions2.js | 6 +- .../src/real-life-examples}/TinderCard.js | 2 +- .../src/real-life-examples}/UxInspirations.js | 0 real-life-example/.babelrc | 3 - real-life-example/.buckconfig | 6 - real-life-example/.flowconfig | 44 - real-life-example/.gitattributes | 1 - real-life-example/.gitignore | 53 - real-life-example/.watchmanconfig | 1 - real-life-example/__tests__/index.android.js | 12 - real-life-example/__tests__/index.ios.js | 12 - real-life-example/android/app/BUCK | 66 - real-life-example/android/app/build.gradle | 61 - .../android/app/src/main/ic_launcher-web.png | Bin 42476 -> 0 bytes .../main/java/com/example/MainActivity.java | 27 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 4187 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2583 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 5898 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 9593 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 13429 -> 0 bytes .../app/src/main/res/values/strings.xml | 3 - .../app/src/main/res/values/styles.xml | 4 - real-life-example/android/build.gradle | 24 - .../android/gradle/wrapper/gradle-wrapper.jar | Bin 52266 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - real-life-example/android/gradlew | 164 - real-life-example/android/gradlew.bat | 90 - real-life-example/android/keystores/BUCK | 8 - .../keystores/debug.keystore.properties | 4 - real-life-example/img/icon-menu.png | Bin 9627 -> 0 bytes real-life-example/index.android.js | 1 - real-life-example/index.ios.js | 1 - .../ios/example.xcodeproj/project.pbxproj | 1034 --- .../xcschemes/example Release.xcscheme | 105 - real-life-example/ios/example/AppDelegate.h | 16 - real-life-example/ios/example/AppDelegate.m | 41 - .../ios/example/Base.lproj/LaunchScreen.xib | 46 - .../AppIcon.appiconset/icon120.png | Bin 12333 -> 0 bytes .../AppIcon.appiconset/icon180.png | Bin 19280 -> 0 bytes real-life-example/ios/example/Info.plist | 55 - real-life-example/ios/example/icon120.png | Bin 12333 -> 0 bytes real-life-example/ios/example/icon180.png | Bin 19280 -> 0 bytes real-life-example/ios/example/icon512.png | Bin 82122 -> 0 bytes real-life-example/ios/example/main.m | 18 - real-life-example/ios/exampleTests/Info.plist | 24 - .../ios/exampleTests/exampleTests.m | 70 - real-life-example/package.json | 24 - real-life-example/src/app.js | 151 - real-life-example/yarn.lock | 3825 ----------- yarn-error.log | 5799 +++++++++++++++++ yarn.lock | 5182 ++++++++++----- 157 files changed, 9969 insertions(+), 8683 deletions(-) create mode 120000 android create mode 100644 e2e/firstTest.spec.js create mode 100644 e2e/init.js create mode 100644 e2e/mocha.opts delete mode 100644 example/.babelrc delete mode 100644 example/.gitattributes delete mode 100644 example/.gitignore delete mode 100644 example/.watchmanconfig delete mode 100644 example/__tests__/index.android.js delete mode 100644 example/__tests__/index.ios.js delete mode 100644 example/android/app/build.gradle delete mode 100644 example/android/app/proguard-rules.pro delete mode 100644 example/android/app/src/main/AndroidManifest.xml delete mode 100644 example/android/app/src/main/java/com/example/MainApplication.java delete mode 100644 example/android/app/src/main/res/values/strings.xml delete mode 100644 example/android/app/src/main/res/values/styles.xml delete mode 100644 example/android/gradle.properties delete mode 100644 example/android/keystores/BUCK delete mode 100644 example/android/settings.gradle delete mode 100644 example/index.android.js delete mode 100644 example/index.ios.js delete mode 100644 example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme delete mode 100644 example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 example/ios/exampleTests/Info.plist delete mode 100644 example/ios/exampleTests/exampleTests.m delete mode 100644 index.android.js delete mode 100644 index.ios.js create mode 100644 index.js create mode 120000 ios create mode 100644 playground/.babelrc rename {example => playground}/.buckconfig (100%) rename {example => playground}/.flowconfig (58%) rename {example => playground}/android/app/BUCK (56%) create mode 100644 playground/android/app/build.gradle rename {real-life-example => playground}/android/app/proguard-rules.pro (92%) rename {real-life-example => playground}/android/app/src/main/AndroidManifest.xml (74%) rename {example/android/app/src/main/java/com/example => playground/android/app/src/main/java/com/playground}/MainActivity.java (85%) rename {real-life-example/android/app/src/main/java/com/example => playground/android/app/src/main/java/com/playground}/MainApplication.java (89%) rename {example => playground}/android/app/src/main/res/mipmap-hdpi/ic_launcher.png (100%) rename {example => playground}/android/app/src/main/res/mipmap-mdpi/ic_launcher.png (100%) rename {example => playground}/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (100%) rename {example => playground}/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (100%) create mode 100644 playground/android/app/src/main/res/values/strings.xml create mode 100644 playground/android/app/src/main/res/values/styles.xml rename {example => playground}/android/build.gradle (88%) rename {real-life-example => playground}/android/gradle.properties (88%) rename {example => playground}/android/gradle/wrapper/gradle-wrapper.jar (100%) rename {example => playground}/android/gradle/wrapper/gradle-wrapper.properties (53%) rename {example => playground}/android/gradlew (100%) rename {example => playground}/android/gradlew.bat (100%) create mode 100644 playground/android/keystores/BUCK rename {example => playground}/android/keystores/debug.keystore.properties (100%) rename {real-life-example => playground}/android/settings.gradle (62%) create mode 100644 playground/app.json rename {real-life-example/img => playground/assets}/airport-photo.jpg (100%) rename {real-life-example/img => playground/assets}/calendar-body.png (100%) rename {real-life-example/img => playground/assets}/calendar-header.png (100%) rename {real-life-example/img => playground/assets}/card-photo.jpg (100%) rename {real-life-example/img => playground/assets}/chatheads-delete.png (100%) rename {real-life-example/img => playground/assets}/chatheads-face1.jpg (100%) rename {real-life-example/img => playground/assets}/chatheads-face2.jpg (100%) rename {real-life-example/img => playground/assets}/icon-check.png (100%) rename {real-life-example/img => playground/assets}/icon-clock.png (100%) rename {example/img => playground/assets}/icon-menu.png (100%) rename {real-life-example/img => playground/assets}/icon-trash.png (100%) rename {real-life-example/img => playground/assets}/icon-up.png (100%) rename {real-life-example/img => playground/assets}/map-bg.jpg (100%) rename {real-life-example/img => playground/assets}/tinder-photo.jpg (100%) create mode 100644 playground/index.js rename {example/ios/example.xcodeproj => playground/ios/playground.xcodeproj}/project.pbxproj (79%) rename real-life-example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme => playground/ios/playground.xcodeproj/xcshareddata/xcschemes/playground-tvOS.xcscheme (69%) rename example/ios/example.xcodeproj/xcshareddata/xcschemes/example Release.xcscheme => playground/ios/playground.xcodeproj/xcshareddata/xcschemes/playground.xcscheme (75%) rename {example/ios/example => playground/ios/playground}/AppDelegate.h (100%) rename {example/ios/example => playground/ios/playground}/AppDelegate.m (95%) rename {example/ios/example => playground/ios/playground}/Base.lproj/LaunchScreen.xib (93%) rename {real-life-example/ios/example => playground/ios/playground}/Images.xcassets/AppIcon.appiconset/Contents.json (88%) create mode 100644 playground/ios/playground/Images.xcassets/Contents.json rename {example/ios/example => playground/ios/playground}/Info.plist (84%) rename {example/ios/example => playground/ios/playground}/main.m (100%) rename {example => playground}/src/app.js (53%) rename {example/src => playground/src/examples}/AlertAreas.js (100%) rename {example/src => playground/src/examples}/ChangePosition.js (100%) rename {example/src => playground/src/examples}/ChatHeads.js (100%) rename {example/src => playground/src/examples}/CollapsingHeader.js (100%) rename {example/src => playground/src/examples}/CollapsingHeaderWithScroll.js (100%) rename {example/src => playground/src/examples}/HandleRelayout.js (100%) rename {example/src => playground/src/examples}/HandleTouches.js (100%) rename {example/src => playground/src/examples}/IconDrawer.js (100%) rename {example/src => playground/src/examples}/MoreChatHeads.js (100%) rename {example/src => playground/src/examples}/MoreDrawers.js (100%) rename {example/src => playground/src/examples}/SideMenu.js (96%) rename {example/src => playground/src/examples}/SnapTo.js (100%) rename {example/src => playground/src/examples}/SwipeableCard.js (100%) rename {example/src => playground/src/examples}/TouchesInside.js (100%) rename {example/src => playground/src/examples}/TouchesInsideStatic.js (100%) rename {real-life-example/src => playground/src/real-life-examples}/CollapsibleCalendar.js (96%) rename {real-life-example/src => playground/src/real-life-examples}/CollapsibleFilter.js (97%) rename {real-life-example/src => playground/src/real-life-examples}/Documentation.js (100%) rename {real-life-example/src => playground/src/real-life-examples}/MapPanel.js (94%) rename {real-life-example/src => playground/src/real-life-examples}/NotifPanel.js (99%) rename {real-life-example/src => playground/src/real-life-examples}/NowCard.js (97%) rename real-life-example/src/ChatHeads.js => playground/src/real-life-examples/RealChatHeads.js (95%) rename {real-life-example/src => playground/src/real-life-examples}/RowActions1.js (96%) rename {real-life-example/src => playground/src/real-life-examples}/RowActions2.js (95%) rename {real-life-example/src => playground/src/real-life-examples}/TinderCard.js (96%) rename {real-life-example/src => playground/src/real-life-examples}/UxInspirations.js (100%) delete mode 100644 real-life-example/.babelrc delete mode 100644 real-life-example/.buckconfig delete mode 100644 real-life-example/.flowconfig delete mode 100644 real-life-example/.gitattributes delete mode 100644 real-life-example/.gitignore delete mode 100644 real-life-example/.watchmanconfig delete mode 100644 real-life-example/__tests__/index.android.js delete mode 100644 real-life-example/__tests__/index.ios.js delete mode 100644 real-life-example/android/app/BUCK delete mode 100644 real-life-example/android/app/build.gradle delete mode 100644 real-life-example/android/app/src/main/ic_launcher-web.png delete mode 100644 real-life-example/android/app/src/main/java/com/example/MainActivity.java delete mode 100644 real-life-example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 real-life-example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 real-life-example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 real-life-example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 real-life-example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 real-life-example/android/app/src/main/res/values/strings.xml delete mode 100644 real-life-example/android/app/src/main/res/values/styles.xml delete mode 100644 real-life-example/android/build.gradle delete mode 100644 real-life-example/android/gradle/wrapper/gradle-wrapper.jar delete mode 100644 real-life-example/android/gradle/wrapper/gradle-wrapper.properties delete mode 100755 real-life-example/android/gradlew delete mode 100644 real-life-example/android/gradlew.bat delete mode 100644 real-life-example/android/keystores/BUCK delete mode 100644 real-life-example/android/keystores/debug.keystore.properties delete mode 100644 real-life-example/img/icon-menu.png delete mode 100644 real-life-example/index.android.js delete mode 100644 real-life-example/index.ios.js delete mode 100644 real-life-example/ios/example.xcodeproj/project.pbxproj delete mode 100644 real-life-example/ios/example.xcodeproj/xcshareddata/xcschemes/example Release.xcscheme delete mode 100644 real-life-example/ios/example/AppDelegate.h delete mode 100644 real-life-example/ios/example/AppDelegate.m delete mode 100644 real-life-example/ios/example/Base.lproj/LaunchScreen.xib delete mode 100644 real-life-example/ios/example/Images.xcassets/AppIcon.appiconset/icon120.png delete mode 100644 real-life-example/ios/example/Images.xcassets/AppIcon.appiconset/icon180.png delete mode 100644 real-life-example/ios/example/Info.plist delete mode 100644 real-life-example/ios/example/icon120.png delete mode 100644 real-life-example/ios/example/icon180.png delete mode 100644 real-life-example/ios/example/icon512.png delete mode 100644 real-life-example/ios/example/main.m delete mode 100644 real-life-example/ios/exampleTests/Info.plist delete mode 100644 real-life-example/ios/exampleTests/exampleTests.m delete mode 100644 real-life-example/package.json delete mode 100644 real-life-example/src/app.js delete mode 100644 real-life-example/yarn.lock create mode 100644 yarn-error.log diff --git a/.gitignore b/.gitignore index eb1535e4..d06293de 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,13 @@ local.properties node_modules/ npm-debug.log +# npm +package-lock.json + +# yarn +yarn.lock +yarn-error.log + # BUCK buck-out/ \.buckd/ diff --git a/.npmignore b/.npmignore index 649af0f2..0941de23 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,5 @@ -example -real-life-example +playground +e2e logos ./index.ios.js ./index.android.js 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..2700fd0a --- /dev/null +++ b/e2e/firstTest.spec.js @@ -0,0 +1,14 @@ +describe('Example', () => { + beforeEach(async () => { + await device.relaunchApp(); + }); + + it('should show Overview screen', async () => { + await expect(element(by.id('Overview'))).toBeVisible(); + }); + + it('Menu is visible', async () => { + await expect(element(by.id('Menu'))).toBeVisible(); + }); + +}) \ No newline at end of file diff --git a/e2e/init.js b/e2e/init.js new file mode 100644 index 00000000..8f38a4e1 --- /dev/null +++ b/e2e/init.js @@ -0,0 +1,10 @@ +const detox = require('detox'); +const config = require('../package.json').detox; + +before(async () => { + await detox.init(config); +}); + +after(async () => { + await detox.cleanup(); +}); \ No newline at end of file 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/.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/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/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/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/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.xcodeproj/xcshareddata/xcschemes/example.xcscheme b/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme deleted file mode 100644 index 825d4536..00000000 --- a/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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/ios/exampleTests/Info.plist b/example/ios/exampleTests/Info.plist deleted file mode 100644 index 886825cc..00000000 --- a/example/ios/exampleTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/example/ios/exampleTests/exampleTests.m b/example/ios/exampleTests/exampleTests.m deleted file mode 100644 index 3fab38df..00000000 --- a/example/ios/exampleTests/exampleTests.m +++ /dev/null @@ -1,70 +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 -#import - -#import -#import - -#define TIMEOUT_SECONDS 600 -#define TEXT_TO_LOOK_FOR @"Welcome to React Native!" - -@interface exampleTests : XCTestCase - -@end - -@implementation exampleTests - -- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test -{ - if (test(view)) { - return YES; - } - for (UIView *subview in [view subviews]) { - if ([self findSubviewInView:subview matching:test]) { - return YES; - } - } - return NO; -} - -- (void)testRendersWelcomeScreen -{ - UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; - NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; - BOOL foundElement = NO; - - __block NSString *redboxError = nil; - RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { - if (level >= RCTLogLevelError) { - redboxError = message; - } - }); - - while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { - [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - - foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { - if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { - return YES; - } - return NO; - }]; - } - - RCTSetLogFunction(RCTDefaultLogFunction); - - XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); - XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); -} - - -@end diff --git a/index.android.js b/index.android.js deleted file mode 100644 index 0d4ac79e..00000000 --- a/index.android.js +++ /dev/null @@ -1 +0,0 @@ -require('./example/index.android'); \ No newline at end of file diff --git a/index.ios.js b/index.ios.js deleted file mode 100644 index 2427c8f9..00000000 --- a/index.ios.js +++ /dev/null @@ -1 +0,0 @@ -require('./example/index.ios'); \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 00000000..d498d78c --- /dev/null +++ b/index.js @@ -0,0 +1 @@ +require('./playground/index.js'); \ No newline at end of file diff --git a/ios b/ios new file mode 120000 index 00000000..879d307c --- /dev/null +++ b/ios @@ -0,0 +1 @@ +lib/ios \ No newline at end of file diff --git a/package.json b/package.json index af04999e..c5a097b9 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "scripts": { "start": "node ./node_modules/react-native/local-cli/cli.js start", "test": "jest", - "postinstall": "ln -sf lib/{ios,android} ." + "postinstall": "ln -sf lib/{ios,android} .", + "run-android": "cd playground/android && ./gradlew installDebug" }, "dependencies": {}, "peerDependencies": { @@ -31,13 +32,43 @@ "preset": "jest-react-native" }, "devDependencies": { - "@types/react-native": ">= 0.42.0", + "@types/react-native": ">= 0.52.2", "babel-jest": "18.0.0", "babel-preset-react-native": "1.9.1", - "jest": "18.1.0", - "react": "16.0.0-alpha.12", - "react-native": "0.45.0", - "react-test-renderer": "15.4.2" + "detox": "^7.3.2", + "jest": "22.x.x", + "mocha": "^5.0.5", + "react": "^16.3.0-alpha.1", + "react-native": "0.54.4", + "react-test-renderer": "16.2.0" }, - "typings": "typings/react-native-interactable.d.ts" + "typings": "typings/react-native-interactable.d.ts", + "babel": { + "env": { + "test": { + "presets": [ + "react-native" + ] + } + } + }, + "detox": { + "test-runner": "mocha", + "specs": "e2e", + "runner-config": "e2e/mocha.opts", + "configurations": { + "ios.sim.debug": { + "binaryPath": "playground/ios/DerivedData/playground/Build/Products/Debug-iphonesimulator/playground.app", + "build": "RCT_NO_LAUNCH_PACKAGER=true xcodebuild build -scheme playground -project playground/ios/playground.xcodeproj -sdk iphonesimulator -configuration Debug -derivedDataPath playground/ios/DerivedData/playground ONLY_ACTIVE_ARCH=YES -quiet", + "type": "ios.simulator", + "name": "iPhone 7" + }, + "android.emu.debug": { + "binaryPath": "playground/android/app/build/outputs/apk/debug/app-debug.apk", + "build": "cd playground/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug", + "type": "android.emulator", + "name": "Nexus_5X_API_26" + } + } + } } diff --git a/playground/.babelrc b/playground/.babelrc new file mode 100644 index 00000000..a9ce1369 --- /dev/null +++ b/playground/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["react-native"] +} diff --git a/example/.buckconfig b/playground/.buckconfig similarity index 100% rename from example/.buckconfig rename to playground/.buckconfig diff --git a/example/.flowconfig b/playground/.flowconfig similarity index 58% rename from example/.flowconfig rename to playground/.flowconfig index 876e701f..10cb8d50 100644 --- a/example/.flowconfig +++ b/playground/.flowconfig @@ -12,33 +12,43 @@ ; 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 + +; Ignore polyfills +.*/Libraries/polyfills/.* + +; Ignore metro +.*/node_modules/metro/.* [include] [libs] node_modules/react-native/Libraries/react-native/react-native-interface.js -node_modules/react-native/flow -flow/ +node_modules/react-native/flow/ +node_modules/react-native/flow-github/ [options] -module.system=haste +emoji=true -experimental.strict_type_args=true +module.system=haste 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' +module.file_ext=.js +module.file_ext=.jsx +module.file_ext=.json +module.file_ext=.native.js + suppress_type=$FlowIssue suppress_type=$FlowFixMe -suppress_type=$FixMe +suppress_type=$FlowFixMeProps +suppress_type=$FlowFixMeState -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\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy - -unsafe.enable_getters_and_setters=true +suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError [version] -^0.36.0 +^0.65.0 diff --git a/example/android/app/BUCK b/playground/android/app/BUCK similarity index 56% rename from example/android/app/BUCK rename to playground/android/app/BUCK index 2ebdb984..5ba3825e 100644 --- a/example/android/app/BUCK +++ b/playground/android/app/BUCK @@ -1,5 +1,3 @@ -import re - # To learn about Buck see [Docs](https://buckbuild.com/). # To run your application with Buck: # - install Buck @@ -11,8 +9,9 @@ import re # lib_deps = [] + for jarfile in glob(['libs/*.jar']): - name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) + name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] lib_deps.append(':' + name) prebuilt_jar( name = name, @@ -20,7 +19,7 @@ for jarfile in glob(['libs/*.jar']): ) for aarfile in glob(['libs/*.aar']): - name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) + name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] lib_deps.append(':' + name) android_prebuilt_aar( name = name, @@ -28,39 +27,39 @@ for aarfile in glob(['libs/*.aar']): ) android_library( - name = 'all-libs', - exported_deps = lib_deps + name = "all-libs", + exported_deps = lib_deps, ) android_library( - name = 'app-code', - srcs = glob([ - 'src/main/java/**/*.java', - ]), - deps = [ - ':all-libs', - ':build_config', - ':res', - ], + name = "app-code", + srcs = glob([ + "src/main/java/**/*.java", + ]), + deps = [ + ":all-libs", + ":build_config", + ":res", + ], ) android_build_config( - name = 'build_config', - package = 'com.example', + name = "build_config", + package = "com.playground", ) android_resource( - name = 'res', - res = 'src/main/res', - package = 'com.example', + name = "res", + package = "com.playground", + res = "src/main/res", ) android_binary( - name = 'app', - package_type = 'debug', - manifest = 'src/main/AndroidManifest.xml', - keystore = '//android/keystores:debug', - deps = [ - ':app-code', - ], + name = "app", + keystore = "//android/keystores:debug", + manifest = "src/main/AndroidManifest.xml", + package_type = "debug", + deps = [ + ":app-code", + ], ) diff --git a/playground/android/app/build.gradle b/playground/android/app/build.gradle new file mode 100644 index 00000000..e5c2a783 --- /dev/null +++ b/playground/android/app/build.gradle @@ -0,0 +1,151 @@ +apply plugin: "com.android.application" + +import com.android.build.OutputFile + +/** + * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets + * and bundleReleaseJsAndAssets). + * These basically call `react-native bundle` with the correct arguments during the Android build + * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the + * bundle directly from the development server. Below you can see all the possible configurations + * and their defaults. If you decide to add a configuration block, make sure to add it before the + * `apply from: "../../node_modules/react-native/react.gradle"` line. + * + * project.ext.react = [ + * // the name of the generated asset file containing your JS bundle + * bundleAssetName: "index.android.bundle", + * + * // the entry file for bundle generation + * entryFile: "index.android.js", + * + * // whether to bundle JS and assets in debug mode + * bundleInDebug: false, + * + * // whether to bundle JS and assets in release mode + * bundleInRelease: true, + * + * // whether to bundle JS and assets in another build variant (if configured). + * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants + * // The configuration property can be in the following formats + * // 'bundleIn${productFlavor}${buildType}' + * // 'bundleIn${buildType}' + * // bundleInFreeDebug: true, + * // bundleInPaidRelease: true, + * // bundleInBeta: true, + * + * // whether to disable dev mode in custom build variants (by default only disabled in release) + * // for example: to disable dev mode in the staging build type (if configured) + * devDisabledInStaging: true, + * // The configuration property can be in the following formats + * // 'devDisabledIn${productFlavor}${buildType}' + * // 'devDisabledIn${buildType}' + * + * // the root of your project, i.e. where "package.json" lives + * root: "../../", + * + * // where to put the JS bundle asset in debug mode + * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", + * + * // where to put the JS bundle asset in release mode + * jsBundleDirRelease: "$buildDir/intermediates/assets/release", + * + * // where to put drawable resources / React Native assets, e.g. the ones you use via + * // require('./image.png')), in debug mode + * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", + * + * // where to put drawable resources / React Native assets, e.g. the ones you use via + * // require('./image.png')), in release mode + * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", + * + * // by default the gradle tasks are skipped if none of the JS files or assets change; this means + * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to + * // date; if you have any other folders that you want to ignore for performance reasons (gradle + * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ + * // for example, you might want to remove it from here. + * inputExcludes: ["android/**", "ios/**"], + * + * // override which node gets called and with what additional arguments + * nodeExecutableAndArgs: ["node"], + * + * // supply additional arguments to the packager + * extraPackagerArgs: [] + * ] + */ + +project.ext.react = [ + entryFile: "index.js" +] + +apply from: "../../../node_modules/react-native/react.gradle" + +/** + * Set this to true to create two separate APKs instead of one: + * - An APK that only works on ARM devices + * - An APK that only works on x86 devices + * The advantage is the size of the APK is reduced by about 4MB. + * Upload all the APKs to the Play Store and people will download + * the correct one based on the CPU architecture of their device. + */ +def enableSeparateBuildPerCPUArchitecture = false + +/** + * Run Proguard to shrink the Java bytecode in release builds. + */ +def enableProguardInReleaseBuilds = false + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.1" + + defaultConfig { + applicationId "com.playground" + minSdkVersion 16 + targetSdkVersion 22 + versionCode 1 + versionName "1.0" + ndk { + abiFilters "armeabi-v7a", "x86" + } + } + splits { + abi { + reset() + enable enableSeparateBuildPerCPUArchitecture + universalApk false // If true, also generate a universal APK + include "armeabi-v7a", "x86" + } + } + buildTypes { + release { + minifyEnabled enableProguardInReleaseBuilds + 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:23.0.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/real-life-example/android/app/proguard-rules.pro b/playground/android/app/proguard-rules.pro similarity index 92% rename from real-life-example/android/app/proguard-rules.pro rename to playground/android/app/proguard-rules.pro index 48361a90..6e8516c8 100644 --- a/real-life-example/android/app/proguard-rules.pro +++ b/playground/android/app/proguard-rules.pro @@ -50,6 +50,10 @@ -dontwarn com.facebook.react.** +# TextLayoutBuilder uses a non-public Android constructor within StaticLayout. +# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. +-dontwarn android.text.StaticLayout + # okhttp -keepattributes Signature diff --git a/real-life-example/android/app/src/main/AndroidManifest.xml b/playground/android/app/src/main/AndroidManifest.xml similarity index 74% rename from real-life-example/android/app/src/main/AndroidManifest.xml rename to playground/android/app/src/main/AndroidManifest.xml index 802178cc..8154787a 100644 --- a/real-life-example/android/app/src/main/AndroidManifest.xml +++ b/playground/android/app/src/main/AndroidManifest.xml @@ -1,26 +1,20 @@ + package="com.playground"> - - - + android:configChanges="keyboard|keyboardHidden|orientation|screenSize" + android:windowSoftInputMode="adjustResize"> diff --git a/example/android/app/src/main/java/com/example/MainActivity.java b/playground/android/app/src/main/java/com/playground/MainActivity.java similarity index 85% rename from example/android/app/src/main/java/com/example/MainActivity.java rename to playground/android/app/src/main/java/com/playground/MainActivity.java index e84b7255..5ab775bc 100644 --- a/example/android/app/src/main/java/com/example/MainActivity.java +++ b/playground/android/app/src/main/java/com/playground/MainActivity.java @@ -1,4 +1,4 @@ -package com.example; +package com.playground; import com.facebook.react.ReactActivity; @@ -10,6 +10,6 @@ public class MainActivity extends ReactActivity { */ @Override protected String getMainComponentName() { - return "example"; + return "playground"; } } diff --git a/real-life-example/android/app/src/main/java/com/example/MainApplication.java b/playground/android/app/src/main/java/com/playground/MainApplication.java similarity index 89% rename from real-life-example/android/app/src/main/java/com/example/MainApplication.java rename to playground/android/app/src/main/java/com/playground/MainApplication.java index 902e732e..65228ee0 100644 --- a/real-life-example/android/app/src/main/java/com/example/MainApplication.java +++ b/playground/android/app/src/main/java/com/playground/MainApplication.java @@ -1,4 +1,4 @@ -package com.example; +package com.playground; import android.app.Application; @@ -27,6 +27,11 @@ protected List getPackages() { new Interactable() ); } + + @Override + protected String getJSMainModuleName() { + return "index"; + } }; @Override diff --git a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/playground/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to playground/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/playground/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to playground/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/playground/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to playground/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/playground/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to playground/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/playground/android/app/src/main/res/values/strings.xml b/playground/android/app/src/main/res/values/strings.xml new file mode 100644 index 00000000..a4230f88 --- /dev/null +++ b/playground/android/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + playground + diff --git a/playground/android/app/src/main/res/values/styles.xml b/playground/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..319eb0ca --- /dev/null +++ b/playground/android/app/src/main/res/values/styles.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/example/android/build.gradle b/playground/android/build.gradle similarity index 88% rename from example/android/build.gradle rename to playground/android/build.gradle index 0d911f26..eaccd0d7 100644 --- a/example/android/build.gradle +++ b/playground/android/build.gradle @@ -3,9 +3,10 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.0' + classpath 'com.android.tools.build:gradle:3.0.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/real-life-example/android/gradle.properties b/playground/android/gradle.properties similarity index 88% rename from real-life-example/android/gradle.properties rename to playground/android/gradle.properties index 21edee9d..1fd964e9 100644 --- a/real-life-example/android/gradle.properties +++ b/playground/android/gradle.properties @@ -10,7 +10,7 @@ # 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 +# 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 diff --git a/example/android/gradle/wrapper/gradle-wrapper.jar b/playground/android/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from example/android/gradle/wrapper/gradle-wrapper.jar rename to playground/android/gradle/wrapper/gradle-wrapper.jar diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/playground/android/gradle/wrapper/gradle-wrapper.properties similarity index 53% rename from example/android/gradle/wrapper/gradle-wrapper.properties rename to playground/android/gradle/wrapper/gradle-wrapper.properties index c62d377d..3a3fecec 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/playground/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Thu Feb 09 18:04:42 IST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip +distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip diff --git a/example/android/gradlew b/playground/android/gradlew similarity index 100% rename from example/android/gradlew rename to playground/android/gradlew diff --git a/example/android/gradlew.bat b/playground/android/gradlew.bat similarity index 100% rename from example/android/gradlew.bat rename to playground/android/gradlew.bat diff --git a/playground/android/keystores/BUCK b/playground/android/keystores/BUCK new file mode 100644 index 00000000..88e4c31b --- /dev/null +++ b/playground/android/keystores/BUCK @@ -0,0 +1,8 @@ +keystore( + name = "debug", + properties = "debug.keystore.properties", + store = "debug.keystore", + visibility = [ + "PUBLIC", + ], +) diff --git a/example/android/keystores/debug.keystore.properties b/playground/android/keystores/debug.keystore.properties similarity index 100% rename from example/android/keystores/debug.keystore.properties rename to playground/android/keystores/debug.keystore.properties diff --git a/real-life-example/android/settings.gradle b/playground/android/settings.gradle similarity index 62% rename from real-life-example/android/settings.gradle rename to playground/android/settings.gradle index 59a97039..281334d1 100644 --- a/real-life-example/android/settings.gradle +++ b/playground/android/settings.gradle @@ -1,6 +1,6 @@ -rootProject.name = 'example' +rootProject.name = 'playground' include ':app' include ':react-native-interactable' -project(':react-native-interactable').projectDir = new File(rootProject.projectDir, '../../lib/android') +project(':react-native-interactable').projectDir = new File(rootProject.projectDir, '../../lib/android') \ No newline at end of file diff --git a/playground/app.json b/playground/app.json new file mode 100644 index 00000000..f462299f --- /dev/null +++ b/playground/app.json @@ -0,0 +1,4 @@ +{ + "name": "playground", + "displayName": "playground" +} \ No newline at end of file diff --git a/real-life-example/img/airport-photo.jpg b/playground/assets/airport-photo.jpg similarity index 100% rename from real-life-example/img/airport-photo.jpg rename to playground/assets/airport-photo.jpg diff --git a/real-life-example/img/calendar-body.png b/playground/assets/calendar-body.png similarity index 100% rename from real-life-example/img/calendar-body.png rename to playground/assets/calendar-body.png diff --git a/real-life-example/img/calendar-header.png b/playground/assets/calendar-header.png similarity index 100% rename from real-life-example/img/calendar-header.png rename to playground/assets/calendar-header.png diff --git a/real-life-example/img/card-photo.jpg b/playground/assets/card-photo.jpg similarity index 100% rename from real-life-example/img/card-photo.jpg rename to playground/assets/card-photo.jpg diff --git a/real-life-example/img/chatheads-delete.png b/playground/assets/chatheads-delete.png similarity index 100% rename from real-life-example/img/chatheads-delete.png rename to playground/assets/chatheads-delete.png diff --git a/real-life-example/img/chatheads-face1.jpg b/playground/assets/chatheads-face1.jpg similarity index 100% rename from real-life-example/img/chatheads-face1.jpg rename to playground/assets/chatheads-face1.jpg diff --git a/real-life-example/img/chatheads-face2.jpg b/playground/assets/chatheads-face2.jpg similarity index 100% rename from real-life-example/img/chatheads-face2.jpg rename to playground/assets/chatheads-face2.jpg diff --git a/real-life-example/img/icon-check.png b/playground/assets/icon-check.png similarity index 100% rename from real-life-example/img/icon-check.png rename to playground/assets/icon-check.png diff --git a/real-life-example/img/icon-clock.png b/playground/assets/icon-clock.png similarity index 100% rename from real-life-example/img/icon-clock.png rename to playground/assets/icon-clock.png diff --git a/example/img/icon-menu.png b/playground/assets/icon-menu.png similarity index 100% rename from example/img/icon-menu.png rename to playground/assets/icon-menu.png diff --git a/real-life-example/img/icon-trash.png b/playground/assets/icon-trash.png similarity index 100% rename from real-life-example/img/icon-trash.png rename to playground/assets/icon-trash.png diff --git a/real-life-example/img/icon-up.png b/playground/assets/icon-up.png similarity index 100% rename from real-life-example/img/icon-up.png rename to playground/assets/icon-up.png diff --git a/real-life-example/img/map-bg.jpg b/playground/assets/map-bg.jpg similarity index 100% rename from real-life-example/img/map-bg.jpg rename to playground/assets/map-bg.jpg diff --git a/real-life-example/img/tinder-photo.jpg b/playground/assets/tinder-photo.jpg similarity index 100% rename from real-life-example/img/tinder-photo.jpg rename to playground/assets/tinder-photo.jpg diff --git a/playground/index.js b/playground/index.js new file mode 100644 index 00000000..f68479c0 --- /dev/null +++ b/playground/index.js @@ -0,0 +1,4 @@ +import { AppRegistry } from 'react-native'; +import App from './src/app'; + +AppRegistry.registerComponent('playground', () => App); diff --git a/example/ios/example.xcodeproj/project.pbxproj b/playground/ios/playground.xcodeproj/project.pbxproj similarity index 79% rename from example/ios/example.xcodeproj/project.pbxproj rename to playground/ios/playground.xcodeproj/project.pbxproj index ec20d1b1..f86073e5 100644 --- a/example/ios/example.xcodeproj/project.pbxproj +++ b/playground/ios/playground.xcodeproj/project.pbxproj @@ -12,7 +12,6 @@ 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; - 00E356F31AD99517003FC87E /* exampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* exampleTests.m */; }; 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; @@ -20,11 +19,11 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; - A71254AB1F0E9F7F0066860E /* libInteractable.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A75ACA031F0E6C2F00B0EEA2 /* libInteractable.a */; }; + ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; }; + DA971B0D2073687400515475 /* libInteractable.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA39D3CF2073443700E787CD /* libInteractable.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -63,13 +62,6 @@ remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; remoteInfo = RCTVibration; }; - 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 13B07F861A680F5B00A75B9A; - remoteInfo = example; - }; 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; @@ -91,6 +83,27 @@ remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; remoteInfo = React; }; + 2D16E6711FA4F8DC00B85C8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = ADD01A681E09402E00F6D226; + remoteInfo = "RCTBlob-tvOS"; + }; + 2D16E6831FA4F8DC00B85C8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3DBE0D001F3B181A0099AA32; + remoteInfo = fishhook; + }; + 2D16E6851FA4F8DC00B85C8A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32; + remoteInfo = "fishhook-tvOS"; + }; 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; @@ -210,40 +223,75 @@ remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; - A71254891F0E9DB80066860E /* PBXContainerItemProxy */ = { + ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A75AC9FE1F0E6C2E00B0EEA2 /* Interactable.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = CC0127961E3ACC3900B23C9F; - remoteInfo = Interactable; + containerPortal = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 358F4ED71D1E81A9004DF814; + remoteInfo = RCTBlob; + }; + DA39D3BA2073441100E787CD /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = EBF21BDC1FC498900052F4D5; + remoteInfo = jsinspector; + }; + DA39D3BC2073441100E787CD /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = EBF21BFA1FC4989A0052F4D5; + remoteInfo = "jsinspector-tvOS"; }; - A71254A71F0E9DB80066860E /* PBXContainerItemProxy */ = { + DA39D3BE2073441100E787CD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; proxyType = 2; remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7; remoteInfo = "third-party"; }; - A71254A91F0E9DB80066860E /* PBXContainerItemProxy */ = { + DA39D3C02073441100E787CD /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D383D3C1EBD27B6005632C8; + remoteInfo = "third-party-tvOS"; + }; + DA39D3C22073441100E787CD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; proxyType = 2; remoteGlobalIDString = 139D7E881E25C6D100323FB7; remoteInfo = "double-conversion"; }; - A75ACA021F0E6C2F00B0EEA2 /* PBXContainerItemProxy */ = { + DA39D3C42073441100E787CD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = A75AC9FE1F0E6C2E00B0EEA2 /* Interactable.xcodeproj */; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; proxyType = 2; - remoteGlobalIDString = CC0127971E3ACC3900B23C9F; - remoteInfo = Interactable; + remoteGlobalIDString = 3D383D621EBD27B9005632C8; + remoteInfo = "double-conversion-tvOS"; }; - A761CB8C1F20D427004720AF /* PBXContainerItemProxy */ = { + DA39D3C62073441100E787CD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 83CBBA2D1A601D0E00E9B192; - remoteInfo = React; + proxyType = 2; + remoteGlobalIDString = 9936F3131F5F2E4B0010BF04; + remoteInfo = privatedata; + }; + DA39D3C82073441100E787CD /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 9936F32F1F5F2E5B0010BF04; + remoteInfo = "privatedata-tvOS"; + }; + DA39D3CE2073443700E787CD /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = DA39D3CA2073443700E787CD /* Interactable.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = CC0127971E3ACC3900B23C9F; + remoteInfo = Interactable; }; /* End PBXContainerItemProxy section */ @@ -254,41 +302,34 @@ 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; - 00E356EE1AD99517003FC87E /* exampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = exampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* exampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = exampleTests.m; sourceTree = ""; }; 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; - 13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = example/AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = example/AppDelegate.m; sourceTree = ""; }; + 13B07F961A680F5B00A75B9A /* playground.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = playground.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = playground/AppDelegate.h; sourceTree = ""; }; + 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = playground/AppDelegate.m; sourceTree = ""; }; 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = ""; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = playground/Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = playground/Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = playground/main.m; sourceTree = ""; }; 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; + 2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; }; 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; - A75AC9FE1F0E6C2E00B0EEA2 /* Interactable.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Interactable.xcodeproj; path = ../../lib/ios/Interactable.xcodeproj; sourceTree = ""; }; + ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = ""; }; + DA39D3CA2073443700E787CD /* Interactable.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Interactable.xcodeproj; path = ../../lib/ios/Interactable.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 00E356EB1AD99517003FC87E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A71254AB1F0E9F7F0066860E /* libInteractable.a in Frameworks */, + DA971B0D2073687400515475 /* libInteractable.a in Frameworks */, + ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */, 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, 146834051AC3E58100842450 /* libReact.a in Frameworks */, + 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, @@ -346,23 +387,6 @@ name = Products; sourceTree = ""; }; - 00E356EF1AD99517003FC87E /* exampleTests */ = { - isa = PBXGroup; - children = ( - 00E356F21AD99517003FC87E /* exampleTests.m */, - 00E356F01AD99517003FC87E /* Supporting Files */, - ); - path = exampleTests; - sourceTree = ""; - }; - 00E356F01AD99517003FC87E /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 00E356F11AD99517003FC87E /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; 139105B71AF99BAD00B5F7CC /* Products */ = { isa = PBXGroup; children = ( @@ -377,11 +401,13 @@ children = ( 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */, + 2D16E6841FA4F8DC00B85C8A /* libfishhook.a */, + 2D16E6861FA4F8DC00B85C8A /* libfishhook-tvOS.a */, ); name = Products; sourceTree = ""; }; - 13B07FAE1A68108700A75B9A /* example */ = { + 13B07FAE1A68108700A75B9A /* playground */ = { isa = PBXGroup; children = ( 008F07F21AC5B25A0029DE68 /* main.jsbundle */, @@ -392,7 +418,7 @@ 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 13B07FB71A68108700A75B9A /* main.m */, ); - name = example; + name = playground; sourceTree = ""; }; 146834001AC3E56700842450 /* Products */ = { @@ -406,12 +432,26 @@ 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */, 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */, 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */, - A71254A81F0E9DB80066860E /* libthird-party.a */, - A71254AA1F0E9DB80066860E /* libdouble-conversion.a */, + DA39D3BB2073441100E787CD /* libjsinspector.a */, + DA39D3BD2073441100E787CD /* libjsinspector-tvOS.a */, + DA39D3BF2073441100E787CD /* libthird-party.a */, + DA39D3C12073441100E787CD /* libthird-party.a */, + DA39D3C32073441100E787CD /* libdouble-conversion.a */, + DA39D3C52073441100E787CD /* libdouble-conversion.a */, + DA39D3C72073441100E787CD /* libprivatedata.a */, + DA39D3C92073441100E787CD /* libprivatedata-tvOS.a */, ); name = Products; sourceTree = ""; }; + 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { + isa = PBXGroup; + children = ( + 2D16E6891FA4F8E400B85C8A /* libReact.a */, + ); + name = Frameworks; + sourceTree = ""; + }; 5E91572E1DD0AC6500FF2AA8 /* Products */ = { isa = PBXGroup; children = ( @@ -433,10 +473,11 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( - A75AC9FE1F0E6C2E00B0EEA2 /* Interactable.xcodeproj */, + DA39D3CA2073443700E787CD /* Interactable.xcodeproj */, 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */, 146833FF1AC3E56700842450 /* React.xcodeproj */, 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, + ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */, 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, @@ -461,28 +502,37 @@ 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( - 13B07FAE1A68108700A75B9A /* example */, + 13B07FAE1A68108700A75B9A /* playground */, 832341AE1AAA6A7D00B99B32 /* Libraries */, - 00E356EF1AD99517003FC87E /* exampleTests */, 83CBBA001A601CBA00E9B192 /* Products */, + 2D16E6871FA4F8E400B85C8A /* Frameworks */, ); indentWidth = 2; sourceTree = ""; tabWidth = 2; + usesTabs = 0; }; 83CBBA001A601CBA00E9B192 /* Products */ = { isa = PBXGroup; children = ( - 13B07F961A680F5B00A75B9A /* example.app */, - 00E356EE1AD99517003FC87E /* exampleTests.xctest */, + 13B07F961A680F5B00A75B9A /* playground.app */, + ); + name = Products; + sourceTree = ""; + }; + ADBDB9201DFEBF0600ED6528 /* Products */ = { + isa = PBXGroup; + children = ( + ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */, + 2D16E6721FA4F8DC00B85C8A /* libRCTBlob-tvOS.a */, ); name = Products; sourceTree = ""; }; - A75AC9FF1F0E6C2E00B0EEA2 /* Products */ = { + DA39D3CB2073443700E787CD /* Products */ = { isa = PBXGroup; children = ( - A75ACA031F0E6C2F00B0EEA2 /* libInteractable.a */, + DA39D3CF2073443700E787CD /* libInteractable.a */, ); name = Products; sourceTree = ""; @@ -490,27 +540,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 00E356ED1AD99517003FC87E /* exampleTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "exampleTests" */; - buildPhases = ( - 00E356EA1AD99517003FC87E /* Sources */, - 00E356EB1AD99517003FC87E /* Frameworks */, - 00E356EC1AD99517003FC87E /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 00E356F51AD99517003FC87E /* PBXTargetDependency */, - ); - name = exampleTests; - productName = exampleTests; - productReference = 00E356EE1AD99517003FC87E /* exampleTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 13B07F861A680F5B00A75B9A /* example */ = { + 13B07F861A680F5B00A75B9A /* playground */ = { isa = PBXNativeTarget; - buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */; + buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "playground" */; buildPhases = ( 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, @@ -520,12 +552,10 @@ buildRules = ( ); dependencies = ( - A761CB8D1F20D427004720AF /* PBXTargetDependency */, - A712548A1F0E9DB80066860E /* PBXTargetDependency */, ); - name = example; + name = playground; productName = "Hello World"; - productReference = 13B07F961A680F5B00A75B9A /* example.app */; + productReference = 13B07F961A680F5B00A75B9A /* playground.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -536,18 +566,8 @@ attributes = { LastUpgradeCheck = 0610; ORGANIZATIONNAME = Facebook; - TargetAttributes = { - 00E356ED1AD99517003FC87E = { - CreatedOnToolsVersion = 6.2; - DevelopmentTeam = S3GLW74Y8N; - TestTargetID = 13B07F861A680F5B00A75B9A; - }; - 13B07F861A680F5B00A75B9A = { - DevelopmentTeam = S3GLW74Y8N; - }; - }; }; - buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */; + buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "playground" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -560,8 +580,8 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = A75AC9FF1F0E6C2E00B0EEA2 /* Products */; - ProjectRef = A75AC9FE1F0E6C2E00B0EEA2 /* Interactable.xcodeproj */; + ProductGroup = DA39D3CB2073443700E787CD /* Products */; + ProjectRef = DA39D3CA2073443700E787CD /* Interactable.xcodeproj */; }, { ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; @@ -571,6 +591,10 @@ ProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */; ProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; }, + { + ProductGroup = ADBDB9201DFEBF0600ED6528 /* Products */; + ProjectRef = ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */; + }, { ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; @@ -610,8 +634,7 @@ ); projectRoot = ""; targets = ( - 13B07F861A680F5B00A75B9A /* example */, - 00E356ED1AD99517003FC87E /* exampleTests */, + 13B07F861A680F5B00A75B9A /* playground */, ); }; /* End PBXProject section */ @@ -673,6 +696,27 @@ remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 2D16E6721FA4F8DC00B85C8A /* libRCTBlob-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTBlob-tvOS.a"; + remoteRef = 2D16E6711FA4F8DC00B85C8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 2D16E6841FA4F8DC00B85C8A /* libfishhook.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libfishhook.a; + remoteRef = 2D16E6831FA4F8DC00B85C8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 2D16E6861FA4F8DC00B85C8A /* libfishhook-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libfishhook-tvOS.a"; + remoteRef = 2D16E6851FA4F8DC00B85C8A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -792,37 +836,79 @@ remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - A71254A81F0E9DB80066860E /* libthird-party.a */ = { + ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTBlob.a; + remoteRef = ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + DA39D3BB2073441100E787CD /* libjsinspector.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libjsinspector.a; + remoteRef = DA39D3BA2073441100E787CD /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + DA39D3BD2073441100E787CD /* libjsinspector-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libjsinspector-tvOS.a"; + remoteRef = DA39D3BC2073441100E787CD /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + DA39D3BF2073441100E787CD /* libthird-party.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libthird-party.a"; + remoteRef = DA39D3BE2073441100E787CD /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + DA39D3C12073441100E787CD /* libthird-party.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libthird-party.a"; - remoteRef = A71254A71F0E9DB80066860E /* PBXContainerItemProxy */; + remoteRef = DA39D3C02073441100E787CD /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + DA39D3C32073441100E787CD /* libdouble-conversion.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libdouble-conversion.a"; + remoteRef = DA39D3C22073441100E787CD /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - A71254AA1F0E9DB80066860E /* libdouble-conversion.a */ = { + DA39D3C52073441100E787CD /* libdouble-conversion.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libdouble-conversion.a"; - remoteRef = A71254A91F0E9DB80066860E /* PBXContainerItemProxy */; + remoteRef = DA39D3C42073441100E787CD /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + DA39D3C72073441100E787CD /* libprivatedata.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libprivatedata.a; + remoteRef = DA39D3C62073441100E787CD /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + DA39D3C92073441100E787CD /* libprivatedata-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libprivatedata-tvOS.a"; + remoteRef = DA39D3C82073441100E787CD /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - A75ACA031F0E6C2F00B0EEA2 /* libInteractable.a */ = { + DA39D3CF2073443700E787CD /* libInteractable.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libInteractable.a; - remoteRef = A75ACA021F0E6C2F00B0EEA2 /* PBXContainerItemProxy */; + remoteRef = DA39D3CE2073443700E787CD /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ - 00E356EC1AD99517003FC87E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 13B07F8E1A680F5B00A75B9A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -837,7 +923,7 @@ /* Begin PBXShellScriptBuildPhase section */ 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { isa = PBXShellScriptBuildPhase; - buildActionMask = 12; + buildActionMask = 2147483647; files = ( ); inputPaths = ( @@ -847,19 +933,11 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../../node_modules/react-native/packager/react-native-xcode.sh index.ios.js\n"; + shellScript = "export NODE_BINARY=node\n../../node_modules/react-native/scripts/react-native-xcode.sh"; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 00E356EA1AD99517003FC87E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 00E356F31AD99517003FC87E /* exampleTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 13B07F871A680F5B00A75B9A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -871,24 +949,6 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 13B07F861A680F5B00A75B9A /* example */; - targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; - }; - A712548A1F0E9DB80066860E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Interactable; - targetProxy = A71254891F0E9DB80066860E /* PBXContainerItemProxy */; - }; - A761CB8D1F20D427004720AF /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = React; - targetProxy = A761CB8C1F20D427004720AF /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { isa = PBXVariantGroup; @@ -896,58 +956,26 @@ 13B07FB21A68108700A75B9A /* Base */, ); name = LaunchScreen.xib; - path = example; + path = playground; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 00E356F61AD99517003FC87E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - DEVELOPMENT_TEAM = S3GLW74Y8N; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = exampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/example"; - }; - name = Debug; - }; - 00E356F71AD99517003FC87E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - COPY_PHASE_STRIP = NO; - DEVELOPMENT_TEAM = S3GLW74Y8N; - INFOPLIST_FILE = exampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/example"; - }; - name = Release; - }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CURRENT_PROJECT_VERSION = 1; DEAD_CODE_STRIPPING = NO; - DEVELOPMENT_TEAM = S3GLW74Y8N; - INFOPLIST_FILE = example/Info.plist; + INFOPLIST_FILE = playground/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", "-lc++", ); - PRODUCT_NAME = example; + PRODUCT_NAME = playground; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -957,15 +985,14 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = S3GLW74Y8N; - INFOPLIST_FILE = example/Info.plist; + INFOPLIST_FILE = playground/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", "-lc++", ); - PRODUCT_NAME = example; + PRODUCT_NAME = playground; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; @@ -1004,7 +1031,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -1039,7 +1066,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; @@ -1049,16 +1076,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "exampleTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 00E356F61AD99517003FC87E /* Debug */, - 00E356F71AD99517003FC87E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */ = { + 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "playground" */ = { isa = XCConfigurationList; buildConfigurations = ( 13B07F941A680F5B00A75B9A /* Debug */, @@ -1067,7 +1085,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */ = { + 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "playground" */ = { isa = XCConfigurationList; buildConfigurations = ( 83CBBA201A601CBA00E9B192 /* Debug */, diff --git a/real-life-example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme b/playground/ios/playground.xcodeproj/xcshareddata/xcschemes/playground-tvOS.xcscheme similarity index 69% rename from real-life-example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme rename to playground/ios/playground.xcodeproj/xcshareddata/xcschemes/playground-tvOS.xcscheme index eae95137..eee5e82f 100644 --- a/real-life-example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme +++ b/playground/ios/playground.xcodeproj/xcshareddata/xcschemes/playground-tvOS.xcscheme @@ -1,6 +1,6 @@ @@ -28,10 +28,10 @@ buildForAnalyzing = "YES"> + BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7" + BuildableName = "playground-tvOS.app" + BlueprintName = "playground-tvOS" + ReferencedContainer = "container:playground.xcodeproj"> + BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7" + BuildableName = "playground-tvOSTests.xctest" + BlueprintName = "playground-tvOSTests" + ReferencedContainer = "container:playground.xcodeproj"> @@ -60,20 +60,20 @@ skipped = "NO"> + BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7" + BuildableName = "playground-tvOSTests.xctest" + BlueprintName = "playground-tvOSTests" + ReferencedContainer = "container:playground.xcodeproj"> + BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7" + BuildableName = "playground-tvOS.app" + BlueprintName = "playground-tvOS" + ReferencedContainer = "container:playground.xcodeproj"> @@ -93,10 +93,10 @@ runnableDebuggingMode = "0"> + BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7" + BuildableName = "playground-tvOS.app" + BlueprintName = "playground-tvOS" + ReferencedContainer = "container:playground.xcodeproj"> @@ -112,10 +112,10 @@ runnableDebuggingMode = "0"> + BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7" + BuildableName = "playground-tvOS.app" + BlueprintName = "playground-tvOS" + ReferencedContainer = "container:playground.xcodeproj"> diff --git a/example/ios/example.xcodeproj/xcshareddata/xcschemes/example Release.xcscheme b/playground/ios/playground.xcodeproj/xcshareddata/xcschemes/playground.xcscheme similarity index 75% rename from example/ios/example.xcodeproj/xcshareddata/xcschemes/example Release.xcscheme rename to playground/ios/playground.xcodeproj/xcshareddata/xcschemes/playground.xcscheme index 459153a3..643a4f7c 100644 --- a/example/ios/example.xcodeproj/xcshareddata/xcschemes/example Release.xcscheme +++ b/playground/ios/playground.xcodeproj/xcshareddata/xcschemes/playground.xcscheme @@ -17,7 +17,7 @@ BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192" BuildableName = "libReact.a" BlueprintName = "React" - ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj"> + ReferencedContainer = "container:../../node_modules/react-native/React/React.xcodeproj"> + BuildableName = "playground.app" + BlueprintName = "playground" + ReferencedContainer = "container:playground.xcodeproj"> @@ -47,18 +48,19 @@ + BuildableName = "playground.app" + BlueprintName = "playground" + ReferencedContainer = "container:playground.xcodeproj"> + BuildableName = "playground.app" + BlueprintName = "playground" + ReferencedContainer = "container:playground.xcodeproj"> @@ -89,9 +91,9 @@ + BuildableName = "playground.app" + BlueprintName = "playground" + ReferencedContainer = "container:playground.xcodeproj"> diff --git a/example/ios/example/AppDelegate.h b/playground/ios/playground/AppDelegate.h similarity index 100% rename from example/ios/example/AppDelegate.h rename to playground/ios/playground/AppDelegate.h diff --git a/example/ios/example/AppDelegate.m b/playground/ios/playground/AppDelegate.m similarity index 95% rename from example/ios/example/AppDelegate.m rename to playground/ios/playground/AppDelegate.m index 0f5c06b3..2328d4e4 100644 --- a/example/ios/example/AppDelegate.m +++ b/playground/ios/playground/AppDelegate.m @@ -18,10 +18,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( { NSURL *jsCodeLocation; - jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; + jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation - moduleName:@"example" + moduleName:@"playground" initialProperties:nil launchOptions:launchOptions]; rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; diff --git a/example/ios/example/Base.lproj/LaunchScreen.xib b/playground/ios/playground/Base.lproj/LaunchScreen.xib similarity index 93% rename from example/ios/example/Base.lproj/LaunchScreen.xib rename to playground/ios/playground/Base.lproj/LaunchScreen.xib index 9e04807a..c04d201d 100644 --- a/example/ios/example/Base.lproj/LaunchScreen.xib +++ b/playground/ios/playground/Base.lproj/LaunchScreen.xib @@ -18,7 +18,7 @@ -