This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const scaleLongestSideToSize = (mesh, size) => { | |
const { x: width, y: height, z: depth } = new THREE.Box3().setFromObject(mesh).getSize(); | |
const longest = Math.max(width, Math.max(height, depth)); | |
const scale = size / longest; | |
mesh.scale.set(scale, scale, scale); | |
} | |
export default scaleLongestSideToSize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const alignMesh = (mesh, axis = { x: 0.5, y: 0.5, z: 0.5 }) => { | |
axis = axis || {}; | |
const box = new THREE.Box3().setFromObject(mesh); | |
const size = box.getSize(); | |
const { max } = box; | |
const min = { x: -box.min.x, y: -box.min.y, z: -box.min.z }; | |
Object.keys(axis).map(key => { | |
const scale = axis[key]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import React Navigation | |
import { | |
createBottomTabNavigator, | |
createStackNavigator, | |
} from 'react-navigation'; | |
import tabBarIcon from './utils/tabBarIcon'; | |
// Import the screens | |
import FeedScreen from './screens/FeedScreen'; | |
import NewPostScreen from './screens/NewPostScreen'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Expo from 'expo'; | |
import * as ExpoPixi from 'expo-pixi'; | |
import React, { Component } from 'react'; | |
import { Image, StyleSheet, View } from 'react-native'; | |
export default class App extends Component { | |
state = { | |
strokeColor: Math.random() * 0xffffff, | |
strokeWidth: Math.random() * 30 + 10, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GoogleAuthDemo $ exp build:ios -c | |
We've built a brand new CLI for Expo! | |
Expo CLI is a drop in replacement for exp. | |
Install: npm install -g expo-cli | |
Use: expo --help | |
Read more: https://blog.expo.io/expo-cli-2-0-released-a7a9c250e99c | |
[13:05:12] Making sure project is set up correctly... | |
[13:05:13] Your project looks good! | |
[13:05:13] Checking if current build exists... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
// import | |
import { MapView } from 'expo'; | |
export default BaseMap = ({ children, ...props }) => ( | |
<MapView | |
{...props} | |
> | |
<MapView.UrlTile | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Platform } from "react-native"; | |
import getDevServer from "react-native/Libraries/Core/Devtools/getDevServer"; | |
const devServerInfo = getDevServer(); | |
/** | |
* Transform a local "public" path location to a URL that works in React Native. | |
* | |
* When the project is not hosted from a development server, use an offline path from an embedded asset. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml | |
index 136676d7c5..764b402b52 100644 | |
--- a/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml | |
+++ b/templates/expo-template-bare-minimum/android/app/src/main/AndroidManifest.xml | |
@@ -8,25 +8,20 @@ | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | |
<!-- END OPTIONAL PERMISSIONS --> | |
- <application | |
- android:name=".MainApplication" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { createExoticTransformer } = require("@expo/metro-config/transformer"); | |
module.exports = createExoticTransformer({ | |
// Add realm packages to the list of modules to transpile locally. | |
transpileModules: ["@realm/", "realm"], | |
}); |
OlderNewer