Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3483d1bfce | |||
| 158423c155 | |||
| 087e91dca1 | |||
| 2de4cbc00f |
@@ -79,8 +79,8 @@ android {
|
|||||||
applicationId "com.ariacockpit"
|
applicationId "com.ariacockpit"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 10101
|
versionCode 10103
|
||||||
versionName "0.1.1.1"
|
versionName "0.1.1.3"
|
||||||
// Fallback fuer Libraries mit Product Flavors
|
// Fallback fuer Libraries mit Product Flavors
|
||||||
missingDimensionStrategy 'react-native-camera', 'general'
|
missingDimensionStrategy 'react-native-camera', 'general'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "aria-cockpit",
|
"name": "aria-cockpit",
|
||||||
"version": "0.1.1.1",
|
"version": "0.1.1.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"android": "react-native run-android",
|
"android": "react-native run-android",
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import {
|
|||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||||
import RNFS from 'react-native-fs';
|
import RNFS from 'react-native-fs';
|
||||||
|
import { SvgUri } from 'react-native-svg';
|
||||||
import rvs, { RVSMessage, ConnectionState } from '../services/rvs';
|
import rvs, { RVSMessage, ConnectionState } from '../services/rvs';
|
||||||
import audioService from '../services/audio';
|
import audioService from '../services/audio';
|
||||||
import wakeWordService from '../services/wakeword';
|
import wakeWordService from '../services/wakeword';
|
||||||
@@ -113,7 +114,9 @@ const ChatImage: React.FC<{
|
|||||||
onError: () => void;
|
onError: () => void;
|
||||||
}> = ({ uri, onPress, onError }) => {
|
}> = ({ uri, onPress, onError }) => {
|
||||||
const [aspectRatio, setAspectRatio] = useState<number>(4 / 3);
|
const [aspectRatio, setAspectRatio] = useState<number>(4 / 3);
|
||||||
|
const isSvg = /\.svg(?:\?|$)/i.test(uri);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (isSvg) return; // SvgUri hat kein getSize
|
||||||
let cancelled = false;
|
let cancelled = false;
|
||||||
Image.getSize(uri, (w, h) => {
|
Image.getSize(uri, (w, h) => {
|
||||||
if (!cancelled && w > 0 && h > 0) {
|
if (!cancelled && w > 0 && h > 0) {
|
||||||
@@ -124,7 +127,16 @@ const ChatImage: React.FC<{
|
|||||||
}
|
}
|
||||||
}, () => {});
|
}, () => {});
|
||||||
return () => { cancelled = true; };
|
return () => { cancelled = true; };
|
||||||
}, [uri]);
|
}, [uri, isSvg]);
|
||||||
|
if (isSvg) {
|
||||||
|
return (
|
||||||
|
<TouchableOpacity onPress={onPress} activeOpacity={0.8}>
|
||||||
|
<View style={[CHAT_IMAGE_STYLE, { height: 260, alignItems: 'center', justifyContent: 'center' }]}>
|
||||||
|
<SvgUri uri={uri} width="100%" height="100%" onError={onError} />
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity onPress={onPress} activeOpacity={0.8}>
|
<TouchableOpacity onPress={onPress} activeOpacity={0.8}>
|
||||||
<Image
|
<Image
|
||||||
@@ -1351,11 +1363,17 @@ const ChatScreen: React.FC = () => {
|
|||||||
onPress={() => setFullscreenImage(null)}
|
onPress={() => setFullscreenImage(null)}
|
||||||
>
|
>
|
||||||
{fullscreenImage && (
|
{fullscreenImage && (
|
||||||
|
/\.svg(?:\?|$)/i.test(fullscreenImage) ? (
|
||||||
|
<View style={styles.fullscreenImage}>
|
||||||
|
<SvgUri uri={fullscreenImage} width="100%" height="100%" preserveAspectRatio="xMidYMid meet" />
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
<Image
|
<Image
|
||||||
source={{ uri: fullscreenImage }}
|
source={{ uri: fullscreenImage }}
|
||||||
style={styles.fullscreenImage}
|
style={styles.fullscreenImage}
|
||||||
resizeMode="contain"
|
resizeMode="contain"
|
||||||
/>
|
/>
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
Reference in New Issue
Block a user