diff --git a/lib/screens/now_playing_screen.dart b/lib/screens/now_playing_screen.dart index 4cf54eb9..036e4f43 100644 --- a/lib/screens/now_playing_screen.dart +++ b/lib/screens/now_playing_screen.dart @@ -1395,21 +1395,36 @@ class _NowPlayingScreenState extends ConsumerState { ), ), ) - : _transitionArtwork( - _compactArtworkKey, - ClipRRect( - borderRadius: - BorderRadius.circular(12), - child: PlayerArtwork( - artUri: mediaItem.artUri - ?.toString(), - colorScheme: colorScheme, - cacheWidth: - (360 * - MediaQuery.devicePixelRatioOf( - context, - )) - .round(), + : Semantics( + button: true, + label: context + .l10n + .nowPlayingTabPlayer, + child: GestureDetector( + behavior: + HitTestBehavior.opaque, + onTap: () => + _setMornyePage(0), + child: _transitionArtwork( + _compactArtworkKey, + ClipRRect( + borderRadius: + BorderRadius.circular( + 12, + ), + child: PlayerArtwork( + artUri: mediaItem.artUri + ?.toString(), + colorScheme: + colorScheme, + cacheWidth: + (360 * + MediaQuery.devicePixelRatioOf( + context, + )) + .round(), + ), + ), ), ), ), diff --git a/lib/widgets/player_track_swipe.dart b/lib/widgets/player_track_swipe.dart index edc5eb26..ba8cf581 100644 --- a/lib/widgets/player_track_swipe.dart +++ b/lib/widgets/player_track_swipe.dart @@ -1,5 +1,6 @@ import 'package:audio_service/audio_service.dart'; import 'package:flutter/foundation.dart'; +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; /// Shares one horizontal gesture between artwork and metadata. Only the @@ -135,6 +136,8 @@ class PlayerTrackSwipeRegion extends StatelessWidget { if (state == null) return child; return GestureDetector( behavior: HitTestBehavior.translucent, + // Keep the initial movement when a cover/title tap competes with a swipe. + dragStartBehavior: DragStartBehavior.down, onHorizontalDragStart: state._start, onHorizontalDragUpdate: state._update, onHorizontalDragEnd: state._finish, diff --git a/test/now_playing_lyrics_transition_test.dart b/test/now_playing_lyrics_transition_test.dart index f696242e..1687df91 100644 --- a/test/now_playing_lyrics_transition_test.dart +++ b/test/now_playing_lyrics_transition_test.dart @@ -2027,7 +2027,7 @@ void main() { for (final lyrics in [true, false]) { testWidgets( - 'motion cover moves into and expands out of ${lyrics ? 'lyrics' : 'queue'}', + 'tapping the compact motion cover returns from ${lyrics ? 'lyrics' : 'queue'}', (tester) async { tester.view.padding = FakeViewPadding(top: 59, bottom: 34); tester.view.viewPadding = FakeViewPadding(top: 59, bottom: 34); @@ -2075,7 +2075,7 @@ void main() { final header = find.byKey(const ValueKey('player-track-header')); expect(tester.getRect(header).left, compactBounds.right + 12); expect(tester.getRect(header).center.dy, compactBounds.center.dy); - await tester.tap(toggle); + await tester.tap(compact); await tester.pump(); expect(tester.getRect(compact), compactBounds); previous = compactBounds; @@ -2169,7 +2169,7 @@ void main() { for (final playing in [false, true]) { testWidgets( - 'cover returns from lyrics to its resting size (playing: $playing)', + 'tapping the lyrics cover returns to its resting size (playing: $playing)', (tester) async { await pumpNowPlaying( tester, @@ -2190,7 +2190,7 @@ void main() { await tester.tap(lyrics); await tester.pumpAndSettle(); final compactBounds = tester.getRect(compact); - await tester.tap(lyrics); + await tester.tap(compact); await tester.pump(); expect(tester.getRect(artwork), compactBounds); var previous = compactBounds;