Skip to content

armgit / ente

Public Imported from GitHub
0

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

use StyledText for select folders action

Prateek Sunalb8128f8ae893
diff --git a/mobile/apps/photos/lib/l10n/intl_en.arb b/mobile/apps/photos/lib/l10n/intl_en.arb
index 0507d3fa24..a4b44f8b9f 100644
--- a/mobile/apps/photos/lib/l10n/intl_en.arb
+++ b/mobile/apps/photos/lib/l10n/intl_en.arb
@@ -892,8 +892,7 @@
"clickOnTheOverflowMenu": "β€’ Click on the overflow menu",
"click": "β€’ Click",
"nothingToSeeHere": "Nothing to see here! πŸ‘€",
- "selectFolders": "Select folders",
- "toViewAndBackupOnEnte": " to view and\nbackup on ente.",
+ "selectFoldersToBackup": "<action>Select folders</action> to view and\nbackup on ente.",
"unarchiveAlbum": "Unarchive album",
"archiveAlbum": "Archive album",
"calculating": "Calculating...",
diff --git a/mobile/apps/photos/lib/ui/collections/device/device_folders_empty_state.dart b/mobile/apps/photos/lib/ui/collections/device/device_folders_empty_state.dart
deleted file mode 100644
index d704b7acc1..0000000000
--- a/mobile/apps/photos/lib/ui/collections/device/device_folders_empty_state.dart
+++ /dev/null
@@ -1,51 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:photos/generated/l10n.dart';
-import 'package:photos/theme/ente_theme.dart';
-
-class DeviceFoldersEmptyState extends StatelessWidget {
- const DeviceFoldersEmptyState({super.key});
-
- static const Color _selectFoldersGreen = Color(0xFF08C225);
-
- @override
- Widget build(BuildContext context) {
- final textTheme = getEnteTextTheme(context);
-
- return Center(
- child: Padding(
- padding: const EdgeInsets.symmetric(vertical: 16),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Image.asset(
- "assets/ducky_folders.png",
- width: 138,
- height: 120,
- ),
- const SizedBox(height: 16),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 10),
- child: Text.rich(
- TextSpan(
- children: [
- TextSpan(
- text: AppLocalizations.of(context).selectFolders,
- style: textTheme.small.copyWith(
- color: _selectFoldersGreen,
- ),
- ),
- TextSpan(
- text: AppLocalizations.of(context).toViewAndBackupOnEnte,
- style: textTheme.smallMuted,
- ),
- ],
- ),
- textAlign: TextAlign.center,
- ),
- ),
- ],
- ),
- ),
- );
- }
-}
diff --git a/mobile/apps/photos/lib/ui/collections/device/device_folders_grid_view.dart b/mobile/apps/photos/lib/ui/collections/device/device_folders_grid_view.dart
index 27db148dff..552c5ea0f6 100644
--- a/mobile/apps/photos/lib/ui/collections/device/device_folders_grid_view.dart
+++ b/mobile/apps/photos/lib/ui/collections/device/device_folders_grid_view.dart
@@ -1,7 +1,6 @@
import 'dart:async';
import "dart:math";
-import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'package:photos/core/event_bus.dart';
@@ -18,6 +17,7 @@ import "package:photos/ui/common/backup_flow_helper.dart";
import 'package:photos/ui/common/loading_widget.dart';
import 'package:photos/ui/viewer/gallery/empty_state.dart';
import "package:photos/utils/standalone/debouncer.dart";
+import "package:styled_text/styled_text.dart";
class DeviceFoldersGridView extends StatefulWidget {
const DeviceFoldersGridView({
@@ -152,27 +152,21 @@ class _DeviceFoldersGridViewState extends State<DeviceFoldersGridView> {
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
- child: Text.rich(
- TextSpan(
- children: [
- TextSpan(
- text: AppLocalizations.of(context).selectFolders,
- style: textTheme.small.copyWith(
- color: selectFoldersGreen,
- ),
- recognizer: TapGestureRecognizer()
- ..onTap = () async {
- await handleFolderSelectionBackupFlow(context);
- if (mounted) setState(() {});
- },
- ),
- TextSpan(
- text: AppLocalizations.of(context).toViewAndBackupOnEnte,
- style: textTheme.smallMuted,
- ),
- ],
- ),
+ child: StyledText(
+ text: AppLocalizations.of(context).selectFoldersToBackup,
+ style: textTheme.smallMuted,
textAlign: TextAlign.center,
+ tags: {
+ 'action': StyledTextActionTag(
+ (String? text, Map<String?, String?> attrs) async {
+ await handleFolderSelectionBackupFlow(context);
+ if (mounted) setState(() {});
+ },
+ style: textTheme.small.copyWith(
+ color: selectFoldersGreen,
+ ),
+ ),
+ },
),
),
],
diff --git a/mobile/apps/photos/lib/ui/collections/device/device_folders_vertical_grid_view.dart b/mobile/apps/photos/lib/ui/collections/device/device_folders_vertical_grid_view.dart
index 8584bcf2eb..fe0c2f58f0 100644
--- a/mobile/apps/photos/lib/ui/collections/device/device_folders_vertical_grid_view.dart
+++ b/mobile/apps/photos/lib/ui/collections/device/device_folders_vertical_grid_view.dart
@@ -11,9 +11,9 @@ import 'package:photos/events/local_photos_updated_event.dart';
import "package:photos/generated/l10n.dart";
import 'package:photos/models/device_collection.dart';
import "package:photos/ui/collections/device/device_folder_item.dart";
-import "package:photos/ui/collections/device/device_folders_empty_state.dart";
import 'package:photos/ui/common/loading_widget.dart';
import 'package:photos/ui/components/searchable_appbar.dart';
+import 'package:photos/ui/viewer/gallery/empty_state.dart';
import "package:photos/utils/standalone/debouncer.dart";
class DeviceFolderVerticalGridView extends StatefulWidget {
@@ -149,9 +149,7 @@ class _DeviceFolderVerticalGridViewBodyState
albumsCountInCrossAxis;
return deviceCollections.isEmpty
- ? const SliverFillRemaining(
- child: DeviceFoldersEmptyState(),
- )
+ ? const SliverFillRemaining(child: EmptyState())
: SliverPadding(
padding: const EdgeInsets.only(
left: horizontalPadding / 2,