mirror of
https://github.com/balzack/databag.git
synced 2025-05-05 07:55:15 +00:00
fixing ui glitches in android
This commit is contained in:
parent
29d55c3fcb
commit
c7cc2fbc18
@ -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,
|
||||||
|
@ -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" />
|
||||||
)}
|
)}
|
||||||
|
@ -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 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
7446
app/sdk/yarn.lock
7446
app/sdk/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user