diff --git a/fastlane/metadata/android/en-US/changelogs/419.txt b/fastlane/metadata/android/en-US/changelogs/420.txt similarity index 100% rename from fastlane/metadata/android/en-US/changelogs/419.txt rename to fastlane/metadata/android/en-US/changelogs/420.txt diff --git a/lib/ui/actions/collection/collection_file_actions.dart b/lib/ui/actions/collection/collection_file_actions.dart index 232520664..846f56744 100644 --- a/lib/ui/actions/collection/collection_file_actions.dart +++ b/lib/ui/actions/collection/collection_file_actions.dart @@ -16,13 +16,15 @@ extension CollectionFileActions on CollectionActions { BuildContext bContext, Collection collection, SelectedFiles selectedFiles, + bool removingOthersFile, ) async { final actionResult = await showActionSheet( context: bContext, buttons: [ ButtonWidget( - labelText: "Yes, remove", - buttonType: ButtonType.neutral, + labelText: "Remove", + buttonType: + removingOthersFile ? ButtonType.critical : ButtonType.neutral, buttonSize: ButtonSize.large, shouldStickToDarkTheme: true, isInAlert: true, @@ -48,9 +50,11 @@ extension CollectionFileActions on CollectionActions { isInAlert: true, ), ], - title: "Remove from album?", - body: "Selected items will be removed from this album. Items which are " - "only in this album will be moved to Uncategorized.", + title: removingOthersFile ? "Remove from album?" : null, + body: removingOthersFile + ? "Some of the items you are removing were " + "added by other people, and you will lose access to them" + : "Selected items will be removed from this album", actionSheetType: ActionSheetType.defaultActionSheet, ); if (actionResult != null && actionResult == ButtonAction.error) { diff --git a/lib/ui/sharing/user_avator_widget.dart b/lib/ui/sharing/user_avator_widget.dart index 18223183d..873cba05a 100644 --- a/lib/ui/sharing/user_avator_widget.dart +++ b/lib/ui/sharing/user_avator_widget.dart @@ -26,10 +26,13 @@ class UserAvatarWidget extends StatelessWidget { final displayChar = (user.name == null || user.name!.isEmpty) ? ((user.email.isEmpty) ? " " : user.email.substring(0, 1)) : user.name!.substring(0, 1); - final randomColor = colorScheme.avatarColors[ - (user.id ?? 0).remainder(colorScheme.avatarColors.length)]; - final Color decorationColor = - ((user.id ?? -1) == currentUserID) ? Colors.black : randomColor; + Color decorationColor; + if (user.id == null || user.id! <= 0 || user.id == currentUserID) { + decorationColor = Colors.black; + } else { + decorationColor = colorScheme + .avatarColors[(user.id!).remainder(colorScheme.avatarColors.length)]; + } final avatarStyle = getAvatarStyle(context, type); final double size = avatarStyle.item1; diff --git a/lib/ui/viewer/actions/file_selection_actions_widget.dart b/lib/ui/viewer/actions/file_selection_actions_widget.dart index ce1f6aed3..2f2c65a48 100644 --- a/lib/ui/viewer/actions/file_selection_actions_widget.dart +++ b/lib/ui/viewer/actions/file_selection_actions_widget.dart @@ -316,10 +316,13 @@ class _FileSelectionActionWidgetState extends State { widget.selectedFiles .unSelectAll(split.ownedByOtherUsers.toSet(), skipNotify: true); } + final bool removingOthersFile = + isCollectionOwner && split.ownedByOtherUsers.isNotEmpty; await collectionActions.showRemoveFromCollectionSheetV2( context, widget.collection!, widget.selectedFiles, + removingOthersFile, ); } diff --git a/lib/ui/viewer/file/thumbnail_widget.dart b/lib/ui/viewer/file/thumbnail_widget.dart index 14d24bfc2..e5b787465 100644 --- a/lib/ui/viewer/file/thumbnail_widget.dart +++ b/lib/ui/viewer/file/thumbnail_widget.dart @@ -10,7 +10,6 @@ import 'package:photos/db/files_db.dart'; import 'package:photos/db/trash_db.dart'; import 'package:photos/events/files_updated_event.dart'; import 'package:photos/events/local_photos_updated_event.dart'; -import 'package:photos/extensions/string_ext.dart'; import 'package:photos/models/collection.dart'; import 'package:photos/models/file.dart'; import 'package:photos/models/file_type.dart'; @@ -128,11 +127,10 @@ class _ThumbnailWidgetState extends State { ); } else if (widget.file!.pubMagicMetadata!.uploaderName != null) { contentChildren.add( - // Use uploadName hashCode as userID so that different uploader - // get avatar color + // Use -1 as userID for enforcing black avatar color OwnerAvatarOverlayIcon( User( - id: widget.file!.pubMagicMetadata!.uploaderName.sumAsciiValues, + id: -1, email: '', name: widget.file!.pubMagicMetadata!.uploaderName, ), diff --git a/pubspec.yaml b/pubspec.yaml index e88e7e30e..e59413cba 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ description: ente photos application # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.7.19+419 +version: 0.7.20+420 environment: sdk: '>=2.17.0 <3.0.0'