From 7bc67174563235729d9cbb7799d51421376a97eb Mon Sep 17 00:00:00 2001 From: ggurdin Date: Tue, 24 Jun 2025 14:20:35 -0400 Subject: [PATCH 1/2] chore: fix overflow in word card text --- .../widgets/word_zoom/word_zoom_widget.dart | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/pangea/toolbar/widgets/word_zoom/word_zoom_widget.dart b/lib/pangea/toolbar/widgets/word_zoom/word_zoom_widget.dart index a3e9481cb..dcb86b6eb 100644 --- a/lib/pangea/toolbar/widgets/word_zoom/word_zoom_widget.dart +++ b/lib/pangea/toolbar/widgets/word_zoom/word_zoom_widget.dart @@ -73,15 +73,18 @@ class WordZoomWidget extends StatelessWidget { ), ), ), - Text( - token.text.content, - style: TextStyle( - fontSize: 32.0, - fontWeight: FontWeight.w600, - height: 1.2, - color: Theme.of(context).brightness == Brightness.light - ? AppConfig.yellowDark - : AppConfig.yellowLight, + Flexible( + child: Text( + token.text.content, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 32.0, + fontWeight: FontWeight.w600, + height: 1.2, + color: Theme.of(context).brightness == Brightness.light + ? AppConfig.yellowDark + : AppConfig.yellowLight, + ), ), ), ConstructXpWidget( From d76cb4752da29673f9053109b3b8e0bc84043369 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Tue, 24 Jun 2025 14:44:48 -0400 Subject: [PATCH 2/2] chore: allow user to set playback speed before audio starts playing --- lib/pages/chat/events/audio_player.dart | 28 +++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/lib/pages/chat/events/audio_player.dart b/lib/pages/chat/events/audio_player.dart index 11bbfba52..6728e69c0 100644 --- a/lib/pages/chat/events/audio_player.dart +++ b/lib/pages/chat/events/audio_player.dart @@ -77,6 +77,8 @@ class AudioPlayerState extends State { // #Pangea StreamSubscription? _onAudioPositionChanged; StreamSubscription? _onAudioStateChanged; + + double playbackSpeed = 1.0; // Pangea# @override @@ -175,6 +177,9 @@ class AudioPlayerState extends State { : matrix.audioPlayer; if (currentPlayer != null) { + // #Pangea + currentPlayer.setSpeed(playbackSpeed); + // Pangea# if (currentPlayer.isAtEndPosition) { currentPlayer.seek(Duration.zero); } else if (currentPlayer.playing) { @@ -250,6 +255,7 @@ class AudioPlayerState extends State { final audioPlayer = matrix.audioPlayer = AudioPlayer(); // #Pangea + audioPlayer.setSpeed(playbackSpeed); _onAudioPositionChanged?.cancel(); _onAudioPositionChanged = matrix.audioPlayer!.positionStream.listen((state) { @@ -306,7 +312,25 @@ class AudioPlayerState extends State { void _toggleSpeed() async { final audioPlayer = matrix.audioPlayer; - if (audioPlayer == null) return; + // #Pangea + // if (audioPlayer == null) return; + if (audioPlayer == null || + matrix.voiceMessageEventId.value != widget.eventId) { + switch (playbackSpeed) { + case 1.0: + setState(() => playbackSpeed = 0.75); + case 0.75: + setState(() => playbackSpeed = 0.5); + case 0.5: + setState(() => playbackSpeed = 1.25); + case 1.25: + setState(() => playbackSpeed = 1.5); + default: + setState(() => playbackSpeed = 1.0); + } + return; + } + // Pangea# switch (audioPlayer.speed) { // #Pangea // case 1.0: @@ -599,7 +623,7 @@ class AudioPlayerState extends State { height: 20, child: Center( child: Text( - '${audioPlayer?.speed.toString() ?? 1}x', + '${audioPlayer?.speed.toString() ?? playbackSpeed}x', style: TextStyle( color: widget.color, fontSize: 9,