Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Redesign QuickLinkAlbumItem

ashilkn9fef6ae6626c
diff --git a/mobile/lib/ui/tabs/shared/quick_link_album_item.dart b/mobile/lib/ui/tabs/shared/quick_link_album_item.dart
index 70ed4d3dc7..9debde5e84 100644
--- a/mobile/lib/ui/tabs/shared/quick_link_album_item.dart
+++ b/mobile/lib/ui/tabs/shared/quick_link_album_item.dart
@@ -4,9 +4,9 @@ import 'package:photos/models/collection/collection.dart';
import 'package:photos/models/collection/collection_items.dart';
import 'package:photos/models/file/file.dart';
import "package:photos/services/collections_service.dart";
-import "package:photos/theme/colors.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/common/loading_widget.dart";
+import "package:photos/ui/components/buttons/icon_button_widget.dart";
import "package:photos/ui/viewer/file/no_thumbnail_widget.dart";
import "package:photos/ui/viewer/file/thumbnail_widget.dart";
import "package:photos/ui/viewer/gallery/collection_page.dart";
@@ -20,96 +20,123 @@ class QuickLinkAlbumItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final colorScheme = getEnteColorScheme(context);
+ final textTheme = getEnteTextTheme(context);
return GestureDetector(
behavior: HitTestBehavior.opaque,
child: Container(
- margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
+ decoration: BoxDecoration(
+ border: Border.all(color: colorScheme.strokeFainter),
+ borderRadius: const BorderRadius.all(
+ Radius.circular(2),
+ ),
+ ),
child: Row(
- children: <Widget>[
- ClipRRect(
- borderRadius: BorderRadius.circular(1),
- child: SizedBox(
- height: 60,
- width: 60,
- child: FutureBuilder<EnteFile?>(
- future: CollectionsService.instance.getCover(c),
- builder: (context, snapshot) {
- if (snapshot.hasData) {
- final String heroTag = heroTagPrefix + snapshot.data!.tag;
- return Hero(
- tag: heroTag,
- child: ThumbnailWidget(
- snapshot.data!,
- key: ValueKey(heroTag),
- ),
- );
- } else {
- return const NoThumbnailWidget();
- }
- },
- ),
- ),
- ),
- const Padding(padding: EdgeInsets.all(8)),
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Flexible(
+ flex: 6,
+ child: Row(
children: [
- Text(
- c.displayName,
- style: getEnteTextTheme(context).body,
- ),
- Padding(
- padding: const EdgeInsets.fromLTRB(0, 4, 0, 0),
- child: FutureBuilder<int>(
- future: CollectionsService.instance.getFileCount(c),
+ SizedBox(
+ width: 60,
+ height: 60,
+ child: FutureBuilder<EnteFile?>(
+ future: CollectionsService.instance.getCover(c),
builder: (context, snapshot) {
- if (!snapshot.hasError) {
- // final String textCount = NumberFormat().format(snapshot.data);
- return Row(
- children: [
- (!snapshot.hasData)
- ? const Padding(
- padding: EdgeInsets.symmetric(
- horizontal: 16.0,
- ),
- child: EnteLoadingWidget(size: 10),
- )
- : Padding(
- padding:
- const EdgeInsets.only(right: 8.0),
- child: Text(
- S.of(context).itemCount(snapshot.data!),
- style: getEnteTextTheme(context)
- .smallMuted,
- ),
- ),
- const SizedBox(width: 6),
- c.hasLink
- ? (c.publicURLs!.first!.isExpired
- ? const Icon(
- Icons.link_outlined,
- color: warning500,
- )
- : Icon(
- Icons.link_outlined,
- color: getEnteColorScheme(context)
- .strokeMuted,
- ))
- : const SizedBox.shrink(),
- ],
+ if (snapshot.hasData) {
+ final String heroTag =
+ heroTagPrefix + snapshot.data!.tag;
+ return Hero(
+ tag: heroTag,
+ child: ClipRRect(
+ borderRadius: const BorderRadius.horizontal(
+ left: Radius.circular(2),
+ ),
+ child: ThumbnailWidget(
+ snapshot.data!,
+ key: ValueKey(heroTag),
+ ),
+ ),
);
- } else if (snapshot.hasError) {
- return Text(S.of(context).somethingWentWrong);
} else {
- return const EnteLoadingWidget(size: 10);
+ return const NoThumbnailWidget();
}
},
),
),
+ const SizedBox(width: 12),
+ Flexible(
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 4),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ c.displayName,
+ overflow: TextOverflow.ellipsis,
+ ),
+ const SizedBox(
+ height: 2,
+ ),
+ FutureBuilder<int>(
+ future: CollectionsService.instance.getFileCount(c),
+ builder: (context, snapshot) {
+ if (!snapshot.hasError) {
+ if (!snapshot.hasData) {
+ return Row(
+ children: [
+ EnteLoadingWidget(
+ size: 10,
+ color: colorScheme.strokeMuted,
+ ),
+ ],
+ );
+ }
+ final noOfMemories = snapshot.data;
+
+ return Row(
+ children: [
+ Text(
+ noOfMemories.toString() + " \u2022 ",
+ style: textTheme.smallMuted,
+ ),
+ c.hasLink
+ ? (c.publicURLs!.first!.isExpired
+ ? Icon(
+ Icons.link_outlined,
+ color: colorScheme.warning500,
+ size: 22,
+ )
+ : Icon(
+ Icons.link_outlined,
+ color: colorScheme.strokeMuted,
+ size: 22,
+ ))
+ : const SizedBox.shrink(),
+ ],
+ );
+ } else if (snapshot.hasError) {
+ return Text(S.of(context).somethingWentWrong);
+ } else {
+ return const EnteLoadingWidget(size: 10);
+ }
+ },
+ ),
+ ],
+ ),
+ ),
+ ),
],
),
),
+ const Flexible(
+ flex: 1,
+ child: IconButtonWidget(
+ icon: Icons.chevron_right_outlined,
+ iconButtonType: IconButtonType.secondary,
+ ),
+ ),
],
),
),
diff --git a/mobile/lib/ui/tabs/shared_collections_tab.dart b/mobile/lib/ui/tabs/shared_collections_tab.dart
index 450d3062ca..161f0908cd 100644
--- a/mobile/lib/ui/tabs/shared_collections_tab.dart
+++ b/mobile/lib/ui/tabs/shared_collections_tab.dart
@@ -218,22 +218,31 @@ class _SharedCollectionsTabState extends State<SharedCollectionsTab>
),
hasQuickLinks
? Padding(
- padding: const EdgeInsets.symmetric(vertical: 8.0),
+ padding: const EdgeInsets.symmetric(
+ vertical: 8.0,
+ ),
child: Column(
children: [
SectionOptions(
SectionTitle(title: S.of(context).quickLinks),
),
const SizedBox(height: 2),
- ListView.builder(
+ ListView.separated(
shrinkWrap: true,
- padding: const EdgeInsets.only(bottom: 12),
+ padding: const EdgeInsets.only(
+ bottom: 12,
+ left: 12,
+ right: 12,
+ ),
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return QuickLinkAlbumItem(
c: collections.quickLinks[index],
);
},
+ separatorBuilder: (context, index) {
+ return const SizedBox(height: 8);
+ },
itemCount: collections.quickLinks.length,
),
],