diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index 5f3bbad..fc83e70 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -4,9 +4,11 @@ "\\assets", "\\components", "\\model", + "\\pages", "\\redux", + "\\redux\\actions", "\\redux\\reducers" ], - "SelectedNode": "\\app.json", + "SelectedNode": "\\components\\DrawingCanva.tsx", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/iut-expo-starter/FileContentIndex/1da72723-62e4-400a-9980-caea1803fa8c.vsidx b/.vs/iut-expo-starter/FileContentIndex/1da72723-62e4-400a-9980-caea1803fa8c.vsidx new file mode 100644 index 0000000..118e588 Binary files /dev/null and b/.vs/iut-expo-starter/FileContentIndex/1da72723-62e4-400a-9980-caea1803fa8c.vsidx differ diff --git a/.vs/iut-expo-starter/FileContentIndex/b55ca5bb-cc34-4338-926a-3d67824b010f.vsidx b/.vs/iut-expo-starter/FileContentIndex/b55ca5bb-cc34-4338-926a-3d67824b010f.vsidx deleted file mode 100644 index 980a1df..0000000 Binary files a/.vs/iut-expo-starter/FileContentIndex/b55ca5bb-cc34-4338-926a-3d67824b010f.vsidx and /dev/null differ diff --git a/.vs/iut-expo-starter/FileContentIndex/bcf709fe-9005-4036-9403-134ef8f674a7.vsidx b/.vs/iut-expo-starter/FileContentIndex/f414478a-b19d-43e9-93d2-7485192e5b4e.vsidx similarity index 100% rename from .vs/iut-expo-starter/FileContentIndex/bcf709fe-9005-4036-9403-134ef8f674a7.vsidx rename to .vs/iut-expo-starter/FileContentIndex/f414478a-b19d-43e9-93d2-7485192e5b4e.vsidx diff --git a/.vs/iut-expo-starter/v17/.wsuo b/.vs/iut-expo-starter/v17/.wsuo index 3523fd4..c2b8a93 100644 Binary files a/.vs/iut-expo-starter/v17/.wsuo and b/.vs/iut-expo-starter/v17/.wsuo differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 77b70f3..44b6a62 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/App.tsx b/App.tsx index 07ec5d1..84219ba 100644 --- a/App.tsx +++ b/App.tsx @@ -4,18 +4,19 @@ import store from "./redux/store"; import { Provider } from 'react-redux'; import { StatusBar } from 'expo-status-bar'; -import { Keyboard, SafeAreaView, StyleSheet, TouchableWithoutFeedback } from 'react-native'; +import { Keyboard, SafeAreaView, StyleSheet, TouchableWithoutFeedback} from 'react-native'; import Header from './components/Header'; -import TabBar from './components/TabBar'; +import TabBar from './navigation/TabBar'; export default function App() { + return ( { Keyboard.dismiss(); }}> -
+
@@ -34,9 +35,15 @@ const tabOptions = { tabBarInactiveTintColor: "black" }; + + const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#FF5C5C', }, }); + + + + diff --git a/app.json b/app.json index d7be4f6..43ee5bc 100644 --- a/app.json +++ b/app.json @@ -5,7 +5,7 @@ "version": "1.0.0", "orientation": "portrait", "icon": "./src/assets/icon.png", - "userInterfaceStyle": "light", + "userInterfaceStyle": "automatic", "splash": { "image": "./src/assets/splash.png", "resizeMode": "contain", @@ -23,7 +23,7 @@ "android": { "adaptiveIcon": { "foregroundImage": "./src/assets/adaptive-icon.png", - "backgroundColor": "#FFFFFF" + "backgroundColor": "#FFFFFF", } }, "web": { diff --git a/components/DrawingCanva.tsx b/components/DrawingCanva.tsx index b50661b..a581c00 100644 --- a/components/DrawingCanva.tsx +++ b/components/DrawingCanva.tsx @@ -1,7 +1,7 @@ import React, {useEffect, useRef, useState } from 'react'; import { SketchCanvas, SketchCanvasRef } from 'rn-perfect-sketch-canvas'; -import { StyleSheet, Button, View, Text } from 'react-native'; -import { SvgUri } from 'react-native-svg'; +import { StyleSheet, Button, View, Text, useColorScheme } from 'react-native'; +import { SvgXml } from 'react-native-svg'; import Slider from '@react-native-community/slider' import { useSelector } from 'react-redux'; @@ -13,43 +13,54 @@ type DrawingCanvaProps = { const DrawingCanva = (props: DrawingCanvaProps) => { + const style = useColorScheme() == 'light' ? style_light : style_dark; + const canvasRef = useRef(null); const [strokeWidth, setStroke] = useState(5); const [isCanvasReady, setIsCanvasReady] = useState(false); + const [imgXml, setImgXml] = useState(''); const selectedKanji = KanjiMapper.SerializedObjectToKanji(useSelector(state => state.kanjiReducer.selectedKanji)); useEffect(() => { if (canvasRef.current) { + fetchXml(); setIsCanvasReady(true); } }, [canvasRef.current]); + const fetchXml = async () => { + const xml = await (await fetch(selectedKanji.image)).text(); + setImgXml(xml); + } + return ( - - {selectedKanji && ()} + + {selectedKanji && ( + )} setStroke(val)} minimumValue={5} maximumValue={10} minimumTrackTintColor={"#FF5C5C"} /> - {isCanvasReady && ( + {isCanvasReady && (