Skip to content

Commit

Permalink
Merge pull request #8 from soil-boys/dev
Browse files Browse the repository at this point in the history
app icon and splash screen
  • Loading branch information
Risuleia authored Aug 27, 2023
2 parents 7f292ee + 71a4c41 commit 977c55e
Show file tree
Hide file tree
Showing 21 changed files with 470 additions and 178 deletions.
25 changes: 24 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,33 @@
"web": {
"bundler": "metro"
},
"icon": "./assets/icon.png",
"name": "Mentis",
"slug": "Mentis",
"plugins": [
"expo-router"
]
],
"splash": {
"image": "./assets/splash.png",
"backgroundColor": "#B1C0E8"
},
"extra": {
"router": {
"origin": false
},
"eas": {
"projectId": "a29396a9-864c-45f7-9815-43657407ac25"
}
},
"android": {
"package": "com.risuleia.Mentis"
},
"runtimeVersion": {
"policy": "appVersion"
},
"updates": {
"url": "https://u.expo.dev/a29396a9-864c-45f7-9815-43657407ac25"
},
"ios": {}
}
}
4 changes: 3 additions & 1 deletion app/(tabs)/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useState } from "react";
import { View, ScrollView, SafeAreaView, RefreshControl } from "react-native";
import { View, ScrollView, SafeAreaView, RefreshControl, Image } from "react-native";

import { Welcome, Overview, Scale } from "../../components";
import { COLORS, SIZES } from "../../constants";
Expand All @@ -20,6 +20,7 @@ function Home() {
}, [])

return(
<>
<SafeAreaView style={{ flex: 1, backgroundColor: COLORS.lightWhite }}>
<ScrollView
style={{ flex: 1 }}
Expand All @@ -39,6 +40,7 @@ function Home() {
</View>
</ScrollView>
</SafeAreaView>
</>
)
}

Expand Down
17 changes: 12 additions & 5 deletions app/_layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Stack } from "expo-router";
import { useCallback, useEffect, useState } from "react";
import * as Font from 'expo-font'
import * as SplashScreen from "expo-splash-screen";
// import Splash from '../components/screens/Splash';

console.reportErrorsAsExceptions = false;

Expand All @@ -18,7 +19,8 @@ SplashScreen.preventAutoHideAsync();
function Layout() {

const [loading, setLoading] = useState(true)

// const [animationVisible, setAnimationVisible] = useState(true)

useEffect(() => {
async function load() {
try {
Expand All @@ -30,25 +32,30 @@ function Layout() {
} catch (err) {
console.warn(err)
} finally {
setLoading(false)
// setInterval(() => {
setLoading(false)
// }, 4000);
}
}

load()
// setInterval(() => setAnimationVisible(false, 4000))
}, [])

const onLayoutRootView = useCallback(async () => {
if (!loading) await SplashScreen.hideAsync()
}, [loading])

if (loading) return null;
if (loading) return null

return (
<>
// loading ? (

// ) : (
<Stack onLayout={onLayoutRootView}>
<Stack.Screen name="(tabs)" options={{ headerShown: false }}/>
</Stack>
</>
// )
)
}

Expand Down
Binary file added assets/_splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/animations/Flow 1@720p-60fps 2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/animations/a1A5oRwmLT.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/animations/iPhone-14-Pro---9 (1).json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/animations/iPhone-14-Pro---9.json

Large diffs are not rendered by default.

Binary file added assets/animations/splash.lottie
Binary file not shown.
1 change: 1 addition & 0 deletions assets/animations/splash3.json

Large diffs are not rendered by default.

Binary file modified assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions assets/images/image-removebg-preview-__.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/splash.mp4
Binary file not shown.
Binary file modified assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions components/screens/Splash.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Video } from 'expo-av'
import { SafeAreaView, useWindowDimensions } from 'react-native'

function Splash({ animationVisible }) {


return (
<SafeAreaView style={{ flex: 1, justifyContent: 'center', alignContent: 'center' }}>
<Video
style={{ flex: 1 }}
videoStyle={{ flexGrow: 1 }}
source={require('../../assets/images/splash.mp4')}
resizeMode='cover'
useNativeControls={false}
shouldPlay={animationVisible}
/>
</SafeAreaView>
)

}

export default Splash
// <SafeAreaView style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
{/* <LottieView
autoPlay
loop
source={require('../../assets/animations/a1A5oRwmLT.json')}
imageAssetsFolder='images'
/> */}
{/* </SafeAreaView> */}
4 changes: 3 additions & 1 deletion constants/animations.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import splash from '../assets/animations/splash.json'
import splash2 from '../assets/animations/splash2.json'
import sphash3 from '../assets/animations/iPhone-14-Pro---9 (1).json'

export {
splash,
splash2
splash2,
sphash3
}
1 change: 1 addition & 0 deletions constants/theme.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const COLORS = {
primary: "#6d5f94",
secondary: "#444262",
// tertiary: "#63808f",
tertiary: "#FF7754",
quaternary: "#cbdbf5",

Expand Down
22 changes: 22 additions & 0 deletions eas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"cli": {
"version": ">= 4.1.2"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal"
},
"production": {
"android": {
"buildType": "apk"
}
}
},
"submit": {
"production": {}
}
}
3 changes: 3 additions & 0 deletions metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ module.exports = {
resolver: {
extraNodeModules: require('node-libs-react-native'),
},
transformer: {
assetPlugins: ['expo-asset/tools/hashAssetFiles'],
},
};
Loading

0 comments on commit 977c55e

Please sign in to comment.