shortcuts review
This commit is contained in:
parent
1521db29a5
commit
8f439a5add
34 changed files with 188 additions and 134 deletions
|
@ -1,5 +1,5 @@
|
|||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||
import 'package:aves/widgets/viewer/controller.dart';
|
||||
import 'package:aves/widgets/viewer/controls/controller.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'enums.dart';
|
||||
|
|
|
@ -247,7 +247,6 @@ class _CollectionGridContentState extends State<_CollectionGridContent> {
|
|||
final viewerCollection = collection.copyWith(
|
||||
listenToSource: false,
|
||||
);
|
||||
assert(viewerCollection.sortedEntries.map((entry) => entry.id).contains(entry.id));
|
||||
Widget child = EntryViewerPage(
|
||||
collection: viewerCollection,
|
||||
initialEntry: entry,
|
||||
|
|
|
@ -30,7 +30,7 @@ import 'package:aves/widgets/dialogs/aves_confirmation_dialog.dart';
|
|||
import 'package:aves/widgets/dialogs/aves_selection_dialog.dart';
|
||||
import 'package:aves/widgets/dialogs/convert_entry_dialog.dart';
|
||||
import 'package:aves/widgets/dialogs/pick_dialogs/album_pick_page.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
|
|
@ -5,7 +5,7 @@ import 'package:aves/theme/themes.dart';
|
|||
import 'package:aves/utils/debouncer.dart';
|
||||
import 'package:aves/widgets/common/fx/blurred.dart';
|
||||
import 'package:aves/widgets/common/identity/aves_filter_chip.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:aves_map/aves_map.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
|
|
@ -32,7 +32,7 @@ import 'package:aves/widgets/common/thumbnail/scroller.dart';
|
|||
import 'package:aves/widgets/filter_grids/common/action_delegates/chip.dart';
|
||||
import 'package:aves/widgets/map/map_info_row.dart';
|
||||
import 'package:aves/widgets/viewer/entry_viewer_page.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:aves_map/aves_map.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
|
@ -29,9 +29,9 @@ import 'package:aves/widgets/dialogs/entry_editors/rename_entry_dialog.dart';
|
|||
import 'package:aves/widgets/viewer/action/entry_info_action_delegate.dart';
|
||||
import 'package:aves/widgets/viewer/action/printer.dart';
|
||||
import 'package:aves/widgets/viewer/action/single_entry_editor.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/debug/debug_page.dart';
|
||||
import 'package:aves/widgets/viewer/multipage/conductor.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/source_viewer_page.dart';
|
||||
import 'package:aves/widgets/viewer/video/conductor.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
|
|
@ -21,7 +21,7 @@ import 'package:aves/widgets/dialogs/aves_dialog.dart';
|
|||
import 'package:aves/widgets/map/map_page.dart';
|
||||
import 'package:aves/widgets/viewer/action/single_entry_editor.dart';
|
||||
import 'package:aves/widgets/viewer/debug/debug_page.dart';
|
||||
import 'package:aves/widgets/viewer/embedded/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/info/embedded/notifications.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import 'package:aves/widgets/dialogs/aves_dialog.dart';
|
|||
import 'package:aves/widgets/dialogs/video_speed_dialog.dart';
|
||||
import 'package:aves/widgets/dialogs/video_stream_selection_dialog.dart';
|
||||
import 'package:aves/widgets/settings/video/video_settings_page.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/video/controller.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/material.dart';
|
|
@ -4,6 +4,7 @@ import 'dart:math';
|
|||
import 'package:aves/model/entry.dart';
|
||||
import 'package:aves/model/settings/enums/enums.dart';
|
||||
import 'package:aves/theme/durations.dart';
|
||||
import 'package:aves/widgets/viewer/controls/events.dart';
|
||||
import 'package:aves_magnifier/aves_magnifier.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
|
@ -103,16 +104,6 @@ class ViewerController {
|
|||
}
|
||||
}
|
||||
|
||||
@immutable
|
||||
class ViewerShowNextEvent {}
|
||||
|
||||
@immutable
|
||||
class ViewerOverlayToggleEvent {
|
||||
final bool? visible;
|
||||
|
||||
const ViewerOverlayToggleEvent({required this.visible});
|
||||
}
|
||||
|
||||
class PageTransitionEffects {
|
||||
static TransitionBuilder fade(
|
||||
PageController pageController,
|
11
lib/widgets/viewer/controls/events.dart
Normal file
11
lib/widgets/viewer/controls/events.dart
Normal file
|
@ -0,0 +1,11 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
|
||||
@immutable
|
||||
class ViewerShowNextEvent {}
|
||||
|
||||
@immutable
|
||||
class ViewerOverlayToggleEvent {
|
||||
final bool? visible;
|
||||
|
||||
const ViewerOverlayToggleEvent({required this.visible});
|
||||
}
|
50
lib/widgets/viewer/controls/intents.dart
Normal file
50
lib/widgets/viewer/controls/intents.dart
Normal file
|
@ -0,0 +1,50 @@
|
|||
import 'package:aves/model/actions/entry_actions.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class ShowPreviousIntent extends Intent {
|
||||
const ShowPreviousIntent();
|
||||
}
|
||||
|
||||
class ShowNextIntent extends Intent {
|
||||
const ShowNextIntent();
|
||||
}
|
||||
|
||||
class LeaveIntent extends Intent {
|
||||
const LeaveIntent();
|
||||
}
|
||||
|
||||
class ShowInfoIntent extends Intent {
|
||||
const ShowInfoIntent();
|
||||
}
|
||||
|
||||
class TvShowLessInfoIntent extends Intent {
|
||||
const TvShowLessInfoIntent();
|
||||
}
|
||||
|
||||
class TvShowMoreInfoIntent extends Intent {
|
||||
const TvShowMoreInfoIntent();
|
||||
}
|
||||
|
||||
class PlayPauseIntent extends Intent {
|
||||
final TvPlayPauseType type;
|
||||
|
||||
const PlayPauseIntent.play() : type = TvPlayPauseType.play;
|
||||
|
||||
const PlayPauseIntent.pause() : type = TvPlayPauseType.pause;
|
||||
|
||||
const PlayPauseIntent.toggle() : type = TvPlayPauseType.toggle;
|
||||
}
|
||||
|
||||
enum TvPlayPauseType {
|
||||
play,
|
||||
pause,
|
||||
toggle,
|
||||
}
|
||||
|
||||
class EntryActionIntent extends Intent {
|
||||
final EntryAction action;
|
||||
|
||||
const EntryActionIntent({
|
||||
required this.action,
|
||||
});
|
||||
}
|
34
lib/widgets/viewer/controls/shortcuts.dart
Normal file
34
lib/widgets/viewer/controls/shortcuts.dart
Normal file
|
@ -0,0 +1,34 @@
|
|||
import 'package:aves/model/actions/entry_actions.dart';
|
||||
import 'package:aves/widgets/viewer/controls/intents.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class ViewerShortcuts {
|
||||
static const entryActions = {
|
||||
SingleActivator(LogicalKeyboardKey.delete): EntryActionIntent(action: EntryAction.delete),
|
||||
};
|
||||
|
||||
// cf https://developer.android.com/training/tv/start/controllers#media-events
|
||||
static const media = {
|
||||
// KEYCODE_MEDIA_PLAY_PAUSE / 85 / play/pause
|
||||
SingleActivator(LogicalKeyboardKey.mediaPlayPause): PlayPauseIntent.toggle(),
|
||||
// KEYCODE_MEDIA_STOP / 86 / stop
|
||||
SingleActivator(LogicalKeyboardKey.mediaStop): PlayPauseIntent.pause(),
|
||||
// KEYCODE_MEDIA_NEXT / 87 / skip to next
|
||||
SingleActivator(LogicalKeyboardKey.mediaTrackNext): ShowNextIntent(),
|
||||
// KEYCODE_MEDIA_PREVIOUS / 88 / skip to previous
|
||||
SingleActivator(LogicalKeyboardKey.mediaTrackPrevious): ShowPreviousIntent(),
|
||||
// KEYCODE_MEDIA_PLAY / 126 / play
|
||||
SingleActivator(LogicalKeyboardKey.mediaPlay): PlayPauseIntent.play(),
|
||||
// KEYCODE_MEDIA_PAUSE / 127 / pause
|
||||
SingleActivator(LogicalKeyboardKey.mediaPause): PlayPauseIntent.pause(),
|
||||
// KEYCODE_BUTTON_L1 / 102 / skip to previous
|
||||
SingleActivator(LogicalKeyboardKey.gameButtonLeft1): ShowPreviousIntent(),
|
||||
// KEYCODE_BUTTON_R1 / 103 / skip to next
|
||||
SingleActivator(LogicalKeyboardKey.gameButtonRight1): ShowNextIntent(),
|
||||
// KEYCODE_BUTTON_START / 108 / pause
|
||||
SingleActivator(LogicalKeyboardKey.gameButtonStart): PlayPauseIntent.pause(),
|
||||
// KEYCODE_BUTTON_SELECT / 109 / play/pause
|
||||
SingleActivator(LogicalKeyboardKey.gameButtonSelect): PlayPauseIntent.toggle(),
|
||||
};
|
||||
}
|
|
@ -3,9 +3,9 @@ import 'package:aves/model/settings/enums/accessibility_animations.dart';
|
|||
import 'package:aves/model/settings/enums/viewer_transition.dart';
|
||||
import 'package:aves/model/settings/settings.dart';
|
||||
import 'package:aves/model/source/collection_lens.dart';
|
||||
import 'package:aves/widgets/viewer/controller.dart';
|
||||
import 'package:aves/widgets/viewer/controls/controller.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/multipage/conductor.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/page_entry_builder.dart';
|
||||
import 'package:aves/widgets/viewer/visual/entry_page_view.dart';
|
||||
import 'package:aves_magnifier/aves_magnifier.dart';
|
||||
|
|
|
@ -8,10 +8,14 @@ import 'package:aves/model/entry.dart';
|
|||
import 'package:aves/model/settings/settings.dart';
|
||||
import 'package:aves/model/source/collection_lens.dart';
|
||||
import 'package:aves/theme/durations.dart';
|
||||
import 'package:aves/widgets/viewer/controller.dart';
|
||||
import 'package:aves/widgets/viewer/action/entry_action_delegate.dart';
|
||||
import 'package:aves/widgets/viewer/controls/controller.dart';
|
||||
import 'package:aves/widgets/viewer/controls/intents.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/controls/shortcuts.dart';
|
||||
import 'package:aves/widgets/viewer/entry_horizontal_pager.dart';
|
||||
import 'package:aves/widgets/viewer/info/info_page.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/multipage/conductor.dart';
|
||||
import 'package:aves/widgets/viewer/video/conductor.dart';
|
||||
import 'package:aves_magnifier/aves_magnifier.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
|
@ -184,37 +188,18 @@ class _ViewerVerticalPageViewState extends State<ViewerVerticalPageView> {
|
|||
Widget _buildImagePage() {
|
||||
final useTvLayout = settings.useTvLayout;
|
||||
|
||||
// cf https://developer.android.com/training/tv/start/controllers#media-events
|
||||
Map<ShortcutActivator, Intent>? shortcuts = {
|
||||
const SingleActivator(LogicalKeyboardKey.arrowUp): useTvLayout ? const TvShowLessInfoIntent() : const _LeaveIntent(),
|
||||
const SingleActivator(LogicalKeyboardKey.arrowDown): useTvLayout ? const _TvShowMoreInfoIntent() : const _ShowInfoIntent(),
|
||||
// KEYCODE_MEDIA_PLAY_PAUSE / 85 / play/pause
|
||||
const SingleActivator(LogicalKeyboardKey.mediaPlayPause): const _PlayPauseIntent.toggle(),
|
||||
// KEYCODE_MEDIA_STOP / 86 / stop
|
||||
const SingleActivator(LogicalKeyboardKey.mediaStop): const _PlayPauseIntent.pause(),
|
||||
// KEYCODE_MEDIA_NEXT / 87 / skip to next
|
||||
const SingleActivator(LogicalKeyboardKey.mediaTrackNext): const _ShowNextIntent(),
|
||||
// KEYCODE_MEDIA_PREVIOUS / 88 / skip to previous
|
||||
const SingleActivator(LogicalKeyboardKey.mediaTrackPrevious): const _ShowPreviousIntent(),
|
||||
// KEYCODE_MEDIA_PLAY / 126 / play
|
||||
const SingleActivator(LogicalKeyboardKey.mediaPlay): const _PlayPauseIntent.play(),
|
||||
// KEYCODE_MEDIA_PAUSE / 127 / pause
|
||||
const SingleActivator(LogicalKeyboardKey.mediaPause): const _PlayPauseIntent.pause(),
|
||||
// KEYCODE_BUTTON_L1 / 102 / skip to previous
|
||||
const SingleActivator(LogicalKeyboardKey.gameButtonLeft1): const _ShowPreviousIntent(),
|
||||
// KEYCODE_BUTTON_R1 / 103 / skip to next
|
||||
const SingleActivator(LogicalKeyboardKey.gameButtonRight1): const _ShowNextIntent(),
|
||||
// KEYCODE_BUTTON_START / 108 / pause
|
||||
const SingleActivator(LogicalKeyboardKey.gameButtonStart): const _PlayPauseIntent.pause(),
|
||||
// KEYCODE_BUTTON_SELECT / 109 / play/pause
|
||||
const SingleActivator(LogicalKeyboardKey.gameButtonSelect): const _PlayPauseIntent.toggle(),
|
||||
...ViewerShortcuts.entryActions,
|
||||
...ViewerShortcuts.media,
|
||||
const SingleActivator(LogicalKeyboardKey.arrowUp): useTvLayout ? const TvShowLessInfoIntent() : const LeaveIntent(),
|
||||
const SingleActivator(LogicalKeyboardKey.arrowDown): useTvLayout ? const TvShowMoreInfoIntent() : const ShowInfoIntent(),
|
||||
};
|
||||
|
||||
Widget? child;
|
||||
if (hasCollection) {
|
||||
shortcuts.addAll(const {
|
||||
SingleActivator(LogicalKeyboardKey.arrowLeft): _ShowPreviousIntent(),
|
||||
SingleActivator(LogicalKeyboardKey.arrowRight): _ShowNextIntent(),
|
||||
SingleActivator(LogicalKeyboardKey.arrowLeft): ShowPreviousIntent(),
|
||||
SingleActivator(LogicalKeyboardKey.arrowRight): ShowNextIntent(),
|
||||
});
|
||||
child = MultiEntryScroller(
|
||||
collection: collection!,
|
||||
|
@ -249,13 +234,14 @@ class _ViewerVerticalPageViewState extends State<ViewerVerticalPageView> {
|
|||
autofocus: true,
|
||||
shortcuts: shortcuts,
|
||||
actions: {
|
||||
_ShowPreviousIntent: CallbackAction<Intent>(onInvoke: (intent) => _goToHorizontalPage(-1, animate: false)),
|
||||
_ShowNextIntent: CallbackAction<Intent>(onInvoke: (intent) => _goToHorizontalPage(1, animate: false)),
|
||||
_LeaveIntent: CallbackAction<Intent>(onInvoke: (intent) => Navigator.maybeOf(context)?.pop()),
|
||||
_ShowInfoIntent: CallbackAction<Intent>(onInvoke: (intent) => ShowInfoPageNotification().dispatch(context)),
|
||||
ShowPreviousIntent: CallbackAction<Intent>(onInvoke: (intent) => _goToHorizontalPage(-1, animate: false)),
|
||||
ShowNextIntent: CallbackAction<Intent>(onInvoke: (intent) => _goToHorizontalPage(1, animate: false)),
|
||||
LeaveIntent: CallbackAction<Intent>(onInvoke: (intent) => Navigator.maybeOf(context)?.pop()),
|
||||
ShowInfoIntent: CallbackAction<Intent>(onInvoke: (intent) => ShowInfoPageNotification().dispatch(context)),
|
||||
TvShowLessInfoIntent: CallbackAction<Intent>(onInvoke: (intent) => TvShowLessInfoNotification().dispatch(context)),
|
||||
_TvShowMoreInfoIntent: CallbackAction<Intent>(onInvoke: (intent) => TvShowMoreInfoNotification().dispatch(context)),
|
||||
_PlayPauseIntent: CallbackAction<_PlayPauseIntent>(onInvoke: (intent) => _onPlayPauseIntent(intent, entry)),
|
||||
TvShowMoreInfoIntent: CallbackAction<Intent>(onInvoke: (intent) => TvShowMoreInfoNotification().dispatch(context)),
|
||||
PlayPauseIntent: CallbackAction<PlayPauseIntent>(onInvoke: (intent) => _onPlayPauseIntent(intent, entry)),
|
||||
EntryActionIntent: CallbackAction<EntryActionIntent>(onInvoke: (intent) => _onEntryActionIntent(intent.action)),
|
||||
ActivateIntent: CallbackAction<Intent>(onInvoke: (intent) {
|
||||
if (useTvLayout) {
|
||||
final _entry = entry;
|
||||
|
@ -279,6 +265,22 @@ class _ViewerVerticalPageViewState extends State<ViewerVerticalPageView> {
|
|||
return const SizedBox();
|
||||
}
|
||||
|
||||
void _onEntryActionIntent(EntryAction action) {
|
||||
final mainEntry = entry;
|
||||
if (mainEntry != null) {
|
||||
AvesEntry? pageEntry;
|
||||
final multiPageController = context.read<MultiPageConductor>().getController(mainEntry);
|
||||
if (multiPageController != null) {
|
||||
pageEntry = multiPageController.info?.getPageEntryByIndex(multiPageController.page);
|
||||
}
|
||||
final appMode = context.read<ValueNotifier<AppMode>>().value;
|
||||
final actionDelegate = EntryActionDelegate(mainEntry, pageEntry ?? mainEntry, collection);
|
||||
if (actionDelegate.isVisible(appMode: appMode, action: action) && actionDelegate.canApply(action)) {
|
||||
actionDelegate.onActionSelected(context, action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _goToHorizontalPage(int delta, {required bool animate}) {
|
||||
final pageController = widget.horizontalPager;
|
||||
final page = pageController.page?.round();
|
||||
|
@ -355,7 +357,7 @@ class _ViewerVerticalPageViewState extends State<ViewerVerticalPageView> {
|
|||
}
|
||||
}
|
||||
|
||||
void _onPlayPauseIntent(_PlayPauseIntent intent, entry) {
|
||||
void _onPlayPauseIntent(PlayPauseIntent intent, entry) {
|
||||
// address `TV-PP` requirement from https://developer.android.com/docs/quality-guidelines/tv-app-quality
|
||||
final _entry = entry;
|
||||
if (_entry != null && _entry.isVideo) {
|
||||
|
@ -363,13 +365,13 @@ class _ViewerVerticalPageViewState extends State<ViewerVerticalPageView> {
|
|||
if (controller != null) {
|
||||
bool toggle;
|
||||
switch (intent.type) {
|
||||
case _TvPlayPauseType.play:
|
||||
case TvPlayPauseType.play:
|
||||
toggle = !controller.isPlaying;
|
||||
break;
|
||||
case _TvPlayPauseType.pause:
|
||||
case TvPlayPauseType.pause:
|
||||
toggle = controller.isPlaying;
|
||||
break;
|
||||
case _TvPlayPauseType.toggle:
|
||||
case TvPlayPauseType.toggle:
|
||||
toggle = true;
|
||||
break;
|
||||
}
|
||||
|
@ -380,49 +382,3 @@ class _ViewerVerticalPageViewState extends State<ViewerVerticalPageView> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// keyboard shortcut intents
|
||||
|
||||
class _ShowPreviousIntent extends Intent {
|
||||
const _ShowPreviousIntent();
|
||||
}
|
||||
|
||||
class _ShowNextIntent extends Intent {
|
||||
const _ShowNextIntent();
|
||||
}
|
||||
|
||||
class _LeaveIntent extends Intent {
|
||||
const _LeaveIntent();
|
||||
}
|
||||
|
||||
class _ShowInfoIntent extends Intent {
|
||||
const _ShowInfoIntent();
|
||||
}
|
||||
|
||||
class TvShowLessInfoIntent extends Intent {
|
||||
const TvShowLessInfoIntent();
|
||||
}
|
||||
|
||||
class _TvShowMoreInfoIntent extends Intent {
|
||||
const _TvShowMoreInfoIntent();
|
||||
}
|
||||
|
||||
class _PlayPauseIntent extends Intent {
|
||||
const _PlayPauseIntent({
|
||||
required this.type,
|
||||
});
|
||||
|
||||
const _PlayPauseIntent.play() : type = _TvPlayPauseType.play;
|
||||
|
||||
const _PlayPauseIntent.pause() : type = _TvPlayPauseType.pause;
|
||||
|
||||
const _PlayPauseIntent.toggle() : type = _TvPlayPauseType.toggle;
|
||||
|
||||
final _TvPlayPauseType type;
|
||||
}
|
||||
|
||||
enum _TvPlayPauseType {
|
||||
play,
|
||||
pause,
|
||||
toggle,
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:aves/model/entry.dart';
|
||||
import 'package:aves/model/source/collection_lens.dart';
|
||||
import 'package:aves/widgets/common/basic/scaffold.dart';
|
||||
import 'package:aves/widgets/viewer/controller.dart';
|
||||
import 'package:aves/widgets/viewer/controls/controller.dart';
|
||||
import 'package:aves/widgets/viewer/entry_viewer_stack.dart';
|
||||
import 'package:aves/widgets/viewer/overlay/bottom.dart';
|
||||
import 'package:aves/widgets/viewer/providers.dart';
|
||||
|
|
|
@ -18,11 +18,12 @@ import 'package:aves/widgets/aves_app.dart';
|
|||
import 'package:aves/widgets/collection/collection_page.dart';
|
||||
import 'package:aves/widgets/common/action_mixins/feedback.dart';
|
||||
import 'package:aves/widgets/common/basic/insets.dart';
|
||||
import 'package:aves/widgets/viewer/controller.dart';
|
||||
import 'package:aves/widgets/viewer/action/video_action_delegate.dart';
|
||||
import 'package:aves/widgets/viewer/controls/controller.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/entry_vertical_pager.dart';
|
||||
import 'package:aves/widgets/viewer/hero.dart';
|
||||
import 'package:aves/widgets/viewer/multipage/conductor.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/overlay/bottom.dart';
|
||||
import 'package:aves/widgets/viewer/overlay/panorama.dart';
|
||||
import 'package:aves/widgets/viewer/overlay/slideshow_buttons.dart';
|
||||
|
@ -31,7 +32,6 @@ import 'package:aves/widgets/viewer/overlay/video/video.dart';
|
|||
import 'package:aves/widgets/viewer/page_entry_builder.dart';
|
||||
import 'package:aves/widgets/viewer/video/conductor.dart';
|
||||
import 'package:aves/widgets/viewer/video/controller.dart';
|
||||
import 'package:aves/widgets/viewer/video_action_delegate.dart';
|
||||
import 'package:aves/widgets/viewer/visual/conductor.dart';
|
||||
import 'package:aves/widgets/viewer/visual/controller_mixin.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
|
@ -786,6 +786,7 @@ class _EntryViewerStackState extends State<EntryViewerStack> with EntryViewContr
|
|||
}
|
||||
|
||||
Future<void> _onOverlayVisibleChanged({bool animate = true}) async {
|
||||
if (!mounted) return;
|
||||
if (_overlayVisible.value) {
|
||||
await AvesApp.showSystemUI();
|
||||
AvesApp.setSystemUIStyle(context);
|
||||
|
|
|
@ -7,8 +7,8 @@ import 'package:aves/widgets/common/action_mixins/feedback.dart';
|
|||
import 'package:aves/widgets/common/behaviour/routes.dart';
|
||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||
import 'package:aves/widgets/dialogs/aves_dialog.dart';
|
||||
import 'package:aves/widgets/viewer/embedded/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/entry_viewer_page.dart';
|
||||
import 'package:aves/widgets/viewer/info/embedded/notifications.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class EmbeddedDataOpener extends StatelessWidget with FeedbackMixin {
|
|
@ -12,14 +12,14 @@ import 'package:aves/widgets/common/basic/scaffold.dart';
|
|||
import 'package:aves/widgets/common/basic/tv_edge_focus.dart';
|
||||
import 'package:aves/widgets/filter_grids/common/action_delegates/chip.dart';
|
||||
import 'package:aves/widgets/viewer/action/entry_info_action_delegate.dart';
|
||||
import 'package:aves/widgets/viewer/embedded/embedded_data_opener.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/info/basic_section.dart';
|
||||
import 'package:aves/widgets/viewer/info/embedded/embedded_data_opener.dart';
|
||||
import 'package:aves/widgets/viewer/info/info_app_bar.dart';
|
||||
import 'package:aves/widgets/viewer/info/location_section.dart';
|
||||
import 'package:aves/widgets/viewer/info/metadata/metadata_dir.dart';
|
||||
import 'package:aves/widgets/viewer/info/metadata/metadata_section.dart';
|
||||
import 'package:aves/widgets/viewer/multipage/conductor.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/page_entry_builder.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
|
|
@ -3,7 +3,7 @@ import 'package:aves/theme/icons.dart';
|
|||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||
import 'package:aves/widgets/common/identity/empty.dart';
|
||||
import 'package:aves/widgets/common/providers/media_query_data_provider.dart';
|
||||
import 'package:aves/widgets/viewer/embedded/embedded_data_opener.dart';
|
||||
import 'package:aves/widgets/viewer/info/embedded/embedded_data_opener.dart';
|
||||
import 'package:aves/widgets/viewer/info/metadata/metadata_dir.dart';
|
||||
import 'package:aves/widgets/viewer/info/metadata/metadata_dir_tile.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
|
|
|
@ -7,8 +7,8 @@ import 'package:aves/theme/colors.dart';
|
|||
import 'package:aves/utils/constants.dart';
|
||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||
import 'package:aves/widgets/common/identity/aves_expansion_tile.dart';
|
||||
import 'package:aves/widgets/viewer/embedded/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/info/common.dart';
|
||||
import 'package:aves/widgets/viewer/info/embedded/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/info/metadata/geotiff.dart';
|
||||
import 'package:aves/widgets/viewer/info/metadata/metadata_dir.dart';
|
||||
import 'package:aves/widgets/viewer/info/metadata/metadata_thumbnail.dart';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:aves/utils/xmp_utils.dart';
|
||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||
import 'package:aves/widgets/viewer/embedded/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/info/common.dart';
|
||||
import 'package:aves/widgets/viewer/info/embedded/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/info/metadata/xmp_namespaces.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:aves/ref/mime_types.dart';
|
||||
import 'package:aves/utils/xmp_utils.dart';
|
||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||
import 'package:aves/widgets/viewer/embedded/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/info/common.dart';
|
||||
import 'package:aves/widgets/viewer/info/embedded/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/info/metadata/xmp_namespaces.dart';
|
||||
|
||||
class XmpBasicNamespace extends XmpNamespace {
|
||||
|
|
|
@ -6,9 +6,9 @@ import 'package:aves/model/selection.dart';
|
|||
import 'package:aves/model/settings/settings.dart';
|
||||
import 'package:aves/model/source/collection_lens.dart';
|
||||
import 'package:aves/widgets/common/extensions/media_query.dart';
|
||||
import 'package:aves/widgets/viewer/entry_vertical_pager.dart';
|
||||
import 'package:aves/widgets/viewer/controls/intents.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/multipage/controller.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/overlay/multipage.dart';
|
||||
import 'package:aves/widgets/viewer/overlay/selection_button.dart';
|
||||
import 'package:aves/widgets/viewer/overlay/thumbnail_preview.dart';
|
||||
|
@ -193,8 +193,14 @@ class _BottomOverlayContentState extends State<_BottomOverlayContent> {
|
|||
)
|
||||
: FocusableActionDetector(
|
||||
focusNode: _buttonRowFocusScopeNode,
|
||||
shortcuts: settings.useTvLayout ? const {SingleActivator(LogicalKeyboardKey.arrowUp): TvShowLessInfoIntent()} : null,
|
||||
actions: {TvShowLessInfoIntent: CallbackAction<Intent>(onInvoke: (intent) => TvShowLessInfoNotification().dispatch(context))},
|
||||
shortcuts: settings.useTvLayout
|
||||
? const {
|
||||
SingleActivator(LogicalKeyboardKey.arrowUp): TvShowLessInfoIntent(),
|
||||
}
|
||||
: null,
|
||||
actions: {
|
||||
TvShowLessInfoIntent: CallbackAction<Intent>(onInvoke: (intent) => TvShowLessInfoNotification().dispatch(context)),
|
||||
},
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
|
|
|
@ -2,8 +2,8 @@ import 'package:aves/model/actions/slideshow_actions.dart';
|
|||
import 'package:aves/model/settings/settings.dart';
|
||||
import 'package:aves/widgets/common/identity/buttons/captioned_button.dart';
|
||||
import 'package:aves/widgets/common/identity/buttons/overlay_button.dart';
|
||||
import 'package:aves/widgets/viewer/entry_vertical_pager.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/controls/intents.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/overlay/viewer_buttons.dart';
|
||||
import 'package:aves/widgets/viewer/slideshow_page.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
|
@ -70,8 +70,14 @@ class _SlideshowButtonsState extends State<SlideshowButtons> {
|
|||
Widget build(BuildContext context) {
|
||||
return FocusableActionDetector(
|
||||
focusNode: _buttonRowFocusScopeNode,
|
||||
shortcuts: settings.useTvLayout ? const {SingleActivator(LogicalKeyboardKey.arrowUp): TvShowLessInfoIntent()} : null,
|
||||
actions: {TvShowLessInfoIntent: CallbackAction<Intent>(onInvoke: (intent) => TvShowLessInfoNotification().dispatch(context))},
|
||||
shortcuts: settings.useTvLayout
|
||||
? const {
|
||||
SingleActivator(LogicalKeyboardKey.arrowUp): TvShowLessInfoIntent(),
|
||||
}
|
||||
: null,
|
||||
actions: {
|
||||
TvShowLessInfoIntent: CallbackAction<Intent>(onInvoke: (intent) => TvShowLessInfoNotification().dispatch(context)),
|
||||
},
|
||||
child: settings.useTvLayout
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
|
|
@ -2,7 +2,7 @@ import 'package:aves/model/entry.dart';
|
|||
import 'package:aves/theme/durations.dart';
|
||||
import 'package:aves/utils/debouncer.dart';
|
||||
import 'package:aves/widgets/common/thumbnail/scroller.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ViewerThumbnailPreview extends StatefulWidget {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:aves/model/actions/entry_actions.dart';
|
||||
import 'package:aves/model/settings/enums/enums.dart';
|
||||
import 'package:aves/model/settings/settings.dart';
|
||||
import 'package:aves/widgets/common/identity/buttons/overlay_button.dart';
|
||||
import 'package:aves/widgets/common/action_controls/togglers/play.dart';
|
||||
import 'package:aves/widgets/common/identity/buttons/overlay_button.dart';
|
||||
import 'package:aves/widgets/viewer/video/controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
|
|
@ -22,7 +22,7 @@ import 'package:aves/widgets/common/extensions/build_context.dart';
|
|||
import 'package:aves/widgets/common/identity/buttons/captioned_button.dart';
|
||||
import 'package:aves/widgets/common/identity/buttons/overlay_button.dart';
|
||||
import 'package:aves/widgets/viewer/action/entry_action_delegate.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/video/conductor.dart';
|
||||
import 'package:aves/widgets/viewer/video/controller.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
|
@ -87,7 +87,7 @@ class ViewerButtons extends StatelessWidget {
|
|||
}
|
||||
|
||||
return ViewerButtonRowContent(
|
||||
actionDelegate: EntryActionDelegate(mainEntry, pageEntry, collection),
|
||||
actionDelegate: actionDelegate,
|
||||
quickActions: quickActions,
|
||||
topLevelActions: getMenuActions(EntryActions.topLevel),
|
||||
exportActions: getMenuActions(EntryActions.export),
|
||||
|
|
|
@ -7,7 +7,7 @@ import 'package:aves/theme/icons.dart';
|
|||
import 'package:aves/widgets/common/basic/scaffold.dart';
|
||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||
import 'package:aves/widgets/common/identity/empty.dart';
|
||||
import 'package:aves/widgets/viewer/controller.dart';
|
||||
import 'package:aves/widgets/viewer/controls/controller.dart';
|
||||
import 'package:aves/widgets/viewer/entry_viewer_stack.dart';
|
||||
import 'package:aves/widgets/viewer/providers.dart';
|
||||
import 'package:aves_magnifier/aves_magnifier.dart';
|
||||
|
|
|
@ -13,7 +13,7 @@ import 'package:aves/widgets/common/basic/scaffold.dart';
|
|||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||
import 'package:aves/widgets/common/identity/empty.dart';
|
||||
import 'package:aves/widgets/settings/viewer/slideshow.dart';
|
||||
import 'package:aves/widgets/viewer/controller.dart';
|
||||
import 'package:aves/widgets/viewer/controls/controller.dart';
|
||||
import 'package:aves/widgets/viewer/entry_viewer_stack.dart';
|
||||
import 'package:aves/widgets/viewer/providers.dart';
|
||||
import 'package:aves_magnifier/aves_magnifier.dart';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:aves/model/entry.dart';
|
||||
import 'package:aves_magnifier/aves_magnifier.dart';
|
||||
import 'package:aves/widgets/viewer/visual/state.dart';
|
||||
import 'package:aves_magnifier/aves_magnifier.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
|
|
@ -10,9 +10,9 @@ import 'package:aves/services/media/media_session_service.dart';
|
|||
import 'package:aves/theme/icons.dart';
|
||||
import 'package:aves/widgets/common/action_mixins/feedback.dart';
|
||||
import 'package:aves/widgets/common/basic/insets.dart';
|
||||
import 'package:aves/widgets/viewer/controller.dart';
|
||||
import 'package:aves/widgets/viewer/controls/controller.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/hero.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/video/conductor.dart';
|
||||
import 'package:aves/widgets/viewer/visual/conductor.dart';
|
||||
import 'package:aves/widgets/viewer/visual/error.dart';
|
||||
|
|
|
@ -7,17 +7,17 @@ import 'package:aves/theme/durations.dart';
|
|||
import 'package:aves/widgets/aves_app.dart';
|
||||
import 'package:aves/widgets/common/basic/insets.dart';
|
||||
import 'package:aves/widgets/common/basic/scaffold.dart';
|
||||
import 'package:aves/widgets/viewer/controller.dart';
|
||||
import 'package:aves/widgets/viewer/action/video_action_delegate.dart';
|
||||
import 'package:aves/widgets/viewer/controls/controller.dart';
|
||||
import 'package:aves/widgets/viewer/controls/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/entry_horizontal_pager.dart';
|
||||
import 'package:aves/widgets/viewer/multipage/conductor.dart';
|
||||
import 'package:aves/widgets/viewer/notifications.dart';
|
||||
import 'package:aves/widgets/viewer/overlay/bottom.dart';
|
||||
import 'package:aves/widgets/viewer/overlay/video/video.dart';
|
||||
import 'package:aves/widgets/viewer/page_entry_builder.dart';
|
||||
import 'package:aves/widgets/viewer/providers.dart';
|
||||
import 'package:aves/widgets/viewer/video/conductor.dart';
|
||||
import 'package:aves/widgets/viewer/video/controller.dart';
|
||||
import 'package:aves/widgets/viewer/video_action_delegate.dart';
|
||||
import 'package:aves/widgets/viewer/visual/controller_mixin.dart';
|
||||
import 'package:aves_magnifier/aves_magnifier.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
Loading…
Reference in a new issue