Skip to content

Commit 1a017bd

Browse files
authored
Merge branch 'master' into master
2 parents 340249b + 20f530d commit 1a017bd

File tree

170 files changed

+10253
-8772
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+10253
-8772
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,18 @@ local.properties
3434
node_modules/
3535
npm-debug.log
3636

37+
# npm
38+
package-lock.json
39+
40+
# yarn
41+
yarn.lock
42+
yarn-error.log
43+
3744
# BUCK
3845
buck-out/
3946
\.buckd/
4047
android/app/libs
4148
android/keystores/debug.keystore
49+
50+
# Bundle artifact
51+
*.jsbundle

.npmignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
example
2-
real-life-example
1+
playground
2+
e2e
33
logos
44
./index.ios.js
55
./index.android.js

PROPS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ horizontalOnly={true}
102102

103103
Optional, whether the view should be locked to horizontal movement only. Default `false`.
104104

105+
#### `startOnFront` (boolean) **[Android Only]**
106+
107+
```jsx
108+
startOnFront
109+
```
110+
111+
Optional, whether the view should call `view.bringToFront()` when the view is first loaded.
112+
*Usually using zIndex does the trick. Use this in cases it doesn't*
113+
105114
#### `verticalOnly` (boolean)
106115

107116
```jsx
@@ -169,6 +178,7 @@ Optional, a function called whenever the user starts or stops dragging the view.
169178
* `state` - `start` or `end`, whether the user started or finished dragging.
170179
* `x` - The horizontal position of the view (relative to the center).
171180
* `y` - The vertical position of the view (relative to the center).
181+
* `targetSnapPointId` - For `end` state, the string `id` of the target point in the `snapPoints` array (assuming it was provided).
172182

173183
#### `onAlert` (function)
174184

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ To see the library in action you have several options:
8989
To run the example, clone the repo and run from the root folder:<br>
9090
```
9191
cd real-life-example
92-
npm install
92+
yarn
9393
react-native run-ios
9494
```
9595

@@ -169,6 +169,12 @@ alertAreas={[{id: 'myArea', influenceArea: {top: 0}}]}
169169
horizontalOnly={true}
170170
```
171171

172+
* [`startOnFront`](https://github.com/wix/react-native-interactable/blob/master/PROPS.md#startOnFront-boolean) - [ANDROID ONLY] whether the view should call `bringToFront`
173+
174+
```jsx
175+
startOnFront
176+
```
177+
172178
* [`verticalOnly`](https://github.com/wix/react-native-interactable/blob/master/PROPS.md#verticalonly-boolean) - whether the view should be locked to vertical movement only
173179

174180
```jsx
@@ -279,7 +285,7 @@ Takes a single argument, which is a params object containing:
279285
##### `changePosition(params)` - used to imperatively set the view's position
280286

281287
```jsx
282-
instance.setPosition({x: 120, y: 40});
288+
instance.changePosition({x: 120, y: 40});
283289
```
284290

285291
Takes a single argument, which is a params object containing:
@@ -288,6 +294,12 @@ Takes a single argument, which is a params object containing:
288294

289295
<br>
290296

297+
##### `bringToFront()` - bring view to front (Android Only)
298+
299+
```jsx
300+
instance.bringToFront();
301+
```
302+
291303
## Animating other views according to `Interactable.View` position
292304

293305
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`.

android

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lib/android

e2e/firstTest.spec.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
describe('Example', () => {
2+
beforeEach(async () => {
3+
await device.reloadReactNative();
4+
});
5+
6+
it('should show Overview screen', async () => {
7+
await expect(element(by.id('Overview'))).toBeVisible();
8+
});
9+
10+
it('Chat Heads is clickable', async () => {
11+
await element(by.text('Chat Heads')).tap();
12+
});
13+
14+
})

e2e/init.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const detox = require('detox');
2+
const config = require('../package.json').detox;
3+
const adapter = require('detox/runners/mocha/adapter');
4+
5+
before(async () => {
6+
await detox.init(config);
7+
});
8+
9+
beforeEach(async function () {
10+
await adapter.beforeEach(this);
11+
});
12+
13+
afterEach(async function () {
14+
await adapter.afterEach(this);
15+
});
16+
17+
after(async () => {
18+
await detox.cleanup();
19+
});

e2e/mocha.opts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--recursive --timeout 120000 --bail

example/.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

example/.flowconfig

Lines changed: 0 additions & 44 deletions
This file was deleted.

example/.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/.gitignore

Lines changed: 0 additions & 53 deletions
This file was deleted.

example/.watchmanconfig

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/__tests__/index.android.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

example/__tests__/index.ios.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

example/android/app/build.gradle

Lines changed: 0 additions & 61 deletions
This file was deleted.

example/android/app/proguard-rules.pro

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)