Skip to content

armgit / ente

Public Imported from GitHub
0

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

refactor: update banners and localization strings for improved UI consistency

AmanRajSinghMourya69fa646fc825
diff --git a/mobile/apps/photos/lib/l10n/intl_en.arb b/mobile/apps/photos/lib/l10n/intl_en.arb
index a49987d187..60cbafbbd0 100644
--- a/mobile/apps/photos/lib/l10n/intl_en.arb
+++ b/mobile/apps/photos/lib/l10n/intl_en.arb
@@ -2747,8 +2747,9 @@
"enableOnDeviceMLDescription": "Enable on-device ML to search by faces, places, and more. Your photos never leave your device.",
"offlineEnableSharingTitle": "Sharing starts here",
"offlineEnableSharingDesc": "Sign up to share photos with everyone - even those not on Ente",
- "offlineEnableBackupTitle": "Your backed-up albums will appear here",
+ "offlineEnableBackupTitle": "Backed-up albums will appear here",
"offlineEnableBackupDesc": "Sign up to preserve your memories with Ente.",
+ "offlineEnableBackupTagLabel": "10 GB FREE!",
"offlineEnableBackupAction": "Start with 10 GB FREE",
"offlineSettingsBannerTitle": "We can't see your photos. Ever.",
"offlineSettingsBannerDesc": "Zero-knowledge encryption means your memories stay yours.",
diff --git a/mobile/apps/photos/lib/ui/components/banners/banner_action_button.dart b/mobile/apps/photos/lib/ui/components/banners/banner_action_button.dart
new file mode 100644
index 0000000000..ca63a9de1f
--- /dev/null
+++ b/mobile/apps/photos/lib/ui/components/banners/banner_action_button.dart
@@ -0,0 +1,105 @@
+import "package:flutter/material.dart";
+import "package:photos/l10n/l10n.dart";
+import "package:photos/theme/colors.dart";
+import "package:photos/theme/ente_theme.dart";
+
+enum BannerActionButtonVariant {
+ neutral,
+ primary,
+}
+
+class BannerActionButton extends StatelessWidget {
+ final String label;
+ final VoidCallback onTap;
+ final EdgeInsetsGeometry padding;
+ final BannerActionButtonVariant variant;
+ final bool showTag;
+ final bool stickTagToLightTheme;
+
+ const BannerActionButton({
+ required this.label,
+ required this.onTap,
+ this.padding = const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
+ this.variant = BannerActionButtonVariant.neutral,
+ this.showTag = false,
+ this.stickTagToLightTheme = false,
+ super.key,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final textTheme = getEnteTextTheme(context);
+ final colorScheme = getEnteColorScheme(context);
+ final tagLabel = context.l10n.offlineEnableBackupTagLabel;
+ final resolvedBackgroundColor = switch (variant) {
+ BannerActionButtonVariant.neutral => fillLight,
+ BannerActionButtonVariant.primary => green,
+ };
+ final resolvedForegroundColor = switch (variant) {
+ BannerActionButtonVariant.neutral => contentLight,
+ BannerActionButtonVariant.primary => contentDark,
+ };
+ final buttonTextStyle = textTheme.smallBold.copyWith(
+ color: resolvedForegroundColor,
+ fontWeight: FontWeight.w700,
+ );
+
+ final resolvedTagBackgroundColor =
+ stickTagToLightTheme ? fillLight : colorScheme.fillReverse;
+ final resolvedTagForegroundColor =
+ stickTagToLightTheme ? contentLight : colorScheme.contentReverse;
+ final tagTextStyle = textTheme.miniBold.copyWith(
+ color: resolvedTagForegroundColor,
+ fontWeight: FontWeight.w900,
+ fontFamily: "Nunito",
+ fontSize: 9,
+ height: 11 / 9,
+ );
+
+ final button = GestureDetector(
+ onTap: onTap,
+ behavior: HitTestBehavior.opaque,
+ child: Container(
+ padding: padding,
+ decoration: BoxDecoration(
+ color: resolvedBackgroundColor,
+ borderRadius: BorderRadius.circular(16),
+ ),
+ child: Text(
+ label,
+ style: buttonTextStyle,
+ textAlign: TextAlign.center,
+ ),
+ ),
+ );
+
+ if (!showTag) {
+ return button;
+ }
+
+ return Stack(
+ clipBehavior: Clip.none,
+ children: [
+ Positioned(
+ top: -17,
+ right: -18,
+ child: Transform.rotate(
+ angle: 0.14,
+ child: Container(
+ padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
+ decoration: BoxDecoration(
+ color: resolvedTagBackgroundColor,
+ borderRadius: BorderRadius.circular(14),
+ ),
+ child: Text(
+ tagLabel,
+ style: tagTextStyle,
+ ),
+ ),
+ ),
+ ),
+ button,
+ ],
+ );
+ }
+}
diff --git a/mobile/apps/photos/lib/ui/components/banners/get_started_banner.dart b/mobile/apps/photos/lib/ui/components/banners/get_started_banner.dart
index 5e8e4a9e0d..770f027fb0 100644
--- a/mobile/apps/photos/lib/ui/components/banners/get_started_banner.dart
+++ b/mobile/apps/photos/lib/ui/components/banners/get_started_banner.dart
@@ -2,8 +2,10 @@ import "package:flutter/material.dart";
import "package:hugeicons/hugeicons.dart";
import "package:photos/generated/l10n.dart";
import "package:photos/service_locator.dart";
+import "package:photos/theme/colors.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/account/email_entry_page.dart";
+import "package:photos/ui/components/banners/banner_action_button.dart";
class GetStartedBanner extends StatefulWidget {
const GetStartedBanner({super.key});
@@ -22,42 +24,29 @@ class _GetStartedBannerState extends State<GetStartedBanner> {
return const SizedBox.shrink();
}
- const titleStyle = TextStyle(
+ final colorScheme = getEnteColorScheme(context);
+ final textTheme = getEnteTextTheme(context);
+ final l10n = AppLocalizations.of(context);
+
+ final titleStyle = textTheme.largeBold.copyWith(
fontFamily: "Nunito",
fontWeight: FontWeight.w800,
- fontSize: 18,
- height: 28 / 18,
+ fontSize: 20,
+ height: 24 / 18,
letterSpacing: -1,
color: Colors.white,
);
- const descriptionStyle = TextStyle(
- fontFamily: "Montserrat",
- fontWeight: FontWeight.w600,
- fontSize: 12,
- height: 18 / 12,
- color: Color.fromRGBO(255, 255, 255, 0.8),
- );
-
- const buttonTextStyle = TextStyle(
- fontFamily: "Montserrat",
- fontWeight: FontWeight.w600,
- fontSize: 10,
- height: 12 / 10,
- color: Colors.black,
- );
-
return GestureDetector(
onTap: _onGetStarted,
child: Container(
- height: 165,
+ height: 180,
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
- color: getEnteColorScheme(context).greenBase,
+ color: colorScheme.greenBase,
),
child: Stack(
- clipBehavior: Clip.none,
children: [
Padding(
padding: const EdgeInsets.all(16),
@@ -68,23 +57,32 @@ class _GetStartedBannerState extends State<GetStartedBanner> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
- child: Text(
- AppLocalizations.of(context).moreThanJustAGallery,
- style: titleStyle,
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 235),
+ child: Text(
+ l10n.moreThanJustAGallery,
+ style: titleStyle,
+ maxLines: 1,
+ softWrap: false,
+ overflow: TextOverflow.ellipsis,
+ ),
),
),
GestureDetector(
onTap: _onDismiss,
behavior: HitTestBehavior.opaque,
- child: const SizedBox(
- height: 20,
- width: 20,
- child: Center(
+ child: Container(
+ decoration: const BoxDecoration(
+ shape: BoxShape.circle,
+ color: greenDark,
+ ),
+ child: const Padding(
+ padding: EdgeInsets.all(4),
child: HugeIcon(
icon: HugeIcons.strokeRoundedCancel01,
- color: Colors.white,
- size: 20,
- strokeWidth: 2,
+ color: contentDark,
+ size: 18,
+ strokeWidth: 2.5,
),
),
),
@@ -95,26 +93,9 @@ class _GetStartedBannerState extends State<GetStartedBanner> {
ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 235),
child: Text(
- AppLocalizations.of(context).encryptedBackupDescription,
- style: descriptionStyle,
- ),
- ),
- const Spacer(),
- GestureDetector(
- onTap: _onGetStarted,
- child: Container(
- height: 36,
- padding: const EdgeInsets.symmetric(horizontal: 24),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(12),
- ),
- child: Center(
- widthFactor: 1,
- child: Text(
- AppLocalizations.of(context).getStarted,
- style: buttonTextStyle,
- ),
+ l10n.encryptedBackupDescription,
+ style: textTheme.smallMuted.copyWith(
+ color: Colors.white.withValues(alpha: 0.9),
),
),
),
@@ -122,12 +103,21 @@ class _GetStartedBannerState extends State<GetStartedBanner> {
),
),
Positioned(
- right: 12,
+ left: 16,
+ bottom: 16,
+ child: BannerActionButton(
+ label: l10n.getStarted,
+ onTap: _onGetStarted,
+ variant: BannerActionButtonVariant.neutral,
+ ),
+ ),
+ Positioned(
+ right: 16,
bottom: 12,
child: IgnorePointer(
child: Image.asset(
"assets/ducky_get_started.png",
- height: 100,
+ height: 120,
fit: BoxFit.contain,
),
),
diff --git a/mobile/apps/photos/lib/ui/components/banners/ml_progress_banner.dart b/mobile/apps/photos/lib/ui/components/banners/ml_progress_banner.dart
index 5329761c3b..a32f841c3c 100644
--- a/mobile/apps/photos/lib/ui/components/banners/ml_progress_banner.dart
+++ b/mobile/apps/photos/lib/ui/components/banners/ml_progress_banner.dart
@@ -139,6 +139,15 @@ class _MLProgressBannerState extends State<MLProgressBanner> {
final showPausedPhase = _shouldShowPausedPhase(status);
final showModelDownloadPhase = _shouldShowModelDownloadPhase(status);
+ final titleStyle = textTheme.largeBold.copyWith(
+ fontFamily: "Nunito",
+ fontWeight: FontWeight.w800,
+ fontSize: 20,
+ height: 24 / 18,
+ letterSpacing: -1,
+ color: colorScheme.greenBase,
+ );
+
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: GestureDetector(
@@ -160,25 +169,23 @@ class _MLProgressBannerState extends State<MLProgressBanner> {
children: [
Text(
l10n.mlProgressBannerTitle,
- style: TextStyle(
- fontFamily: "Montserrat",
- fontWeight: FontWeight.bold,
- fontSize: 16,
- color: colorScheme.greenBase,
- ),
+ style: titleStyle,
),
GestureDetector(
onTap: _onDismiss,
behavior: HitTestBehavior.opaque,
- child: SizedBox(
- width: 20,
- height: 20,
- child: Center(
+ child: Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: colorScheme.fillDark,
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(4),
child: HugeIcon(
icon: HugeIcons.strokeRoundedCancel01,
- color: colorScheme.textFaint,
- size: 20,
- strokeWidth: 2,
+ color: colorScheme.contentDark,
+ size: 18,
+ strokeWidth: 2.5,
),
),
),
@@ -188,10 +195,7 @@ class _MLProgressBannerState extends State<MLProgressBanner> {
const SizedBox(height: 8),
Text(
l10n.mlProgressBannerDescription,
- style: textTheme.miniMuted.copyWith(
- fontFamily: "Montserrat",
- fontWeight: FontWeight.w600,
- ),
+ style: textTheme.smallMuted,
),
const SizedBox(height: 24),
ClipRRect(
@@ -232,7 +236,7 @@ class _MLProgressBannerState extends State<MLProgressBanner> {
indexed: format.format(status.indexedItems),
total: format.format(total),
),
- style: textTheme.tinyMuted,
+ style: textTheme.miniMuted,
),
),
],
diff --git a/mobile/apps/photos/lib/ui/components/banners/name_face_banner.dart b/mobile/apps/photos/lib/ui/components/banners/name_face_banner.dart
index 3610dee1ca..70a1a53969 100644
--- a/mobile/apps/photos/lib/ui/components/banners/name_face_banner.dart
+++ b/mobile/apps/photos/lib/ui/components/banners/name_face_banner.dart
@@ -3,6 +3,7 @@ import "package:hugeicons/hugeicons.dart";
import "package:photos/generated/intl/app_localizations.dart";
import "package:photos/service_locator.dart";
import "package:photos/theme/ente_theme.dart";
+import "package:photos/ui/components/banners/banner_action_button.dart";
import "package:photos/ui/home/landing_page_widget.dart";
class NameFaceBanner extends StatefulWidget {
@@ -24,6 +25,7 @@ class _NameFaceBannerState extends State<NameFaceBanner> {
}
final colorScheme = getEnteColorScheme(context);
+ final textTheme = getEnteTextTheme(context);
final l10n = AppLocalizations.of(context);
return Padding(
@@ -46,12 +48,12 @@ class _NameFaceBannerState extends State<NameFaceBanner> {
child: Text(
l10n.offlineNameFaceBannerTitle,
textAlign: TextAlign.center,
- style: TextStyle(
+ style: textTheme.largeBold.copyWith(
fontFamily: "Nunito",
fontWeight: FontWeight.w800,
- fontSize: 16,
- height: 20 / 16,
- letterSpacing: -1.0,
+ fontSize: 20,
+ height: 24 / 18,
+ letterSpacing: -1,
color: colorScheme.textBase,
),
),
@@ -59,13 +61,19 @@ class _NameFaceBannerState extends State<NameFaceBanner> {
GestureDetector(
onTap: _onDismiss,
behavior: HitTestBehavior.opaque,
- child: Padding(
- padding: const EdgeInsets.all(4),
- child: HugeIcon(
- icon: HugeIcons.strokeRoundedCancel01,
- color: colorScheme.contentLight,
- size: 18,
- strokeWidth: 2,
+ child: Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: colorScheme.fillDark,
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(4),
+ child: HugeIcon(
+ icon: HugeIcons.strokeRoundedCancel01,
+ color: colorScheme.contentLight,
+ size: 18,
+ strokeWidth: 2.5,
+ ),
),
),
),
@@ -73,22 +81,17 @@ class _NameFaceBannerState extends State<NameFaceBanner> {
),
),
const SizedBox(height: 8),
- ConstrainedBox(
- constraints: const BoxConstraints(maxWidth: 250),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 8),
child: Text(
l10n.offlineNameFaceBannerSubtitle,
textAlign: TextAlign.center,
- style: TextStyle(
- fontFamily: "Inter",
- fontWeight: FontWeight.w500,
- fontSize: 12,
- height: 16 / 12,
- color: colorScheme.contentLight,
- ),
+ style: textTheme.smallMuted,
),
),
const SizedBox(height: 16),
- GestureDetector(
+ BannerActionButton(
+ label: l10n.signUp,
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
@@ -96,27 +99,7 @@ class _NameFaceBannerState extends State<NameFaceBanner> {
),
);
},
- child: Container(
- width: 140,
- alignment: Alignment.center,
- decoration: BoxDecoration(
- color: colorScheme.greenBase,
- borderRadius: BorderRadius.circular(12),
- ),
- padding: const EdgeInsets.symmetric(
- vertical: 18,
- ),
- child: Text(
- l10n.signUp,
- style: const TextStyle(
- fontFamily: "Montserrat",
- fontWeight: FontWeight.w600,
- fontSize: 10,
- height: 12 / 10,
- color: Colors.white,
- ),
- ),
- ),
+ variant: BannerActionButtonVariant.primary,
),
],
),
diff --git a/mobile/apps/photos/lib/ui/components/banners/offline_settings_banner.dart b/mobile/apps/photos/lib/ui/components/banners/offline_settings_banner.dart
index 01b88c6cfc..7bab7d8885 100644
--- a/mobile/apps/photos/lib/ui/components/banners/offline_settings_banner.dart
+++ b/mobile/apps/photos/lib/ui/components/banners/offline_settings_banner.dart
@@ -4,6 +4,9 @@ import "package:flutter/material.dart";
import "package:hugeicons/hugeicons.dart";
import "package:photos/generated/l10n.dart";
import "package:photos/service_locator.dart";
+import "package:photos/theme/colors.dart";
+import "package:photos/theme/ente_theme.dart";
+import "package:photos/ui/components/banners/banner_action_button.dart";
class OfflineSettingsBanner extends StatefulWidget {
final VoidCallback onGetStarted;
@@ -27,40 +30,25 @@ class _OfflineSettingsBannerState extends State<OfflineSettingsBanner> {
return const SizedBox.shrink();
}
- const titleStyle = TextStyle(
+ final textTheme = getEnteTextTheme(context);
+ final l10n = AppLocalizations.of(context);
+ final titleStyle = textTheme.largeBold.copyWith(
fontFamily: "Nunito",
fontWeight: FontWeight.w800,
- fontSize: 18,
- height: 28 / 18,
+ fontSize: 20,
+ height: 24 / 18,
letterSpacing: -1,
color: Colors.white,
);
- const descriptionStyle = TextStyle(
- fontFamily: "Montserrat",
- fontWeight: FontWeight.w600,
- fontSize: 12,
- height: 18 / 12,
- color: Color.fromRGBO(165, 165, 165, 0.79),
- );
-
- const buttonTextStyle = TextStyle(
- fontFamily: "Montserrat",
- fontWeight: FontWeight.w600,
- fontSize: 10,
- height: 12 / 10,
- color: Colors.black,
- );
-
- final l10n = AppLocalizations.of(context);
-
- return ClipRRect(
- borderRadius: BorderRadius.circular(15),
+ return GestureDetector(
+ onTap: widget.onGetStarted,
child: Container(
- height: 165,
- width: double.infinity,
- decoration: const BoxDecoration(
- gradient: LinearGradient(
+ height: 175,
+ clipBehavior: Clip.hardEdge,
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(16),
+ gradient: const LinearGradient(
colors: [
Color.fromRGBO(21, 21, 21, 1),
Color.fromRGBO(43, 43, 43, 1),
@@ -96,15 +84,18 @@ class _OfflineSettingsBannerState extends State<OfflineSettingsBanner> {
GestureDetector(
onTap: _onDismiss,
behavior: HitTestBehavior.opaque,
- child: const SizedBox(
- width: 20,
- height: 20,
- child: Center(
+ child: Container(
+ decoration: const BoxDecoration(
+ shape: BoxShape.circle,
+ color: contentLight,
+ ),
+ child: const Padding(
+ padding: EdgeInsets.all(4),
child: HugeIcon(
icon: HugeIcons.strokeRoundedCancel01,
- color: Colors.white,
- size: 20,
- strokeWidth: 2,
+ color: contentDark,
+ size: 18,
+ strokeWidth: 2.5,
),
),
),
@@ -116,25 +107,8 @@ class _OfflineSettingsBannerState extends State<OfflineSettingsBanner> {
constraints: const BoxConstraints(maxWidth: 235),
child: Text(
l10n.offlineSettingsBannerDesc,
- style: descriptionStyle,
- ),
- ),
- const Spacer(),
- GestureDetector(
- onTap: widget.onGetStarted,
- child: Container(
- height: 36,
- padding: const EdgeInsets.symmetric(horizontal: 24),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(12),
- ),
- child: Center(
- widthFactor: 1,
- child: Text(
- l10n.offlineEnableBackupAction,
- style: buttonTextStyle,
- ),
+ style: textTheme.smallMuted.copyWith(
+ color: Colors.white.withValues(alpha: 0.5),
),
),
),
@@ -142,7 +116,18 @@ class _OfflineSettingsBannerState extends State<OfflineSettingsBanner> {
),
),
Positioned(
- right: 12,
+ left: 16,
+ bottom: 16,
+ child: BannerActionButton(
+ label: l10n.getStarted,
+ onTap: widget.onGetStarted,
+ variant: BannerActionButtonVariant.primary,
+ stickTagToLightTheme: true,
+ showTag: true,
+ ),
+ ),
+ Positioned(
+ right: 16,
bottom: 0,
child: IgnorePointer(
child: Image.asset(
diff --git a/mobile/apps/photos/lib/ui/components/banners/save_faces_banner.dart b/mobile/apps/photos/lib/ui/components/banners/save_faces_banner.dart
index ae13665226..4152787d89 100644
--- a/mobile/apps/photos/lib/ui/components/banners/save_faces_banner.dart
+++ b/mobile/apps/photos/lib/ui/components/banners/save_faces_banner.dart
@@ -4,6 +4,7 @@ import "package:photos/generated/intl/app_localizations.dart";
import "package:photos/service_locator.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/account/email_entry_page.dart";
+import "package:photos/ui/components/banners/banner_action_button.dart";
class SaveFacesBanner extends StatefulWidget {
const SaveFacesBanner({super.key});
@@ -24,6 +25,7 @@ class _SaveFacesBannerState extends State<SaveFacesBanner> {
}
final colorScheme = getEnteColorScheme(context);
+ final textTheme = getEnteTextTheme(context);
final l10n = AppLocalizations.of(context);
return Padding(
@@ -46,12 +48,12 @@ class _SaveFacesBannerState extends State<SaveFacesBanner> {
child: Text(
l10n.offlineFacesBannerTitle,
textAlign: TextAlign.center,
- style: TextStyle(
+ style: textTheme.largeBold.copyWith(
fontFamily: "Nunito",
fontWeight: FontWeight.w800,
- fontSize: 16,
- height: 20 / 16,
- letterSpacing: -1.0,
+ fontSize: 20,
+ height: 24 / 18,
+ letterSpacing: -1,
color: colorScheme.textBase,
),
),
@@ -59,15 +61,18 @@ class _SaveFacesBannerState extends State<SaveFacesBanner> {
GestureDetector(
onTap: _onDismiss,
behavior: HitTestBehavior.opaque,
- child: SizedBox(
- width: 20,
- height: 20,
- child: Center(
+ child: Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: colorScheme.fillDark,
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(4),
child: HugeIcon(
icon: HugeIcons.strokeRoundedCancel01,
color: colorScheme.contentLight,
size: 18,
- strokeWidth: 2,
+ strokeWidth: 2.5,
),
),
),
@@ -76,22 +81,17 @@ class _SaveFacesBannerState extends State<SaveFacesBanner> {
),
),
const SizedBox(height: 8),
- ConstrainedBox(
- constraints: const BoxConstraints(maxWidth: 250),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 8),
child: Text(
l10n.offlineFacesBannerSubtitle,
textAlign: TextAlign.center,
- style: TextStyle(
- fontFamily: "Inter",
- fontWeight: FontWeight.w500,
- fontSize: 12,
- height: 16 / 12,
- color: colorScheme.contentLight,
- ),
+ style: textTheme.smallMuted,
),
),
const SizedBox(height: 16),
- GestureDetector(
+ BannerActionButton(
+ label: l10n.signUp,
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
@@ -99,27 +99,7 @@ class _SaveFacesBannerState extends State<SaveFacesBanner> {
),
);
},
- child: Container(
- width: 140,
- alignment: Alignment.center,
- decoration: BoxDecoration(
- color: colorScheme.greenBase,
- borderRadius: BorderRadius.circular(12),
- ),
- padding: const EdgeInsets.symmetric(
- vertical: 18,
- ),
- child: Text(
- l10n.signUp,
- style: const TextStyle(
- fontFamily: "Montserrat",
- fontWeight: FontWeight.w600,
- fontSize: 10,
- height: 12 / 10,
- color: Colors.white,
- ),
- ),
- ),
+ variant: BannerActionButtonVariant.primary,
),
],
),
diff --git a/mobile/apps/photos/lib/ui/components/banners/shared_empty_offline_state_widget.dart b/mobile/apps/photos/lib/ui/components/banners/shared_empty_offline_state_widget.dart
index 2c74b288fa..edd736d3ec 100644
--- a/mobile/apps/photos/lib/ui/components/banners/shared_empty_offline_state_widget.dart
+++ b/mobile/apps/photos/lib/ui/components/banners/shared_empty_offline_state_widget.dart
@@ -2,6 +2,7 @@ import "package:flutter/material.dart";
import "package:photos/generated/l10n.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/account/email_entry_page.dart";
+import "package:photos/ui/components/banners/banner_action_button.dart";
class SharedEmptyOfflineStateWidget extends StatelessWidget {
const SharedEmptyOfflineStateWidget({super.key});
@@ -9,6 +10,7 @@ class SharedEmptyOfflineStateWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colorScheme = getEnteColorScheme(context);
+ final textTheme = getEnteTextTheme(context);
final l10n = AppLocalizations.of(context);
return Center(
@@ -26,28 +28,27 @@ class SharedEmptyOfflineStateWidget extends StatelessWidget {
),
Text(
l10n.offlineEnableSharingTitle,
- style: TextStyle(
+ style: textTheme.largeBold.copyWith(
fontFamily: "Nunito",
- fontWeight: FontWeight.w900,
- fontSize: 28,
- letterSpacing: -1.0,
- color: colorScheme.textBase,
+ fontWeight: FontWeight.w800,
+ fontSize: 20,
+ height: 24 / 18,
+ letterSpacing: -1,
+ color: colorScheme.content,
),
),
const SizedBox(height: 12),
Text(
l10n.offlineEnableSharingDesc,
textAlign: TextAlign.center,
- style: TextStyle(
- fontFamily: "Inter",
- fontWeight: FontWeight.w500,
- fontSize: 14,
- height: 20 / 14,
- color: colorScheme.textMuted,
- ),
+ style: textTheme.smallMuted,
),
- const SizedBox(height: 24),
- GestureDetector(
+ const SizedBox(height: 28),
+ BannerActionButton(
+ label: l10n.getStarted,
+ showTag: true,
+ stickTagToLightTheme: false,
+ variant: BannerActionButtonVariant.primary,
onTap: () async {
await Navigator.of(context).push(
MaterialPageRoute(
@@ -55,25 +56,6 @@ class SharedEmptyOfflineStateWidget extends StatelessWidget {
),
);
},
- child: Container(
- height: 48,
- padding:
- const EdgeInsets.symmetric(vertical: 14, horizontal: 24),
- decoration: BoxDecoration(
- color: colorScheme.greenBase,
- borderRadius: BorderRadius.circular(16),
- ),
- child: Text(
- l10n.offlineEnableBackupAction,
- style: const TextStyle(
- fontFamily: "Montserrat",
- fontWeight: FontWeight.bold,
- fontSize: 13,
- height: 16 / 13,
- color: Colors.white,
- ),
- ),
- ),
),
],
),
diff --git a/mobile/apps/photos/lib/ui/offline/empty/on_ente.dart b/mobile/apps/photos/lib/ui/offline/empty/on_ente.dart
deleted file mode 100644
index 7f91d3030b..0000000000
--- a/mobile/apps/photos/lib/ui/offline/empty/on_ente.dart
+++ /dev/null
@@ -1,94 +0,0 @@
-import "package:flutter/material.dart";
-import "package:photos/generated/l10n.dart";
-import "package:photos/models/collection/collection.dart";
-import "package:photos/theme/ente_theme.dart";
-import "package:photos/ui/account/email_entry_page.dart";
-
-class EmptyOnEnteSection extends StatelessWidget {
- final List<Collection> collections;
-
- const EmptyOnEnteSection({
- super.key,
- required this.collections,
- });
-
- @override
- Widget build(BuildContext context) {
- final colorScheme = getEnteColorScheme(context);
- final l10n = AppLocalizations.of(context);
-
- return Padding(
- padding: const EdgeInsets.all(12),
- child: Container(
- padding: const EdgeInsets.symmetric(vertical: 24),
- decoration: BoxDecoration(
- color: colorScheme.backgroundColour,
- borderRadius: BorderRadius.circular(20),
- ),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- ConstrainedBox(
- constraints: const BoxConstraints(maxWidth: 200),
- child: Text(
- l10n.offlineEnableBackupTitle,
- textAlign: TextAlign.center,
- style: TextStyle(
- fontFamily: "Nunito",
- fontWeight: FontWeight.w800,
- fontSize: 16,
- height: 20 / 16,
- letterSpacing: -1.0,
- color: colorScheme.textBase,
- ),
- ),
- ),
- const SizedBox(height: 8),
- ConstrainedBox(
- constraints: const BoxConstraints(maxWidth: 235),
- child: Text(
- l10n.offlineEnableBackupDesc,
- textAlign: TextAlign.center,
- style: TextStyle(
- fontFamily: "Inter",
- fontWeight: FontWeight.w500,
- fontSize: 12,
- height: 16 / 12,
- color: colorScheme.textBase.withValues(alpha: 0.6),
- ),
- ),
- ),
- const SizedBox(height: 16),
- GestureDetector(
- onTap: () async {
- await Navigator.of(context).push(
- MaterialPageRoute(
- builder: (_) => const EmailEntryPage(),
- ),
- );
- },
- child: Container(
- decoration: BoxDecoration(
- color: colorScheme.greenBase,
- borderRadius: BorderRadius.circular(12),
- ),
- padding:
- const EdgeInsets.symmetric(horizontal: 24, vertical: 18),
- child: Text(
- l10n.offlineEnableBackupAction,
- style: const TextStyle(
- fontFamily: "Montserrat",
- fontWeight: FontWeight.w600,
- fontSize: 10,
- height: 12 / 10,
- color: Colors.white,
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- );
- }
-}
diff --git a/mobile/apps/photos/lib/ui/offline/empty/on_ente_empty_state.dart b/mobile/apps/photos/lib/ui/offline/empty/on_ente_empty_state.dart
new file mode 100644
index 0000000000..9d1799ef07
--- /dev/null
+++ b/mobile/apps/photos/lib/ui/offline/empty/on_ente_empty_state.dart
@@ -0,0 +1,76 @@
+import "package:flutter/material.dart";
+import "package:photos/generated/l10n.dart";
+import "package:photos/theme/ente_theme.dart";
+import "package:photos/ui/account/email_entry_page.dart";
+import "package:photos/ui/components/banners/banner_action_button.dart";
+
+class EmptyOnEnteSection extends StatelessWidget {
+ const EmptyOnEnteSection({
+ super.key,
+ });
+
+ @override
+ Widget build(BuildContext context) {
+ final colorScheme = getEnteColorScheme(context);
+ final textTheme = getEnteTextTheme(context);
+ final l10n = AppLocalizations.of(context);
+ final titleStyle = textTheme.largeBold.copyWith(
+ fontFamily: "Nunito",
+ fontWeight: FontWeight.w800,
+ fontSize: 20,
+ height: 24 / 18,
+ letterSpacing: -1,
+ color: colorScheme.content,
+ );
+
+ return Padding(
+ padding: const EdgeInsets.all(12),
+ child: Container(
+ width: double.infinity,
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
+ decoration: BoxDecoration(
+ color: colorScheme.fillDark,
+ borderRadius: BorderRadius.circular(20),
+ ),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ SizedBox(
+ height: 140,
+ child: Image.asset(
+ "assets/photo_backup.png",
+ fit: BoxFit.contain,
+ ),
+ ),
+ const SizedBox(height: 14),
+ Text(
+ l10n.offlineEnableBackupTitle,
+ textAlign: TextAlign.center,
+ style: titleStyle,
+ ),
+ const SizedBox(height: 8),
+ Text(
+ l10n.offlineEnableBackupDesc,
+ textAlign: TextAlign.center,
+ style: textTheme.smallMuted,
+ ),
+ const SizedBox(height: 28),
+ BannerActionButton(
+ label: l10n.getStarted,
+ stickTagToLightTheme: false,
+ showTag: true,
+ variant: BannerActionButtonVariant.primary,
+ onTap: () async {
+ await Navigator.of(context).push(
+ MaterialPageRoute(
+ builder: (_) => const EmailEntryPage(),
+ ),
+ );
+ },
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
diff --git a/mobile/apps/photos/lib/ui/tabs/user_collections_tab.dart b/mobile/apps/photos/lib/ui/tabs/user_collections_tab.dart
index acaf9195f5..64023f1cb6 100644
--- a/mobile/apps/photos/lib/ui/tabs/user_collections_tab.dart
+++ b/mobile/apps/photos/lib/ui/tabs/user_collections_tab.dart
@@ -27,7 +27,7 @@ import "package:photos/ui/collections/device/device_folders_vertical_grid_view.d
import "package:photos/ui/collections/flex_grid_view.dart";
import "package:photos/ui/common/loading_widget.dart";
import "package:photos/ui/components/buttons/icon_button_widget.dart";
-import "package:photos/ui/offline/empty/on_ente.dart";
+import "package:photos/ui/offline/empty/on_ente_empty_state.dart";
import "package:photos/ui/tabs/section_title.dart";
import "package:photos/ui/viewer/actions/album_selection_overlay_bar.dart";
import "package:photos/ui/viewer/actions/delete_empty_albums.dart";
@@ -259,8 +259,8 @@ class _UserCollectionsTabState extends State<UserCollectionsTab>
),
SliverToBoxAdapter(child: DeleteEmptyAlbums(collections)),
isOfflineMode
- ? SliverToBoxAdapter(
- child: EmptyOnEnteSection(collections: collections),
+ ? const SliverToBoxAdapter(
+ child: EmptyOnEnteSection(),
)
: Configuration.instance.hasConfiguredAccount()
? CollectionsFlexiGridViewWidget(