From 96422e3340dcd88524c64dfd38d12b04d7dafb4d Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Sat, 26 Sep 2020 11:41:53 +0900 Subject: [PATCH 01/19] info: custom marker on map --- lib/widgets/common/aves_filter_chip.dart | 2 +- .../fullscreen/info/location_section.dart | 17 +- .../fullscreen/info/maps/google_map.dart | 87 ++++++--- .../fullscreen/info/maps/leaflet_map.dart | 18 +- lib/widgets/fullscreen/info/maps/marker.dart | 182 ++++++++++++++++++ 5 files changed, 263 insertions(+), 43 deletions(-) create mode 100644 lib/widgets/fullscreen/info/maps/marker.dart diff --git a/lib/widgets/common/aves_filter_chip.dart b/lib/widgets/common/aves_filter_chip.dart index b6bb5ef03..8fa097991 100644 --- a/lib/widgets/common/aves_filter_chip.dart +++ b/lib/widgets/common/aves_filter_chip.dart @@ -146,7 +146,7 @@ class _AvesFilterChipState extends State { child: Stack( fit: StackFit.passthrough, children: [ - if (widget.background != null) + if (hasBackground) ClipRRect( borderRadius: borderRadius, child: widget.background, diff --git a/lib/widgets/fullscreen/info/location_section.dart b/lib/widgets/fullscreen/info/location_section.dart index 0d25b2cff..3bfb30cf0 100644 --- a/lib/widgets/fullscreen/info/location_section.dart +++ b/lib/widgets/fullscreen/info/location_section.dart @@ -9,6 +9,7 @@ import 'package:aves/widgets/fullscreen/info/info_page.dart'; import 'package:aves/widgets/fullscreen/info/maps/common.dart'; import 'package:aves/widgets/fullscreen/info/maps/google_map.dart'; import 'package:aves/widgets/fullscreen/info/maps/leaflet_map.dart'; +import 'package:aves/widgets/fullscreen/info/maps/marker.dart'; import 'package:flutter/material.dart'; class LocationSection extends StatefulWidget { @@ -34,6 +35,9 @@ class LocationSection extends StatefulWidget { class _LocationSectionState extends State { String _loadedUri; + static const extent = 48.0; + static const pointerSize = Size(8.0, 6.0); + CollectionLens get collection => widget.collection; ImageEntry get entry => widget.entry; @@ -85,6 +89,14 @@ class _LocationSectionState extends State { if (place != null && place.isNotEmpty) filters.add(LocationFilter(LocationLevel.place, place)); } + Widget buildMarker(BuildContext context) { + return ImageMarker( + entry: entry, + extent: extent, + pointerSize: pointerSize, + ); + } + return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -96,16 +108,19 @@ class _LocationSectionState extends State { }, child: settings.infoMapStyle.isGoogleMaps ? EntryGoogleMap( - markerId: entry.uri ?? entry.path, latLng: entry.latLng, geoUri: entry.geoUri, initialZoom: settings.infoMapZoom, + markerId: entry.uri ?? entry.path, + markerBuilder: buildMarker, ) : EntryLeafletMap( latLng: entry.latLng, geoUri: entry.geoUri, initialZoom: settings.infoMapZoom, style: settings.infoMapStyle, + markerSize: Size(extent, extent + pointerSize.height), + markerBuilder: buildMarker, ), ), if (entry.hasGps) diff --git a/lib/widgets/fullscreen/info/maps/google_map.dart b/lib/widgets/fullscreen/info/maps/google_map.dart index 1480e1085..2d70b77f1 100644 --- a/lib/widgets/fullscreen/info/maps/google_map.dart +++ b/lib/widgets/fullscreen/info/maps/google_map.dart @@ -1,22 +1,28 @@ +import 'dart:async'; +import 'dart:typed_data'; + import 'package:aves/model/settings/settings.dart'; import 'package:aves/widgets/fullscreen/info/location_section.dart'; import 'package:aves/widgets/fullscreen/info/maps/common.dart'; +import 'package:aves/widgets/fullscreen/info/maps/marker.dart'; import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:tuple/tuple.dart'; class EntryGoogleMap extends StatefulWidget { - final String markerId; final LatLng latLng; final String geoUri; final double initialZoom; + final String markerId; + final WidgetBuilder markerBuilder; EntryGoogleMap({ Key key, - this.markerId, Tuple2 latLng, this.geoUri, this.initialZoom, + this.markerId, + this.markerBuilder, }) : latLng = LatLng(latLng.item1, latLng.item2), super(key: key); @@ -26,6 +32,13 @@ class EntryGoogleMap extends StatefulWidget { class EntryGoogleMapState extends State with AutomaticKeepAliveClientMixin { GoogleMapController _controller; + Completer _markerLoaderCompleter; + + @override + void initState() { + super.initState(); + _markerLoaderCompleter = Completer(); + } @override void didUpdateWidget(EntryGoogleMap oldWidget) { @@ -33,6 +46,9 @@ class EntryGoogleMapState extends State with AutomaticKeepAliveC if (widget.latLng != oldWidget.latLng && _controller != null) { _controller.moveCamera(CameraUpdate.newLatLng(widget.latLng)); } + if (widget.markerId != oldWidget.markerId) { + _markerLoaderCompleter = Completer(); + } } @override @@ -46,6 +62,11 @@ class EntryGoogleMapState extends State with AutomaticKeepAliveC super.build(context); return Stack( children: [ + MarkerGeneratorWidget( + key: Key(widget.markerId), + markers: [widget.markerBuilder(context)], + onComplete: (bitmaps) => _markerLoaderCompleter.complete(bitmaps.first), + ), MapDecorator( child: _buildMap(), ), @@ -58,34 +79,40 @@ class EntryGoogleMapState extends State with AutomaticKeepAliveC } Widget _buildMap() { - final accentHue = HSVColor.fromColor(Theme.of(context).accentColor).hue; - return GoogleMap( - // GoogleMap init perf issue: https://github.com/flutter/flutter/issues/28493 - initialCameraPosition: CameraPosition( - target: widget.latLng, - zoom: widget.initialZoom, - ), - onMapCreated: (controller) => setState(() => _controller = controller), - compassEnabled: false, - mapToolbarEnabled: false, - mapType: _toMapStyle(settings.infoMapStyle), - rotateGesturesEnabled: false, - scrollGesturesEnabled: false, - zoomControlsEnabled: false, - zoomGesturesEnabled: false, - liteModeEnabled: false, - // no camera animation in lite mode - tiltGesturesEnabled: false, - myLocationEnabled: false, - myLocationButtonEnabled: false, - markers: { - Marker( - markerId: MarkerId(widget.markerId), - icon: BitmapDescriptor.defaultMarkerWithHue(accentHue), - position: widget.latLng, - ) - }, - ); + return FutureBuilder( + future: _markerLoaderCompleter.future, + builder: (context, snapshot) { + final markers = {}; + if (!snapshot.hasError && snapshot.connectionState == ConnectionState.done) { + final markerBytes = snapshot.data; + markers.add(Marker( + markerId: MarkerId(widget.markerId), + icon: BitmapDescriptor.fromBytes(markerBytes), + position: widget.latLng, + )); + } + return GoogleMap( + // GoogleMap init perf issue: https://github.com/flutter/flutter/issues/28493 + initialCameraPosition: CameraPosition( + target: widget.latLng, + zoom: widget.initialZoom, + ), + onMapCreated: (controller) => setState(() => _controller = controller), + compassEnabled: false, + mapToolbarEnabled: false, + mapType: _toMapStyle(settings.infoMapStyle), + rotateGesturesEnabled: false, + scrollGesturesEnabled: false, + zoomControlsEnabled: false, + zoomGesturesEnabled: false, + liteModeEnabled: false, + // no camera animation in lite mode + tiltGesturesEnabled: false, + myLocationEnabled: false, + myLocationButtonEnabled: false, + markers: markers, + ); + }); } void _zoomBy(double amount) { diff --git a/lib/widgets/fullscreen/info/maps/leaflet_map.dart b/lib/widgets/fullscreen/info/maps/leaflet_map.dart index 570a71511..4b35b8d22 100644 --- a/lib/widgets/fullscreen/info/maps/leaflet_map.dart +++ b/lib/widgets/fullscreen/info/maps/leaflet_map.dart @@ -15,6 +15,8 @@ class EntryLeafletMap extends StatefulWidget { final String geoUri; final double initialZoom; final EntryMapStyle style; + final Size markerSize; + final WidgetBuilder markerBuilder; EntryLeafletMap({ Key key, @@ -22,6 +24,8 @@ class EntryLeafletMap extends StatefulWidget { this.geoUri, this.initialZoom, this.style, + this.markerBuilder, + this.markerSize, }) : latLng = LatLng(latLng.item1, latLng.item2), super(key: key); @@ -32,8 +36,6 @@ class EntryLeafletMap extends StatefulWidget { class EntryLeafletMapState extends State with AutomaticKeepAliveClientMixin, TickerProviderStateMixin { final MapController _mapController = MapController(); - static const markerSize = 40.0; - @override void didUpdateWidget(EntryLeafletMap oldWidget) { super.didUpdateWidget(oldWidget); @@ -80,16 +82,10 @@ class EntryLeafletMapState extends State with AutomaticKeepAliv options: MarkerLayerOptions( markers: [ Marker( - width: markerSize, - height: markerSize, + width: widget.markerSize.width, + height: widget.markerSize.height, point: widget.latLng, - builder: (ctx) { - return Icon( - Icons.place, - size: markerSize, - color: Theme.of(context).accentColor, - ); - }, + builder: widget.markerBuilder, anchorPos: AnchorPos.align(AnchorAlign.top), ), ], diff --git a/lib/widgets/fullscreen/info/maps/marker.dart b/lib/widgets/fullscreen/info/maps/marker.dart new file mode 100644 index 000000000..a640ae731 --- /dev/null +++ b/lib/widgets/fullscreen/info/maps/marker.dart @@ -0,0 +1,182 @@ +import 'dart:typed_data'; +import 'dart:ui' as ui; + +import 'package:aves/model/image_entry.dart'; +import 'package:aves/widgets/collection/thumbnail/raster.dart'; +import 'package:aves/widgets/collection/thumbnail/vector.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; + +class ImageMarker extends StatelessWidget { + final ImageEntry entry; + final double extent; + final Size pointerSize; + + static const double outerBorderRadiusDim = 8; + static const double outerBorderWidth = 1.5; + static const double innerBorderWidth = 2; + static const outerBorderColor = Colors.white30; + static final innerBorderColor = Colors.grey[900]; + + const ImageMarker({ + @required this.entry, + @required this.extent, + this.pointerSize = Size.zero, + }); + + @override + Widget build(BuildContext context) { + final thumbnail = entry.isSvg + ? ThumbnailVectorImage( + entry: entry, + extent: extent, + ) + : ThumbnailRasterImage( + entry: entry, + extent: extent, + ); + + final outerBorderRadius = BorderRadius.circular(outerBorderRadiusDim); + final innerBorderRadius = BorderRadius.circular(outerBorderRadiusDim - outerBorderWidth); + + return CustomPaint( + foregroundPainter: MarkerPointerPainter( + color: innerBorderColor, + outlineColor: outerBorderColor, + outlineWidth: outerBorderWidth, + size: pointerSize, + ), + child: Padding( + padding: EdgeInsets.only(bottom: pointerSize.height), + child: Container( + decoration: BoxDecoration( + border: Border.all( + color: outerBorderColor, + width: outerBorderWidth, + ), + borderRadius: outerBorderRadius, + ), + child: DecoratedBox( + decoration: BoxDecoration( + border: Border.all( + color: innerBorderColor, + width: innerBorderWidth, + ), + borderRadius: innerBorderRadius, + ), + position: DecorationPosition.foreground, + child: ClipRRect( + borderRadius: innerBorderRadius, + child: thumbnail, + ), + ), + ), + ), + ); + } +} + +class MarkerPointerPainter extends CustomPainter { + final Color color, outlineColor; + final double outlineWidth; + final Size size; + + const MarkerPointerPainter({ + this.color, + this.outlineColor, + this.outlineWidth, + this.size, + }); + + @override + void paint(Canvas canvas, Size size) { + final pointerWidth = this.size.width; + final pointerHeight = this.size.height; + + final bottomCenter = Offset(size.width / 2, size.height); + final topLeft = bottomCenter + Offset(-pointerWidth / 2, -pointerHeight); + final topRight = bottomCenter + Offset(pointerWidth / 2, -pointerHeight); + + canvas.drawPath( + Path() + ..moveTo(bottomCenter.dx, bottomCenter.dy) + ..lineTo(topRight.dx, topRight.dy) + ..lineTo(topLeft.dx, topLeft.dy) + ..close(), + Paint()..color = outlineColor); + + canvas.translate(0, -outlineWidth.ceilToDouble()); + canvas.drawPath( + Path() + ..moveTo(bottomCenter.dx, bottomCenter.dy) + ..lineTo(topRight.dx, topRight.dy) + ..lineTo(topLeft.dx, topLeft.dy) + ..close(), + Paint()..color = color); + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) => false; +} + +// generate bitmap from widget, for Google Maps +class MarkerGeneratorWidget extends StatefulWidget { + final List markers; + final Duration delay; + final Function(List bitmaps) onComplete; + + const MarkerGeneratorWidget({ + Key key, + @required this.markers, + this.delay = Duration.zero, + @required this.onComplete, + }) : super(key: key); + + @override + _MarkerGeneratorWidgetState createState() => _MarkerGeneratorWidgetState(); +} + +class _MarkerGeneratorWidgetState extends State { + final _globalKeys = []; + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addPostFrameCallback((_) async { + if (widget.delay > Duration.zero) { + await Future.delayed(widget.delay); + } + widget.onComplete(await _getBitmaps(context)); + }); + } + + @override + Widget build(BuildContext context) { + return Transform.translate( + offset: Offset(MediaQuery.of(context).size.width, 0), + child: Material( + type: MaterialType.transparency, + child: Stack( + children: widget.markers.map((i) { + final key = GlobalKey(); + _globalKeys.add(key); + return RepaintBoundary( + key: key, + child: i, + ); + }).toList(), + ), + ), + ); + } + + Future> _getBitmaps(BuildContext context) async { + final pixelRatio = MediaQuery.of(context).devicePixelRatio; + return Future.wait(_globalKeys.map((key) async { + RenderRepaintBoundary boundary = key.currentContext.findRenderObject(); + final image = await boundary.toImage(pixelRatio: pixelRatio); + final byteData = await image.toByteData(format: ui.ImageByteFormat.png); + return byteData.buffer.asUint8List(); + })); + } +} From 3355779f16f40620f8e6b16b7cab9c093badae96 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Sun, 27 Sep 2020 22:01:38 +0900 Subject: [PATCH 02/19] album renaming performance review (WIP) --- .../aves/channel/calls/ImageFileHandler.java | 4 ++++ .../thibault/aves/model/provider/ImageProvider.java | 13 +++++-------- lib/widgets/collection/thumbnail_collection.dart | 1 - 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/android/app/src/main/java/deckers/thibault/aves/channel/calls/ImageFileHandler.java b/android/app/src/main/java/deckers/thibault/aves/channel/calls/ImageFileHandler.java index b1702a11a..fdea9c636 100644 --- a/android/app/src/main/java/deckers/thibault/aves/channel/calls/ImageFileHandler.java +++ b/android/app/src/main/java/deckers/thibault/aves/channel/calls/ImageFileHandler.java @@ -9,6 +9,7 @@ import androidx.annotation.NonNull; import com.bumptech.glide.Glide; +import java.io.File; import java.util.List; import java.util.Map; @@ -190,6 +191,9 @@ public class ImageFileHandler implements MethodChannel.MethodCallHandler { result.error("renameDirectory-args", "failed because of missing arguments", null); return; } + if (!dirPath.endsWith(File.separator)) { + dirPath += File.separator; + } ImageProvider provider = new MediaStoreImageProvider(); provider.renameDirectory(activity, dirPath, newName, new ImageProvider.AlbumRenameOpCallback() { diff --git a/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java b/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java index 14a0a620c..4f23bc575 100644 --- a/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java +++ b/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java @@ -90,11 +90,7 @@ public abstract class ImageProvider { } @SuppressWarnings("UnstableApiUsage") - public void renameDirectory(Context context, String oldDirPath, String newDirName, final AlbumRenameOpCallback callback) { - if (!oldDirPath.endsWith(File.separator)) { - oldDirPath += File.separator; - } - + public void renameDirectory(Context context, final String oldDirPath, String newDirName, final AlbumRenameOpCallback callback) { DocumentFileCompat destinationDirDocFile = StorageUtils.createDirectoryIfAbsent(context, oldDirPath); if (destinationDirDocFile == null) { callback.onFailure(new Exception("failed to find directory at path=" + oldDirPath)); @@ -118,15 +114,16 @@ public abstract class ImageProvider { return; } + String[] oldEntryPaths = entries.stream().map(entry -> oldDirPath + entry.get("displayName")).toArray(String[]::new); + String[] mimeTypes = entries.stream().map(entry -> (String) entry.get("mimeType")).toArray(String[]::new); + MediaScannerConnection.scanFile(context, oldEntryPaths, mimeTypes, null); + List>> scanFutures = new ArrayList<>(); String newDirPath = new File(oldDirPath).getParent() + File.separator + newDirName + File.separator; for (Map entry : entries) { String displayName = (String) entry.get("displayName"); String mimeType = (String) entry.get("mimeType"); - String oldEntryPath = oldDirPath + displayName; - MediaScannerConnection.scanFile(context, new String[]{oldEntryPath}, new String[]{mimeType}, null); - SettableFuture> scanFuture = SettableFuture.create(); scanFutures.add(scanFuture); String newEntryPath = newDirPath + displayName; diff --git a/lib/widgets/collection/thumbnail_collection.dart b/lib/widgets/collection/thumbnail_collection.dart index 8d5328121..d880f4835 100644 --- a/lib/widgets/collection/thumbnail_collection.dart +++ b/lib/widgets/collection/thumbnail_collection.dart @@ -219,7 +219,6 @@ class _CollectionScrollViewState extends State { text: 'No favourites', ); } - debugPrint('collection.filters=${collection.filters}'); if (collection.filters.any((filter) => filter is MimeFilter && filter.mime == MimeTypes.anyVideo)) { return EmptyContent( icon: AIcons.video, From ac67f4e08026b7e3bba9a23517e796014eba7c4e Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 28 Sep 2020 00:05:19 +0900 Subject: [PATCH 03/19] album renaming performance review (WIP) --- .../aves/model/provider/ImageProvider.java | 133 +++++++++++++----- .../common/chip_action_delegate.dart | 12 +- 2 files changed, 102 insertions(+), 43 deletions(-) diff --git a/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java b/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java index 4f23bc575..3141e564b 100644 --- a/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java +++ b/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java @@ -24,10 +24,15 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.concurrent.ExecutionException; +import java.util.stream.Collectors; +import java.util.stream.Stream; import deckers.thibault.aves.model.AvesImageEntry; import deckers.thibault.aves.utils.MetadataHelper; @@ -97,10 +102,14 @@ public abstract class ImageProvider { return; } - List> entries = new ArrayList<>(); - entries.addAll(listContentEntries(context, MediaStore.Images.Media.EXTERNAL_CONTENT_URI, oldDirPath)); - entries.addAll(listContentEntries(context, MediaStore.Video.Media.EXTERNAL_CONTENT_URI, oldDirPath)); + // list entries with their content IDs before renaming + Uri[] baseContentUris = new Uri[]{MediaStore.Images.Media.EXTERNAL_CONTENT_URI, MediaStore.Video.Media.EXTERNAL_CONTENT_URI}; + Map>> entriesByBaseContentUri = Arrays.stream(baseContentUris).collect(Collectors.toMap( + uri -> uri, + uri -> listContentEntries(context, uri, oldDirPath) + )); + // rename directory boolean renamed; try { renamed = destinationDirDocFile.renameTo(newDirName); @@ -108,44 +117,44 @@ public abstract class ImageProvider { callback.onFailure(new Exception("failed to rename to name=" + newDirName + " directory at path=" + oldDirPath, e)); return; } - if (!renamed) { callback.onFailure(new Exception("failed to rename to name=" + newDirName + " directory at path=" + oldDirPath)); return; } - - String[] oldEntryPaths = entries.stream().map(entry -> oldDirPath + entry.get("displayName")).toArray(String[]::new); - String[] mimeTypes = entries.stream().map(entry -> (String) entry.get("mimeType")).toArray(String[]::new); - MediaScannerConnection.scanFile(context, oldEntryPaths, mimeTypes, null); - - List>> scanFutures = new ArrayList<>(); String newDirPath = new File(oldDirPath).getParent() + File.separator + newDirName + File.separator; - for (Map entry : entries) { - String displayName = (String) entry.get("displayName"); - String mimeType = (String) entry.get("mimeType"); - SettableFuture> scanFuture = SettableFuture.create(); - scanFutures.add(scanFuture); - String newEntryPath = newDirPath + displayName; - scanNewPath(context, newEntryPath, mimeType, new ImageProvider.ImageOpCallback() { - @Override - public void onSuccess(Map newFields) { - entry.putAll(newFields); - entry.put("success", true); - scanFuture.set(entry); + // scan old paths for cleanup, and new paths to fetch content IDs + Collection>> scanFutures = new ArrayList<>(); + entriesByBaseContentUri.forEach((baseContentUri, entries) -> { + int count = entries.size(); + if (count > 0) { + String[] oldPaths = new String[count]; + String[] newPaths = new String[count]; + String[] mimeTypes = new String[count]; + for (int i = 0; i < count; i++) { + Map entry = entries.get(i); + String displayName = (String) entry.get("displayName"); + oldPaths[i] = oldDirPath + displayName; + newPaths[i] = newDirPath + displayName; + mimeTypes[i] = (String) entry.get("mimeType"); } - - @Override - public void onFailure(Throwable throwable) { - Log.w(LOG_TAG, "failed to scan entry=" + displayName + " in new directory=" + newDirPath, throwable); - entry.put("success", false); - scanFuture.set(entry); - } - }); - } + MediaScannerConnection.scanFile(context, oldPaths, mimeTypes, null); + scanFutures.addAll(scanNewPaths(context, newPaths, mimeTypes, baseContentUri)); + } + }); try { - callback.onSuccess(Futures.allAsList(scanFutures).get()); + List> scanResults = Futures.allAsList(scanFutures).get(); + Stream> allEntries = entriesByBaseContentUri.values().stream().flatMap(Collection::stream); + Map oldContentIdByDisplayName = allEntries.collect(Collectors.toMap( + fields -> (String) fields.get("displayName"), + fields -> (Integer) Objects.requireNonNull(fields.get("oldContentId")) + )); + scanResults.forEach(newFields -> { + String displayName = (String) newFields.get("displayName"); + newFields.put("oldContentId", oldContentIdByDisplayName.get(displayName)); + }); + callback.onSuccess(scanResults); } catch (ExecutionException | InterruptedException e) { callback.onFailure(e); } @@ -332,6 +341,64 @@ public abstract class ImageProvider { // } } + protected Collection>> scanNewPaths(final Context context, final String[] paths, final String[] mimeTypes, final Uri baseContentUri) { + Map>> scanFutures = new HashMap<>(); + for (String path : paths) { + scanFutures.put(path, SettableFuture.create()); + } + + MediaScannerConnection.scanFile(context, paths, mimeTypes, (path, rawUri) -> { + SettableFuture> future = scanFutures.get(path); + if (future == null) { + Log.e(LOG_TAG, "no future for path=" + path); + return; + } + + if (rawUri == null) { + future.setException(new Exception("failed to get URI of item at path=" + path)); + return; + } + + // newURI is possibly a file media URI (e.g. "content://media/12a9-8b42/file/62872") + // but we need an image/video media URI (e.g. "content://media/external/images/media/62872") + long contentId = ContentUris.parseId(rawUri); + Uri contentUri = ContentUris.withAppendedId(baseContentUri, contentId); + + Map newFields = new HashMap<>(); + // we retrieve updated fields as the renamed/moved file became a new entry in the Media Store + String[] projection = { + MediaStore.MediaColumns.DISPLAY_NAME, + MediaStore.MediaColumns.TITLE, + MediaStore.MediaColumns.DATE_MODIFIED, + }; + try { + Cursor cursor = context.getContentResolver().query(contentUri, projection, null, null, null); + if (cursor != null) { + if (cursor.moveToNext()) { + newFields.put("uri", contentUri.toString()); + newFields.put("contentId", contentId); + newFields.put("path", path); + newFields.put("displayName", cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DISPLAY_NAME))); + newFields.put("title", cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.TITLE))); + newFields.put("dateModifiedSecs", cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATE_MODIFIED))); + } + cursor.close(); + } + } catch (Exception e) { + future.setException(e); + return; + } + + if (newFields.isEmpty()) { + future.setException(new Exception("failed to get item details from provider at contentUri=" + contentUri)); + } else { + future.set(newFields); + } + }); + + return scanFutures.values(); + } + protected void scanNewPath(final Context context, final String path, final String mimeType, final ImageOpCallback callback) { MediaScannerConnection.scanFile(context, new String[]{path}, new String[]{mimeType}, (newPath, newUri) -> { long contentId = 0; @@ -352,7 +419,7 @@ public abstract class ImageProvider { } Map newFields = new HashMap<>(); - // we retrieve updated fields as the renamed file became a new entry in the Media Store + // we retrieve updated fields as the renamed/moved file became a new entry in the Media Store String[] projection = { MediaStore.MediaColumns.DISPLAY_NAME, MediaStore.MediaColumns.TITLE, diff --git a/lib/widgets/filter_grids/common/chip_action_delegate.dart b/lib/widgets/filter_grids/common/chip_action_delegate.dart index cdbdd389e..f6908b256 100644 --- a/lib/widgets/filter_grids/common/chip_action_delegate.dart +++ b/lib/widgets/filter_grids/common/chip_action_delegate.dart @@ -9,10 +9,8 @@ import 'package:aves/widgets/common/action_delegates/feedback.dart'; import 'package:aves/widgets/common/action_delegates/permission_aware.dart'; import 'package:aves/widgets/common/action_delegates/rename_album_dialog.dart'; import 'package:aves/widgets/filter_grids/common/chip_actions.dart'; -import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; -import 'package:intl/intl.dart'; import 'package:path/path.dart' as path; import 'package:pedantic/pedantic.dart'; @@ -64,11 +62,10 @@ class AlbumChipActionDelegate extends ChipActionDelegate with FeedbackMixin, Per if (!await checkStoragePermissionForAlbums(context, {album})) return; final result = await ImageFileService.renameDirectory(album, newName); - final bySuccess = groupBy(result, (fields) => fields['success']); final albumEntries = source.rawEntries.where(filter.filter); final movedEntries = []; - await Future.forEach(bySuccess[true], (newFields) async { + await Future.forEach(result, (newFields) async { final oldContentId = newFields['oldContentId']; final entry = albumEntries.firstWhere((entry) => entry.contentId == oldContentId, orElse: () => null); if (entry != null) { @@ -88,11 +85,6 @@ class AlbumChipActionDelegate extends ChipActionDelegate with FeedbackMixin, Per ..remove(filter) ..add(newFilter); - final failed = bySuccess[false]?.length ?? 0; - if (failed > 0) { - showFeedback(context, 'Failed to move ${Intl.plural(failed, one: '$failed item', other: '$failed items')}'); - } else { - showFeedback(context, 'Done!'); - } + showFeedback(context, 'Done!'); } } From e137ee6e57178a298ecee8183586d48186919a8e Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 28 Sep 2020 10:12:12 +0900 Subject: [PATCH 04/19] album renaming performance review --- .../aves/model/provider/ImageProvider.java | 110 ++++++------------ lib/model/source/collection_source.dart | 7 +- 2 files changed, 40 insertions(+), 77 deletions(-) diff --git a/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java b/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java index 3141e564b..47b6422c0 100644 --- a/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java +++ b/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java @@ -29,10 +29,8 @@ import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; -import java.util.stream.Stream; import deckers.thibault.aves.model.AvesImageEntry; import deckers.thibault.aves.utils.MetadataHelper; @@ -128,33 +126,53 @@ public abstract class ImageProvider { entriesByBaseContentUri.forEach((baseContentUri, entries) -> { int count = entries.size(); if (count > 0) { + String[] mimeTypes = new String[count]; String[] oldPaths = new String[count]; String[] newPaths = new String[count]; - String[] mimeTypes = new String[count]; + Map oldContentIdByPath = new HashMap<>(); + Map>> scanFutureByPath = new HashMap<>(); for (int i = 0; i < count; i++) { Map entry = entries.get(i); String displayName = (String) entry.get("displayName"); - oldPaths[i] = oldDirPath + displayName; - newPaths[i] = newDirPath + displayName; + String newPath = newDirPath + displayName; mimeTypes[i] = (String) entry.get("mimeType"); + oldPaths[i] = oldDirPath + displayName; + newPaths[i] = newPath; + oldContentIdByPath.put(newPath, (Integer) entry.get("oldContentId")); + scanFutureByPath.put(newPath, SettableFuture.create()); } MediaScannerConnection.scanFile(context, oldPaths, mimeTypes, null); - scanFutures.addAll(scanNewPaths(context, newPaths, mimeTypes, baseContentUri)); + MediaScannerConnection.scanFile(context, newPaths, mimeTypes, (path, rawUri) -> { + SettableFuture> future = scanFutureByPath.get(path); + if (future == null) { + Log.e(LOG_TAG, "no future for path=" + path); + return; + } + + if (rawUri == null) { + future.setException(new Exception("failed to get URI of item at path=" + path)); + return; + } + + // newURI is possibly a file media URI (e.g. "content://media/12a9-8b42/file/62872") + // but we need an image/video media URI (e.g. "content://media/external/images/media/62872") + long contentId = ContentUris.parseId(rawUri); + Uri contentUri = ContentUris.withAppendedId(baseContentUri, contentId); + Map newFields = new HashMap() {{ + put("path", path); + put("uri", contentUri.toString()); + put("contentId", contentId); + put("oldContentId", oldContentIdByPath.get(path)); + }}; + future.set(newFields); + }); + + scanFutures.addAll(scanFutureByPath.values()); } }); try { - List> scanResults = Futures.allAsList(scanFutures).get(); - Stream> allEntries = entriesByBaseContentUri.values().stream().flatMap(Collection::stream); - Map oldContentIdByDisplayName = allEntries.collect(Collectors.toMap( - fields -> (String) fields.get("displayName"), - fields -> (Integer) Objects.requireNonNull(fields.get("oldContentId")) - )); - scanResults.forEach(newFields -> { - String displayName = (String) newFields.get("displayName"); - newFields.put("oldContentId", oldContentIdByDisplayName.get(displayName)); - }); - callback.onSuccess(scanResults); + callback.onSuccess(Futures.allAsList(scanFutures).get()); } catch (ExecutionException | InterruptedException e) { callback.onFailure(e); } @@ -341,64 +359,6 @@ public abstract class ImageProvider { // } } - protected Collection>> scanNewPaths(final Context context, final String[] paths, final String[] mimeTypes, final Uri baseContentUri) { - Map>> scanFutures = new HashMap<>(); - for (String path : paths) { - scanFutures.put(path, SettableFuture.create()); - } - - MediaScannerConnection.scanFile(context, paths, mimeTypes, (path, rawUri) -> { - SettableFuture> future = scanFutures.get(path); - if (future == null) { - Log.e(LOG_TAG, "no future for path=" + path); - return; - } - - if (rawUri == null) { - future.setException(new Exception("failed to get URI of item at path=" + path)); - return; - } - - // newURI is possibly a file media URI (e.g. "content://media/12a9-8b42/file/62872") - // but we need an image/video media URI (e.g. "content://media/external/images/media/62872") - long contentId = ContentUris.parseId(rawUri); - Uri contentUri = ContentUris.withAppendedId(baseContentUri, contentId); - - Map newFields = new HashMap<>(); - // we retrieve updated fields as the renamed/moved file became a new entry in the Media Store - String[] projection = { - MediaStore.MediaColumns.DISPLAY_NAME, - MediaStore.MediaColumns.TITLE, - MediaStore.MediaColumns.DATE_MODIFIED, - }; - try { - Cursor cursor = context.getContentResolver().query(contentUri, projection, null, null, null); - if (cursor != null) { - if (cursor.moveToNext()) { - newFields.put("uri", contentUri.toString()); - newFields.put("contentId", contentId); - newFields.put("path", path); - newFields.put("displayName", cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DISPLAY_NAME))); - newFields.put("title", cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.TITLE))); - newFields.put("dateModifiedSecs", cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATE_MODIFIED))); - } - cursor.close(); - } - } catch (Exception e) { - future.setException(e); - return; - } - - if (newFields.isEmpty()) { - future.setException(new Exception("failed to get item details from provider at contentUri=" + contentUri)); - } else { - future.set(newFields); - } - }); - - return scanFutures.values(); - } - protected void scanNewPath(final Context context, final String path, final String mimeType, final ImageOpCallback callback) { MediaScannerConnection.scanFile(context, new String[]{path}, new String[]{mimeType}, (newPath, newUri) -> { long contentId = 0; diff --git a/lib/model/source/collection_source.dart b/lib/model/source/collection_source.dart index 3f2c173d7..89855ce28 100644 --- a/lib/model/source/collection_source.dart +++ b/lib/model/source/collection_source.dart @@ -88,12 +88,15 @@ class CollectionSource with SourceBase, AlbumMixin, LocationMixin, TagMixin { invalidateFilterEntryCounts(); } + // `dateModifiedSecs` changes when moving entries to another directory, + // but it does not change when renaming the containing directory Future moveEntry(ImageEntry entry, Map newFields) async { final oldContentId = entry.contentId; final newContentId = newFields['contentId'] as int; - entry.uri = newFields['uri'] as String; + final newDateModifiedSecs = newFields['dateModifiedSecs'] as int; + if (newDateModifiedSecs != null) entry.dateModifiedSecs = newDateModifiedSecs; entry.path = newFields['path'] as String; - entry.dateModifiedSecs = newFields['dateModifiedSecs'] as int; + entry.uri = newFields['uri'] as String; entry.contentId = newContentId; entry.catalogMetadata = entry.catalogMetadata?.copyWith(contentId: newContentId); entry.addressDetails = entry.addressDetails?.copyWith(contentId: newContentId); From 2809f976e44198797a3269bffef931657e22f3f0 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 28 Sep 2020 10:12:38 +0900 Subject: [PATCH 05/19] minor fix for decorated chip without entry --- .../common/decorated_filter_chip.dart | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/widgets/filter_grids/common/decorated_filter_chip.dart b/lib/widgets/filter_grids/common/decorated_filter_chip.dart index 4616f4da9..9bfb5b714 100644 --- a/lib/widgets/filter_grids/common/decorated_filter_chip.dart +++ b/lib/widgets/filter_grids/common/decorated_filter_chip.dart @@ -34,18 +34,17 @@ class DecoratedFilterChip extends StatelessWidget { @override Widget build(BuildContext context) { - Widget backgroundImage; - if (entry != null) { - backgroundImage = entry.isSvg - ? ThumbnailVectorImage( - entry: entry, - extent: FilterGridPage.maxCrossAxisExtent, - ) - : ThumbnailRasterImage( - entry: entry, - extent: FilterGridPage.maxCrossAxisExtent, - ); - } + final backgroundImage = entry == null + ? Container(color: Colors.white) + : entry.isSvg + ? ThumbnailVectorImage( + entry: entry, + extent: FilterGridPage.maxCrossAxisExtent, + ) + : ThumbnailRasterImage( + entry: entry, + extent: FilterGridPage.maxCrossAxisExtent, + ); return AvesFilterChip( filter: filter, showGenericIcon: false, From f32c3f11544a1e82695ecb2ff53d92b36f1280d4 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 28 Sep 2020 11:02:06 +0900 Subject: [PATCH 06/19] album: delete --- .../common/action_delegates/feedback.dart | 65 ++++++++++++++++ .../action_delegates/rename_entry_dialog.dart | 1 - .../selection_action_delegate.dart | 74 ++----------------- lib/widgets/debug_page.dart | 1 + lib/widgets/filter_grids/albums_page.dart | 1 + .../common/chip_action_delegate.dart | 52 +++++++++++++ .../filter_grids/common/chip_actions.dart | 5 ++ 7 files changed, 129 insertions(+), 70 deletions(-) diff --git a/lib/widgets/common/action_delegates/feedback.dart b/lib/widgets/common/action_delegates/feedback.dart index 81c36bad0..f103df3cd 100644 --- a/lib/widgets/common/action_delegates/feedback.dart +++ b/lib/widgets/common/action_delegates/feedback.dart @@ -1,7 +1,11 @@ +import 'package:aves/model/image_entry.dart'; +import 'package:aves/services/image_file_service.dart'; import 'package:aves/utils/durations.dart'; import 'package:flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; +import 'package:intl/intl.dart'; +import 'package:percent_indicator/circular_percent_indicator.dart'; mixin FeedbackMixin { Flushbar _flushbar; @@ -20,4 +24,65 @@ mixin FeedbackMixin { animationDuration: Durations.opToastAnimation, )..show(context); } + + // report overlay for multiple operations + + OverlayEntry _opReportOverlayEntry; + + void showOpReport({ + @required BuildContext context, + @required List selection, + @required Stream opStream, + @required void Function(Set processed) onDone, + }) { + final processed = {}; + + // do not handle completion inside `StreamBuilder` + // as it could be called multiple times + Future onComplete() => _hideOpReportOverlay().then((_) => onDone(processed)); + opStream.listen( + processed.add, + onError: (error) { + debugPrint('_showOpReport error=$error'); + onComplete(); + }, + onDone: onComplete, + ); + + _opReportOverlayEntry = OverlayEntry( + builder: (context) { + return AbsorbPointer( + child: StreamBuilder( + stream: opStream, + builder: (context, snapshot) { + Widget child = SizedBox.shrink(); + if (!snapshot.hasError && snapshot.connectionState == ConnectionState.active) { + final percent = processed.length.toDouble() / selection.length; + child = CircularPercentIndicator( + percent: percent, + lineWidth: 16, + radius: 160, + backgroundColor: Colors.white24, + progressColor: Theme.of(context).accentColor, + animation: true, + center: Text(NumberFormat.percentPattern().format(percent)), + animateFromLastPercent: true, + ); + } + return AnimatedSwitcher( + duration: Durations.collectionOpOverlayAnimation, + child: child, + ); + }), + ); + }, + ); + Overlay.of(context).insert(_opReportOverlayEntry); + } + + Future _hideOpReportOverlay() async { + await Future.delayed(Durations.collectionOpOverlayAnimation * timeDilation); + _opReportOverlayEntry.remove(); + _opReportOverlayEntry = null; + } } diff --git a/lib/widgets/common/action_delegates/rename_entry_dialog.dart b/lib/widgets/common/action_delegates/rename_entry_dialog.dart index 8c143d5b7..3fbd6f52d 100644 --- a/lib/widgets/common/action_delegates/rename_entry_dialog.dart +++ b/lib/widgets/common/action_delegates/rename_entry_dialog.dart @@ -74,7 +74,6 @@ class _RenameEntryDialogState extends State { final newName = _nameController.text ?? ''; final path = _buildEntryPath(newName); final exists = newName.isNotEmpty && await FileSystemEntity.type(path) != FileSystemEntityType.notFound; - debugPrint('TLAD path=$path exists=$exists'); _isValidNotifier.value = newName.isNotEmpty && !exists; } diff --git a/lib/widgets/common/action_delegates/selection_action_delegate.dart b/lib/widgets/common/action_delegates/selection_action_delegate.dart index d9320a80a..f39b66ade 100644 --- a/lib/widgets/common/action_delegates/selection_action_delegate.dart +++ b/lib/widgets/common/action_delegates/selection_action_delegate.dart @@ -7,7 +7,6 @@ import 'package:aves/model/source/collection_lens.dart'; import 'package:aves/model/source/collection_source.dart'; import 'package:aves/services/android_app_service.dart'; import 'package:aves/services/image_file_service.dart'; -import 'package:aves/utils/durations.dart'; import 'package:aves/widgets/collection/collection_actions.dart'; import 'package:aves/widgets/collection/empty.dart'; import 'package:aves/widgets/common/action_delegates/create_album_dialog.dart'; @@ -20,10 +19,8 @@ import 'package:aves/widgets/filter_grids/albums_page.dart'; import 'package:aves/widgets/filter_grids/common/filter_grid_page.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/scheduler.dart'; import 'package:flutter/widgets.dart'; import 'package:intl/intl.dart'; -import 'package:percent_indicator/circular_percent_indicator.dart'; class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin { final CollectionLens collection; @@ -61,7 +58,7 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin { } } - Future _moveSelection(BuildContext context, {@required bool copy}) async { + Future _moveSelection(BuildContext context, {@required bool copy}) async { final source = collection.source; final destinationAlbum = await Navigator.push( context, @@ -106,7 +103,7 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin { final selection = collection.selection.toList(); if (!await checkStoragePermission(context, selection)) return; - _showOpReport( + showOpReport( context: context, selection: selection, opStream: ImageFileService.move(selection, copy: copy, destinationAlbum: destinationAlbum), @@ -166,7 +163,7 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin { ); } - void _refreshSelectionMetadata() async { + Future _refreshSelectionMetadata() async { collection.selection.forEach((entry) => entry.clearMetadata()); final source = collection.source; source.stateNotifier.value = SourceState.cataloguing; @@ -176,7 +173,7 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin { source.stateNotifier.value = SourceState.ready; } - void _showDeleteDialog(BuildContext context) async { + Future _showDeleteDialog(BuildContext context) async { final selection = collection.selection.toList(); final count = selection.length; @@ -202,7 +199,7 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin { if (!await checkStoragePermission(context, selection)) return; - _showOpReport( + showOpReport( context: context, selection: selection, opStream: ImageFileService.delete(selection), @@ -222,65 +219,4 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin { }, ); } - - // selection action report overlay - - OverlayEntry _opReportOverlayEntry; - - void _showOpReport({ - @required BuildContext context, - @required List selection, - @required Stream opStream, - @required void Function(Set processed) onDone, - }) { - final processed = {}; - - // do not handle completion inside `StreamBuilder` - // as it could be called multiple times - Future onComplete() => _hideOpReportOverlay().then((_) => onDone(processed)); - opStream.listen( - processed.add, - onError: (error) { - debugPrint('_showOpReport error=$error'); - onComplete(); - }, - onDone: onComplete, - ); - - _opReportOverlayEntry = OverlayEntry( - builder: (context) { - return AbsorbPointer( - child: StreamBuilder( - stream: opStream, - builder: (context, snapshot) { - Widget child = SizedBox.shrink(); - if (!snapshot.hasError && snapshot.connectionState == ConnectionState.active) { - final percent = processed.length.toDouble() / selection.length; - child = CircularPercentIndicator( - percent: percent, - lineWidth: 16, - radius: 160, - backgroundColor: Colors.white24, - progressColor: Theme.of(context).accentColor, - animation: true, - center: Text(NumberFormat.percentPattern().format(percent)), - animateFromLastPercent: true, - ); - } - return AnimatedSwitcher( - duration: Durations.collectionOpOverlayAnimation, - child: child, - ); - }), - ); - }, - ); - Overlay.of(context).insert(_opReportOverlayEntry); - } - - Future _hideOpReportOverlay() async { - await Future.delayed(Durations.collectionOpOverlayAnimation * timeDilation); - _opReportOverlayEntry.remove(); - _opReportOverlayEntry = null; - } } diff --git a/lib/widgets/debug_page.dart b/lib/widgets/debug_page.dart index e78a35cc8..15399f7ce 100644 --- a/lib/widgets/debug_page.dart +++ b/lib/widgets/debug_page.dart @@ -299,6 +299,7 @@ class DebugPageState extends State { 'collectionSortFactor': '${settings.collectionSortFactor}', 'collectionTileExtent': '${settings.collectionTileExtent}', 'infoMapZoom': '${settings.infoMapZoom}', + 'pinnedFilters': '${settings.pinnedFilters}', }), ], ); diff --git a/lib/widgets/filter_grids/albums_page.dart b/lib/widgets/filter_grids/albums_page.dart index e623a4d6a..dd9902225 100644 --- a/lib/widgets/filter_grids/albums_page.dart +++ b/lib/widgets/filter_grids/albums_page.dart @@ -41,6 +41,7 @@ class AlbumListPage extends StatelessWidget { chipActionsBuilder: (filter) => [ settings.pinnedFilters.contains(filter) ? ChipAction.unpin : ChipAction.pin, ChipAction.rename, + ChipAction.delete, ], filterEntries: getAlbumEntries(source), filterBuilder: (album) => AlbumFilter(album, source.getUniqueAlbumName(album)), diff --git a/lib/widgets/filter_grids/common/chip_action_delegate.dart b/lib/widgets/filter_grids/common/chip_action_delegate.dart index f6908b256..2cd0145ae 100644 --- a/lib/widgets/filter_grids/common/chip_action_delegate.dart +++ b/lib/widgets/filter_grids/common/chip_action_delegate.dart @@ -8,9 +8,11 @@ import 'package:aves/utils/durations.dart'; import 'package:aves/widgets/common/action_delegates/feedback.dart'; import 'package:aves/widgets/common/action_delegates/permission_aware.dart'; import 'package:aves/widgets/common/action_delegates/rename_album_dialog.dart'; +import 'package:aves/widgets/common/aves_dialog.dart'; import 'package:aves/widgets/filter_grids/common/chip_actions.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; +import 'package:intl/intl.dart'; import 'package:path/path.dart' as path; import 'package:pedantic/pedantic.dart'; @@ -43,6 +45,9 @@ class AlbumChipActionDelegate extends ChipActionDelegate with FeedbackMixin, Per Future onActionSelected(BuildContext context, CollectionFilter filter, ChipAction action) async { await super.onActionSelected(context, filter, action); switch (action) { + case ChipAction.delete: + unawaited(_showDeleteDialog(context, filter as AlbumFilter)); + break; case ChipAction.rename: unawaited(_showRenameDialog(context, filter as AlbumFilter)); break; @@ -51,6 +56,53 @@ class AlbumChipActionDelegate extends ChipActionDelegate with FeedbackMixin, Per } } + Future _showDeleteDialog(BuildContext context, AlbumFilter filter) async { + final selection = source.rawEntries.where(filter.filter).toList(); + final count = selection.length; + + final confirmed = await showDialog( + context: context, + builder: (context) { + return AvesDialog( + content: Text('Are you sure you want to delete this album and its ${Intl.plural(count, one: 'item', other: '$count items')}?'), + actions: [ + FlatButton( + onPressed: () => Navigator.pop(context), + child: Text('Cancel'.toUpperCase()), + ), + FlatButton( + onPressed: () => Navigator.pop(context, true), + child: Text('Delete'.toUpperCase()), + ), + ], + ); + }, + ); + if (confirmed == null || !confirmed) return; + + if (!await checkStoragePermission(context, selection)) return; + + showOpReport( + context: context, + selection: selection, + opStream: ImageFileService.delete(selection), + onDone: (processed) { + final deletedUris = processed.where((e) => e.success).map((e) => e.uri); + final deletedCount = deletedUris.length; + final selectionCount = selection.length; + if (deletedCount < selectionCount) { + final count = selectionCount - deletedCount; + showFeedback(context, 'Failed to delete ${Intl.plural(count, one: '$count item', other: '$count items')}'); + } else { + settings.pinnedFilters = settings.pinnedFilters..remove(filter); + } + if (deletedCount > 0) { + source.removeEntries(selection.where((e) => deletedUris.contains(e.uri))); + } + }, + ); + } + Future _showRenameDialog(BuildContext context, AlbumFilter filter) async { final album = filter.album; final newName = await showDialog( diff --git a/lib/widgets/filter_grids/common/chip_actions.dart b/lib/widgets/filter_grids/common/chip_actions.dart index e26455793..9d2c00467 100644 --- a/lib/widgets/filter_grids/common/chip_actions.dart +++ b/lib/widgets/filter_grids/common/chip_actions.dart @@ -6,6 +6,7 @@ enum ChipSetAction { } enum ChipAction { + delete, pin, unpin, rename, @@ -14,6 +15,8 @@ enum ChipAction { extension ExtraChipAction on ChipAction { String getText() { switch (this) { + case ChipAction.delete: + return 'Delete'; case ChipAction.pin: return 'Pin to top'; case ChipAction.unpin: @@ -26,6 +29,8 @@ extension ExtraChipAction on ChipAction { IconData getIcon() { switch (this) { + case ChipAction.delete: + return AIcons.delete; case ChipAction.pin: case ChipAction.unpin: return AIcons.pin; From 44fe56efdb6195a906a982b229be8244679abd31 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 28 Sep 2020 11:46:25 +0900 Subject: [PATCH 07/19] album: rename by moving entries --- .../aves/channel/calls/ImageFileHandler.java | 29 ---- .../aves/model/provider/ImageProvider.java | 128 ------------------ lib/model/source/collection_source.dart | 48 ++++++- lib/services/image_file_service.dart | 13 -- .../selection_action_delegate.dart | 47 +------ .../common/chip_action_delegate.dart | 51 +++---- 6 files changed, 74 insertions(+), 242 deletions(-) diff --git a/android/app/src/main/java/deckers/thibault/aves/channel/calls/ImageFileHandler.java b/android/app/src/main/java/deckers/thibault/aves/channel/calls/ImageFileHandler.java index fdea9c636..ebe81b15d 100644 --- a/android/app/src/main/java/deckers/thibault/aves/channel/calls/ImageFileHandler.java +++ b/android/app/src/main/java/deckers/thibault/aves/channel/calls/ImageFileHandler.java @@ -9,7 +9,6 @@ import androidx.annotation.NonNull; import com.bumptech.glide.Glide; -import java.io.File; import java.util.List; import java.util.Map; @@ -59,9 +58,6 @@ public class ImageFileHandler implements MethodChannel.MethodCallHandler { case "rotate": new Thread(() -> rotate(call, new MethodResultWrapper(result))).start(); break; - case "renameDirectory": - new Thread(() -> renameDirectory(call, new MethodResultWrapper(result))).start(); - break; default: result.notImplemented(); break; @@ -183,29 +179,4 @@ public class ImageFileHandler implements MethodChannel.MethodCallHandler { } }); } - - private void renameDirectory(@NonNull MethodCall call, @NonNull MethodChannel.Result result) { - String dirPath = call.argument("path"); - String newName = call.argument("newName"); - if (dirPath == null || newName == null) { - result.error("renameDirectory-args", "failed because of missing arguments", null); - return; - } - if (!dirPath.endsWith(File.separator)) { - dirPath += File.separator; - } - - ImageProvider provider = new MediaStoreImageProvider(); - provider.renameDirectory(activity, dirPath, newName, new ImageProvider.AlbumRenameOpCallback() { - @Override - public void onSuccess(List> fieldsByEntry) { - result.success(fieldsByEntry); - } - - @Override - public void onFailure(Throwable throwable) { - result.error("renameDirectory-failure", "failed to rename directory", throwable.getMessage()); - } - }); - } } \ No newline at end of file diff --git a/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java b/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java index 47b6422c0..3c9600d5c 100644 --- a/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java +++ b/android/app/src/main/java/deckers/thibault/aves/model/provider/ImageProvider.java @@ -17,20 +17,14 @@ import com.bumptech.glide.load.resource.bitmap.TransformationUtils; import com.commonsware.cwac.document.DocumentFileCompat; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.SettableFuture; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.ExecutionException; -import java.util.stream.Collectors; import deckers.thibault.aves.model.AvesImageEntry; import deckers.thibault.aves.utils.MetadataHelper; @@ -92,122 +86,6 @@ public abstract class ImageProvider { scanNewPath(context, newFile.getPath(), mimeType, callback); } - @SuppressWarnings("UnstableApiUsage") - public void renameDirectory(Context context, final String oldDirPath, String newDirName, final AlbumRenameOpCallback callback) { - DocumentFileCompat destinationDirDocFile = StorageUtils.createDirectoryIfAbsent(context, oldDirPath); - if (destinationDirDocFile == null) { - callback.onFailure(new Exception("failed to find directory at path=" + oldDirPath)); - return; - } - - // list entries with their content IDs before renaming - Uri[] baseContentUris = new Uri[]{MediaStore.Images.Media.EXTERNAL_CONTENT_URI, MediaStore.Video.Media.EXTERNAL_CONTENT_URI}; - Map>> entriesByBaseContentUri = Arrays.stream(baseContentUris).collect(Collectors.toMap( - uri -> uri, - uri -> listContentEntries(context, uri, oldDirPath) - )); - - // rename directory - boolean renamed; - try { - renamed = destinationDirDocFile.renameTo(newDirName); - } catch (FileNotFoundException e) { - callback.onFailure(new Exception("failed to rename to name=" + newDirName + " directory at path=" + oldDirPath, e)); - return; - } - if (!renamed) { - callback.onFailure(new Exception("failed to rename to name=" + newDirName + " directory at path=" + oldDirPath)); - return; - } - String newDirPath = new File(oldDirPath).getParent() + File.separator + newDirName + File.separator; - - // scan old paths for cleanup, and new paths to fetch content IDs - Collection>> scanFutures = new ArrayList<>(); - entriesByBaseContentUri.forEach((baseContentUri, entries) -> { - int count = entries.size(); - if (count > 0) { - String[] mimeTypes = new String[count]; - String[] oldPaths = new String[count]; - String[] newPaths = new String[count]; - Map oldContentIdByPath = new HashMap<>(); - Map>> scanFutureByPath = new HashMap<>(); - for (int i = 0; i < count; i++) { - Map entry = entries.get(i); - String displayName = (String) entry.get("displayName"); - String newPath = newDirPath + displayName; - mimeTypes[i] = (String) entry.get("mimeType"); - oldPaths[i] = oldDirPath + displayName; - newPaths[i] = newPath; - oldContentIdByPath.put(newPath, (Integer) entry.get("oldContentId")); - scanFutureByPath.put(newPath, SettableFuture.create()); - } - MediaScannerConnection.scanFile(context, oldPaths, mimeTypes, null); - MediaScannerConnection.scanFile(context, newPaths, mimeTypes, (path, rawUri) -> { - SettableFuture> future = scanFutureByPath.get(path); - if (future == null) { - Log.e(LOG_TAG, "no future for path=" + path); - return; - } - - if (rawUri == null) { - future.setException(new Exception("failed to get URI of item at path=" + path)); - return; - } - - // newURI is possibly a file media URI (e.g. "content://media/12a9-8b42/file/62872") - // but we need an image/video media URI (e.g. "content://media/external/images/media/62872") - long contentId = ContentUris.parseId(rawUri); - Uri contentUri = ContentUris.withAppendedId(baseContentUri, contentId); - Map newFields = new HashMap() {{ - put("path", path); - put("uri", contentUri.toString()); - put("contentId", contentId); - put("oldContentId", oldContentIdByPath.get(path)); - }}; - future.set(newFields); - }); - - scanFutures.addAll(scanFutureByPath.values()); - } - }); - - try { - callback.onSuccess(Futures.allAsList(scanFutures).get()); - } catch (ExecutionException | InterruptedException e) { - callback.onFailure(e); - } - } - - private List> listContentEntries(Context context, Uri contentUri, String dirPath) { - List> entries = new ArrayList<>(); - String[] projection = { - MediaStore.MediaColumns._ID, - MediaStore.MediaColumns.DISPLAY_NAME, - MediaStore.MediaColumns.MIME_TYPE, - }; - String selection = MediaStore.MediaColumns.DATA + " like ?"; - - try { - Cursor cursor = context.getContentResolver().query(contentUri, projection, selection, new String[]{dirPath + "%"}, null); - if (cursor != null) { - int idColumn = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns._ID); - int displayNameColumn = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DISPLAY_NAME); - int mimeTypeColumn = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.MIME_TYPE); - while (cursor.moveToNext()) { - entries.add(new HashMap() {{ - put("oldContentId", cursor.getInt(idColumn)); - put("displayName", cursor.getString(displayNameColumn)); - put("mimeType", cursor.getString(mimeTypeColumn)); - }}); - } - cursor.close(); - } - } catch (Exception e) { - Log.e(LOG_TAG, "failed to list entries in contentUri=" + contentUri, e); - } - return entries; - } - public void rotate(final Context context, final String path, final Uri uri, final String mimeType, final boolean clockwise, final ImageOpCallback callback) { switch (mimeType) { case MimeTypes.JPEG: @@ -416,10 +294,4 @@ public abstract class ImageProvider { void onFailure(Throwable throwable); } - - public interface AlbumRenameOpCallback { - void onSuccess(List> fieldsByEntry); - - void onFailure(Throwable throwable); - } } diff --git a/lib/model/source/collection_source.dart b/lib/model/source/collection_source.dart index 89855ce28..3ef329b02 100644 --- a/lib/model/source/collection_source.dart +++ b/lib/model/source/collection_source.dart @@ -9,6 +9,7 @@ import 'package:aves/model/source/album.dart'; import 'package:aves/model/source/collection_lens.dart'; import 'package:aves/model/source/location.dart'; import 'package:aves/model/source/tag.dart'; +import 'package:aves/services/image_file_service.dart'; import 'package:event_bus/event_bus.dart'; import 'package:flutter/foundation.dart'; @@ -108,20 +109,53 @@ class CollectionSource with SourceBase, AlbumMixin, LocationMixin, TagMixin { } void updateAfterMove({ - @required Iterable entries, - @required Set fromAlbums, - @required String toAlbum, + @required List selection, @required bool copy, - }) { + @required String destinationAlbum, + @required Iterable movedOps, + }) async { + if (movedOps.isEmpty) return; + + final fromAlbums = {}; + final movedEntries = []; if (copy) { - addAll(entries); + movedOps.forEach((movedOp) { + final sourceUri = movedOp.uri; + final newFields = movedOp.newFields; + final sourceEntry = selection.firstWhere((entry) => entry.uri == sourceUri, orElse: () => null); + fromAlbums.add(sourceEntry.directory); + movedEntries.add(sourceEntry?.copyWith( + uri: newFields['uri'] as String, + path: newFields['path'] as String, + contentId: newFields['contentId'] as int, + dateModifiedSecs: newFields['dateModifiedSecs'] as int, + )); + }); + await metadataDb.saveEntries(movedEntries); + await metadataDb.saveMetadata(movedEntries.map((entry) => entry.catalogMetadata)); + await metadataDb.saveAddresses(movedEntries.map((entry) => entry.addressDetails)); + } else { + await Future.forEach(movedOps, (movedOp) async { + final sourceUri = movedOp.uri; + final newFields = movedOp.newFields; + final entry = selection.firstWhere((entry) => entry.uri == sourceUri, orElse: () => null); + if (entry != null) { + fromAlbums.add(entry.directory); + movedEntries.add(entry); + await moveEntry(entry, newFields); + } + }); + } + + if (copy) { + addAll(movedEntries); } else { cleanEmptyAlbums(fromAlbums); - addFolderPath({toAlbum}); + addFolderPath({destinationAlbum}); } updateAlbums(); invalidateFilterEntryCounts(); - eventBus.fire(EntryMovedEvent(entries)); + eventBus.fire(EntryMovedEvent(movedEntries)); } int count(CollectionFilter filter) { diff --git a/lib/services/image_file_service.dart b/lib/services/image_file_service.dart index 8011b97da..f6fb234c5 100644 --- a/lib/services/image_file_service.dart +++ b/lib/services/image_file_service.dart @@ -194,19 +194,6 @@ class ImageFileService { } return {}; } - - static Future> renameDirectory(String path, String newName) async { - try { - final result = await platform.invokeMethod('renameDirectory', { - 'path': path, - 'newName': newName, - }); - return (result as List).cast(); - } on PlatformException catch (e) { - debugPrint('renameDirectory failed with code=${e.code}, exception=${e.message}, details=${e.details}'); - } - return []; - } } @immutable diff --git a/lib/widgets/common/action_delegates/selection_action_delegate.dart b/lib/widgets/common/action_delegates/selection_action_delegate.dart index f39b66ade..a02ee9890 100644 --- a/lib/widgets/common/action_delegates/selection_action_delegate.dart +++ b/lib/widgets/common/action_delegates/selection_action_delegate.dart @@ -1,8 +1,6 @@ import 'dart:async'; import 'package:aves/model/filters/album.dart'; -import 'package:aves/model/image_entry.dart'; -import 'package:aves/model/metadata_db.dart'; import 'package:aves/model/source/collection_lens.dart'; import 'package:aves/model/source/collection_source.dart'; import 'package:aves/services/android_app_service.dart'; @@ -108,7 +106,6 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin { selection: selection, opStream: ImageFileService.move(selection, copy: copy, destinationAlbum: destinationAlbum), onDone: (processed) async { - debugPrint('$runtimeType _moveSelection onDone'); final movedOps = processed.where((e) => e.success); final movedCount = movedOps.length; final selectionCount = selection.length; @@ -119,44 +116,12 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin { final count = movedCount; showFeedback(context, '${copy ? 'Copied' : 'Moved'} ${Intl.plural(count, one: '$count item', other: '$count items')}'); } - if (movedCount > 0) { - final fromAlbums = {}; - final movedEntries = []; - if (copy) { - movedOps.forEach((movedOp) { - final sourceUri = movedOp.uri; - final newFields = movedOp.newFields; - final sourceEntry = selection.firstWhere((entry) => entry.uri == sourceUri, orElse: () => null); - fromAlbums.add(sourceEntry.directory); - movedEntries.add(sourceEntry?.copyWith( - uri: newFields['uri'] as String, - path: newFields['path'] as String, - contentId: newFields['contentId'] as int, - dateModifiedSecs: newFields['dateModifiedSecs'] as int, - )); - }); - await metadataDb.saveEntries(movedEntries); - await metadataDb.saveMetadata(movedEntries.map((entry) => entry.catalogMetadata)); - await metadataDb.saveAddresses(movedEntries.map((entry) => entry.addressDetails)); - } else { - await Future.forEach(movedOps, (movedOp) async { - final sourceUri = movedOp.uri; - final newFields = movedOp.newFields; - final entry = selection.firstWhere((entry) => entry.uri == sourceUri, orElse: () => null); - if (entry != null) { - fromAlbums.add(entry.directory); - movedEntries.add(entry); - await source.moveEntry(entry, newFields); - } - }); - } - source.updateAfterMove( - entries: movedEntries, - fromAlbums: fromAlbums, - toAlbum: destinationAlbum, - copy: copy, - ); - } + await source.updateAfterMove( + selection: selection, + copy: copy, + destinationAlbum: destinationAlbum, + movedOps: movedOps, + ); collection.clearSelection(); collection.browse(); }, diff --git a/lib/widgets/filter_grids/common/chip_action_delegate.dart b/lib/widgets/filter_grids/common/chip_action_delegate.dart index 2cd0145ae..d1f2ecfb0 100644 --- a/lib/widgets/filter_grids/common/chip_action_delegate.dart +++ b/lib/widgets/filter_grids/common/chip_action_delegate.dart @@ -1,6 +1,5 @@ import 'package:aves/model/filters/album.dart'; import 'package:aves/model/filters/filters.dart'; -import 'package:aves/model/image_entry.dart'; import 'package:aves/model/settings/settings.dart'; import 'package:aves/model/source/collection_source.dart'; import 'package:aves/services/image_file_service.dart'; @@ -113,30 +112,34 @@ class AlbumChipActionDelegate extends ChipActionDelegate with FeedbackMixin, Per if (!await checkStoragePermissionForAlbums(context, {album})) return; - final result = await ImageFileService.renameDirectory(album, newName); + final selection = source.rawEntries.where(filter.filter).toList(); + final destinationAlbum = path.join(path.dirname(album), newName); - final albumEntries = source.rawEntries.where(filter.filter); - final movedEntries = []; - await Future.forEach(result, (newFields) async { - final oldContentId = newFields['oldContentId']; - final entry = albumEntries.firstWhere((entry) => entry.contentId == oldContentId, orElse: () => null); - if (entry != null) { - movedEntries.add(entry); - await source.moveEntry(entry, newFields); - } - }); - final newAlbum = path.join(path.dirname(album), newName); - source.updateAfterMove( - entries: movedEntries, - fromAlbums: {album}, - toAlbum: newAlbum, - copy: false, + showOpReport( + context: context, + selection: selection, + opStream: ImageFileService.move(selection, copy: false, destinationAlbum: destinationAlbum), + onDone: (processed) async { + final movedOps = processed.where((e) => e.success); + final movedCount = movedOps.length; + final selectionCount = selection.length; + if (movedCount < selectionCount) { + final count = selectionCount - movedCount; + showFeedback(context, 'Failed to move ${Intl.plural(count, one: '$count item', other: '$count items')}'); + } else { + showFeedback(context, 'Done!'); + } + await source.updateAfterMove( + selection: selection, + copy: false, + destinationAlbum: destinationAlbum, + movedOps: movedOps, + ); + final newFilter = AlbumFilter(destinationAlbum, source.getUniqueAlbumName(destinationAlbum)); + settings.pinnedFilters = settings.pinnedFilters + ..remove(filter) + ..add(newFilter); + }, ); - final newFilter = AlbumFilter(newAlbum, source.getUniqueAlbumName(newAlbum)); - settings.pinnedFilters = settings.pinnedFilters - ..remove(filter) - ..add(newFilter); - - showFeedback(context, 'Done!'); } } From 8052347895d809963a8d493a3f85e0051681d9a2 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 28 Sep 2020 12:10:37 +0900 Subject: [PATCH 08/19] fixed freeze after deleting multiple entries --- lib/model/source/album.dart | 6 ++++++ lib/model/source/collection_source.dart | 2 +- .../common/action_delegates/selection_action_delegate.dart | 4 ++-- lib/widgets/filter_grids/common/chip_action_delegate.dart | 6 ++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/model/source/album.dart b/lib/model/source/album.dart index 3369ed290..c9256ed4f 100644 --- a/lib/model/source/album.dart +++ b/lib/model/source/album.dart @@ -1,4 +1,6 @@ +import 'package:aves/model/filters/album.dart'; import 'package:aves/model/image_entry.dart'; +import 'package:aves/model/settings/settings.dart'; import 'package:aves/model/source/collection_source.dart'; import 'package:aves/utils/android_file_utils.dart'; import 'package:collection/collection.dart'; @@ -67,6 +69,10 @@ mixin AlbumMixin on SourceBase { if (emptyAlbums.isNotEmpty) { _folderPaths.removeAll(emptyAlbums); updateAlbums(); + + final pinnedFilters = settings.pinnedFilters; + emptyAlbums.forEach((album) => pinnedFilters.remove(AlbumFilter(album, getUniqueAlbumName(album)))); + settings.pinnedFilters = pinnedFilters; } } diff --git a/lib/model/source/collection_source.dart b/lib/model/source/collection_source.dart index 3ef329b02..d3c80fe7a 100644 --- a/lib/model/source/collection_source.dart +++ b/lib/model/source/collection_source.dart @@ -70,7 +70,7 @@ class CollectionSource with SourceBase, AlbumMixin, LocationMixin, TagMixin { eventBus.fire(EntryAddedEvent()); } - void removeEntries(Iterable entries) { + void removeEntries(List entries) { entries.forEach((entry) => entry.removeFromFavourites()); _rawEntries.removeWhere(entries.contains); cleanEmptyAlbums(entries.map((entry) => entry.directory).toSet()); diff --git a/lib/widgets/common/action_delegates/selection_action_delegate.dart b/lib/widgets/common/action_delegates/selection_action_delegate.dart index a02ee9890..0c5788712 100644 --- a/lib/widgets/common/action_delegates/selection_action_delegate.dart +++ b/lib/widgets/common/action_delegates/selection_action_delegate.dart @@ -169,7 +169,7 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin { selection: selection, opStream: ImageFileService.delete(selection), onDone: (processed) { - final deletedUris = processed.where((e) => e.success).map((e) => e.uri); + final deletedUris = processed.where((e) => e.success).map((e) => e.uri).toList(); final deletedCount = deletedUris.length; final selectionCount = selection.length; if (deletedCount < selectionCount) { @@ -177,7 +177,7 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin { showFeedback(context, 'Failed to delete ${Intl.plural(count, one: '$count item', other: '$count items')}'); } if (deletedCount > 0) { - collection.source.removeEntries(selection.where((e) => deletedUris.contains(e.uri))); + collection.source.removeEntries(selection.where((e) => deletedUris.contains(e.uri)).toList()); } collection.clearSelection(); collection.browse(); diff --git a/lib/widgets/filter_grids/common/chip_action_delegate.dart b/lib/widgets/filter_grids/common/chip_action_delegate.dart index d1f2ecfb0..56b518752 100644 --- a/lib/widgets/filter_grids/common/chip_action_delegate.dart +++ b/lib/widgets/filter_grids/common/chip_action_delegate.dart @@ -86,17 +86,15 @@ class AlbumChipActionDelegate extends ChipActionDelegate with FeedbackMixin, Per selection: selection, opStream: ImageFileService.delete(selection), onDone: (processed) { - final deletedUris = processed.where((e) => e.success).map((e) => e.uri); + final deletedUris = processed.where((e) => e.success).map((e) => e.uri).toList(); final deletedCount = deletedUris.length; final selectionCount = selection.length; if (deletedCount < selectionCount) { final count = selectionCount - deletedCount; showFeedback(context, 'Failed to delete ${Intl.plural(count, one: '$count item', other: '$count items')}'); - } else { - settings.pinnedFilters = settings.pinnedFilters..remove(filter); } if (deletedCount > 0) { - source.removeEntries(selection.where((e) => deletedUris.contains(e.uri))); + source.removeEntries(selection.where((e) => deletedUris.contains(e.uri)).toList()); } }, ); From 097a051b3774868c38d3cf9c30702eb1988f48c8 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 28 Sep 2020 13:43:25 +0900 Subject: [PATCH 09/19] shortcut: icon from entry --- .../aves/channel/calls/AppAdapterHandler.java | 4 +-- .../channel/calls/AppShortcutHandler.java | 29 +++++++++++++++---- lib/services/app_shortcut_service.dart | 6 +++- lib/widgets/collection/app_bar.dart | 3 +- .../collection/grid/header_generic.dart | 3 +- .../action_delegates/add_shortcut_dialog.dart | 2 +- .../image_providers/thumbnail_provider.dart | 1 + .../fullscreen/info/maps/scale_layer.dart | 7 ++++- 8 files changed, 40 insertions(+), 15 deletions(-) diff --git a/android/app/src/main/java/deckers/thibault/aves/channel/calls/AppAdapterHandler.java b/android/app/src/main/java/deckers/thibault/aves/channel/calls/AppAdapterHandler.java index 4fdd70d8b..2e0ee78f6 100644 --- a/android/app/src/main/java/deckers/thibault/aves/channel/calls/AppAdapterHandler.java +++ b/android/app/src/main/java/deckers/thibault/aves/channel/calls/AppAdapterHandler.java @@ -38,8 +38,6 @@ import deckers.thibault.aves.utils.Utils; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; -import static com.bumptech.glide.request.RequestOptions.centerCropTransform; - public class AppAdapterHandler implements MethodChannel.MethodCallHandler { private static final String LOG_TAG = Utils.createLogTag(AppAdapterHandler.class); @@ -184,7 +182,7 @@ public class AppAdapterHandler implements MethodChannel.MethodCallHandler { FutureTarget target = Glide.with(context) .asBitmap() .apply(options) - .apply(centerCropTransform()) + .centerCrop() .load(uri) .signature(signature) .submit(size, size); diff --git a/android/app/src/main/java/deckers/thibault/aves/channel/calls/AppShortcutHandler.java b/android/app/src/main/java/deckers/thibault/aves/channel/calls/AppShortcutHandler.java index b4a4a3457..08c7071e0 100644 --- a/android/app/src/main/java/deckers/thibault/aves/channel/calls/AppShortcutHandler.java +++ b/android/app/src/main/java/deckers/thibault/aves/channel/calls/AppShortcutHandler.java @@ -2,6 +2,8 @@ package deckers.thibault.aves.channel.calls; import android.content.Context; import android.content.Intent; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.text.TextUtils; import androidx.annotation.NonNull; @@ -10,6 +12,9 @@ import androidx.core.content.pm.ShortcutInfoCompat; import androidx.core.content.pm.ShortcutManagerCompat; import androidx.core.graphics.drawable.IconCompat; +import com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool; +import com.bumptech.glide.load.resource.bitmap.TransformationUtils; + import java.util.List; import deckers.thibault.aves.MainActivity; @@ -35,8 +40,9 @@ public class AppShortcutHandler implements MethodChannel.MethodCallHandler { } case "pin": { String label = call.argument("label"); + byte[] iconBytes = call.argument("iconBytes"); List filters = call.argument("filters"); - pin(label, filters); + new Thread(() -> pin(label, iconBytes, filters)).start(); result.success(null); break; } @@ -46,17 +52,28 @@ public class AppShortcutHandler implements MethodChannel.MethodCallHandler { } } - private void pin(String label, @Nullable List filters) { + private void pin(String label, byte[] iconBytes, @Nullable List filters) { if (!ShortcutManagerCompat.isRequestPinShortcutSupported(context) || filters == null) { return; } + IconCompat icon; + if (iconBytes != null && iconBytes.length > 0) { + Bitmap bitmap = BitmapFactory.decodeByteArray(iconBytes, 0, iconBytes.length); + bitmap = TransformationUtils.centerCrop(new LruBitmapPool(2 << 24), bitmap, 256, 256); + icon = IconCompat.createWithBitmap(bitmap); + } else { + icon = IconCompat.createWithResource(context, R.mipmap.ic_shortcut_collection); + } + + Intent intent = new Intent(Intent.ACTION_MAIN, null, context, MainActivity.class) + .putExtra("page", "/collection") + .putExtra("filters", filters.toArray(new String[0])); + ShortcutInfoCompat shortcut = new ShortcutInfoCompat.Builder(context, "collection-" + TextUtils.join("-", filters)) .setShortLabel(label) - .setIcon(IconCompat.createWithResource(context, R.mipmap.ic_shortcut_collection)) - .setIntent(new Intent(Intent.ACTION_MAIN, null, context, MainActivity.class) - .putExtra("page", "/collection") - .putExtra("filters", filters.toArray(new String[0]))) + .setIcon(icon) + .setIntent(intent) .build(); ShortcutManagerCompat.requestPinShortcut(context, shortcut, null); diff --git a/lib/services/app_shortcut_service.dart b/lib/services/app_shortcut_service.dart index 5d4c244b7..6369048f1 100644 --- a/lib/services/app_shortcut_service.dart +++ b/lib/services/app_shortcut_service.dart @@ -1,4 +1,6 @@ import 'package:aves/model/filters/filters.dart'; +import 'package:aves/model/image_entry.dart'; +import 'package:aves/services/image_file_service.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; @@ -22,10 +24,12 @@ class AppShortcutService { return false; } - static Future pin(String label, Set filters) async { + static Future pin(String label, ImageEntry iconEntry, Set filters) async { + final iconBytes = iconEntry != null ? await ImageFileService.getThumbnail(iconEntry, 256, 256) : null; try { await platform.invokeMethod('pin', { 'label': label, + 'iconBytes': iconBytes, 'filters': filters.map((filter) => filter.toJson()).toList(), }); } on PlatformException catch (e) { diff --git a/lib/widgets/collection/app_bar.dart b/lib/widgets/collection/app_bar.dart index e29302f42..8436686b6 100644 --- a/lib/widgets/collection/app_bar.dart +++ b/lib/widgets/collection/app_bar.dart @@ -356,7 +356,8 @@ class _CollectionAppBarState extends State with SingleTickerPr ); if (name == null || name.isEmpty) return; - unawaited(AppShortcutService.pin(name, collection.filters)); + final iconEntry = collection.sortedEntries.isNotEmpty ? collection.sortedEntries.first : null; + unawaited(AppShortcutService.pin(name, iconEntry, collection.filters)); } void _goToSearch() { diff --git a/lib/widgets/collection/grid/header_generic.dart b/lib/widgets/collection/grid/header_generic.dart index e267e2be4..7c0fda47a 100644 --- a/lib/widgets/collection/grid/header_generic.dart +++ b/lib/widgets/collection/grid/header_generic.dart @@ -87,8 +87,7 @@ class SectionHeader extends StatelessWidget { // force a higher first line to match leading icon/selector dimension style: TextStyle(height: 2.3 * textScaleFactor), ), // 23 hair spaces match a width of 40.0 - if (hasTrailing) - TextSpan(text: '\u200A' * 17), + if (hasTrailing) TextSpan(text: '\u200A' * 17), TextSpan( text: text, style: Constants.titleTextStyle, diff --git a/lib/widgets/common/action_delegates/add_shortcut_dialog.dart b/lib/widgets/common/action_delegates/add_shortcut_dialog.dart index 1b353f519..7274c273e 100644 --- a/lib/widgets/common/action_delegates/add_shortcut_dialog.dart +++ b/lib/widgets/common/action_delegates/add_shortcut_dialog.dart @@ -43,7 +43,7 @@ class _AddShortcutDialogState extends State { labelText: 'Shortcut label', ), autofocus: true, - maxLength: 10, + maxLength: 25, onChanged: (_) => _validate(), onSubmitted: (_) => _submit(context), ), diff --git a/lib/widgets/common/image_providers/thumbnail_provider.dart b/lib/widgets/common/image_providers/thumbnail_provider.dart index b3f1875c7..7d0e58e3e 100644 --- a/lib/widgets/common/image_providers/thumbnail_provider.dart +++ b/lib/widgets/common/image_providers/thumbnail_provider.dart @@ -66,6 +66,7 @@ class ThumbnailProviderKey { final ImageEntry entry; final double extent; final double scale; + // do not access `contentId` via `entry` for hashCode and equality purposes // as an entry is not constant and its contentId can change final int contentId; diff --git a/lib/widgets/fullscreen/info/maps/scale_layer.dart b/lib/widgets/fullscreen/info/maps/scale_layer.dart index 70bf1ad4a..ac92d838d 100644 --- a/lib/widgets/fullscreen/info/maps/scale_layer.dart +++ b/lib/widgets/fullscreen/info/maps/scale_layer.dart @@ -75,7 +75,12 @@ class ScaleLayer extends StatelessWidget { builder: (context, snapshot) { final center = map.center; final latitude = center.latitude.abs(); - final level = map.zoom.round() + (latitude > 80 ? 4 : latitude > 60 ? 3 : 2); + final level = map.zoom.round() + + (latitude > 80 + ? 4 + : latitude > 60 + ? 3 + : 2); final distance = scale[max(0, min(20, level))].toDouble(); final start = map.project(center); final targetPoint = util.calculateEndingGlobalCoordinates(center, 90, distance); From 652a5383ea3131072678095e556dcbdb45e9f3c8 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 28 Sep 2020 14:14:27 +0900 Subject: [PATCH 10/19] info: show picture embedded in videos --- .../aves/channel/calls/MetadataHandler.java | 25 ++++++++++++++++++- .../aves/decoder/VideoThumbnailFetcher.java | 4 +-- .../thibault/aves/utils/MetadataHelper.java | 2 +- lib/services/metadata_service.dart | 12 +++++++++ .../fullscreen/info/metadata_section.dart | 6 +++-- .../fullscreen/info/metadata_thumbnail.dart | 15 ++++++++--- 6 files changed, 54 insertions(+), 10 deletions(-) diff --git a/android/app/src/main/java/deckers/thibault/aves/channel/calls/MetadataHandler.java b/android/app/src/main/java/deckers/thibault/aves/channel/calls/MetadataHandler.java index b69a320f3..90e06dc34 100644 --- a/android/app/src/main/java/deckers/thibault/aves/channel/calls/MetadataHandler.java +++ b/android/app/src/main/java/deckers/thibault/aves/channel/calls/MetadataHandler.java @@ -190,6 +190,9 @@ public class MetadataHandler implements MethodChannel.MethodCallHandler { case "getContentResolverMetadata": new Thread(() -> getContentResolverMetadata(call, new MethodResultWrapper(result))).start(); break; + case "getEmbeddedPictures": + new Thread(() -> getEmbeddedPictures(call, new MethodResultWrapper(result))).start(); + break; case "getExifThumbnails": new Thread(() -> getExifThumbnails(call, new MethodResultWrapper(result))).start(); break; @@ -415,7 +418,7 @@ public class MetadataHandler implements MethodChannel.MethodCallHandler { metadataMap.put(KEY_LATITUDE, latitude); metadataMap.put(KEY_LONGITUDE, longitude); } - } catch (NumberFormatException ex) { + } catch (NumberFormatException e) { // ignore } } @@ -530,6 +533,26 @@ public class MetadataHandler implements MethodChannel.MethodCallHandler { } } + private void getEmbeddedPictures(@NonNull MethodCall call, @NonNull MethodChannel.Result result) { + Uri uri = Uri.parse(call.argument("uri")); + List pictures = new ArrayList<>(); + MediaMetadataRetriever retriever = StorageUtils.openMetadataRetriever(context, uri); + if (retriever != null) { + try { + byte[] picture = retriever.getEmbeddedPicture(); + if (picture != null) { + pictures.add(picture); + } + } catch (Exception e) { + result.error("getVideoEmbeddedPictures-failure", "failed to get embedded picture for uri=" + uri, e); + } finally { + // cannot rely on `MediaMetadataRetriever` being `AutoCloseable` on older APIs + retriever.release(); + } + } + result.success(pictures); + } + private void getExifThumbnails(@NonNull MethodCall call, @NonNull MethodChannel.Result result) { Uri uri = Uri.parse(call.argument("uri")); List thumbnails = new ArrayList<>(); diff --git a/android/app/src/main/java/deckers/thibault/aves/decoder/VideoThumbnailFetcher.java b/android/app/src/main/java/deckers/thibault/aves/decoder/VideoThumbnailFetcher.java index 8ee573f45..9c357eb6f 100644 --- a/android/app/src/main/java/deckers/thibault/aves/decoder/VideoThumbnailFetcher.java +++ b/android/app/src/main/java/deckers/thibault/aves/decoder/VideoThumbnailFetcher.java @@ -40,8 +40,8 @@ class VideoThumbnailFetcher implements DataFetcher { } callback.onDataReady(new ByteArrayInputStream(bos.toByteArray())); } - } catch (Exception ex) { - callback.onLoadFailed(ex); + } catch (Exception e) { + callback.onLoadFailed(e); } finally { // cannot rely on `MediaMetadataRetriever` being `AutoCloseable` on older APIs retriever.release(); diff --git a/android/app/src/main/java/deckers/thibault/aves/utils/MetadataHelper.java b/android/app/src/main/java/deckers/thibault/aves/utils/MetadataHelper.java index 5bc895ff7..21c601d99 100644 --- a/android/app/src/main/java/deckers/thibault/aves/utils/MetadataHelper.java +++ b/android/app/src/main/java/deckers/thibault/aves/utils/MetadataHelper.java @@ -55,7 +55,7 @@ public class MetadataHelper { DateFormat parser = new SimpleDateFormat("yyyyMMdd'T'HHmmss", Locale.US); parser.setTimeZone((timeZone != null) ? timeZone : TimeZone.getTimeZone("GMT")); date = parser.parse(dateString); - } catch (ParseException ex) { + } catch (ParseException e) { // ignore } diff --git a/lib/services/metadata_service.dart b/lib/services/metadata_service.dart index 276fc2a34..c728a0704 100644 --- a/lib/services/metadata_service.dart +++ b/lib/services/metadata_service.dart @@ -89,6 +89,18 @@ class MetadataService { return {}; } + static Future> getEmbeddedPictures(String uri) async { + try { + final result = await platform.invokeMethod('getEmbeddedPictures', { + 'uri': uri, + }); + return (result as List).cast(); + } on PlatformException catch (e) { + debugPrint('getEmbeddedPictures failed with code=${e.code}, exception=${e.message}, details=${e.details}'); + } + return []; + } + static Future> getExifThumbnails(String uri) async { try { final result = await platform.invokeMethod('getExifThumbnails', { diff --git a/lib/widgets/fullscreen/info/metadata_section.dart b/lib/widgets/fullscreen/info/metadata_section.dart index 004b6793e..03cdc0bc0 100644 --- a/lib/widgets/fullscreen/info/metadata_section.dart +++ b/lib/widgets/fullscreen/info/metadata_section.dart @@ -36,8 +36,9 @@ class _MetadataSectionSliverState extends State with Auto static const int maxValueLength = 140; // directory names from metadata-extractor - static const exifThumbnailDirectory = 'Exif Thumbnail'; - static const xmpDirectory = 'XMP'; + static const exifThumbnailDirectory = 'Exif Thumbnail'; // from metadata-extractor + static const xmpDirectory = 'XMP'; // from metadata-extractor + static const videoDirectory = 'Video'; // additional generic video directory @override void initState() { @@ -106,6 +107,7 @@ class _MetadataSectionSliverState extends State with Auto SizedBox(height: 4), if (dir.name == exifThumbnailDirectory) MetadataThumbnails(source: MetadataThumbnailSource.exif, entry: entry), if (dir.name == xmpDirectory) MetadataThumbnails(source: MetadataThumbnailSource.xmp, entry: entry), + if (dir.name == videoDirectory) MetadataThumbnails(source: MetadataThumbnailSource.embedded, entry: entry), Container( alignment: Alignment.topLeft, padding: EdgeInsets.only(left: 8, right: 8, bottom: 8), diff --git a/lib/widgets/fullscreen/info/metadata_thumbnail.dart b/lib/widgets/fullscreen/info/metadata_thumbnail.dart index 8599ae9d9..2727d9a0c 100644 --- a/lib/widgets/fullscreen/info/metadata_thumbnail.dart +++ b/lib/widgets/fullscreen/info/metadata_thumbnail.dart @@ -5,7 +5,7 @@ import 'package:aves/model/image_entry.dart'; import 'package:aves/services/metadata_service.dart'; import 'package:flutter/material.dart'; -enum MetadataThumbnailSource { exif, xmp } +enum MetadataThumbnailSource { embedded, exif, xmp } class MetadataThumbnails extends StatefulWidget { final MetadataThumbnailSource source; @@ -24,15 +24,22 @@ class MetadataThumbnails extends StatefulWidget { class _MetadataThumbnailsState extends State { Future> _loader; + ImageEntry get entry => widget.entry; + + String get uri => entry.uri; + @override void initState() { super.initState(); switch (widget.source) { + case MetadataThumbnailSource.embedded: + _loader = MetadataService.getEmbeddedPictures(uri); + break; case MetadataThumbnailSource.exif: - _loader = MetadataService.getExifThumbnails(widget.entry.uri); + _loader = MetadataService.getExifThumbnails(uri); break; case MetadataThumbnailSource.xmp: - _loader = MetadataService.getXmpThumbnails(widget.entry.uri); + _loader = MetadataService.getXmpThumbnails(uri); break; } } @@ -43,7 +50,7 @@ class _MetadataThumbnailsState extends State { future: _loader, builder: (context, snapshot) { if (!snapshot.hasError && snapshot.connectionState == ConnectionState.done && snapshot.data.isNotEmpty) { - final turns = (widget.entry.orientationDegrees / 90).round(); + final turns = (entry.orientationDegrees / 90).round(); final devicePixelRatio = MediaQuery.of(context).devicePixelRatio; return Container( alignment: AlignmentDirectional.topStart, From 32a7dfcad479552e6b38d3c5daebcf64bacf82c2 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 28 Sep 2020 15:26:12 +0900 Subject: [PATCH 11/19] fixed orientation of DNG thumbnails from content resolver --- .../thibault/aves/channel/calls/ImageDecodeTask.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/java/deckers/thibault/aves/channel/calls/ImageDecodeTask.java b/android/app/src/main/java/deckers/thibault/aves/channel/calls/ImageDecodeTask.java index c6e9df3b5..7393c983d 100644 --- a/android/app/src/main/java/deckers/thibault/aves/channel/calls/ImageDecodeTask.java +++ b/android/app/src/main/java/deckers/thibault/aves/channel/calls/ImageDecodeTask.java @@ -120,10 +120,14 @@ public class ImageDecodeTask extends AsyncTask intentDataMap; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - handleIntent(getIntent()); - - BinaryMessenger messenger = Objects.requireNonNull(getFlutterEngine()).getDartExecutor().getBinaryMessenger(); - - new MethodChannel(messenger, AppAdapterHandler.CHANNEL).setMethodCallHandler(new AppAdapterHandler(this)); - new MethodChannel(messenger, AppShortcutHandler.CHANNEL).setMethodCallHandler(new AppShortcutHandler(this)); - new MethodChannel(messenger, ImageFileHandler.CHANNEL).setMethodCallHandler(new ImageFileHandler(this)); - new MethodChannel(messenger, MetadataHandler.CHANNEL).setMethodCallHandler(new MetadataHandler(this)); - new MethodChannel(messenger, StorageHandler.CHANNEL).setMethodCallHandler(new StorageHandler(this)); - - new StreamsChannel(messenger, ImageByteStreamHandler.CHANNEL).setStreamHandlerFactory(args -> new ImageByteStreamHandler(this, args)); - new StreamsChannel(messenger, ImageOpStreamHandler.CHANNEL).setStreamHandlerFactory(args -> new ImageOpStreamHandler(this, args)); - new StreamsChannel(messenger, MediaStoreStreamHandler.CHANNEL).setStreamHandlerFactory(args -> new MediaStoreStreamHandler(this, args)); - new StreamsChannel(messenger, StorageAccessStreamHandler.CHANNEL).setStreamHandlerFactory(args -> new StorageAccessStreamHandler(this, args)); - - new MethodChannel(messenger, VIEWER_CHANNEL).setMethodCallHandler( - (call, result) -> { - if (call.method.contentEquals("getIntentData")) { - result.success(intentDataMap); - intentDataMap = null; - } else if (call.method.contentEquals("pick")) { - result.success(intentDataMap); - intentDataMap = null; - String resultUri = call.argument("uri"); - if (resultUri != null) { - Intent intent = new Intent(); - intent.setData(Uri.parse(resultUri)); - intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - setResult(RESULT_OK, intent); - } else { - setResult(RESULT_CANCELED); - } - finish(); - } - }); - intentStreamHandler = new IntentStreamHandler(); - new EventChannel(messenger, INTENT_CHANNEL).setStreamHandler(intentStreamHandler); - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { - setupShortcuts(); - } - } - - @RequiresApi(Build.VERSION_CODES.N_MR1) - private void setupShortcuts() { - // do not use 'route' as extra key, as the Flutter framework acts on it - - ShortcutInfoCompat search = new ShortcutInfoCompat.Builder(this, "search") - .setShortLabel(getString(R.string.search_shortcut_short_label)) - .setIcon(IconCompat.createWithResource(this, R.mipmap.ic_shortcut_search)) - .setIntent(new Intent(Intent.ACTION_MAIN, null, this, MainActivity.class) - .putExtra("page", "/search")) - .build(); - - ShortcutInfoCompat videos = new ShortcutInfoCompat.Builder(this, "videos") - .setShortLabel(getString(R.string.videos_shortcut_short_label)) - .setIcon(IconCompat.createWithResource(this, R.mipmap.ic_shortcut_movie)) - .setIntent(new Intent(Intent.ACTION_MAIN, null, this, MainActivity.class) - .putExtra("page", "/collection") - .putExtra("filters", new String[]{"{\"type\":\"mime\",\"mime\":\"video/*\"}"})) - .build(); - - ShortcutManagerCompat.setDynamicShortcuts(this, Arrays.asList(videos, search)); - } - - @Override - protected void onNewIntent(@NonNull Intent intent) { - super.onNewIntent(intent); - handleIntent(intent); - intentStreamHandler.notifyNewIntent(); - } - - private void handleIntent(Intent intent) { - Log.i(LOG_TAG, "handleIntent intent=" + intent); - if (intent == null) return; - String action = intent.getAction(); - if (action == null) return; - switch (action) { - case Intent.ACTION_MAIN: - String page = intent.getStringExtra("page"); - if (page != null) { - intentDataMap = new HashMap<>(); - intentDataMap.put("page", page); - String[] filters = intent.getStringArrayExtra("filters"); - intentDataMap.put("filters", filters != null ? new ArrayList<>(Arrays.asList(filters)) : null); - } - break; - case Intent.ACTION_VIEW: - Uri uri = intent.getData(); - String mimeType = intent.getType(); - if (uri != null && mimeType != null) { - intentDataMap = new HashMap<>(); - intentDataMap.put("action", "view"); - intentDataMap.put("uri", uri.toString()); - intentDataMap.put("mimeType", mimeType); - } - break; - case Intent.ACTION_GET_CONTENT: - case Intent.ACTION_PICK: - intentDataMap = new HashMap<>(); - intentDataMap.put("action", "pick"); - intentDataMap.put("mimeType", intent.getType()); - break; - } - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - if (requestCode == PermissionManager.VOLUME_ROOT_PERMISSION_REQUEST_CODE) { - if (resultCode != RESULT_OK || data.getData() == null) { - PermissionManager.onPermissionResult(requestCode, null); - return; - } - - Uri treeUri = data.getData(); - - // save access permissions across reboots - final int takeFlags = data.getFlags() - & (Intent.FLAG_GRANT_READ_URI_PERMISSION - | Intent.FLAG_GRANT_WRITE_URI_PERMISSION); - getContentResolver().takePersistableUriPermission(treeUri, takeFlags); - - // resume pending action - PermissionManager.onPermissionResult(requestCode, treeUri); - } - } -} - diff --git a/android/app/src/main/java/deckers/thibault/aves/channel/calls/StorageHandler.java b/android/app/src/main/java/deckers/thibault/aves/channel/calls/StorageHandler.java index c3e785d4f..c32c82ab4 100644 --- a/android/app/src/main/java/deckers/thibault/aves/channel/calls/StorageHandler.java +++ b/android/app/src/main/java/deckers/thibault/aves/channel/calls/StorageHandler.java @@ -52,10 +52,17 @@ public class StorageHandler implements MethodChannel.MethodCallHandler { } break; } - case "scanFile": { + case "revokeDirectoryAccess": + String path = call.argument("path"); + PermissionManager.revokeDirectoryAccess(context, path); + result.success(true); + break; + case "getGrantedDirectories": + result.success(new ArrayList<>(PermissionManager.getGrantedDirs(context))); + break; + case "scanFile": scanFile(call, new MethodResultWrapper(result)); break; - } default: result.notImplemented(); break; diff --git a/android/app/src/main/java/deckers/thibault/aves/utils/PermissionManager.java b/android/app/src/main/java/deckers/thibault/aves/utils/PermissionManager.java index b7e9cc979..4692a2add 100644 --- a/android/app/src/main/java/deckers/thibault/aves/utils/PermissionManager.java +++ b/android/app/src/main/java/deckers/thibault/aves/utils/PermissionManager.java @@ -71,11 +71,11 @@ public class PermissionManager { } public static Optional getGrantedDirForPath(@NonNull Context context, @NonNull String anyPath) { - return getGrantedDirs(context).stream().filter(anyPath::startsWith).findFirst(); + return getAccessibleDirs(context).stream().filter(anyPath::startsWith).findFirst(); } public static List> getInaccessibleDirectories(@NonNull Context context, @NonNull List dirPaths) { - Set grantedDirs = getGrantedDirs(context); + Set accessibleDirs = getAccessibleDirs(context); // find set of inaccessible directories for each volume Map> dirsPerVolume = new HashMap<>(); @@ -83,7 +83,7 @@ public class PermissionManager { if (!dirPath.endsWith(File.separator)) { dirPath += File.separator; } - if (grantedDirs.stream().noneMatch(dirPath::startsWith)) { + if (accessibleDirs.stream().noneMatch(dirPath::startsWith)) { // inaccessible dirs StorageUtils.PathSegments segments = new StorageUtils.PathSegments(context, dirPath); Set dirSet = dirsPerVolume.getOrDefault(segments.volumePath, new HashSet<>()); @@ -135,22 +135,34 @@ public class PermissionManager { return inaccessibleDirs; } - private static Set getGrantedDirs(Context context) { - HashSet accessibleDirs = new HashSet<>(); - // find paths matching URIs granted by the user + public static void revokeDirectoryAccess(Context context, String path) { + Optional uri = StorageUtils.convertDirPathToTreeUri(context, path); + if (uri.isPresent()) { + int flags = Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION; + context.getContentResolver().releasePersistableUriPermission(uri.get(), flags); + } + } + + // returns paths matching URIs granted by the user + public static Set getGrantedDirs(Context context) { + Set grantedDirs = new HashSet<>(); for (UriPermission uriPermission : context.getContentResolver().getPersistedUriPermissions()) { Optional dirPath = StorageUtils.convertTreeUriToDirPath(context, uriPermission.getUri()); - dirPath.ifPresent(accessibleDirs::add); + dirPath.ifPresent(grantedDirs::add); } + return grantedDirs; + } + // returns paths accessible to the app (granted by the user or by default) + private static Set getAccessibleDirs(Context context) { + Set accessibleDirs = new HashSet<>(getGrantedDirs(context)); // from Android R, we no longer have access permission by default on primary volume if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.Q) { String primaryPath = StorageUtils.getPrimaryVolumePath(); accessibleDirs.add(primaryPath); } - - Log.d(LOG_TAG, "getGrantedDirs accessibleDirs=" + accessibleDirs); + Log.d(LOG_TAG, "getAccessibleDirs accessibleDirs=" + accessibleDirs); return accessibleDirs; } diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/MainActivity.kt b/android/app/src/main/kotlin/deckers/thibault/aves/MainActivity.kt new file mode 100644 index 000000000..fdb0bba50 --- /dev/null +++ b/android/app/src/main/kotlin/deckers/thibault/aves/MainActivity.kt @@ -0,0 +1,159 @@ +package deckers.thibault.aves + +import android.content.Intent +import android.net.Uri +import android.os.Build +import android.os.Bundle +import android.util.Log +import androidx.annotation.RequiresApi +import androidx.core.content.pm.ShortcutInfoCompat +import androidx.core.content.pm.ShortcutManagerCompat +import androidx.core.graphics.drawable.IconCompat +import app.loup.streams_channel.StreamsChannel +import deckers.thibault.aves.channel.calls.* +import deckers.thibault.aves.channel.streams.* +import deckers.thibault.aves.utils.PermissionManager +import deckers.thibault.aves.utils.Utils +import io.flutter.embedding.android.FlutterActivity +import io.flutter.plugin.common.EventChannel +import io.flutter.plugin.common.MethodChannel + +class MainActivity : FlutterActivity() { + companion object { + private val LOG_TAG = Utils.createLogTag(MainActivity::class.java) + const val INTENT_CHANNEL = "deckers.thibault/aves/intent" + const val VIEWER_CHANNEL = "deckers.thibault/aves/viewer" + } + + private val intentStreamHandler = IntentStreamHandler() + private var intentDataMap: MutableMap? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + handleIntent(intent) + + val messenger = flutterEngine!!.dartExecutor.binaryMessenger + + MethodChannel(messenger, AppAdapterHandler.CHANNEL).setMethodCallHandler(AppAdapterHandler(this)) + MethodChannel(messenger, AppShortcutHandler.CHANNEL).setMethodCallHandler(AppShortcutHandler(this)) + MethodChannel(messenger, ImageFileHandler.CHANNEL).setMethodCallHandler(ImageFileHandler(this)) + MethodChannel(messenger, MetadataHandler.CHANNEL).setMethodCallHandler(MetadataHandler(this)) + MethodChannel(messenger, StorageHandler.CHANNEL).setMethodCallHandler(StorageHandler(this)) + + StreamsChannel(messenger, ImageByteStreamHandler.CHANNEL).setStreamHandlerFactory { args -> ImageByteStreamHandler(this, args) } + StreamsChannel(messenger, ImageOpStreamHandler.CHANNEL).setStreamHandlerFactory { args -> ImageOpStreamHandler(this, args) } + StreamsChannel(messenger, MediaStoreStreamHandler.CHANNEL).setStreamHandlerFactory { args -> MediaStoreStreamHandler(this, args) } + StreamsChannel(messenger, StorageAccessStreamHandler.CHANNEL).setStreamHandlerFactory { args -> StorageAccessStreamHandler(this, args) } + + MethodChannel(messenger, VIEWER_CHANNEL).setMethodCallHandler { call, result -> + when (call.method) { + "getIntentData" -> { + result.success(intentDataMap) + intentDataMap = null + } + "pick" -> { + result.success(intentDataMap) + intentDataMap = null + val resultUri = call.argument("uri") + if (resultUri != null) { + val intent = Intent().apply { + data = Uri.parse(resultUri) + addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) + } + setResult(RESULT_OK, intent) + } else { + setResult(RESULT_CANCELED) + } + finish() + } + + } + } + EventChannel(messenger, INTENT_CHANNEL).setStreamHandler(intentStreamHandler) + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { + setupShortcuts() + } + } + + @RequiresApi(Build.VERSION_CODES.N_MR1) + private fun setupShortcuts() { + // do not use 'route' as extra key, as the Flutter framework acts on it + + val search = ShortcutInfoCompat.Builder(this, "search") + .setShortLabel(getString(R.string.search_shortcut_short_label)) + .setIcon(IconCompat.createWithResource(this, R.mipmap.ic_shortcut_search)) + .setIntent(Intent(Intent.ACTION_MAIN, null, this, MainActivity::class.java) + .putExtra("page", "/search")) + .build() + + val videos = ShortcutInfoCompat.Builder(this, "videos") + .setShortLabel(getString(R.string.videos_shortcut_short_label)) + .setIcon(IconCompat.createWithResource(this, R.mipmap.ic_shortcut_movie)) + .setIntent(Intent(Intent.ACTION_MAIN, null, this, MainActivity::class.java) + .putExtra("page", "/collection") + .putExtra("filters", arrayOf("{\"type\":\"mime\",\"mime\":\"video/*\"}"))) + .build() + + ShortcutManagerCompat.setDynamicShortcuts(this, listOf(videos, search)) + } + + override fun onNewIntent(intent: Intent) { + super.onNewIntent(intent) + handleIntent(intent) + intentStreamHandler.notifyNewIntent() + } + + private fun handleIntent(intent: Intent?) { + Log.i(LOG_TAG, "handleIntent intent=$intent") + if (intent == null) return + when (intent.action) { + Intent.ACTION_MAIN -> { + val page = intent.getStringExtra("page") + if (page != null) { + intentDataMap = hashMapOf( + "page" to page, + "filters" to intent.getStringArrayExtra("filters")?.toList(), + ) + } + } + Intent.ACTION_VIEW -> { + val uri = intent.data + val mimeType = intent.type + if (uri != null && mimeType != null) { + intentDataMap = hashMapOf( + "action" to "view", + "uri" to uri.toString(), + "mimeType" to mimeType, + ) + } + } + Intent.ACTION_GET_CONTENT, Intent.ACTION_PICK -> { + intentDataMap = hashMapOf( + "action" to "pick", + "mimeType" to intent.type, + ) + } + } + } + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) { + if (requestCode == PermissionManager.VOLUME_ROOT_PERMISSION_REQUEST_CODE) { + val treeUri = data.data + if (resultCode != RESULT_OK || treeUri == null) { + PermissionManager.onPermissionResult(requestCode, null) + return + } + + // save access permissions across reboots + val takeFlags = (data.flags + and (Intent.FLAG_GRANT_READ_URI_PERMISSION + or Intent.FLAG_GRANT_WRITE_URI_PERMISSION)) + contentResolver.takePersistableUriPermission(treeUri, takeFlags) + + // resume pending action + PermissionManager.onPermissionResult(requestCode, treeUri) + } + } +} \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index ca6b56711..a87e9aa15 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,13 +1,15 @@ buildscript { + ext.kotlin_version = '1.4.10' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.6.3' + classpath 'com.android.tools.build:gradle:3.6.3' // do not upgrade to 4+ until this is fixed: https://github.com/flutter/flutter/issues/58247 + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.3' - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0' } } diff --git a/ios/.gitignore b/ios/.gitignore deleted file mode 100644 index e96ef602b..000000000 --- a/ios/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ -.sconsign.dblite -.tags* -**/.vagrant/ -**/DerivedData/ -Icon? -**/Pods/ -**/.symlinks/ -profile -xcuserdata -**/.generated/ -Flutter/App.framework -Flutter/Flutter.framework -Flutter/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 6b4c0f78a..000000000 --- a/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 8.0 - - diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig deleted file mode 100644 index e8efba114..000000000 --- a/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig deleted file mode 100644 index 399e9340e..000000000 --- a/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile deleted file mode 100644 index 6697f0a53..000000000 --- a/ios/Podfile +++ /dev/null @@ -1,87 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '9.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def parse_KV_file(file, separator='=') - file_abs_path = File.expand_path(file) - if !File.exists? file_abs_path - return []; - end - generated_key_values = {} - skip_line_start_symbols = ["#", "/"] - File.foreach(file_abs_path) do |line| - next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } - plugin = line.split(pattern=separator) - if plugin.length == 2 - podname = plugin[0].strip() - path = plugin[1].strip() - podpath = File.expand_path("#{path}", file_abs_path) - generated_key_values[podname] = podpath - else - puts "Invalid plugin specification: #{line}" - end - end - generated_key_values -end - -target 'Runner' do - use_frameworks! - use_modular_headers! - - # Flutter Pod - - copied_flutter_dir = File.join(__dir__, 'Flutter') - copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') - copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') - unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) - # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. - # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. - # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. - - generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') - unless File.exist?(generated_xcode_build_settings_path) - raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) - cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; - - unless File.exist?(copied_framework_path) - FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) - end - unless File.exist?(copied_podspec_path) - FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) - end - end - - # Keep pod path relative so it can be checked into Podfile.lock. - pod 'Flutter', :path => 'Flutter' - - # Plugin Pods - - # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock - # referring to absolute paths on developers' machines. - system('rm -rf .symlinks') - system('mkdir -p .symlinks/plugins') - plugin_pods = parse_KV_file('../.flutter-plugins') - plugin_pods.each do |name, path| - symlink = File.join('.symlinks', 'plugins', name) - File.symlink(path, symlink) - pod name, :path => File.join(symlink, 'ios') - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['ENABLE_BITCODE'] = 'NO' - end - end -end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 1e25880d2..000000000 --- a/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,506 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.aves; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.aves; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.aves; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16e..000000000 --- a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5e..000000000 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index a28140cfd..000000000 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16e..000000000 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5e..000000000 --- a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift deleted file mode 100644 index 70693e4a8..000000000 --- a/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import UIKit -import Flutter - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab2..000000000 --- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada4725e9b0ddb1deab583e5b5102493aa332..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10932 zcmeHN2~<R zh`|8`A_PQ1nSu(UMFx?8j8PC!!VDphaL#`F42fd#7Vlc`zIE4n%Y~eiz4y1j|NDpi z?<@|pSJ-HM`qifhf@m%MamgwK83`XpBA<+azdF#2QsT{X@z0A9Bq>~TVErigKH1~P zRX-!h-f0NJ4Mh++{D}J+K>~~rq}d%o%+4dogzXp7RxX4C>Km5XEI|PAFDmo;DFm6G zzjVoB`@qW98Yl0Kvc-9w09^PrsobmG*Eju^=3f?0o-t$U)TL1B3;sZ^!++3&bGZ!o-*6w?;oOhf z=A+Qb$scV5!RbG+&2S}BQ6YH!FKb0``VVX~T$dzzeSZ$&9=X$3)_7Z{SspSYJ!lGE z7yig_41zpQ)%5dr4ff0rh$@ky3-JLRk&DK)NEIHecf9c*?Z1bUB4%pZjQ7hD!A0r-@NF(^WKdr(LXj|=UE7?gBYGgGQV zidf2`ZT@pzXf7}!NH4q(0IMcxsUGDih(0{kRSez&z?CFA0RVXsVFw3^u=^KMtt95q z43q$b*6#uQDLoiCAF_{RFc{!H^moH_cmll#Fc^KXi{9GDl{>%+3qyfOE5;Zq|6#Hb zp^#1G+z^AXfRKaa9HK;%b3Ux~U@q?xg<2DXP%6k!3E)PA<#4$ui8eDy5|9hA5&{?v z(-;*1%(1~-NTQ`Is1_MGdQ{+i*ccd96ab$R$T3=% zw_KuNF@vI!A>>Y_2pl9L{9h1-C6H8<)J4gKI6{WzGBi<@u3P6hNsXG=bRq5c+z;Gc3VUCe;LIIFDmQAGy+=mRyF++u=drBWV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Y6J6TdHWTjXfX~-=1A1Bw`EW8rn}MqeI34nh zexFeA?&C3B2(E?0{drE@DA2pu(A#ElY&6el60Rn|Qpn-FkfQ8M93AfWIr)drgDFEU zghdWK)^71EWCP(@(=c4kfH1Y(4iugD4fve6;nSUpLT%!)MUHs1!zJYy4y||C+SwQ! z)KM&$7_tyM`sljP2fz6&Z;jxRn{Wup8IOUx8D4uh&(=O zx-7$a;U><*5L^!%xRlw)vAbh;sdlR||& ze}8_8%)c2Fwy=F&H|LM+p{pZB5DKTx>Y?F1N%BlZkXf!}JeGuMZk~LPi7{cidvUGB zAJ4LVeNV%XO>LTrklB#^-;8nb;}6l;1oW&WS=Mz*Az!4cqqQzbOSFq`$Q%PfD7srM zpKgP-D_0XPTRX*hAqeq0TDkJ;5HB1%$3Np)99#16c{ zJImlNL(npL!W|Gr_kxl1GVmF5&^$^YherS7+~q$p zt}{a=*RiD2Ikv6o=IM1kgc7zqpaZ;OB)P!1zz*i3{U()Dq#jG)egvK}@uFLa`oyWZ zf~=MV)|yJn`M^$N%ul5);JuQvaU1r2wt(}J_Qgyy`qWQI`hEeRX0uC@c1(dQ2}=U$ tNIIaX+dr)NRWXcxoR{>fqI{SF_dm1Ylv~=3YHI)h002ovPDHLkV1g(pWS;;4 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0bca859a3f474b03065bef75ba58a9e4c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1588 zcmV-42Fv-0P)C1SqPt}wig>|5Crh^=oyX$BK<}M8eLU3e2hGT;=G|!_SP)7zNI6fqUMB=)y zRAZ>eDe#*r`yDAVgB_R*LB*MAc)8(b{g{9McCXW!lq7r(btRoB9!8B-#AI6JMb~YFBEvdsV)`mEQO^&#eRKx@b&x- z5lZm*!WfD8oCLzfHGz#u7sT0^VLMI1MqGxF^v+`4Y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og^td-^QbUtkTirdyK^mTHAOuptDflut!#^lnKqU md>ggs(5nOWAqO?umG&QVYK#ibz}*4>0000U6E9hRK9^#O7(mu>ETqrXGsduA8$)?`v2seloOCza43C{NQ$$gAOH**MCn0Q?+L7dl7qnbRdqZ8LSVp1ItDxhxD?t@5_yHg6A8yI zC*%Wgg22K|8E#!~cTNYR~@Y9KepMPrrB8cABapAFa=`H+UGhkXUZV1GnwR1*lPyZ;*K(i~2gp|@bzp8}og7e*#% zEnr|^CWdVV!-4*Y_7rFvlww2Ze+>j*!Z!pQ?2l->4q#nqRu9`ELo6RMS5=br47g_X zRw}P9a7RRYQ%2Vsd0Me{_(EggTnuN6j=-?uFS6j^u69elMypu?t>op*wBx<=Wx8?( ztpe^(fwM6jJX7M-l*k3kEpWOl_Vk3@(_w4oc}4YF4|Rt=2V^XU?#Yz`8(e?aZ@#li0n*=g^qOcVpd-Wbok=@b#Yw zqn8u9a)z>l(1kEaPYZ6hwubN6i<8QHgsu0oE) ziJ(p;Wxm>sf!K+cw>R-(^Y2_bahB+&KI9y^);#0qt}t-$C|Bo71lHi{_+lg#f%RFy z0um=e3$K3i6K{U_4K!EX?F&rExl^W|G8Z8;`5z-k}OGNZ0#WVb$WCpQu-_YsiqKP?BB# vzVHS-CTUF4Ozn5G+mq_~Qqto~ahA+K`|lyv3(-e}00000NkvXXu0mjfd`9t{ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7edb86cdfe0d15b4b0d98334a86163658..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1716 zcmds$`#;kQ7{|XelZftyR5~xW7?MLxS4^|Hw3&P7^y)@A9Fj{Xm1~_CIV^XZ%SLBn zA;!r`GqGHg=7>xrB{?psZQs88ZaedDoagm^KF{a*>G|dJWRSe^I$DNW008I^+;Kjt z>9p3GNR^I;v>5_`+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U zghdWK)^71EWCP(@(=c4kfH1Y(4iugD4fve6;nSUpLT%!)MUHs1!zJYy4y||C+SwQ! z)KM&$7_tyM`sljP2fz6&Z;jxRn{Wup8IOUx8D4uh&(=O zx-7$a;U><*5L^!%xRlw)vAbh;sdlR||& ze}8_8%)c2Fwy=F&H|LM+p{pZB5DKTx>Y?F1N%BlZkXf!}JeGuMZk~LPi7{cidvUGB zAJ4LVeNV%XO>LTrklB#^-;8nb;}6l;1oW&WS=Mz*Az!4cqqQzbOSFq`$Q%PfD7srM zpKgP-D_0XPTRX*hAqeq0TDkJ;5HB1%$3Np)99#16c{ zJImlNL(npL!W|Gr_kxl1GVmF5&^$^YherS7+~q$p zt}{a=*RiD2Ikv6o=IM1kgc7zqpaZ;OB)P!1zz*i3{U()Dq#jG)egvK}@uFLa`oyWZ zf~=MV)|yJn`M^$N%ul5);JuQvaU1r2wt(}J_Qgyy`qWQI`hEeRX0uC@c1(dQ2}=U$ tNIIaX+dr)NRWXcxoR{>fqI{SF_dm1Ylv~=3YHI)h002ovPDHLkV1g(pWS;;4 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f5cee1c98386d13b17e89f719e83555b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1895 zcmV-t2blPYP)FQtfgmafE#=YDCq`qUBt#QpG%*H6QHY765~R=q zZ6iudfM}q!Pz#~9JgOi8QJ|DSu?1-*(kSi1K4#~5?#|rh?sS)(-JQqX*}ciXJ56_H zdw=^s_srbAdqxlvGyrgGet#6T7_|j;95sL%MtM;q86vOxKM$f#puR)Bjv9Zvz9-di zXOTSsZkM83)E9PYBXC<$6(|>lNLVBb&&6y{NByFCp%6+^ALR@NCTse_wqvNmSWI-m z!$%KlHFH2omF!>#%1l3LTZg(s7eof$7*xB)ZQ0h?ejh?Ta9fDv59+u#MokW+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bRlVoxasyhcUF1+)o`&3r0colr}QJ3hcSdLu;9;td>kf@Tcn<@9sIx&=m z;AD;SCh95=&p;$r{Xz3iWCO^MX83AGJ(yH&eTXgv|0=34#-&WAmw{)U7OU9!Wz^!7 zZ%jZFi@JR;>Mhi7S>V7wQ176|FdW2m?&`qa(ScO^CFPR80HucLHOTy%5s*HR0^8)i h0WYBP*#0Ks^FNSabJA*5${_#%002ovPDHLkV1oKhTl@e3 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b8609df07bf62e5100a53a01510388bd2b22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2665 zcmV-v3YPVWP)oFh3q0MFesq&64WThn3$;G69TfjsAv=f2G9}p zgSx99+!YV6qME!>9MD13x)k(+XE7W?_O4LoLb5ND8 zaV{9+P@>42xDfRiYBMSgD$0!vssptcb;&?u9u(LLBKmkZ>RMD=kvD3h`sk6!QYtBa ztlZI#nu$8lJ^q2Z79UTgZe>BU73(Aospiq+?SdMt8lDZ;*?@tyWVZVS_Q7S&*tJaiRlJ z+aSMOmbg3@h5}v;A*c8SbqM3icg-`Cnwl;7Ts%A1RkNIp+Txl-Ckkvg4oxrqGA5ewEgYqwtECD<_3Egu)xGllKt&J8g&+=ac@Jq4-?w6M3b*>w5 z69N3O%=I^6&UL5gZ!}trC7bUj*12xLdkNs~Bz4QdJJ*UDZox2UGR}SNg@lmOvhCc~ z*f_UeXv(=#I#*7>VZx2ObEN~UoGUTl=-@)E;YtCRZ>SVp$p9yG5hEFZ!`wI!spd)n zSk+vK0Vin7FL{7f&6OB%f;SH22dtbcF<|9fi2Fp%q4kxL!b1#l^)8dUwJ zwEf{(wJj@8iYDVnKB`eSU+;ml-t2`@%_)0jDM`+a46xhDbBj2+&Ih>1A>6aky#(-SYyE{R3f#y57wfLs z6w1p~$bp;6!9DX$M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ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b8609df07bf62e5100a53a01510388bd2b22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2665 zcmV-v3YPVWP)oFh3q0MFesq&64WThn3$;G69TfjsAv=f2G9}p zgSx99+!YV6qME!>9MD13x)k(+XE7W?_O4LoLb5ND8 zaV{9+P@>42xDfRiYBMSgD$0!vssptcb;&?u9u(LLBKmkZ>RMD=kvD3h`sk6!QYtBa ztlZI#nu$8lJ^q2Z79UTgZe>BU73(Aospiq+?SdMt8lDZ;*?@tyWVZVS_Q7S&*tJaiRlJ z+aSMOmbg3@h5}v;A*c8SbqM3icg-`Cnwl;7Ts%A1RkNIp+Txl-Ckkvg4oxrqGA5ewEgYqwtECD<_3Egu)xGllKt&J8g&+=ac@Jq4-?w6M3b*>w5 z69N3O%=I^6&UL5gZ!}trC7bUj*12xLdkNs~Bz4QdJJ*UDZox2UGR}SNg@lmOvhCc~ z*f_UeXv(=#I#*7>VZx2ObEN~UoGUTl=-@)E;YtCRZ>SVp$p9yG5hEFZ!`wI!spd)n zSk+vK0Vin7FL{7f&6OB%f;SH22dtbcF<|9fi2Fp%q4kxL!b1#l^)8dUwJ zwEf{(wJj@8iYDVnKB`eSU+;ml-t2`@%_)0jDM`+a46xhDbBj2+&Ih>1A>6aky#(-SYyE{R3f#y57wfLs z6w1p~$bp;6!9DX$M+J~S@D6vJAaElETnsX4h9a5tvPhC3L@qB~bOzkL@^z0k_hS{T4PF*TDrgdXp+dzsE? z>V|VR035Pl9n5&-RePFdS{7KAr2vPOqR9=M$vXA1Yy5>w;EsF`;OK{2pkn-kpp9Pw z)r;5JfJKKaT$4qCb{TaXHjb$QA{y0EYy*+b1XI;6Ah- zw13P)xT`>~eFoJC!>{2XL(a_#upp3gaR1#5+L(Jmzp4TBnx{~WHedpJ1ch8JFk~Sw z>F+gN+i+VD?gMXwcIhn8rz`>e>J^TI3E-MW>f}6R-pL}>WMOa0k#jN+`RyUVUC;#D zg|~oS^$6%wpF{^Qr+}X>0PKcr3Fc&>Z>uv@C);pwDs@2bZWhYP!rvGx?_|q{d`t<*XEb#=aOb=N+L@CVBGqImZf&+a zCQEa3$~@#kC);pasdG=f6tuIi0PO-y&tvX%>Mv=oY3U$nD zJ#gMegnQ46pq+3r=;zmgcG+zRc9D~c>z+jo9&D+`E6$LmyFqlmCYw;-Zooma{sR@~ z)_^|YL1&&@|GXo*pivH7k!msl+$Sew3%XJnxajt0K%3M6Bd&YFNy9}tWG^aovK2eX z1aL1%7;KRDrA@eG-Wr6w+;*H_VD~qLiVI`{_;>o)k`{8xa3EJT1O_>#iy_?va0eR? zDV=N%;Zjb%Z2s$@O>w@iqt!I}tLjGk!=p`D23I}N4Be@$(|iSA zf3Ih7b<{zqpDB4WF_5X1(peKe+rASze%u8eKLn#KKXt;UZ+Adf$_TO+vTqshLLJ5c z52HucO=lrNVae5XWOLm!V@n-ObU11!b+DN<$RuU+YsrBq*lYT;?AwJpmNKniF0Q1< zJCo>Q$=v$@&y=sj6{r!Y&y&`0$-I}S!H_~pI&2H8Z1C|BX4VgZ^-! zje3-;x0PBD!M`v*J_)rL^+$<1VJhH*2Fi~aA7s&@_rUHYJ9zD=M%4AFQ`}k8OC$9s XsPq=LnkwKG00000NkvXXu0mjfhAk5^ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164a5a98e212cca15ea7bf2ab5de5108680..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3831 zcmVjJBgitF5mAp-i>4+KS_oR{|13AP->1TD4=w)g|)JHOx|a2Wk1Va z!k)vP$UcQ#mdj%wNQoaJ!w>jv_6&JPyutpQps?s5dmDQ>`%?Bvj>o<%kYG!YW6H-z zu`g$@mp`;qDR!51QaS}|ZToSuAGcJ7$2HF0z`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kF9`eWrW zfr^D%LNfOcTNvtx0JXR35J0~Jpi2#P3Q&80w+nqNfc}&G0A~*)lGHKv=^FE+b(37|)zL;KLF>oiGfb(?&1 zV3XRu!Sw>@quKiab%g6jun#oZ%!>V#A%+lNc?q>6+VvyAn=kf_6z^(TZUa4Eelh{{ zqFX-#dY(EV@7l$NE&kv9u9BR8&Ojd#ZGJ6l8_BW}^r?DIS_rU2(XaGOK z225E@kH5Opf+CgD^{y29jD4gHbGf{1MD6ggQ&%>UG4WyPh5q_tb`{@_34B?xfSO*| zZv8!)q;^o-bz`MuxXk*G^}(6)ACb@=Lfs`Hxoh>`Y0NE8QRQ!*p|SH@{r8=%RKd4p z+#Ty^-0kb=-H-O`nAA3_6>2z(D=~Tbs(n8LHxD0`R0_ATFqp-SdY3(bZ3;VUM?J=O zKCNsxsgt@|&nKMC=*+ZqmLHhX1KHbAJs{nGVMs6~TiF%Q)P@>!koa$%oS zjXa=!5>P`vC-a}ln!uH1ooeI&v?=?v7?1n~P(wZ~0>xWxd_Aw;+}9#eULM7M8&E?Y zC-ZLhi3RoM92SXUb-5i-Lmt5_rfjE{6y^+24`y$1lywLyHO!)Boa7438K4#iLe?rh z2O~YGSgFUBH?og*6=r9rme=peP~ah`(8Zt7V)j5!V0KPFf_mebo3z95U8(up$-+EA^9dTRLq>Yl)YMBuch9%=e5B`Vnb>o zt03=kq;k2TgGe4|lGne&zJa~h(UGutjP_zr?a7~#b)@15XNA>Dj(m=gg2Q5V4-$)D|Q9}R#002ovPDHLkV1o7DH3k3x diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d39da7941ef3f6dcb7f06a192d8dcb308d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1888 zcmV-m2cP(fP)x~L`~4d)Rspd&<9kFh{hn*KP1LP0~$;u(LfAu zp%fx&qLBcRH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^2sd8?N!_w~4v+f-HCF|a$TNZDoNl$I1Uq87euoNgKb6&r26TNrfkUa@o zfdiFA@p{K&mH3b8i!lcoz)V{n8Q@g(vR4ns4r6w;K z>1~ecQR0-<^J|Ndg5fvVUM9g;lbu-){#ghGw(fg>L zh)T5Ljb%lWE;V9L!;Cqk>AV1(rULYF07ZBJbGb9qbSoLAd;in9{)95YqX$J43-dY7YU*k~vrM25 zxh5_IqO0LYZW%oxQ5HOzmk4x{atE*vipUk}sh88$b2tn?!ujEHn`tQLe&vo}nMb&{ zio`xzZ&GG6&ZyN3jnaQy#iVqXE9VT(3tWY$n-)uWDQ|tc{`?fq2F`oQ{;d3aWPg4Hp-(iE{ry>MIPWL> iW8Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad3b03bb08bbddbbf4ac48dd78b3d838..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad3b03bb08bbddbbf4ac48dd78b3d838..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b7..000000000 --- a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7c..000000000 --- a/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516f..000000000 --- a/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist deleted file mode 100644 index c7d5fc6c2..000000000 --- a/ios/Runner/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - aves - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index 308a2a560..000000000 --- a/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" diff --git a/lib/services/android_file_service.dart b/lib/services/android_file_service.dart index 03fbf287d..979bb1331 100644 --- a/lib/services/android_file_service.dart +++ b/lib/services/android_file_service.dart @@ -18,6 +18,27 @@ class AndroidFileService { return []; } + static Future> getGrantedDirectories() async { + try { + final result = await platform.invokeMethod('getGrantedDirectories'); + return (result as List).cast(); + } on PlatformException catch (e) { + debugPrint('getGrantedDirectories failed with code=${e.code}, exception=${e.message}, details=${e.details}}'); + } + return []; + } + + static Future revokeDirectoryAccess(String path) async { + try { + await platform.invokeMethod('revokeDirectoryAccess', { + 'path': path, + }); + } on PlatformException catch (e) { + debugPrint('revokeDirectoryAccess failed with code=${e.code}, exception=${e.message}, details=${e.details}}'); + } + return; + } + // returns a list of directories, // each directory is a map with "volumePath", "volumeDescription", "relativeDir" static Future> getInaccessibleDirectories(Iterable dirPaths) async { diff --git a/lib/widgets/settings/access_grants.dart b/lib/widgets/settings/access_grants.dart new file mode 100644 index 000000000..69e03ade7 --- /dev/null +++ b/lib/widgets/settings/access_grants.dart @@ -0,0 +1,65 @@ +import 'package:aves/services/android_file_service.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +class GrantedDirectories extends StatefulWidget { + @override + _GrantedDirectoriesState createState() => _GrantedDirectoriesState(); +} + +class _GrantedDirectoriesState extends State { + Future> _pathLoader; + List _lastPaths; + + @override + void initState() { + super.initState(); + _load(); + } + + void _load() => _pathLoader = AndroidFileService.getGrantedDirectories(); + + @override + Widget build(BuildContext context) { + final textTheme = Theme.of(context).textTheme; + return Padding( + padding: EdgeInsets.symmetric(horizontal: 16), + child: FutureBuilder>( + future: _pathLoader, + builder: (context, snapshot) { + if (snapshot.hasError) { + return Text(snapshot.error.toString()); + } + if (snapshot.connectionState != ConnectionState.done && _lastPaths == null) { + return SizedBox.shrink(); + } + _lastPaths = snapshot.data..sort(); + final count = _lastPaths.length; + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Aves has access to ${Intl.plural(count, zero: 'no directories.', one: 'one directory:', other: '$count directories:')}', + style: textTheme.subtitle1, + ), + ..._lastPaths.map((path) => Row( + children: [ + Expanded(child: Text(path, style: textTheme.caption)), + SizedBox(width: 8), + OutlineButton( + onPressed: () async { + await AndroidFileService.revokeDirectoryAccess(path); + _load(); + setState(() {}); + }, + child: Text('Revoke'), + ), + ], + )), + ], + ); + }, + ), + ); + } +} diff --git a/lib/widgets/settings/settings_page.dart b/lib/widgets/settings/settings_page.dart index f230ce8da..bf6358660 100644 --- a/lib/widgets/settings/settings_page.dart +++ b/lib/widgets/settings/settings_page.dart @@ -6,6 +6,7 @@ import 'package:aves/utils/constants.dart'; import 'package:aves/widgets/common/aves_selection_dialog.dart'; import 'package:aves/widgets/common/data_providers/media_query_data_provider.dart'; import 'package:aves/widgets/common/highlight_title.dart'; +import 'package:aves/widgets/settings/access_grants.dart'; import 'package:aves/widgets/settings/svg_background.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -116,6 +117,7 @@ class SettingsPage extends StatelessWidget { onChanged: (v) => settings.isCrashlyticsEnabled = v, title: Text('Allow anonymous crash reporting'), ), + GrantedDirectories(), ], ), ), From 557a65dbdde9b372dc30da4b098711f544c0f808 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Tue, 29 Sep 2020 18:17:15 +0900 Subject: [PATCH 16/19] minor fixes --- lib/widgets/collection/app_bar.dart | 26 +++++++++---------- .../filter_grids/common/filter_grid_page.dart | 4 +-- lib/widgets/fullscreen/info/maps/common.dart | 4 +-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/widgets/collection/app_bar.dart b/lib/widgets/collection/app_bar.dart index 8436686b6..973f89e15 100644 --- a/lib/widgets/collection/app_bar.dart +++ b/lib/widgets/collection/app_bar.dart @@ -200,33 +200,33 @@ class _CollectionAppBarState extends State with SingleTickerPr PopupMenuItem( key: Key('menu-sort'), value: CollectionAction.sort, - child: MenuRow(text: 'Sort...', icon: AIcons.sort), + child: MenuRow(text: 'Sort…', icon: AIcons.sort), ), if (collection.sortFactor == EntrySortFactor.date) PopupMenuItem( key: Key('menu-group'), value: CollectionAction.group, - child: MenuRow(text: 'Group...', icon: AIcons.group), + child: MenuRow(text: 'Group…', icon: AIcons.group), ), if (collection.isBrowsing) ...[ + if (kDebugMode) + PopupMenuItem( + value: CollectionAction.refresh, + child: MenuRow(text: 'Refresh', icon: AIcons.refresh), + ), if (AvesApp.mode == AppMode.main) - if (kDebugMode) - PopupMenuItem( - value: CollectionAction.refresh, - child: MenuRow(text: 'Refresh', icon: AIcons.refresh), - ), - PopupMenuItem( - value: CollectionAction.select, - child: MenuRow(text: 'Select', icon: AIcons.select), - ), + PopupMenuItem( + value: CollectionAction.select, + child: MenuRow(text: 'Select', icon: AIcons.select), + ), PopupMenuItem( value: CollectionAction.stats, child: MenuRow(text: 'Stats', icon: AIcons.stats), ), - if (canAddShortcuts) + if (AvesApp.mode == AppMode.main && canAddShortcuts) PopupMenuItem( value: CollectionAction.addShortcut, - child: MenuRow(text: 'Add shortcut', icon: AIcons.addShortcut), + child: MenuRow(text: 'Add shortcut…', icon: AIcons.addShortcut), ), ], if (collection.isSelecting) ...[ diff --git a/lib/widgets/filter_grids/common/filter_grid_page.dart b/lib/widgets/filter_grids/common/filter_grid_page.dart index ecc8ae752..6e54cf5bf 100644 --- a/lib/widgets/filter_grids/common/filter_grid_page.dart +++ b/lib/widgets/filter_grids/common/filter_grid_page.dart @@ -87,7 +87,7 @@ class FilterNavigationPage extends StatelessWidget { ), settings.navRemoveRoutePredicate(CollectionPage.routeName), ), - onLongPress: (filter, tapPosition) => _showMenu(context, filter, tapPosition), + onLongPress: AvesApp.mode == AppMode.main ? (filter, tapPosition) => _showMenu(context, filter, tapPosition) : null, ); } @@ -119,7 +119,7 @@ class FilterNavigationPage extends StatelessWidget { PopupMenuItem( key: Key('menu-sort'), value: ChipSetAction.sort, - child: MenuRow(text: 'Sort...', icon: AIcons.sort), + child: MenuRow(text: 'Sort…', icon: AIcons.sort), ), ]; }, diff --git a/lib/widgets/fullscreen/info/maps/common.dart b/lib/widgets/fullscreen/info/maps/common.dart index a1e24be9e..d0d67dae5 100644 --- a/lib/widgets/fullscreen/info/maps/common.dart +++ b/lib/widgets/fullscreen/info/maps/common.dart @@ -62,7 +62,7 @@ class MapButtonPanel extends StatelessWidget { MapOverlayButton( icon: AIcons.openInNew, onPressed: () => AndroidAppService.openMap(geoUri), - tooltip: 'Show on map...', + tooltip: 'Show on map…', ), SizedBox(height: padding), MapOverlayButton( @@ -81,7 +81,7 @@ class MapButtonPanel extends StatelessWidget { MapStyleChangedNotification().dispatch(context); } }, - tooltip: 'Style map...', + tooltip: 'Style map…', ), Spacer(), MapOverlayButton( From bdd18d9e713e0de2d1ff668d8ea2d9d164096589 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Tue, 29 Sep 2020 18:33:03 +0900 Subject: [PATCH 17/19] albums/countries/tags: added refresh, stats actions --- lib/widgets/filter_grids/albums_page.dart | 2 +- .../filter_grids/common/chip_actions.dart | 2 + .../common/chip_set_action_delegate.dart | 53 +++++++++++++++++++ .../filter_grids/common/filter_grid_page.dart | 11 ++++ lib/widgets/filter_grids/countries_page.dart | 2 +- lib/widgets/filter_grids/tags_page.dart | 2 +- 6 files changed, 69 insertions(+), 3 deletions(-) diff --git a/lib/widgets/filter_grids/albums_page.dart b/lib/widgets/filter_grids/albums_page.dart index dd9902225..6a4c104cb 100644 --- a/lib/widgets/filter_grids/albums_page.dart +++ b/lib/widgets/filter_grids/albums_page.dart @@ -36,7 +36,7 @@ class AlbumListPage extends StatelessWidget { builder: (context, snapshot) => FilterNavigationPage( source: source, title: 'Albums', - chipSetActionDelegate: AlbumChipSetActionDelegate(), + chipSetActionDelegate: AlbumChipSetActionDelegate(source: source), chipActionDelegate: AlbumChipActionDelegate(source: source), chipActionsBuilder: (filter) => [ settings.pinnedFilters.contains(filter) ? ChipAction.unpin : ChipAction.pin, diff --git a/lib/widgets/filter_grids/common/chip_actions.dart b/lib/widgets/filter_grids/common/chip_actions.dart index 9d2c00467..a63edfd8f 100644 --- a/lib/widgets/filter_grids/common/chip_actions.dart +++ b/lib/widgets/filter_grids/common/chip_actions.dart @@ -3,6 +3,8 @@ import 'package:flutter/widgets.dart'; enum ChipSetAction { sort, + refresh, + stats, } enum ChipAction { diff --git a/lib/widgets/filter_grids/common/chip_set_action_delegate.dart b/lib/widgets/filter_grids/common/chip_set_action_delegate.dart index e053ee92a..5112d7396 100644 --- a/lib/widgets/filter_grids/common/chip_set_action_delegate.dart +++ b/lib/widgets/filter_grids/common/chip_set_action_delegate.dart @@ -1,12 +1,19 @@ import 'package:aves/model/settings/settings.dart'; +import 'package:aves/model/source/collection_lens.dart'; +import 'package:aves/model/source/collection_source.dart'; import 'package:aves/model/source/enums.dart'; import 'package:aves/utils/durations.dart'; import 'package:aves/widgets/common/aves_selection_dialog.dart'; +import 'package:aves/widgets/common/data_providers/media_store_collection_provider.dart'; import 'package:aves/widgets/filter_grids/common/chip_actions.dart'; +import 'package:aves/widgets/stats/stats.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; +import 'package:pedantic/pedantic.dart'; abstract class ChipSetActionDelegate { + CollectionSource get source; + ChipSortFactor get sortFactor; set sortFactor(ChipSortFactor factor); @@ -19,6 +26,15 @@ abstract class ChipSetActionDelegate { case ChipSetAction.sort: await _showSortDialog(context); break; + case ChipSetAction.refresh: + if (source is MediaStoreSource) { + source.clearEntries(); + unawaited((source as MediaStoreSource).refresh()); + } + break; + case ChipSetAction.stats: + _goToStats(context); + break; } } @@ -38,9 +54,32 @@ abstract class ChipSetActionDelegate { sortFactor = factor; } } + + void _goToStats(BuildContext context) { + Navigator.push( + context, + MaterialPageRoute( + settings: RouteSettings(name: StatsPage.routeName), + builder: (context) => StatsPage( + collection: CollectionLens( + source: source, + groupFactor: settings.collectionGroupFactor, + sortFactor: settings.collectionSortFactor, + ), + ), + ), + ); + } } class AlbumChipSetActionDelegate extends ChipSetActionDelegate { + @override + final CollectionSource source; + + AlbumChipSetActionDelegate({ + @required this.source, + }); + @override ChipSortFactor get sortFactor => settings.albumSortFactor; @@ -49,6 +88,13 @@ class AlbumChipSetActionDelegate extends ChipSetActionDelegate { } class CountryChipSetActionDelegate extends ChipSetActionDelegate { + @override + final CollectionSource source; + + CountryChipSetActionDelegate({ + @required this.source, + }); + @override ChipSortFactor get sortFactor => settings.countrySortFactor; @@ -57,6 +103,13 @@ class CountryChipSetActionDelegate extends ChipSetActionDelegate { } class TagChipSetActionDelegate extends ChipSetActionDelegate { + @override + final CollectionSource source; + + TagChipSetActionDelegate({ + @required this.source, + }); + @override ChipSortFactor get sortFactor => settings.tagSortFactor; diff --git a/lib/widgets/filter_grids/common/filter_grid_page.dart b/lib/widgets/filter_grids/common/filter_grid_page.dart index 6e54cf5bf..89e6db5af 100644 --- a/lib/widgets/filter_grids/common/filter_grid_page.dart +++ b/lib/widgets/filter_grids/common/filter_grid_page.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:aves/main.dart'; import 'package:aves/model/filters/filters.dart'; import 'package:aves/model/image_entry.dart'; import 'package:aves/model/settings/settings.dart'; @@ -24,6 +25,7 @@ import 'package:aves/widgets/filter_grids/common/chip_set_action_delegate.dart'; import 'package:aves/widgets/filter_grids/common/decorated_filter_chip.dart'; import 'package:collection/collection.dart'; import 'package:draggable_scrollbar/draggable_scrollbar.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:pedantic/pedantic.dart'; @@ -121,6 +123,15 @@ class FilterNavigationPage extends StatelessWidget { value: ChipSetAction.sort, child: MenuRow(text: 'Sort…', icon: AIcons.sort), ), + if (kDebugMode) + PopupMenuItem( + value: ChipSetAction.refresh, + child: MenuRow(text: 'Refresh', icon: AIcons.refresh), + ), + PopupMenuItem( + value: ChipSetAction.stats, + child: MenuRow(text: 'Stats', icon: AIcons.stats), + ), ]; }, onSelected: (action) => chipSetActionDelegate.onActionSelected(context, action), diff --git a/lib/widgets/filter_grids/countries_page.dart b/lib/widgets/filter_grids/countries_page.dart index 783e79429..fae95bd1a 100644 --- a/lib/widgets/filter_grids/countries_page.dart +++ b/lib/widgets/filter_grids/countries_page.dart @@ -33,7 +33,7 @@ class CountryListPage extends StatelessWidget { builder: (context, snapshot) => FilterNavigationPage( source: source, title: 'Countries', - chipSetActionDelegate: CountryChipSetActionDelegate(), + chipSetActionDelegate: CountryChipSetActionDelegate(source: source), chipActionDelegate: ChipActionDelegate(), chipActionsBuilder: (filter) => [ settings.pinnedFilters.contains(filter) ? ChipAction.unpin : ChipAction.pin, diff --git a/lib/widgets/filter_grids/tags_page.dart b/lib/widgets/filter_grids/tags_page.dart index 9f8cb47a8..0efce6eca 100644 --- a/lib/widgets/filter_grids/tags_page.dart +++ b/lib/widgets/filter_grids/tags_page.dart @@ -33,7 +33,7 @@ class TagListPage extends StatelessWidget { builder: (context, snapshot) => FilterNavigationPage( source: source, title: 'Tags', - chipSetActionDelegate: TagChipSetActionDelegate(), + chipSetActionDelegate: TagChipSetActionDelegate(source: source), chipActionDelegate: ChipActionDelegate(), chipActionsBuilder: (filter) => [ settings.pinnedFilters.contains(filter) ? ChipAction.unpin : ChipAction.pin, From b315ebe72465c3d2821ebffef5e4029716bc8d20 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Tue, 29 Sep 2020 20:00:00 +0900 Subject: [PATCH 18/19] migration to Kotlin (WIP) --- .../thibault/aves/utils/MetadataHelper.java | 79 ------------------- .../thibault/aves/utils/MimeTypes.java | 19 ----- .../deckers/thibault/aves/utils/Utils.java | 54 ------------- .../thibault/aves/utils/MetadataHelper.kt | 63 +++++++++++++++ .../deckers/thibault/aves/utils/MimeTypes.kt | 18 +++++ .../deckers/thibault/aves/utils/Utils.kt | 25 ++++++ 6 files changed, 106 insertions(+), 152 deletions(-) delete mode 100644 android/app/src/main/java/deckers/thibault/aves/utils/MetadataHelper.java delete mode 100644 android/app/src/main/java/deckers/thibault/aves/utils/MimeTypes.java delete mode 100644 android/app/src/main/java/deckers/thibault/aves/utils/Utils.java create mode 100644 android/app/src/main/kotlin/deckers/thibault/aves/utils/MetadataHelper.kt create mode 100644 android/app/src/main/kotlin/deckers/thibault/aves/utils/MimeTypes.kt create mode 100644 android/app/src/main/kotlin/deckers/thibault/aves/utils/Utils.kt diff --git a/android/app/src/main/java/deckers/thibault/aves/utils/MetadataHelper.java b/android/app/src/main/java/deckers/thibault/aves/utils/MetadataHelper.java deleted file mode 100644 index 21c601d99..000000000 --- a/android/app/src/main/java/deckers/thibault/aves/utils/MetadataHelper.java +++ /dev/null @@ -1,79 +0,0 @@ -package deckers.thibault.aves.utils; - -import androidx.annotation.Nullable; -import androidx.exifinterface.media.ExifInterface; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Locale; -import java.util.TimeZone; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class MetadataHelper { - - // interpret EXIF code to angle (0, 90, 180 or 270 degrees) - public static int getOrientationDegreesForExifCode(int exifOrientation) { - switch (exifOrientation) { - case ExifInterface.ORIENTATION_ROTATE_180: // bottom, right side - return 180; - case ExifInterface.ORIENTATION_ROTATE_90: // right side, top - return 90; - case ExifInterface.ORIENTATION_ROTATE_270: // left side, bottom - return 270; - } - // all other orientations (regular, flipped...) default to an angle of 0 degree - return 0; - } - - // yyyyMMddTHHmmss(.sss)?(Z|+/-hhmm)? - public static long parseVideoMetadataDate(@Nullable String dateString) { - if (dateString == null) { - return 0; - } - - // optional sub-second - String subSecond = null; - Matcher subSecondMatcher = Pattern.compile("(\\d{6})(\\.\\d+)").matcher(dateString); - if (subSecondMatcher.find()) { - subSecond = subSecondMatcher.group(2).substring(1); - dateString = subSecondMatcher.replaceAll("$1"); - } - - // optional time zone - TimeZone timeZone = null; - Matcher timeZoneMatcher = Pattern.compile("(Z|[+-]\\d{4})$").matcher(dateString); - if (timeZoneMatcher.find()) { - timeZone = TimeZone.getTimeZone("GMT" + timeZoneMatcher.group().replaceAll("Z", "")); - dateString = timeZoneMatcher.replaceAll(""); - } - - Date date = null; - try { - DateFormat parser = new SimpleDateFormat("yyyyMMdd'T'HHmmss", Locale.US); - parser.setTimeZone((timeZone != null) ? timeZone : TimeZone.getTimeZone("GMT")); - date = parser.parse(dateString); - } catch (ParseException e) { - // ignore - } - - if (date == null) { - return 0; - } - - long dateMillis = date.getTime(); - if (subSecond != null) { - try { - int millis = (int) (Double.parseDouble("." + subSecond) * 1000); - if (millis >= 0 && millis < 1000) { - dateMillis += millis; - } - } catch (NumberFormatException e) { - // ignore - } - } - return dateMillis; - } -} diff --git a/android/app/src/main/java/deckers/thibault/aves/utils/MimeTypes.java b/android/app/src/main/java/deckers/thibault/aves/utils/MimeTypes.java deleted file mode 100644 index debb8a3c3..000000000 --- a/android/app/src/main/java/deckers/thibault/aves/utils/MimeTypes.java +++ /dev/null @@ -1,19 +0,0 @@ -package deckers.thibault.aves.utils; - -public class MimeTypes { - public static final String IMAGE = "image"; - public static final String DNG = "image/x-adobe-dng"; // .dng - public static final String GIF = "image/gif"; - public static final String HEIC = "image/heic"; - public static final String HEIF = "image/heif"; - public static final String JPEG = "image/jpeg"; - public static final String PNG = "image/png"; - public static final String PSD = "image/x-photoshop"; // .psd - public static final String SVG = "image/svg+xml"; // .svg - public static final String WEBP = "image/webp"; - - public static final String VIDEO = "video"; - public static final String AVI = "video/avi"; - public static final String MP2T = "video/mp2t"; // .m2ts - public static final String MP4 = "video/mp4"; -} diff --git a/android/app/src/main/java/deckers/thibault/aves/utils/Utils.java b/android/app/src/main/java/deckers/thibault/aves/utils/Utils.java deleted file mode 100644 index 9dd458567..000000000 --- a/android/app/src/main/java/deckers/thibault/aves/utils/Utils.java +++ /dev/null @@ -1,54 +0,0 @@ -package deckers.thibault.aves.utils; - -import java.io.File; -import java.io.FileDescriptor; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.channels.FileChannel; -import java.util.regex.Pattern; - -public class Utils { - private static final int logTagMaxLength = 23; - private static final Pattern logTagPackagePattern = Pattern.compile("(\\w)(\\w*)\\."); - - public static String createLogTag(Class clazz) { - // shorten class name to "a.b.CccDdd" - String logTag = logTagPackagePattern.matcher(clazz.getName()).replaceAll("$1."); - if (logTag.length() > logTagMaxLength) { - // shorten class name to "a.b.CD" - String simpleName = clazz.getSimpleName(); - String shortSimpleName = simpleName.replaceAll("[a-z]", ""); - logTag = logTag.replace(simpleName, shortSimpleName); - if (logTag.length() > logTagMaxLength) { - // shorten class name to "CD" - logTag = shortSimpleName; - } - } - return logTag; - } - - public static void copyFile(final File source, final FileDescriptor descriptor) throws IOException { - try (FileInputStream inStream = new FileInputStream(source); FileOutputStream outStream = new FileOutputStream(descriptor)) { - final FileChannel inChannel = inStream.getChannel(); - final FileChannel outChannel = outStream.getChannel(); - final long size = inChannel.size(); - long position = 0; - while (position < size) { - position += inChannel.transferTo(position, 1024L * 1024L, outChannel); - } - } - } - - public static void copyFile(final File source, final File destination) throws IOException { - try (FileInputStream inStream = new FileInputStream(source); FileOutputStream outStream = new FileOutputStream(destination)) { - final FileChannel inChannel = inStream.getChannel(); - final FileChannel outChannel = outStream.getChannel(); - final long size = inChannel.size(); - long position = 0; - while (position < size) { - position += inChannel.transferTo(position, 1024L * 1024L, outChannel); - } - } - } -} \ No newline at end of file diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/utils/MetadataHelper.kt b/android/app/src/main/kotlin/deckers/thibault/aves/utils/MetadataHelper.kt new file mode 100644 index 000000000..2c5d2ebb0 --- /dev/null +++ b/android/app/src/main/kotlin/deckers/thibault/aves/utils/MetadataHelper.kt @@ -0,0 +1,63 @@ +package deckers.thibault.aves.utils + +import androidx.exifinterface.media.ExifInterface +import java.text.DateFormat +import java.text.ParseException +import java.text.SimpleDateFormat +import java.util.* +import java.util.regex.Pattern + +object MetadataHelper { + // interpret EXIF code to angle (0, 90, 180 or 270 degrees) + @JvmStatic + fun getOrientationDegreesForExifCode(exifOrientation: Int): Int = when (exifOrientation) { + ExifInterface.ORIENTATION_ROTATE_180 -> 180 + ExifInterface.ORIENTATION_ROTATE_90 -> 90 + ExifInterface.ORIENTATION_ROTATE_270 -> 270 + else -> 0 // all other orientations (regular, flipped...) default to an angle of 0 degree + } + + // yyyyMMddTHHmmss(.sss)?(Z|+/-hhmm)? + @JvmStatic + fun parseVideoMetadataDate(metadataDate: String?): Long { + var dateString = metadataDate ?: return 0 + + // optional sub-second + var subSecond: String? = null + val subSecondMatcher = Pattern.compile("(\\d{6})(\\.\\d+)").matcher(dateString) + if (subSecondMatcher.find()) { + subSecond = subSecondMatcher.group(2)?.substring(1) + dateString = subSecondMatcher.replaceAll("$1") + } + + // optional time zone + var timeZone: TimeZone? = null + val timeZoneMatcher = Pattern.compile("(Z|[+-]\\d{4})$").matcher(dateString) + if (timeZoneMatcher.find()) { + timeZone = TimeZone.getTimeZone("GMT" + timeZoneMatcher.group().replace("Z".toRegex(), "")) + dateString = timeZoneMatcher.replaceAll("") + } + + val date: Date = try { + val parser = SimpleDateFormat("yyyyMMdd'T'HHmmss", Locale.US) + parser.timeZone = timeZone ?: TimeZone.getTimeZone("GMT") + parser.parse(dateString) + } catch (e: ParseException) { + // ignore + null + } ?: return 0 + + var dateMillis = date.time + if (subSecond != null) { + try { + val millis = (".$subSecond".toDouble() * 1000).toInt() + if (millis in 0..999) { + dateMillis += millis.toLong() + } + } catch (e: NumberFormatException) { + // ignore + } + } + return dateMillis + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/utils/MimeTypes.kt b/android/app/src/main/kotlin/deckers/thibault/aves/utils/MimeTypes.kt new file mode 100644 index 000000000..416e71994 --- /dev/null +++ b/android/app/src/main/kotlin/deckers/thibault/aves/utils/MimeTypes.kt @@ -0,0 +1,18 @@ +package deckers.thibault.aves.utils + +object MimeTypes { + const val IMAGE = "image" + const val DNG = "image/x-adobe-dng" // .dng + const val GIF = "image/gif" + const val HEIC = "image/heic" + const val HEIF = "image/heif" + const val JPEG = "image/jpeg" + const val PNG = "image/png" + const val PSD = "image/x-photoshop" // .psd + const val SVG = "image/svg+xml" // .svg + const val WEBP = "image/webp" + const val VIDEO = "video" + const val AVI = "video/avi" + const val MP2T = "video/mp2t" // .m2ts + const val MP4 = "video/mp4" +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/utils/Utils.kt b/android/app/src/main/kotlin/deckers/thibault/aves/utils/Utils.kt new file mode 100644 index 000000000..3c914314d --- /dev/null +++ b/android/app/src/main/kotlin/deckers/thibault/aves/utils/Utils.kt @@ -0,0 +1,25 @@ +package deckers.thibault.aves.utils + +import java.util.regex.Pattern + +object Utils { + private const val LOG_TAG_MAX_LENGTH = 23 + private val LOG_TAG_PACKAGE_PATTERN = Pattern.compile("(\\w)(\\w*)\\.") + + @JvmStatic + fun createLogTag(clazz: Class<*>): String { + // shorten class name to "a.b.CccDdd" + var logTag = LOG_TAG_PACKAGE_PATTERN.matcher(clazz.name).replaceAll("$1.") + if (logTag.length > LOG_TAG_MAX_LENGTH) { + // shorten class name to "a.b.CD" + val simpleName = clazz.simpleName + val shortSimpleName = simpleName.replace("[a-z]".toRegex(), "") + logTag = logTag.replace(simpleName, shortSimpleName) + if (logTag.length > LOG_TAG_MAX_LENGTH) { + // shorten class name to "CD" + logTag = shortSimpleName + } + } + return logTag + } +} \ No newline at end of file From b9ffc2d5f096a0eca2f2819c6d12a503f6b7ae80 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Tue, 29 Sep 2020 21:30:53 +0900 Subject: [PATCH 19/19] version bump --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 1e15c3027..fb67b55be 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.1.13+25 +version: 1.1.14+26 # video_player (as of v0.10.8+2, backed by ExoPlayer): # - does not support content URIs (by default, but trivial by fork)