Merge pull request #3283 from pangeachat/fix-android-audio

chore: don't interupt message audio with button click sound
pull/2245/head
ggurdin 5 months ago committed by GitHub
commit 8c14004303
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -209,7 +209,8 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
// #Pangea // #Pangea
// if (!kIsWeb) { // if (!kIsWeb) {
if (!kIsWeb && matrixFile != null) { if (!kIsWeb) {
if (matrixFile != null) {
// Pangea# // Pangea#
final tempDir = await getTemporaryDirectory(); final tempDir = await getTemporaryDirectory();
final fileName = Uri.encodeComponent( final fileName = Uri.encodeComponent(
@ -231,6 +232,14 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
} }
file = convertedFile; file = convertedFile;
} }
// #Pangea
} else if (widget.matrixFile != null) {
final tempDir = await getTemporaryDirectory();
file = File('${tempDir.path}/${widget.matrixFile!.name}');
await file.writeAsBytes(widget.matrixFile!.bytes);
}
// Pangea#
} }
setState(() { setState(() {

@ -206,8 +206,8 @@ class OverlayMessage extends StatelessWidget {
text: overlayController text: overlayController
.transcription!.transcript.text, .transcription!.transcript.text,
textLanguage: PLanguageStore.byLangCode( textLanguage: PLanguageStore.byLangCode(
pangeaMessageEvent! overlayController
.messageDisplayLangCode, .transcription!.langCode,
) ?? ) ??
LanguageModel.unknown, LanguageModel.unknown,
style: AppConfig.messageTextStyle( style: AppConfig.messageTextStyle(

@ -492,7 +492,7 @@ class SelectModeButtonsState extends State<SelectModeButtons> {
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
color: Theme.of(context).colorScheme.primaryContainer, color: Theme.of(context).colorScheme.primaryContainer,
onPressed: () => _updateMode(mode), onPressed: () => _updateMode(mode),
playSound: true, playSound: mode != SelectMode.audio,
colorFactor: Theme.of(context).brightness == Brightness.light colorFactor: Theme.of(context).brightness == Brightness.light
? 0.55 ? 0.55
: 0.3, : 0.3,

Loading…
Cancel
Save