Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/redesign-playlist-remove' into r…
Browse files Browse the repository at this point in the history
…edesign-playlist-remove
  • Loading branch information
Komodo5197 committed May 13, 2024
2 parents 44361f3 + fdde8ba commit 60d6fa8
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 28 deletions.
4 changes: 2 additions & 2 deletions lib/components/AddToPlaylistScreen/playlist_actions_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Future<void> showPlaylistActionsMenu({
);

final menuEntries = [
SongInfo(
SongInfo.condensed(
item: item,
useThemeImage: usePlayerTheme,
),
Expand Down Expand Up @@ -105,7 +105,7 @@ Future<void> showPlaylistActionsMenu({
var menu = [
SliverStickyHeader(
header: Padding(
padding: const EdgeInsets.only(top: 10.0, bottom: 20.0),
padding: const EdgeInsets.only(top: 6.0, bottom: 16.0),
child: Center(
child: Text(AppLocalizations.of(context)!.addRemoveFromPlaylist,
style: TextStyle(
Expand Down
55 changes: 32 additions & 23 deletions lib/components/AlbumScreen/song_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ class _SongMenuState extends ConsumerState<SongMenu> {
null);
var iconColor = Theme.of(context).colorScheme.primary;

final isInCurrentPlaylist = widget.isInPlaylist && widget.parentItem != null;

final currentTrack = _queueService.getCurrentTrack();
FinampQueueItem? queueItem;
if (isBaseItemInQueueItem(widget.item, currentTrack)) {
Expand All @@ -241,7 +243,7 @@ class _SongMenuState extends ConsumerState<SongMenu> {
Icons.playlist_add,
color: iconColor,
),
title: Text(AppLocalizations.of(context)!.addToPlaylistTitle),
title: Text(isInCurrentPlaylist ? AppLocalizations.of(context)!.addToMorePlaylistsTitle : AppLocalizations.of(context)!.addToPlaylistTitle),
enabled: !widget.isOffline,
onTap: () {
Navigator.pop(context); // close menu
Expand Down Expand Up @@ -332,7 +334,7 @@ class _SongMenuState extends ConsumerState<SongMenu> {
},
),
Visibility(
visible: widget.isInPlaylist && widget.parentItem != null,
visible: isInCurrentPlaylist,
child: ListTile(
leading: Icon(
Icons.playlist_remove,
Expand Down Expand Up @@ -775,10 +777,17 @@ class SongInfo extends ConsumerStatefulWidget {
super.key,
required this.item,
required this.useThemeImage,
});
}) : condensed = false;

const SongInfo.condensed({
super.key,
required this.item,
required this.useThemeImage,
}) : condensed = true;

final BaseItemDto item;
final bool useThemeImage;
final bool condensed;

@override
ConsumerState createState() => _SongInfoState();
Expand All @@ -791,8 +800,8 @@ class _SongInfoState extends ConsumerState<SongInfo> {
color: Colors.transparent,
child: Center(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 12.0),
height: 120,
margin: EdgeInsets.symmetric(horizontal: widget.condensed ? 28.0 : 12.0),
height: widget.condensed ? 80 : 120,
clipBehavior: Clip.antiAlias,
decoration: ShapeDecoration(
color: Theme.of(context).brightness == Brightness.dark
Expand All @@ -805,9 +814,8 @@ class _SongInfoState extends ConsumerState<SongInfo> {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 120,
height: 120,
AspectRatio(
aspectRatio: 1.0,
child: AlbumImage(
// Only supply one of item or imageListenable
item: widget.useThemeImage ? null : widget.item,
Expand All @@ -820,7 +828,7 @@ class _SongInfoState extends ConsumerState<SongInfo> {
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Expand All @@ -829,7 +837,7 @@ class _SongInfoState extends ConsumerState<SongInfo> {
AppLocalizations.of(context)!.unknownName,
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 18,
fontSize: widget.condensed ? 16 : 18,
height: 1.2,
color:
Theme.of(context).textTheme.bodyMedium?.color ??
Expand All @@ -840,7 +848,7 @@ class _SongInfoState extends ConsumerState<SongInfo> {
maxLines: 2,
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0),
padding: widget.condensed ? const EdgeInsets.only(top: 6.0) : const EdgeInsets.symmetric(vertical: 4.0),
child: ArtistChips(
baseItem: widget.item,
backgroundColor: IconTheme.of(context)
Expand All @@ -853,18 +861,19 @@ class _SongInfoState extends ConsumerState<SongInfo> {
Colors.white,
),
),
AlbumChip(
item: widget.item,
color: Theme.of(context).textTheme.bodyMedium?.color ??
Colors.white,
backgroundColor:
IconTheme.of(context).color?.withOpacity(0.1) ??
Theme.of(context).textTheme.bodyMedium?.color ??
Colors.white,
key: widget.item.album == null
? null
: ValueKey("${widget.item.album}-album"),
),
if (!widget.condensed)
AlbumChip(
item: widget.item,
color: Theme.of(context).textTheme.bodyMedium?.color ??
Colors.white,
backgroundColor:
IconTheme.of(context).color?.withOpacity(0.1) ??
Theme.of(context).textTheme.bodyMedium?.color ??
Colors.white,
key: widget.item.album == null
? null
: ValueKey("${widget.item.album}-album"),
),
],
),
),
Expand Down
10 changes: 7 additions & 3 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -607,9 +607,13 @@
"@addToPlaylistTooltip": {},
"addToPlaylistTitle": "Add to Playlist",
"@addToPlaylistTitle": {},
"removeFromPlaylistTooltip": "Remove from playlist",
"addToMorePlaylistsTooltip": "Add to more playlists",
"@addToMorePlaylistsTooltip": {},
"addToMorePlaylistsTitle": "Add to More Playlists",
"@addToMorePlaylistsTitle": {},
"removeFromPlaylistTooltip": "Remove from this playlist",
"@removeFromPlaylistTooltip": {},
"removeFromPlaylistTitle": "Remove from Playlist",
"removeFromPlaylistTitle": "Remove From This Playlist",
"@removeFromPlaylistTitle": {},
"removeFromPlaylistNamedTooltip": "Remove from playlist '{playlistName}'",
"@removeFromPlaylistNamedTooltip": {
Expand Down Expand Up @@ -1429,7 +1433,7 @@
"prioritizePlayerCoverSubtitle": "Prioritize showing a larger album cover on player screen. Non-critical controls will be hidden more aggressively at small screen sizes.",
"suppressPlayerPadding": "Suppress player controls padding",
"suppressPlayerPaddingSubtitle": "Fully minimizes padding between player screen controls when album cover is not at full size.",
"lockDownload": "Keep on Device",
"lockDownload": "Always Keep on Device",
"@lockDownload": {
"description": "Text shown on button to require an item which is already downloaded by a parent collection, preventing it from being deleted if the parent is removed."
},
Expand Down

0 comments on commit 60d6fa8

Please sign in to comment.