Skip to content

Commit

Permalink
fix: make podcast subscribe icon more clear, dont allow podcasts in p…
Browse files Browse the repository at this point in the history
…laylists, add onTap for radio metadata url

Ref #1122
Fixes #1107
  • Loading branch information
Feichtmeier committed Jan 20, 2025
1 parent 07e2a34 commit 26cd594
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 576 deletions.
3 changes: 2 additions & 1 deletion lib/common/view/audio_tile_option_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class AudioTileOptionButton extends StatelessWidget {
),
),
),
if (audios.none((e) => e.audioType == AudioType.radio))
if (audios.none((e) => e.audioType == AudioType.radio) &&
audios.none((e) => e.audioType == AudioType.podcast))
PopupMenuItem(
onTap: () => showDialog(
context: context,
Expand Down
12 changes: 6 additions & 6 deletions lib/common/view/icons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,15 @@ class Iconz {
: Icons.settings;

static IconData get addToLibrary => yaruStyled
? YaruIcons.bell
? YaruIcons.plus
: appleStyled
? CupertinoIcons.bell
: Icons.notifications_outlined;
? CupertinoIcons.plus
: Icons.add;
static IconData get removeFromLibrary => yaruStyled
? YaruIcons.bell_filled
? YaruIcons.checkmark
: appleStyled
? CupertinoIcons.bell_fill
: Icons.notifications_rounded;
? CupertinoIcons.check_mark
: Icons.check;
static IconData get refresh => yaruStyled
? YaruIcons.refresh
: appleStyled
Expand Down
18 changes: 18 additions & 0 deletions lib/common/view/meta_data_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:yaru/yaru.dart';

import '../../app_config.dart';
import '../../l10n/l10n.dart';
import '../data/audio.dart';
import '../data/audio_type.dart';
import 'copy_clipboard_content.dart';
import 'modals.dart';
import 'snackbars.dart';

class MetaDataContent extends StatelessWidget {
const MetaDataContent.dialog({
Expand Down Expand Up @@ -86,6 +89,21 @@ class MetaDataContent extends StatelessWidget {
dense: true,
title: Text(e.$1),
subtitle: Text(e.$2),
onTap: e.$1 == l10n.url
? () {
final maybeUri = Uri.tryParse(e.$2);
if (maybeUri != null) {
showSnackBar(
context: context,
content: CopyClipboardContent(
text: maybeUri.toString(),
onSearch: () => launchUrl(maybeUri),
),
);
Navigator.of(context).pop();
}
}
: null,
),
)
.toList(),
Expand Down
4 changes: 3 additions & 1 deletion lib/player/view/player_main_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ class PlayerMainControls extends StatelessWidget with WatchItMixin {
active: active,
iconColor: defaultColor,
),
AudioType.radio => const PlayerPauseTimerButton(),
AudioType.radio => PlayerPauseTimerButton(
iconColor: defaultColor,
),
_ => const SizedBox.shrink(),
},
];
Expand Down
9 changes: 7 additions & 2 deletions lib/player/view/player_pause_timer_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import '../../l10n/l10n.dart';
import '../player_model.dart';

class PlayerPauseTimerButton extends StatelessWidget {
const PlayerPauseTimerButton({super.key});
const PlayerPauseTimerButton({super.key, this.iconColor});

final Color? iconColor;

@override
Widget build(BuildContext context) => IconButton(
Expand All @@ -25,7 +27,10 @@ class PlayerPauseTimerButton extends StatelessWidget {
mode: ModalMode.platformModalMode,
content: isMobilePlatform ? const _BottomSheet() : const _Dialog(),
),
icon: Icon(Iconz.sleep),
icon: Icon(
Iconz.sleep,
color: iconColor,
),
);
}

Expand Down
Loading

0 comments on commit 26cd594

Please sign in to comment.