Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Find a combination of packages that works reliably #78

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules/**/*
.expo/*
npm-debug.*
.idea/*
.history/*
Comment on lines +4 to +5
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your site-specific clutter should not be added to the repo-wide .gitignore. Use your local git config, or the private .git/info/exclude.

3 changes: 1 addition & 2 deletions examples/basic/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"version": "1.0.0",
"primaryColor": "#E44262",
"icon": "./assets/icon.png",
"platforms": ["web", "ios", "android"],
"loading": {
"icon": "./assets/icon.png",
"hideExponentText": false
Expand All @@ -17,4 +16,4 @@
},
"platforms": ["android", "ios", "web"]
}
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a newline at the end of the file.

7 changes: 4 additions & 3 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
"dependencies": {
"expo": "^33.0.0-alpha.web.1",
"expo-asset-utils": "^1.1.0",
"expo-pixi": "../../expo-pixi-v1.1.0.tgz",
"expo-pixi": "file:./../../../expo-pixi",
"react": "16.8.6",
"react-dom": "^16.8.6",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
"react-native-web": "^0.11.2"
},
"devDependencies": {
"babel-preset-expo": "^5.1.1",
"@babel/core": "^7.7.7",
"babel-preset-expo": "^8.0.0",
"eslint": "^5.16.0",
"eslint-config-universe": "^1.0.7",
"prettier": "^1.17.0"
"prettier": "^1.19.1"
}
}
7,269 changes: 7,269 additions & 0 deletions examples/basic/yarn-error.log

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/comprehensive/components/TouchableView.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class TouchableView extends React.Component {
},
});

componentWillMount() {
UNSAFE_componentWillMount() {
this._panResponder = this.buildGestures();
}

Expand Down
8 changes: 5 additions & 3 deletions examples/comprehensive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
"react-navigation": "^3.0.9"
},
"devDependencies": {
"eslint": "^5.12.0",
"eslint-config-universe": "^1.0.6",
"prettier": "^1.7.4"
"@babel/core": "^7.7.7",
"babel-preset-expo": "^8.0.0",
"eslint": "^5.16.0",
"eslint-config-universe": "^1.0.7",
"prettier": "^1.19.1"
}
}
2 changes: 1 addition & 1 deletion examples/filter-image/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class App extends Component {
index: 0,
};

componentWillMount() {
UNSAFE_componentWillMount() {
console.log('pixi filters', PIXI.filters);

const filter = filters => {
Expand Down
83 changes: 24 additions & 59 deletions examples/signature/App.js
Original file line number Diff line number Diff line change
@@ -1,72 +1,37 @@
import Expo from 'expo';
import * as ExpoPixi from 'expo-pixi';
import React, { Component } from 'react';
import { Image, Button, Platform, AppState, StyleSheet, Text, View } from 'react-native';
import React from 'react';
import { Button, StyleSheet, View } from 'react-native';

const isAndroid = Platform.OS === 'android';
function uuidv4() {
//https://stackoverflow.com/a/2117523/4047926
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (Math.random() * 16) | 0,
v = c == 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
}

export default class App extends Component {
state = {
image: null,
strokeColor: 0,
appState: AppState.currentState,
};

handleAppStateChangeAsync = nextAppState => {
if (this.state.appState.match(/inactive|background/) && nextAppState === 'active') {
if (isAndroid && this.sketch) {
this.setState({ appState: nextAppState, id: uuidv4(), lines: this.sketch.lines });
return;
}
}
this.setState({ appState: nextAppState });
};

componentDidMount() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe removal of this will break switching apps in Android - the drawing will be cleared upon return to the app.

AppState.addEventListener('change', this.handleAppStateChangeAsync);
}

componentWillUnmount() {
AppState.removeEventListener('change', this.handleAppStateChangeAsync);
}
export default function App() {
let sketch = null;

onReady = () => {
console.log('ready!');
};

render() {
return (
return (
<View style={styles.container}>
<View style={styles.container}>
<View style={styles.container}>
<View style={styles.sketchContainer}>
<ExpoPixi.Signature
ref={ref => (this.sketch = ref)}
style={styles.sketch}
strokeColor={'blue'}
strokeAlpha={1}
onReady={this.onReady}
/>
</View>
<View style={styles.sketchContainer}>
<ExpoPixi.Signature
ref={ref => (sketch = ref)}
style={styles.sketch}
strokeColor={'blue'}
strokeAlpha={1}
onReady={onReady}
/>
</View>
<Button
color={'blue'}
title="undo"
style={styles.button}
onPress={() => {
this.sketch.undo();
}}
/>
</View>
);
}
<Button
color={'blue'}
title="undo"
style={styles.button}
onPress={() => {
sketch.undo();
}}
/>
</View>
);
}

const styles = StyleSheet.create({
Expand Down
9 changes: 7 additions & 2 deletions examples/signature/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "signature",
"description": "expo-pixi signature example",
"slug": "expo-pixi-signature",
"sdkVersion": "32.0.0",
"sdkVersion": "36.0.0",
"version": "1.0.0",
"primaryColor": "#E44262",
"privacy": "public",
Expand All @@ -14,6 +14,11 @@
},
"ios": {
"supportsTablet": true
}
},
"platforms": [
"android",
"ios",
"web"
]
}
}
19 changes: 12 additions & 7 deletions examples/signature/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@
"private": true,
"main": "node_modules/expo/AppEntry.js",
"dependencies": {
"expo": "^32.0.0",
"expo-pixi": "file:../../../expo-pixi/",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz"
"expo": "^36.0.0",
"expo-gl": "~8.0.0",
"expo-pixi": "file:./../../../expo-pixi",
"react": "16.9.0",
"react-dom": "^16.12.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz",
"react-native-web": "^0.12.0-rc.1"
},
"devDependencies": {
"eslint": "^4.9.0",
"eslint-config-universe": "^1.0.6",
"prettier": "^1.7.4"
"@babel/core": "^7.7.7",
"babel-preset-expo": "^8.0.0",
"eslint": "^5.16.0",
"eslint-config-universe": "^1.0.7",
"prettier": "^1.19.1"
}
}
Loading