Merge branch 'main' of https://github.com/pangeachat/client into find-people-default-avatars
This commit is contained in:
commit
fee8742248
4 changed files with 55 additions and 14 deletions
|
|
@ -1856,7 +1856,10 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
}
|
||||
}
|
||||
|
||||
void pinEvent() {
|
||||
// #Pangea
|
||||
// void pinEvent() {
|
||||
Future<void> pinEvent() async {
|
||||
// Pangea#
|
||||
final pinnedEventIds = room.pinnedEventIds;
|
||||
final selectedEventIds = selectedEvents.map((e) => e.eventId).toSet();
|
||||
final unpin = selectedEventIds.length == 1 &&
|
||||
|
|
@ -1866,10 +1869,16 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
} else {
|
||||
pinnedEventIds.addAll(selectedEventIds);
|
||||
}
|
||||
showFutureLoadingDialog(
|
||||
// #Pangea
|
||||
// showFutureLoadingDialog(
|
||||
// context: context,
|
||||
// future: () => room.setPinnedEvents(pinnedEventIds),
|
||||
// );
|
||||
await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () => room.setPinnedEvents(pinnedEventIds),
|
||||
);
|
||||
// Pangea#
|
||||
}
|
||||
|
||||
Timer? _storeInputTimeoutTimer;
|
||||
|
|
|
|||
|
|
@ -77,6 +77,8 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
|
|||
// #Pangea
|
||||
StreamSubscription? _onAudioPositionChanged;
|
||||
StreamSubscription? _onAudioStateChanged;
|
||||
|
||||
double playbackSpeed = 1.0;
|
||||
// Pangea#
|
||||
|
||||
@override
|
||||
|
|
@ -175,6 +177,9 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
|
|||
: 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<AudioPlayerWidget> {
|
|||
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<AudioPlayerWidget> {
|
|||
|
||||
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<AudioPlayerWidget> {
|
|||
height: 20,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${audioPlayer?.speed.toString() ?? 1}x',
|
||||
'${audioPlayer?.speed.toString() ?? playbackSpeed}x',
|
||||
style: TextStyle(
|
||||
color: widget.color,
|
||||
fontSize: 9,
|
||||
|
|
|
|||
|
|
@ -109,10 +109,15 @@ class OverlayHeaderState extends State<OverlayHeader> {
|
|||
icon: pinned
|
||||
? const Icon(Icons.push_pin)
|
||||
: const Icon(Icons.push_pin_outlined),
|
||||
onPressed: controller.pinEvent,
|
||||
onPressed: () {
|
||||
controller
|
||||
.pinEvent()
|
||||
.then((_) => setState(() {}));
|
||||
},
|
||||
tooltip: pinned ? l10n.unpin : l10n.pinMessage,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
|
||||
if (controller.canEditSelectedEvents &&
|
||||
!controller.selectedEvents.first.isActivityMessage)
|
||||
IconButton(
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue