Skip to content

Commit

Permalink
Add episode refresh option to podcast details context menu, to compli…
Browse files Browse the repository at this point in the history
…ment pull-down action and work better with screen readers.
  • Loading branch information
amugofjava committed Apr 17, 2024
1 parent ed52876 commit 0bd9295
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/core/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Environment {
static const _applicationName = 'Anytime';
static const _applicationUrl = 'https://github.com/amugofjava/anytime_podcast_player';
static const _projectVersion = '1.3.8';
static const _build = '121';
static const _build = '126';

static var _agentString = userAgentAppString;

Expand Down
10 changes: 10 additions & 0 deletions lib/l10n/L.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,16 @@ class L {
locale: localeName,
);
}

String get refresh_feed_label {
return message('refresh_feed_label') ??
Intl.message(
'Refresh episodes',
name: 'refresh_feed_label',
desc: 'Menu item to refresh episodes',
locale: localeName,
);
}
}

class AnytimeLocalisationsDelegate extends LocalizationsDelegate<L> {
Expand Down
6 changes: 6 additions & 0 deletions lib/l10n/intl_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -968,5 +968,11 @@
"description": "Open show website in browser",
"type": "text",
"placeholders": {}
},
"refresh_feed_label": "Holen Sie sich neue Episoden",
"@refresh_feed_label": {
"description": "Menu item to refresh episodes",
"type": "text",
"placeholders": {}
}
}
6 changes: 6 additions & 0 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -968,5 +968,11 @@
"description": "Open show website in browser",
"type": "text",
"placeholders": {}
},
"refresh_feed_label": "Refresh episodes",
"@refresh_feed_label": {
"description": "Menu item to refresh episodes",
"type": "text",
"placeholders": {}
}
}
6 changes: 6 additions & 0 deletions lib/l10n/intl_it.arb
Original file line number Diff line number Diff line change
Expand Up @@ -968,5 +968,11 @@
"description": "Open show website in browser",
"type": "text",
"placeholders": {}
},
"refresh_feed_label": "Recupera nuovi episodi",
"@refresh_feed_label": {
"description": "Menu item to refresh episodes",
"type": "text",
"placeholders": {}
}
}
8 changes: 7 additions & 1 deletion lib/l10n/intl_messages.arb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@@last_modified": "2024-04-04T16:54:01.419283",
"@@last_modified": "2024-04-17T14:09:22.222143",
"app_title": "Anytime Podcast Player",
"@app_title": {
"description": "Full title for the application",
Expand Down Expand Up @@ -913,5 +913,11 @@
"description": "Open show website in browser",
"type": "text",
"placeholders": {}
},
"refresh_feed_label": "Refresh episodes",
"@refresh_feed_label": {
"description": "Menu item to refresh episodes",
"type": "text",
"placeholders": {}
}
}
1 change: 1 addition & 0 deletions lib/l10n/messages_de.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class MessageLookup extends MessageLookupByLibrary {
'queue_clear_label': MessageLookupByLibrary.simpleMessage('Möchten Sie die Warteschlange wirklich löschen?'),
'queue_clear_label_title': MessageLookupByLibrary.simpleMessage('Warteschlange löschen'),
'queue_remove_label': MessageLookupByLibrary.simpleMessage('Entfernen'),
'refresh_feed_label': MessageLookupByLibrary.simpleMessage('Holen Sie sich neue Episoden'),
'rewind_button_label': MessageLookupByLibrary.simpleMessage('10 Sekunden zurückspulen'),
'search_back_button_label': MessageLookupByLibrary.simpleMessage('Zurück'),
'search_button_label': MessageLookupByLibrary.simpleMessage('Suche'),
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class MessageLookup extends MessageLookupByLibrary {
'queue_clear_label': MessageLookupByLibrary.simpleMessage('Are you sure you wish to clear the queue?'),
'queue_clear_label_title': MessageLookupByLibrary.simpleMessage('Clear Queue'),
'queue_remove_label': MessageLookupByLibrary.simpleMessage('Remove'),
'refresh_feed_label': MessageLookupByLibrary.simpleMessage('Refresh episodes'),
'rewind_button_label': MessageLookupByLibrary.simpleMessage('Rewind episode 10 seconds'),
'search_back_button_label': MessageLookupByLibrary.simpleMessage('Back'),
'search_button_label': MessageLookupByLibrary.simpleMessage('Search'),
Expand Down
9 changes: 9 additions & 0 deletions lib/l10n/messages_it.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,16 @@ class MessageLookup extends MessageLookupByLibrary {
'episode_filter_no_episodes_title_label': MessageLookupByLibrary.simpleMessage('Nessun episodio trovato'),
'episode_filter_none_label': MessageLookupByLibrary.simpleMessage('Nessuno'),
'episode_filter_played_label': MessageLookupByLibrary.simpleMessage('Riprodotto'),
'episode_filter_semantic_label': MessageLookupByLibrary.simpleMessage('Filtra gli episodi'),
'episode_filter_started_label': MessageLookupByLibrary.simpleMessage('Avviato'),
'episode_filter_unplayed_label': MessageLookupByLibrary.simpleMessage('Non riprodotto'),
'episode_label': MessageLookupByLibrary.simpleMessage('Episodio'),
'episode_sort_alphabetical_ascending_label': MessageLookupByLibrary.simpleMessage('Ordine Alfabetico A-Z'),
'episode_sort_alphabetical_descending_label': MessageLookupByLibrary.simpleMessage('Ordine Alfabetico Z-A'),
'episode_sort_earliest_first_label': MessageLookupByLibrary.simpleMessage('I più vecchi'),
'episode_sort_latest_first_label': MessageLookupByLibrary.simpleMessage('Gli ultimi'),
'episode_sort_none_label': MessageLookupByLibrary.simpleMessage('Default'),
'episode_sort_semantic_label': MessageLookupByLibrary.simpleMessage('Ordina gli episodi'),
'error_no_connection': MessageLookupByLibrary.simpleMessage('Impossibile riprodurre l\'episodio. Per favore, verifica la tua connessione e prova di nuovo.'),
'error_playback_fail': MessageLookupByLibrary.simpleMessage('Sì è verificato un errore inatteso durante la riproduzione. Per favore, verifica la tua connessione e prova di nuovo.'),
'fast_forward_button_label': MessageLookupByLibrary.simpleMessage('Manda avanti di 30 secondi'),
Expand All @@ -86,6 +93,7 @@ class MessageLookup extends MessageLookupByLibrary {
'notes_label': MessageLookupByLibrary.simpleMessage('Note'),
'now_playing_queue_label': MessageLookupByLibrary.simpleMessage('In Riproduzione'),
'ok_button_label': MessageLookupByLibrary.simpleMessage('OK'),
'open_show_website_label': MessageLookupByLibrary.simpleMessage('Vai al sito web dello show'),
'opml_export_button_label': MessageLookupByLibrary.simpleMessage('Esporta'),
'opml_import_button_label': MessageLookupByLibrary.simpleMessage('Importa'),
'opml_import_export_label': MessageLookupByLibrary.simpleMessage('OPML Importa/Esporta'),
Expand All @@ -99,6 +107,7 @@ class MessageLookup extends MessageLookupByLibrary {
'queue_clear_label': MessageLookupByLibrary.simpleMessage('Sicuro/a di voler ripulire la coda?'),
'queue_clear_label_title': MessageLookupByLibrary.simpleMessage('Svuota la Coda'),
'queue_remove_label': MessageLookupByLibrary.simpleMessage('Rimuovi'),
'refresh_feed_label': MessageLookupByLibrary.simpleMessage('Recupera nuovi episodi'),
'rewind_button_label': MessageLookupByLibrary.simpleMessage('Riavvolgi di 10 secondi'),
'search_back_button_label': MessageLookupByLibrary.simpleMessage('Indietro'),
'search_button_label': MessageLookupByLibrary.simpleMessage('Cerca'),
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/messages_messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class MessageLookup extends MessageLookupByLibrary {
'queue_clear_label': MessageLookupByLibrary.simpleMessage('Are you sure you wish to clear the queue?'),
'queue_clear_label_title': MessageLookupByLibrary.simpleMessage('Clear Queue'),
'queue_remove_label': MessageLookupByLibrary.simpleMessage('Remove'),
'refresh_feed_label': MessageLookupByLibrary.simpleMessage('Refresh episodes'),
'rewind_button_label': MessageLookupByLibrary.simpleMessage('Rewind episode 10 seconds'),
'search_back_button_label': MessageLookupByLibrary.simpleMessage('Back'),
'search_button_label': MessageLookupByLibrary.simpleMessage('Search'),
Expand Down
23 changes: 20 additions & 3 deletions lib/ui/podcast/podcast_context_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:anytime/bloc/podcast/podcast_bloc.dart';
import 'package:anytime/entities/feed.dart';
import 'package:anytime/entities/podcast.dart';
import 'package:anytime/l10n/L.dart';
import 'package:anytime/state/bloc_state.dart';
Expand Down Expand Up @@ -76,6 +77,12 @@ class _MaterialPodcastMenu extends StatelessWidget {
child: Text(L.of(context)!.mark_episodes_not_played_label),
),
const PopupMenuDivider(),
PopupMenuItem<String>(
value: 'refresh',
enabled: podcast.link?.isNotEmpty ?? false,
child: Text(L.of(context)!.refresh_feed_label),
),
const PopupMenuDivider(),
PopupMenuItem<String>(
value: 'web',
enabled: podcast.link?.isNotEmpty ?? false,
Expand All @@ -95,6 +102,11 @@ class _MaterialPodcastMenu extends StatelessWidget {
bloc.podcastEvent(PodcastEvent.markAllPlayed);
} else if (value == 'ua') {
bloc.podcastEvent(PodcastEvent.clearAllPlayed);
} else if (value == 'refresh') {
bloc.load(Feed(
podcast: podcast,
refresh: true,
));
} else if (value == 'web') {
final uri = Uri.parse(podcast.link!);

Expand Down Expand Up @@ -141,10 +153,15 @@ class _CupertinoContextMenu extends StatelessWidget {
CupertinoActionSheetAction(
isDefaultAction: true,
onPressed: () {
bloc.podcastEvent(PodcastEvent.clearAllPlayed);
Navigator.pop(context, 'Cancel');
bloc.load(Feed(
podcast: podcast,
refresh: true,
));
if (context.mounted) {
Navigator.pop(context, 'Cancel');
}
},
child: Text(L.of(context)!.mark_episodes_not_played_label),
child: Text(L.of(context)!.refresh_feed_label),
),
CupertinoActionSheetAction(
isDefaultAction: true,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: anytime
description: Anytime Podcast Player

version: 1.3.8+122
version: 1.3.8+126

environment:
sdk: '>=3.2.0 <4.0.0'
Expand Down

0 comments on commit 0bd9295

Please sign in to comment.