Você está na página 1de 2

React Native

// ARQUIVOS STYLE COMPONENTS

// APP.JS

import React from 'react';


import {SafeAreaView, Text, TextInput} from 'react-native';
import {setCustomText, setCustomTextInput} from 'react-native-global-props';
import styles from './styles';

const App = () => {


const customTextProps = {
style: {
fontFamily: 'GoodFeelingSans',
},
};

setCustomText(customTextProps);
setCustomTextInput(customTextProps);

return (
<SafeAreaView style={styles.container}>
<Text style={styles.header}>How to Customize Fonts in React Native</Text>
<Text style={styles.textDefaultFont}>
This is the default font (GoodFeelingSans)
</Text>
<Text style={styles.textDifferentFont}>
This is a different font (Dan'sDisneyUI)
</Text>
<TextInput value="This input has default font" />
<TextInput
value="This input has a different font"
style={styles.inputDifferentFont}
/>
</SafeAreaView>
);
};

export default App;

// STYLES.JS

import {StyleSheet} from 'react-native';

const differentFont = "Dan'sDisneyUI";

const styles = StyleSheet.create({


container: {
alignItems: 'center',
flex: 1,
justifyContent: 'space-around',
},

React Native 1
header: {
fontSize: 18,
fontWeight: 'bold',
margin: 15,
textAlign: 'center',
},

inputDifferentFont: {
fontFamily: differentFont,
},

textDefaultFont: {
fontSize: 16,
marginVertical: 15,
textAlign: 'center',
},

textDifferentFont: {
fontFamily: differentFont,
fontSize: 16,
marginVertical: 15,
textAlign: 'center',
},
});

export default styles;

# Limpar gradle
cd android && ./gradlew clean && ./gradlew :app:bundleRelease

# Gerar Chave

keytool -genkey -v -keystore JASPI.keystore -alias your_key_alias -keyalg RSA -keysize 2048 -validity 10000

// Gerar app
cd android && ./gradlew bundleRelease && cd .. cd android && ./gradlew assembleRelease && cd ..

android > app > build > outputs > bundle > release

#CMD KILL TASKS

netstat -ano | findstr :8081

taskkill /PID 2304 /F

React Native 2

Você também pode gostar