minor fixes

This commit is contained in:
Thibault Deckers 2022-04-07 14:19:59 +09:00
parent 56f520b08b
commit 638a41d467
7 changed files with 24 additions and 13 deletions

View file

@ -37,12 +37,13 @@
<application
android:allowBackup="true"
android:appCategory="image"
android:fullBackupOnly="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
tools:targetApi="lollipop">
tools:targetApi="o">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"

View file

@ -8,6 +8,7 @@ https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/
https://www.adobe.io/content/dam/udp/en/open/standards/tiff/TIFFphotoshop.pdf
*/
object ExifTags {
private const val PROCESSING_SOFTWARE = 0x000b
private const val X_POSITION = 0x011e
private const val Y_POSITION = 0x011f
private const val T4_OPTIONS = 0x0124
@ -29,6 +30,7 @@ object ExifTags {
private const val GDAL_NO_DATA = 0xa481
private val tagNameMap = hashMapOf(
PROCESSING_SOFTWARE to "Processing Software",
X_POSITION to "X Position",
Y_POSITION to "Y Position",
T4_OPTIONS to "T4 Options",

View file

@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.6.20'
repositories {
google()
mavenCentral()

View file

@ -8,7 +8,7 @@ class TileExtentController {
final String settingsRouteKey;
final int columnCountMin, columnCountDefault;
final double extentMin, extentMax, spacing, horizontalPadding;
final ValueNotifier<double> extentNotifier = ValueNotifier(0);
late final ValueNotifier<double> extentNotifier;
late double userPreferredExtent;
Size _viewportSize = Size.zero;
@ -24,6 +24,7 @@ class TileExtentController {
required this.spacing,
required this.horizontalPadding,
}) {
extentNotifier = ValueNotifier(extentMin);
userPreferredExtent = settings.getTileExtent(settingsRouteKey);
settings.addListener(_onSettingsChanged);
}

View file

@ -173,6 +173,7 @@ class AlbumChipSetActionDelegate extends ChipSetActionDelegate<AlbumFilter> with
final showAction = SnackBarAction(
label: context.l10n.showButtonLabel,
onPressed: () async {
// assume Album page is still the current page when action is triggered
final filter = AlbumFilter(newAlbum, source.getAlbumDisplayName(context, newAlbum));
context.read<HighlightInfo>().trackItem(FilterGridItem(filter, null), highlightItem: filter);
},

View file

@ -258,12 +258,15 @@ class EntryActionDelegate with FeedbackMixin, PermissionAwareMixin, SizeAwareMix
source.resumeMonitoring();
source.refreshUris(newUris);
final l10n = context.l10n;
final navigator = Navigator.of(context);
final showAction = isMainMode && newUris.isNotEmpty
? SnackBarAction(
label: context.l10n.showButtonLabel,
label: l10n.showButtonLabel,
onPressed: () {
Navigator.pushAndRemoveUntil(
context,
// `context` may be obsolete if the user navigated away before triggering the action
// so we reused the navigator retrieved before showing the snack bar
navigator.pushAndRemoveUntil(
MaterialPageRoute(
settings: const RouteSettings(name: CollectionPage.routeName),
builder: (context) => CollectionPage(
@ -282,13 +285,13 @@ class EntryActionDelegate with FeedbackMixin, PermissionAwareMixin, SizeAwareMix
final count = selectionCount - successCount;
showFeedback(
context,
context.l10n.collectionExportFailureFeedback(count),
l10n.collectionExportFailureFeedback(count),
showAction,
);
} else {
showFeedback(
context,
context.l10n.genericSuccessFeedback,
l10n.genericSuccessFeedback,
showAction,
);
}

View file

@ -107,16 +107,19 @@ class VideoActionDelegate with FeedbackMixin, PermissionAwareMixin, SizeAwareMix
);
final success = newFields.isNotEmpty;
final l10n = context.l10n;
if (success) {
final _collection = collection;
final navigator = Navigator.of(context);
final showAction = _collection != null
? SnackBarAction(
label: context.l10n.showButtonLabel,
label: l10n.showButtonLabel,
onPressed: () {
final source = _collection.source;
final newUri = newFields['uri'] as String?;
Navigator.pushAndRemoveUntil(
context,
// `context` may be obsolete if the user navigated away before triggering the action
// so we reused the navigator retrieved before showing the snack bar
navigator.pushAndRemoveUntil(
MaterialPageRoute(
settings: const RouteSettings(name: CollectionPage.routeName),
builder: (context) => CollectionPage(
@ -130,9 +133,9 @@ class VideoActionDelegate with FeedbackMixin, PermissionAwareMixin, SizeAwareMix
},
)
: null;
showFeedback(context, context.l10n.genericSuccessFeedback, showAction);
showFeedback(context, l10n.genericSuccessFeedback, showAction);
} else {
showFeedback(context, context.l10n.genericFailureFeedback);
showFeedback(context, l10n.genericFailureFeedback);
}
}