fixing ui glitches in android

This commit is contained in:
Roland Osborne 2025-01-08 17:06:40 -08:00
parent 29d55c3fcb
commit c7cc2fbc18
4 changed files with 2894 additions and 4570 deletions

View File

@ -13,6 +13,7 @@ export const styles = StyleSheet.create({
color: Colors.offsync, color: Colors.offsync,
}, },
control: { control: {
position: 'absolute',
backgroundColor: 'transparent', backgroundColor: 'transparent',
}, },
button: { button: {
@ -44,11 +45,16 @@ export const styles = StyleSheet.create({
height: 92, height: 92,
}, },
full: { full: {
position: 'absolute',
top: 0, top: 0,
left: 0, left: 0,
width: '100%', width: '100%',
height: '100%', height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
},
player: {
display: 'none',
}, },
info: { info: {
fontSize: 12, fontSize: 12,

View File

@ -83,7 +83,7 @@ export function AudioAsset({ topicId, asset, loaded, show }: { topicId: string,
source={thumb} source={thumb}
/> />
{ state.dataUrl && ( { state.dataUrl && (
<Video source={{ uri: state.dataUrl }} style={styles.full} paused={false} ref={videoRef} <Video source={{ uri: state.dataUrl }} style={styles.player} paused={false} ref={videoRef}
onPlaybackRateChange={playbackRateChange} onEnd={end} onError={actions.failed} onPlaybackRateChange={playbackRateChange} onEnd={end} onError={actions.failed}
controls={false} resizeMode="contain" /> controls={false} resizeMode="contain" />
)} )}

View File

@ -1,4 +1,4 @@
import {useEffect, useState, useContext} from 'react'; import {useEffect, useState, useContext, useRef} from 'react';
import {AppContext} from '../context/AppContext'; import {AppContext} from '../context/AppContext';
import {DisplayContext} from '../context/DisplayContext'; import {DisplayContext} from '../context/DisplayContext';
import {ContextType} from '../context/ContextType'; import {ContextType} from '../context/ContextType';
@ -6,6 +6,7 @@ import {ContextType} from '../context/ContextType';
export function useSession() { export function useSession() {
const display = useContext(DisplayContext) as ContextType; const display = useContext(DisplayContext) as ContextType;
const app = useContext(AppContext) as ContextType; const app = useContext(AppContext) as ContextType;
const disconnecting = useRef(null);
const [state, setState] = useState({ const [state, setState] = useState({
layout: null, layout: null,
@ -20,8 +21,11 @@ export function useSession() {
useEffect(() => { useEffect(() => {
const setStatus = (status: string) => { const setStatus = (status: string) => {
if (status === 'disconnected') { if (status === 'disconnected') {
updateState({ disconnected: true }); disconnecting.current = setTimeout(() => {
updateState({ disconnected: true });
}, [2000]);
} if (status === 'connected') { } if (status === 'connected') {
clearTimeout(disconnecting.current);
updateState({ disconnected: false }); updateState({ disconnected: false });
} }
} }

File diff suppressed because it is too large Load Diff