Merge branch 'develop'

This commit is contained in:
Thibault Deckers 2021-12-22 11:28:46 +09:00
commit 1643708aae
8 changed files with 42 additions and 22 deletions

View file

@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
## <a id="unreleased"></a>[Unreleased] ## <a id="unreleased"></a>[Unreleased]
## <a id="v1.5.8"></a>[v1.5.8] - 2021-12-22 ## <a id="v1.5.9"></a>[v1.5.9] - 2021-12-22
### Added ### Added
@ -21,6 +21,9 @@ All notable changes to this project will be documented in this file.
- Collection: more consistent scroll bar thumb position to match the viewport - Collection: more consistent scroll bar thumb position to match the viewport
- Settings: fixed file selection to import settings on older devices - Settings: fixed file selection to import settings on older devices
- Viewer: UI mode switch for Android <10
## <a id="v1.5.8"></a>[v1.5.8] - 2021-12-22 [YANKED]
## <a id="v1.5.7"></a>[v1.5.7] - 2021-12-01 ## <a id="v1.5.7"></a>[v1.5.7] - 2021-12-01

View file

@ -36,6 +36,7 @@ class DeviceHandler(private val context: Context) : MethodCallHandler {
"canRenderGoogleMaps" to (sdkInt >= Build.VERSION_CODES.KITKAT_WATCH), "canRenderGoogleMaps" to (sdkInt >= Build.VERSION_CODES.KITKAT_WATCH),
"hasFilePicker" to (sdkInt >= Build.VERSION_CODES.KITKAT), "hasFilePicker" to (sdkInt >= Build.VERSION_CODES.KITKAT),
"showPinShortcutFeedback" to (sdkInt >= Build.VERSION_CODES.O), "showPinShortcutFeedback" to (sdkInt >= Build.VERSION_CODES.O),
"supportEdgeToEdgeUIMode" to (sdkInt >= Build.VERSION_CODES.Q),
) )
) )
} }

View file

@ -6,7 +6,7 @@ final Device device = Device._private();
class Device { class Device {
late final String _userAgent; late final String _userAgent;
late final bool _canGrantDirectoryAccess, _canPinShortcut, _canPrint, _canRenderFlagEmojis, _canRenderGoogleMaps; late final bool _canGrantDirectoryAccess, _canPinShortcut, _canPrint, _canRenderFlagEmojis, _canRenderGoogleMaps;
late final bool _hasFilePicker, _showPinShortcutFeedback; late final bool _hasFilePicker, _showPinShortcutFeedback, _supportEdgeToEdgeUIMode;
String get userAgent => _userAgent; String get userAgent => _userAgent;
@ -20,11 +20,12 @@ class Device {
bool get canRenderGoogleMaps => _canRenderGoogleMaps; bool get canRenderGoogleMaps => _canRenderGoogleMaps;
// TODO TLAD toggle settings > import/export, about > bug report > save
bool get hasFilePicker => _hasFilePicker; bool get hasFilePicker => _hasFilePicker;
bool get showPinShortcutFeedback => _showPinShortcutFeedback; bool get showPinShortcutFeedback => _showPinShortcutFeedback;
bool get supportEdgeToEdgeUIMode => _supportEdgeToEdgeUIMode;
Device._private(); Device._private();
Future<void> init() async { Future<void> init() async {
@ -39,5 +40,6 @@ class Device {
_canRenderGoogleMaps = capabilities['canRenderGoogleMaps'] ?? false; _canRenderGoogleMaps = capabilities['canRenderGoogleMaps'] ?? false;
_hasFilePicker = capabilities['hasFilePicker'] ?? false; _hasFilePicker = capabilities['hasFilePicker'] ?? false;
_showPinShortcutFeedback = capabilities['showPinShortcutFeedback'] ?? false; _showPinShortcutFeedback = capabilities['showPinShortcutFeedback'] ?? false;
_supportEdgeToEdgeUIMode = capabilities['supportEdgeToEdgeUIMode'] ?? false;
} }
} }

View file

@ -33,20 +33,20 @@ Future<String?> pickAlbum({
final filter = await Navigator.push( final filter = await Navigator.push(
context, context,
MaterialPageRoute<AlbumFilter>( MaterialPageRoute<AlbumFilter>(
settings: const RouteSettings(name: AlbumPickPage.routeName), settings: const RouteSettings(name: _AlbumPickPage.routeName),
builder: (context) => AlbumPickPage(source: source, moveType: moveType), builder: (context) => _AlbumPickPage(source: source, moveType: moveType),
), ),
); );
return filter?.album; return filter?.album;
} }
class AlbumPickPage extends StatefulWidget { class _AlbumPickPage extends StatefulWidget {
static const routeName = '/album_pick'; static const routeName = '/album_pick';
final CollectionSource source; final CollectionSource source;
final MoveType? moveType; final MoveType? moveType;
const AlbumPickPage({ const _AlbumPickPage({
Key? key, Key? key,
required this.source, required this.source,
required this.moveType, required this.moveType,
@ -56,7 +56,7 @@ class AlbumPickPage extends StatefulWidget {
_AlbumPickPageState createState() => _AlbumPickPageState(); _AlbumPickPageState createState() => _AlbumPickPageState();
} }
class _AlbumPickPageState extends State<AlbumPickPage> { class _AlbumPickPageState extends State<_AlbumPickPage> {
final _queryNotifier = ValueNotifier(''); final _queryNotifier = ValueNotifier('');
CollectionSource get source => widget.source; CollectionSource get source => widget.source;
@ -75,13 +75,13 @@ class _AlbumPickPageState extends State<AlbumPickPage> {
return SelectionProvider<FilterGridItem<AlbumFilter>>( return SelectionProvider<FilterGridItem<AlbumFilter>>(
child: FilterGridPage<AlbumFilter>( child: FilterGridPage<AlbumFilter>(
settingsRouteKey: AlbumListPage.routeName, settingsRouteKey: AlbumListPage.routeName,
appBar: AlbumPickAppBar( appBar: _AlbumPickAppBar(
source: source, source: source,
moveType: widget.moveType, moveType: widget.moveType,
actionDelegate: AlbumChipSetActionDelegate(gridItems), actionDelegate: AlbumChipSetActionDelegate(gridItems),
queryNotifier: _queryNotifier, queryNotifier: _queryNotifier,
), ),
appBarHeight: AlbumPickAppBar.preferredHeight, appBarHeight: _AlbumPickAppBar.preferredHeight,
sections: AlbumListPage.groupToSections(context, source, gridItems), sections: AlbumListPage.groupToSections(context, source, gridItems),
newFilters: source.getNewAlbumFilters(context), newFilters: source.getNewAlbumFilters(context),
sortFactor: settings.albumSortFactor, sortFactor: settings.albumSortFactor,
@ -108,15 +108,15 @@ class _AlbumPickPageState extends State<AlbumPickPage> {
} }
} }
class AlbumPickAppBar extends StatelessWidget { class _AlbumPickAppBar extends StatelessWidget {
final CollectionSource source; final CollectionSource source;
final MoveType? moveType; final MoveType? moveType;
final AlbumChipSetActionDelegate actionDelegate; final AlbumChipSetActionDelegate actionDelegate;
final ValueNotifier<String> queryNotifier; final ValueNotifier<String> queryNotifier;
static const preferredHeight = kToolbarHeight + AlbumQueryBar.preferredHeight; static const preferredHeight = kToolbarHeight + _AlbumQueryBar.preferredHeight;
const AlbumPickAppBar({ const _AlbumPickAppBar({
Key? key, Key? key,
required this.source, required this.source,
required this.moveType, required this.moveType,
@ -145,7 +145,7 @@ class AlbumPickAppBar extends StatelessWidget {
title: Text(title()), title: Text(title()),
source: source, source: source,
), ),
bottom: AlbumQueryBar( bottom: _AlbumQueryBar(
queryNotifier: queryNotifier, queryNotifier: queryNotifier,
), ),
actions: [ actions: [
@ -160,7 +160,7 @@ class AlbumPickAppBar extends StatelessWidget {
// wait for the dialog to hide as applying the change may block the UI // wait for the dialog to hide as applying the change may block the UI
await Future.delayed(Durations.dialogTransitionAnimation * timeDilation); await Future.delayed(Durations.dialogTransitionAnimation * timeDilation);
if (newAlbum != null && newAlbum.isNotEmpty) { if (newAlbum != null && newAlbum.isNotEmpty) {
Navigator.pop<String>(context, newAlbum); Navigator.pop<AlbumFilter>(context, AlbumFilter(newAlbum, source.getAlbumDisplayName(context, newAlbum)));
} }
}, },
tooltip: context.l10n.createAlbumTooltip, tooltip: context.l10n.createAlbumTooltip,
@ -192,12 +192,12 @@ class AlbumPickAppBar extends StatelessWidget {
} }
} }
class AlbumQueryBar extends StatelessWidget implements PreferredSizeWidget { class _AlbumQueryBar extends StatelessWidget implements PreferredSizeWidget {
final ValueNotifier<String> queryNotifier; final ValueNotifier<String> queryNotifier;
static const preferredHeight = kToolbarHeight; static const preferredHeight = kToolbarHeight;
const AlbumQueryBar({ const _AlbumQueryBar({
Key? key, Key? key,
required this.queryNotifier, required this.queryNotifier,
}) : super(key: key); }) : super(key: key);
@ -208,7 +208,7 @@ class AlbumQueryBar extends StatelessWidget implements PreferredSizeWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
height: AlbumQueryBar.preferredHeight, height: _AlbumQueryBar.preferredHeight,
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
child: QueryBar( child: QueryBar(
queryNotifier: queryNotifier, queryNotifier: queryNotifier,

View file

@ -1,5 +1,6 @@
import 'dart:math'; import 'dart:math';
import 'package:aves/model/device.dart';
import 'package:aves/model/entry.dart'; import 'package:aves/model/entry.dart';
import 'package:aves/model/filters/filters.dart'; import 'package:aves/model/filters/filters.dart';
import 'package:aves/model/highlight.dart'; import 'package:aves/model/highlight.dart';
@ -538,7 +539,13 @@ class _EntryViewerStackState extends State<EntryViewerStack> with FeedbackMixin,
// system UI // system UI
static void _showSystemUI() => SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); static void _showSystemUI() {
if (device.supportEdgeToEdgeUIMode) {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
} else {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: SystemUiOverlay.values);
}
}
static void _hideSystemUI() => SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive); static void _hideSystemUI() => SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);

View file

@ -1,5 +1,6 @@
import 'dart:math'; import 'dart:math';
import 'package:aves/model/device.dart';
import 'package:aves/model/entry.dart'; import 'package:aves/model/entry.dart';
import 'package:aves/model/entry_images.dart'; import 'package:aves/model/entry_images.dart';
import 'package:aves/model/panorama.dart'; import 'package:aves/model/panorama.dart';
@ -148,7 +149,13 @@ class _PanoramaPageState extends State<PanoramaPage> {
// system UI // system UI
static void _showSystemUI() => SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); static void _showSystemUI() {
if (device.supportEdgeToEdgeUIMode) {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
} else {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: SystemUiOverlay.values);
}
}
static void _hideSystemUI() => SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive); static void _hideSystemUI() => SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);

View file

@ -1,7 +1,7 @@
name: aves name: aves
description: A visual media gallery and metadata explorer app. description: A visual media gallery and metadata explorer app.
repository: https://github.com/deckerst/aves repository: https://github.com/deckerst/aves
version: 1.5.8+62 version: 1.5.9+63
publish_to: none publish_to: none
environment: environment:

View file

@ -1,5 +1,5 @@
Thanks for using Aves! Thanks for using Aves!
In v1.5.8: In v1.5.9:
- list view for items and albums - list view for items and albums
- moving, editing or deleting items can be cancelled - moving, editing or deleting items can be cancelled
- enjoy the app in German - enjoy the app in German