Skip to content

armgit / ente

Public Imported from GitHub
0

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

update add buttons

AmanRajSinghMourya5425a26087da
diff --git a/mobile/apps/photos/lib/ui/collections/album/new_list_item.dart b/mobile/apps/photos/lib/ui/collections/album/new_list_item.dart
index c3c8abef45..0d9523db5f 100644
--- a/mobile/apps/photos/lib/ui/collections/album/new_list_item.dart
+++ b/mobile/apps/photos/lib/ui/collections/album/new_list_item.dart
@@ -1,11 +1,19 @@
import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/material.dart';
+import 'package:hugeicons/hugeicons.dart';
import "package:photos/generated/l10n.dart";
import 'package:photos/theme/ente_theme.dart';
//https://www.figma.com/design/SYtMyLBs5SAOkTbfMMzhqt/Ente-Visual-Design?node-id=39181-172209&t=3qmSZWpXF3ZC4JGN-1
class NewAlbumListItemWidget extends StatelessWidget {
+ static const _rowHeight = 68.0;
+ static const _cardRadius = 20.0;
+ static const _thumbnailSize = 52.0;
+ static const _thumbnailRadius = 12.0;
+ static const _thumbnailInset = 8.0;
+ static const _iconSize = 18.0;
+
const NewAlbumListItemWidget({
super.key,
});
@@ -14,63 +22,58 @@ class NewAlbumListItemWidget extends StatelessWidget {
Widget build(BuildContext context) {
final textTheme = getEnteTextTheme(context);
final colorScheme = getEnteColorScheme(context);
- const sideOfThumbnail = 60.0;
- return LayoutBuilder(
- builder: (context, constraints) {
- return Stack(
- alignment: Alignment.center,
- children: [
- Row(
- children: [
- ClipRRect(
- borderRadius: BorderRadius.circular(4),
- child: Container(
- height: sideOfThumbnail,
- width: sideOfThumbnail,
- color: Theme.of(context).brightness == Brightness.light
- ? colorScheme.backdropBase
- : colorScheme.backdropFaint,
- child: Icon(
- Icons.add_outlined,
- color: colorScheme.strokeMuted,
- ),
- ),
+ return Container(
+ height: _rowHeight,
+ padding: const EdgeInsets.all(8),
+ decoration: BoxDecoration(
+ color: colorScheme.fill,
+ borderRadius: BorderRadius.circular(_cardRadius),
+ ),
+ child: Row(
+ children: [
+ SizedBox(
+ height: _thumbnailSize,
+ width: _thumbnailSize,
+ child: DottedBorder(
+ dashPattern: const [4, 4],
+ color: colorScheme.strokeDark,
+ strokeWidth: 1,
+ padding: EdgeInsets.zero,
+ borderType: BorderType.RRect,
+ radius: const Radius.circular(_thumbnailRadius),
+ child: Container(
+ height: _thumbnailSize,
+ width: _thumbnailSize,
+ decoration: BoxDecoration(
+ color: colorScheme.fill,
+ borderRadius: BorderRadius.circular(_thumbnailRadius),
),
- Padding(
- padding: const EdgeInsets.only(left: 12),
- child: Text(
- AppLocalizations.of(context).newAlbum,
- style:
- textTheme.body.copyWith(color: colorScheme.textMuted),
+ padding: const EdgeInsets.all(_thumbnailInset),
+ child: Center(
+ child: SizedBox.square(
+ dimension: _iconSize,
+ child: HugeIcon(
+ icon: HugeIcons.strokeRoundedAdd01,
+ size: _iconSize,
+ strokeWidth: 1.5,
+ color: colorScheme.contentLight,
+ ),
),
),
- ],
- ),
- IgnorePointer(
- child: DottedBorder(
- dashPattern: const [4],
- color: colorScheme.strokeFaint,
- strokeWidth: 1,
- padding: const EdgeInsets.all(0),
- borderType: BorderType.RRect,
- radius: const Radius.circular(4),
- child: SizedBox(
- //Have to decrease the height and width by 1 pt as the stroke
- //dotted border gives is of strokeAlign.center, so 0.5 inside and
- // outside. Here for the row, stroke should be inside so we
- //decrease the size of this sizedBox by 1 (so it shrinks 0.5 from
- //every side) so that the strokeAlign.center of this sizedBox
- //looks like a strokeAlign.inside in the row.
- height: sideOfThumbnail - 1,
- //This width will work for this only if the row widget takes up the
- //full size it's parent (stack).
- width: constraints.maxWidth - 1,
- ),
),
),
- ],
- );
- },
+ ),
+ const SizedBox(width: 12),
+ Expanded(
+ child: Text(
+ AppLocalizations.of(context).addNew,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: textTheme.body.copyWith(color: colorScheme.contentLight),
+ ),
+ ),
+ ],
+ ),
);
}
}
diff --git a/mobile/apps/photos/lib/ui/collections/album/new_row_item.dart b/mobile/apps/photos/lib/ui/collections/album/new_row_item.dart
index dd380bc979..85757d537c 100644
--- a/mobile/apps/photos/lib/ui/collections/album/new_row_item.dart
+++ b/mobile/apps/photos/lib/ui/collections/album/new_row_item.dart
@@ -1,6 +1,7 @@
import "package:dotted_border/dotted_border.dart";
import "package:ente_pure_utils/ente_pure_utils.dart";
import 'package:flutter/material.dart';
+import 'package:hugeicons/hugeicons.dart';
import "package:logging/logging.dart";
import "package:photos/generated/l10n.dart";
import 'package:photos/models/collection/collection.dart';
@@ -11,6 +12,8 @@ import "package:photos/ui/viewer/gallery/collection_page.dart";
import "package:photos/utils/dialog_util.dart";
class NewAlbumRowItemWidget extends StatelessWidget {
+ static const _cornerRadius = 20.0;
+ static const _iconSize = 18.0;
final Color? color;
final double height;
final double width;
@@ -69,7 +72,7 @@ class NewAlbumRowItemWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
- borderRadius: BorderRadius.circular(12),
+ borderRadius: BorderRadius.circular(_cornerRadius),
child: Container(
height: height,
width: width,
@@ -80,13 +83,18 @@ class NewAlbumRowItemWidget extends StatelessWidget {
borderType: BorderType.RRect,
strokeWidth: 1.75,
dashPattern: const [3.75, 3.75],
- radius: const Radius.circular(12),
+ radius: const Radius.circular(_cornerRadius),
padding: EdgeInsets.zero,
- color: colorScheme.strokeFaint,
+ color: colorScheme.strokeDark,
child: Center(
- child: Icon(
- Icons.add,
- color: colorScheme.strokeFaint,
+ child: SizedBox.square(
+ dimension: _iconSize,
+ child: HugeIcon(
+ icon: HugeIcons.strokeRoundedAdd01,
+ size: _iconSize,
+ strokeWidth: 1.5,
+ color: colorScheme.contentLight,
+ ),
),
),
),