feat/调整tts音色,调整封面图prompt,修复对话页输入框显示逻辑,待验证封面图生成功能
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
Animated,
|
||||
FlatList,
|
||||
InteractionManager,
|
||||
Keyboard,
|
||||
KeyboardAvoidingView,
|
||||
Platform,
|
||||
Pressable,
|
||||
@@ -578,8 +579,20 @@ export default function ConversationScreen() {
|
||||
|
||||
const [input, setInput] = useState('');
|
||||
const [inputMode, setInputMode] = useState<InputMode>('text');
|
||||
const [isKeyboardVisible, setIsKeyboardVisible] = useState(false);
|
||||
const listRef = useRef<FlatList>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const onShow = () => setIsKeyboardVisible(true);
|
||||
const onHide = () => setIsKeyboardVisible(false);
|
||||
const subShow = Keyboard.addListener('keyboardDidShow', onShow);
|
||||
const subHide = Keyboard.addListener('keyboardDidHide', onHide);
|
||||
return () => {
|
||||
subShow.remove();
|
||||
subHide.remove();
|
||||
};
|
||||
}, []);
|
||||
|
||||
const flattenedData = flattenMessagesForList(messages ?? []);
|
||||
|
||||
const isRecording = recorderStatus === 'recording';
|
||||
@@ -607,11 +620,12 @@ export default function ConversationScreen() {
|
||||
: t('connectionDisconnected');
|
||||
|
||||
const keyboardOffset = Platform.OS === 'ios' ? insets.top + 56 : 0;
|
||||
const kavEnabled = inputMode === 'text' && isKeyboardVisible;
|
||||
|
||||
return (
|
||||
<KeyboardAvoidingView
|
||||
style={styles.container}
|
||||
behavior="padding"
|
||||
behavior={kavEnabled ? 'padding' : undefined}
|
||||
keyboardVerticalOffset={keyboardOffset}
|
||||
>
|
||||
<View style={styles.column}>
|
||||
@@ -694,9 +708,14 @@ export default function ConversationScreen() {
|
||||
onChangeText={setInput}
|
||||
onSend={handleSend}
|
||||
inputMode={inputMode}
|
||||
onInputModeToggle={() =>
|
||||
setInputMode((m) => (m === 'text' ? 'voice' : 'text'))
|
||||
}
|
||||
onInputModeToggle={() => {
|
||||
setInputMode((m) => {
|
||||
if (m === 'text') {
|
||||
Keyboard.dismiss();
|
||||
}
|
||||
return m === 'text' ? 'voice' : 'text';
|
||||
});
|
||||
}}
|
||||
onAddPress={() => {}}
|
||||
onStartRecording={handleStartRecording}
|
||||
onStopRecording={() => void stopRecording()}
|
||||
|
||||
Reference in New Issue
Block a user