diff --git a/README.md b/README.md
index 3de931a..0672e35 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
Cardápio Mobile UERJ
-
+
diff --git a/android/app/build.gradle b/android/app/build.gradle
index c5edfe4..94e4766 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -78,7 +78,7 @@ import com.android.build.OutputFile
*/
project.ext.react = [
- enableHermes: false, // clean and rebuild if changing
+ enableHermes: true, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
@@ -96,7 +96,7 @@ def enableSeparateBuildPerCPUArchitecture = true
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
-def enableProguardInReleaseBuilds = false
+def enableProguardInReleaseBuilds = true
/**
* The preferred build flavor of JavaScriptCore.
@@ -132,8 +132,8 @@ android {
applicationId "com.cardapiomobileuerj"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 3
- versionName "1.02"
+ versionCode 4
+ versionName "1.03"
project.ext.set("archivesBaseName", "cardapio-mobile-uerj-" + defaultConfig.versionName);
}
splits {
@@ -169,6 +169,7 @@ android {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
minifyEnabled enableProguardInReleaseBuilds
+ shrinkResources enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro
index 11b0257..fb4140f 100644
--- a/android/app/proguard-rules.pro
+++ b/android/app/proguard-rules.pro
@@ -8,3 +8,6 @@
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
+-keep class com.facebook.hermes.unicode.** { *; }
+-keep class com.facebook.jni.** { *; }
+-keep public class com.horcrux.svg.** {*;}
\ No newline at end of file
diff --git a/package.json b/package.json
index e76de5a..65fd0d1 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "cardapioMobileUerj",
- "version": "1.0.0",
+ "version": "1.03",
"author": "Petro Cardoso",
"license": "Apache",
"private": true,
diff --git a/src/components/Errors.js b/src/components/Errors.js
index acc36f9..1961111 100644
--- a/src/components/Errors.js
+++ b/src/components/Errors.js
@@ -19,11 +19,16 @@ const Title = styled.Text`
const Column = styled.View`
flex: 1;
padding: 2%;
- margin-top: ${props => (props.margin ? props.margin : 0)}%;
- align-items: center;
+ align-self: center;
justify-content: flex-end;
`;
+const Refresh = styled.TouchableOpacity`
+ flex: 1;
+ background-color: #016ba5;
+ margin-top: 50%;
+`;
+
const Text = styled.Text`
font-size: ${Responsive(14)}px;
font-weight: bold;
@@ -52,10 +57,10 @@ export const ParseErrorHeader = () => (
);
-export const NetworkErrorView = () => (
-
+export const NetworkErrorView = props => (
+ props.getCardapio()}>
Ops... Ocorreu um erro :(
{'\n'}Sem conexão disponível.
-
+
);
diff --git a/src/components/Footer.js b/src/components/Footer.js
index b697b98..89e6f25 100644
--- a/src/components/Footer.js
+++ b/src/components/Footer.js
@@ -26,8 +26,9 @@ AccessibilityInfo.isScreenReaderEnabled().then(res => {
AccessibilityIsOn = res;
});
+const FooterView = Animated.createAnimatedComponent(FooterV);
+
const Footer = props => {
- const FooterView = Animated.createAnimatedComponent(FooterV);
return (
{
useEffect(() => {}, [props.offline, props.parseError]);
return (
-
+ <>
{
]}>
{props.loading && }
{props.parseError ? (
-
+
) : (
{
Você está offline
)}
-
+ >
);
};
diff --git a/src/components/carousel.js b/src/components/carousel.js
index f2cf6ad..ee645e0 100644
--- a/src/components/carousel.js
+++ b/src/components/carousel.js
@@ -1,4 +1,5 @@
import React, { useState } from 'react';
+import { Animated } from 'react-native';
import Carousel from 'react-native-snap-carousel';
import {
Container,
diff --git a/src/pages/Main/index.js b/src/pages/Main/index.js
index 267c8b6..ba365ee 100644
--- a/src/pages/Main/index.js
+++ b/src/pages/Main/index.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import { RefreshControl, StatusBar, Animated } from 'react-native';
+import { StatusBar, Animated } from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
const cheerio = require('react-native-cheerio');
import { RUapi } from '../../services/axios';
@@ -12,9 +12,8 @@ import About from '../../components/About';
import { ParseErrorView, NetworkErrorView } from '../../components/Errors';
import Header from '../../components/Header';
-import { Refresh, Loading, Background } from './styles';
-
-const CardapioView = Animated.createAnimatedComponent(Refresh);
+import { Loading, Background, View } from './styles';
+const CardapioView = Animated.createAnimatedComponent(View);
export default class Main extends Component {
state = {
@@ -235,39 +234,40 @@ export default class Main extends Component {
return (
+ this.setState(state)}
+ />
- this.setState(state)}
- />
+
this.getCardapio()}
- />
- }
style={[
{
translateY: this.state.menuHeight,
},
]}>
{this.state.networkError && !this.state.offine ? (
-
+
) : this.state.parseError ? (
) : this.state.loading ? (
) : (
-
+
)}