mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 13:19:44 +02:00
fix(queue): style Mornye swipe removal and simplify queue heading
This commit is contained in:
1 parent
7d43153b07
commit
63210c0277
4 files changed
+64
-86
No files matched your search
@@ -1301,8 +1301,6 @@ class _NowPlayingScreenState extends ConsumerState<NowPlayingScreen> {
|
||||
child: showQueue
|
||||
? MornyePlayerQueue(
|
||||
colorScheme: colorScheme,
|
||||
onShuffleLibrary: () =>
|
||||
_shuffleLibrary(controller),
|
||||
)
|
||||
: _lyricsSection(
|
||||
colorScheme,
|
||||
@@ -1486,10 +1484,7 @@ class _NowPlayingScreenState extends ConsumerState<NowPlayingScreen> {
|
||||
lyricsOptions: showLyrics
|
||||
? _lyricsOptionsButton(colorScheme)
|
||||
: null,
|
||||
queue: MornyePlayerQueue(
|
||||
colorScheme: colorScheme,
|
||||
onShuffleLibrary: () => _shuffleLibrary(controller),
|
||||
),
|
||||
queue: MornyePlayerQueue(colorScheme: colorScheme),
|
||||
controls: controls(),
|
||||
volume: const MornyeVolumeControl(),
|
||||
);
|
||||
|
||||
@@ -7,18 +7,12 @@ import 'package:spotiflac_android/providers/music_player_provider.dart';
|
||||
import 'package:spotiflac_android/providers/settings_provider.dart';
|
||||
import 'package:spotiflac_android/widgets/player_artwork.dart';
|
||||
import 'package:spotiflac_android/widgets/player_queue_dismissible.dart';
|
||||
import 'package:spotiflac_android/widgets/mornye_context_menu.dart';
|
||||
|
||||
/// Upcoming tracks share the player's artwork backdrop and transport controls.
|
||||
class MornyePlayerQueue extends ConsumerWidget {
|
||||
const MornyePlayerQueue({
|
||||
super.key,
|
||||
required this.colorScheme,
|
||||
required this.onShuffleLibrary,
|
||||
});
|
||||
const MornyePlayerQueue({super.key, required this.colorScheme});
|
||||
|
||||
final ColorScheme colorScheme;
|
||||
final VoidCallback onShuffleLibrary;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
@@ -89,6 +83,7 @@ class MornyePlayerQueue extends ConsumerWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 28),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
@@ -140,59 +135,25 @@ class MornyePlayerQueue extends ConsumerWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
context.l10n.mornyeContinuePlaying,
|
||||
style: type.titleLarge?.copyWith(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
if (autoplay &&
|
||||
playback.repeat == AudioServiceRepeatMode.none)
|
||||
Text(
|
||||
context.l10n.autoplayFromLibrary,
|
||||
style: type.bodySmall?.copyWith(
|
||||
color: Colors.white70,
|
||||
),
|
||||
),
|
||||
],
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
context.l10n.mornyeContinuePlaying,
|
||||
style: type.titleLarge?.copyWith(color: Colors.white),
|
||||
),
|
||||
),
|
||||
Builder(
|
||||
builder: (buttonContext) => IconButton(
|
||||
tooltip: MaterialLocalizations.of(
|
||||
context,
|
||||
).moreButtonTooltip,
|
||||
icon: const Icon(
|
||||
CupertinoIcons.ellipsis,
|
||||
color: Colors.white,
|
||||
),
|
||||
onPressed: () => showMornyeContextMenu<void>(
|
||||
context: buttonContext,
|
||||
builder: (menuContext) => MornyeContextMenu(
|
||||
groups: [
|
||||
[
|
||||
MornyeMenuAction(
|
||||
icon: CupertinoIcons.shuffle,
|
||||
label: context.l10n.nowPlayingShuffleLibrary,
|
||||
onPressed: () {
|
||||
Navigator.pop(menuContext);
|
||||
onShuffleLibrary();
|
||||
},
|
||||
),
|
||||
],
|
||||
],
|
||||
if (autoplay &&
|
||||
playback.repeat == AudioServiceRepeatMode.none)
|
||||
Text(
|
||||
context.l10n.autoplayFromLibrary,
|
||||
style: type.bodySmall?.copyWith(
|
||||
color: Colors.white70,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import 'package:flutter/cupertino.dart' show CupertinoColors, CupertinoIcons;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:spotiflac_android/l10n/l10n.dart';
|
||||
import 'package:spotiflac_android/theme/mornye_theme.dart';
|
||||
|
||||
/// Removing a row affects the queue only, never the song on disk.
|
||||
class PlayerQueueDismissible extends StatelessWidget {
|
||||
@@ -23,19 +26,46 @@ class PlayerQueueDismissible extends StatelessWidget {
|
||||
onRemove();
|
||||
return false;
|
||||
},
|
||||
background: Container(
|
||||
alignment: AlignmentDirectional.centerEnd,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.delete_outline,
|
||||
color: Theme.of(context).colorScheme.onError,
|
||||
semanticLabel: MaterialLocalizations.of(context).deleteButtonTooltip,
|
||||
),
|
||||
),
|
||||
background: context.isMornye
|
||||
? Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Align(
|
||||
alignment: AlignmentDirectional.centerEnd,
|
||||
child: SizedBox.square(
|
||||
dimension: 48,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: CupertinoColors.systemRed.resolveFrom(context),
|
||||
border: Border.all(
|
||||
color: Colors.white.withValues(alpha: 0.18),
|
||||
),
|
||||
),
|
||||
child: Icon(
|
||||
CupertinoIcons.minus,
|
||||
color: Colors.white,
|
||||
size: 24,
|
||||
semanticLabel: context.l10n.dialogRemove,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
alignment: AlignmentDirectional.centerEnd,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.delete_outline,
|
||||
color: Theme.of(context).colorScheme.onError,
|
||||
semanticLabel: MaterialLocalizations.of(
|
||||
context,
|
||||
).deleteButtonTooltip,
|
||||
),
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user