diff --git a/packages/app-mobile/components/voiceTyping/VoiceTypingDialog.tsx b/packages/app-mobile/components/voiceTyping/VoiceTypingDialog.tsx index 0effd0a3cad..e002da97c99 100644 --- a/packages/app-mobile/components/voiceTyping/VoiceTypingDialog.tsx +++ b/packages/app-mobile/components/voiceTyping/VoiceTypingDialog.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState, useEffect, useCallback, useRef, useMemo } from 'react'; -import { Banner, ActivityIndicator, Text } from 'react-native-paper'; +import { Icon, ActivityIndicator, Text, Surface, Button } from 'react-native-paper'; import { _, languageName } from '@joplin/lib/locale'; import useAsyncEffect, { AsyncEffectEvent } from '@joplin/lib/hooks/useAsyncEffect'; import { IconSource } from 'react-native-paper/lib/typescript/components/Icon'; @@ -9,6 +9,8 @@ import whisper from '../../services/voiceTyping/whisper'; import vosk from '../../services/voiceTyping/vosk'; import { AppState } from '../../utils/types'; import { connect } from 'react-redux'; +import { View, StyleSheet } from 'react-native'; +import AccessibleView from '../accessibility/AccessibleView'; interface Props { locale: string; @@ -79,6 +81,30 @@ const useWhisper = ({ locale, provider, onSetPreview, onText }: UseVoiceTypingPr return [error, mustDownloadModel, voiceTyping]; }; +const styles = StyleSheet.create({ + container: { + marginHorizontal: 1, + width: '100%', + maxWidth: 680, + alignSelf: 'center', + }, + contentWrapper: { + flexDirection: 'row', + }, + iconWrapper: { + margin: 8, + marginTop: 16, + }, + content: { + marginTop: 16, + marginHorizontal: 8, + }, + actionContainer: { + flexDirection: 'row', + justifyContent: 'flex-end', + }, +}); + const VoiceTypingDialog: React.FC = props => { const [recorderState, setRecorderState] = useState(RecorderState.Loading); const [preview, setPreview] = useState(''); @@ -142,22 +168,44 @@ const VoiceTypingDialog: React.FC = props => { return {preview}; }; - const headerAndStatus = {`${_('Voice typing...')}\n${renderContent()}`}; return ( - - {headerAndStatus} - {'\n'} - {renderPreview()} - + + + + + + + + + + {_('Voice typing...')} + + + {renderContent()} + {renderPreview()} + + + + + + + ); };