Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Use theme background color for avatar borders and fix anonymous user colors

ashilkn51cd65a08417
diff --git a/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart b/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart
index bf4b559b40..26cf06b1f2 100644
--- a/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart
+++ b/mobile/apps/photos/lib/ui/sharing/user_avator_widget.dart
@@ -209,8 +209,7 @@ class _FirstLetterCircularAvatarState
: widget.user.email.substring(0, 1))
: widget.user.displayName!.substring(0, 1);
Color decorationColor;
- if ((widget.user.id != null && widget.user.id! < 0) ||
- widget.user.email == Configuration.instance.getEmail()) {
+ if (widget.user.email == Configuration.instance.getEmail()) {
decorationColor = Colors.black;
} else {
decorationColor = colorScheme.avatarColors[(widget.user.email.length)
@@ -321,8 +320,7 @@ class _FirstLetterUserAvatarState extends State<FirstLetterUserAvatar> {
? ((user.email.isEmpty) ? " " : user.email.substring(0, 1))
: user.displayName!.substring(0, 1);
Color decorationColor;
- if ((widget.user.id != null && widget.user.id! < 0) ||
- user.email == currentUserEmail) {
+ if (user.email == currentUserEmail) {
decorationColor = Colors.black;
} else {
decorationColor = colorScheme.avatarColors[
diff --git a/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart
index f4f6a9e1e5..47776abc3e 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/feed_item_widget.dart
@@ -248,11 +248,12 @@ class _StackedAvatars extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final colorScheme = getEnteColorScheme(context);
final actors = _getActors();
final displayCount = actors.length.clamp(1, 2);
if (displayCount == 1) {
- return _buildSingleAvatar(actors.first);
+ return _buildSingleAvatar(actors.first, colorScheme);
}
// Stacked avatars with overlap
@@ -269,7 +270,7 @@ class _StackedAvatars extends StatelessWidget {
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(
- color: Colors.white,
+ color: colorScheme.backgroundBase,
width: 1.167,
),
),
@@ -284,11 +285,20 @@ class _StackedAvatars extends StatelessWidget {
// Second (back) avatar
Positioned(
left: 21, // Overlap by 7px (28 - 21 = 7)
- child: UserAvatarWidget(
- actors[1],
- type: AvatarType.lg,
- currentUserID: currentUserID,
- addStroke: false,
+ child: Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ border: Border.all(
+ color: colorScheme.backgroundBase,
+ width: 1.167,
+ ),
+ ),
+ child: UserAvatarWidget(
+ actors[1],
+ type: AvatarType.lg,
+ currentUserID: currentUserID,
+ addStroke: false,
+ ),
),
),
],
@@ -296,12 +306,12 @@ class _StackedAvatars extends StatelessWidget {
);
}
- Widget _buildSingleAvatar(User user) {
+ Widget _buildSingleAvatar(User user, EnteColorScheme colorScheme) {
return Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(
- color: Colors.white,
+ color: colorScheme.backgroundBase,
width: 1.167,
),
),
diff --git a/mobile/apps/photos/lib/ui/social/widgets/feed_preview_item_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/feed_preview_item_widget.dart
index 1711855098..2b6d2e7d9d 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/feed_preview_item_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/feed_preview_item_widget.dart
@@ -100,14 +100,14 @@ class _PreviewAvatarStack extends StatelessWidget {
Positioned(
left: 0,
top: 0,
- child: _buildAvatar(actors.first, showBorder: false),
+ child: _buildAvatar(actors.first, colorScheme, showBorder: false),
),
// Second (bottom-right) avatar - only if multiple actors
if (hasMultipleActors)
Positioned(
right: 0,
bottom: 0,
- child: _buildAvatar(actors[1], showBorder: true),
+ child: _buildAvatar(actors[1], colorScheme, showBorder: true),
),
// Icon badge at bottom-left
Positioned(
@@ -124,13 +124,17 @@ class _PreviewAvatarStack extends StatelessWidget {
);
}
- Widget _buildAvatar(User user, {required bool showBorder}) {
+ Widget _buildAvatar(
+ User user,
+ EnteColorScheme colorScheme, {
+ required bool showBorder,
+ }) {
return Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: showBorder
? Border.all(
- color: Colors.white,
+ color: colorScheme.backgroundBase,
width: 1.5,
)
: null,