Skip to content

Instantly share code, notes, and snippets.

View android_settings.gradle
//react-native-unimodules installation
apply from: '../node_modules/react-native-unimodules/gradle.groovy'
includeUnimodulesProjects()
//react-native-unimodules installation
rootProject.name = 'supercerebros'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
View MainActivity.java
package com.cerezabusiness.supercerebros;
import com.facebook.react.ReactActivity;
// react-native-splash-screen instalation
import org.devio.rn.splashscreen.SplashScreen; // here
import android.os.Bundle;//here
public class MainActivity extends ReactActivity {
/**
View MainApplication.java
package com.cerezabusiness.supercerebros;
import androidx.multidex.MultiDexApplication;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
View android_app_build.gradle
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
View android_build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
View EntryPoint.js
import React, { Component } from 'react';
import {View,Text,StyleSheet} from 'react-native';
class EntryPoint extends Component {
constructor(props) {
super(props);
this.state = { }
}
render() {
return ( <View>
View react-native.config.js
module.exports = {
project: {
ios: {},
android: {},
},
assets: [
"./src/assets/fonts/"
],
}
View Loader.js
import React, { Component } from 'react';
import { View,Text,Image,StyleSheet } from 'react-native';
import Values from './Values';
class Loader extends Component {
state = { }
render() {
return (
<View style={[{flex:1},Values.styles.centered]}>
<Image style={styles.logo} source={require('../assets/images/icon.png')} />
<Text style={[Values.styles.appText,{marginTop:5}]}>
View Values.js
import { StyleSheet } from 'react-native';
import appConstants from './AppConstants';
export default values = {
styles: StyleSheet.create({
centered: {
justifyContent: 'center',
alignItems: 'center',
},
container: {
flex: 1,
View Common.js
import { Alert } from 'react-native';
export default class Common {
static showAlert(title, message, btns = []) {
btns = btns.length == 0 ? [{ text: 'Continuar' }] : btns;
Alert.alert(title, message, btns)
}
}
You can’t perform that action at this time.