diff --git a/lib/pages/player/widgets/player_overlay.dart b/lib/pages/player/widgets/player_overlay.dart index ade1564..ab3de69 100644 --- a/lib/pages/player/widgets/player_overlay.dart +++ b/lib/pages/player/widgets/player_overlay.dart @@ -56,8 +56,8 @@ class PlayerPlaybackOverlay extends StatelessWidget { _top(context), _bottom(context), _rail(context), - _fullScreenPill(), ], + _fullScreenPill(), if (!controlsVisible) Positioned( top: AppDimens.spaceSm, @@ -321,7 +321,7 @@ class PlayerPlaybackOverlay extends StatelessWidget { child: InkWell( key: const Key('player-fullscreen-toggle'), borderRadius: BorderRadius.circular(999), - onTap: actions.onClear, + onTap: controlsVisible ? actions.onClear : actions.onExitClear, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 7), child: Row( @@ -334,7 +334,9 @@ class PlayerPlaybackOverlay extends StatelessWidget { ), const SizedBox(width: 5), Text( - data.l10n.fullScreenWatch, + controlsVisible + ? data.l10n.fullScreenWatch + : data.l10n.exitClearScreen, style: const TextStyle( color: AppColors.onPrimary, fontSize: 12, diff --git a/test/player/player_fullscreen_test.dart b/test/player/player_fullscreen_test.dart index 8c5dd9d..bc3108d 100644 --- a/test/player/player_fullscreen_test.dart +++ b/test/player/player_fullscreen_test.dart @@ -383,6 +383,19 @@ void main() { expect(find.byKey(const Key('player-exit-clear-screen')), findsOneWidget); }); + testWidgets('should_toggle_fullscreen_from_the_same_pill', (tester) async { + await _pumpApp(tester); + await _openSeriesPlayer(tester); + await tester.tap(find.byKey(const Key('player-fullscreen-toggle'))); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('player-controls-top')), findsNothing); + + await tester.tap(find.byKey(const Key('player-fullscreen-toggle'))); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('player-controls-top')), findsOneWidget); + expect(find.byKey(const Key('player-controls-bottom')), findsOneWidget); + }); + testWidgets('should_open_unlock_panel_with_honest_method_states', ( tester, ) async {