💚 End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mobile][photos] Add the Locker preview sheet
r4khulca74d167baee
diff --git a/mobile/apps/photos/assets/subscription/2.0x/locker_phone.png b/mobile/apps/photos/assets/subscription/2.0x/locker_phone.pngnew file mode 100644index 0000000000..1b4fc97908Binary files /dev/null and b/mobile/apps/photos/assets/subscription/2.0x/locker_phone.png differdiff --git a/mobile/apps/photos/assets/subscription/3.0x/locker_phone.png b/mobile/apps/photos/assets/subscription/3.0x/locker_phone.pngnew file mode 100644index 0000000000..ae3c009aefBinary files /dev/null and b/mobile/apps/photos/assets/subscription/3.0x/locker_phone.png differdiff --git a/mobile/apps/photos/assets/subscription/locker_phone.png b/mobile/apps/photos/assets/subscription/locker_phone.pngnew file mode 100644index 0000000000..a9baa34a28Binary files /dev/null and b/mobile/apps/photos/assets/subscription/locker_phone.png differdiff --git a/mobile/apps/photos/assets/subscription/locker_wordmark.svg b/mobile/apps/photos/assets/subscription/locker_wordmark.svgnew file mode 100644index 0000000000..6872988981--- /dev/null+++ b/mobile/apps/photos/assets/subscription/locker_wordmark.svg@@ -0,0 +1,10 @@+<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="59.2" height="40" viewBox="0 0 59.2 40" fill="none" xmlns="http://www.w3.org/2000/svg">+<g id="Official Ente Locker wordmark">+<path id="Vector" d="M14.8747 11.5366H4.94866C5.42818 12.7066 6.5023 13.2916 8.17104 13.2916C9.18762 13.2916 10.0604 12.9559 10.7892 12.2846L14.2418 14.7014C12.8416 16.4851 10.7796 17.3771 8.05595 17.3771C5.61998 17.3771 3.66354 16.6674 2.18661 15.248C0.728872 13.8095 0 11.9969 0 9.81028C0 7.64284 0.719282 5.83025 2.15784 4.37251C3.5964 2.91476 5.42818 2.1859 7.65315 2.1859C9.80141 2.1859 11.5756 2.90518 12.9758 4.34374C14.376 5.76313 15.0761 7.56612 15.0761 9.75273C15.0761 10.4241 15.009 11.0187 14.8747 11.5366ZM4.89112 8.22785H10.4152C10.0508 6.88519 9.14926 6.21387 7.7107 6.21387C6.23378 6.21387 5.2939 6.88519 4.89112 8.22785Z" fill="white" style="fill:white;fill-opacity:1;"/>+<path id="Vector_2" d="M24.4611 2.1859C26.0531 2.1859 27.3286 2.73255 28.2876 3.82585C29.2659 4.89998 29.755 6.41527 29.755 8.3717V16.9743H24.979V8.97591C24.979 8.24703 24.7871 7.69079 24.4036 7.30718C24.0199 6.90438 23.4924 6.70298 22.8212 6.70298C22.0731 6.70298 21.4881 6.93314 21.066 7.3935C20.6633 7.83465 20.4619 8.47721 20.4619 9.32116V16.9743H15.6859V2.5887H20.4619V4.02726C21.3251 2.79969 22.6582 2.1859 24.4611 2.1859Z" fill="white" style="fill:white;fill-opacity:1;"/>+<path id="Vector_3" d="M39.8235 2.58947V7.1641H36.8312V11.3359C36.8312 11.9497 37.0422 12.3429 37.4642 12.5156C37.9054 12.669 38.6918 12.7169 39.8235 12.6594V16.975C36.9846 17.3203 34.9707 17.0614 33.7814 16.1982C32.6307 15.2968 32.0552 13.7144 32.0552 11.451V7.1641H29.8974V2.58947H32.0552V5.33594e-05L36.8312 0V2.58947H39.8235Z" fill="white" style="fill:white;fill-opacity:1;"/>+<path id="Vector_4" d="M54.5222 11.5366H44.5961C45.0756 12.7066 46.1497 13.2916 47.8185 13.2916C48.8351 13.2916 49.7078 12.9559 50.4367 12.2846L53.8892 14.7014C52.489 16.4851 50.4271 17.3771 47.7034 17.3771C45.2674 17.3771 43.311 16.6674 41.834 15.248C40.3764 13.8095 39.6474 11.9969 39.6474 9.81028C39.6474 7.64284 40.3668 5.83025 41.8054 4.37251C43.2439 2.91476 45.0756 2.1859 47.3006 2.1859C49.4489 2.1859 51.2231 2.90518 52.6233 4.34374C54.0234 5.76313 54.7236 7.56612 54.7236 9.75273C54.7236 10.4241 54.6564 11.0187 54.5222 11.5366ZM44.5386 8.22785H50.0626C49.6982 6.88519 48.7967 6.21387 47.3582 6.21387C45.8812 6.21387 44.9414 6.88519 44.5386 8.22785Z" fill="white" style="fill:white;fill-opacity:1;"/>+<path id="Vector_5" d="M52.103 18.09L17.2635 20.6767C14.0566 20.9148 11.6499 23.7074 11.888 26.9143L12.3191 32.7208C12.5572 35.9277 15.35 38.3344 18.5569 38.0964L53.3963 35.5096C56.6032 35.2716 59.0099 32.4788 58.7718 29.2719L58.3406 23.4653C58.1025 20.2584 55.3099 17.8519 52.103 18.09Z" fill="black" style="fill:black;fill-opacity:1;"/>+<path id="Vector_6" d="M24.9129 30.6251L27.1342 30.4434L27.2647 32.0379L23.3935 32.3547L22.8654 25.9027L24.5153 25.7677L24.9129 30.6251ZM29.547 31.981C28.1921 32.0918 26.9993 31.1224 26.8868 29.7491C26.7745 28.3757 27.7846 27.2259 29.1486 27.1142C30.522 27.0019 31.6964 27.9728 31.8087 29.3462C31.9212 30.7195 30.9204 31.8685 29.547 31.981ZM29.4263 30.5062C29.9609 30.4624 30.3255 30.0429 30.2788 29.4714C30.2319 28.9 29.8039 28.5453 29.2694 28.5891C28.7439 28.632 28.3793 29.0517 28.4262 29.623C28.4729 30.1946 28.9009 30.5491 29.4263 30.5062ZM34.4505 31.5795C33.0495 31.6942 31.9121 30.7203 31.7996 29.3469C31.6873 27.9736 32.6511 26.8277 34.0523 26.713C34.9647 26.6382 35.7958 27.0434 36.251 27.7299L35.0041 28.5928C34.8347 28.3376 34.5247 28.1774 34.1652 28.2069C33.6491 28.2491 33.2937 28.6678 33.3388 29.221C33.3841 29.7739 33.803 30.1294 34.3191 30.0872C34.6787 30.0578 34.9676 29.8485 35.0833 29.5606L36.454 30.2093C36.1172 30.9699 35.363 31.5048 34.4505 31.5795ZM41.1263 30.9032L39.4121 31.0435L37.9425 29.1874L38.1031 31.1507L36.5732 31.2758L36.0451 24.824L37.5751 24.6987L37.8836 28.4685L38.915 26.4448L40.6847 26.3L39.3247 28.7309L41.1263 30.9032ZM42.0324 29.0754C42.2529 29.5027 42.6683 29.5893 43.1108 29.5531C43.4425 29.5259 43.7193 29.392 43.9231 29.1618L45.0926 29.8456C44.6791 30.464 44.0014 30.7978 43.1811 30.865C41.5865 30.9955 40.5135 30.0162 40.4019 28.652C40.2886 27.2694 41.2158 26.1266 42.6535 26.0088C44.0361 25.8957 45.1169 26.8557 45.23 28.2382C45.2459 28.4318 45.2425 28.6178 45.2123 28.815L42.0324 29.0754ZM41.9271 28.0168L43.6969 27.872C43.5195 27.404 43.1463 27.2675 42.7777 27.2978C42.3353 27.3339 42.0215 27.5824 41.9271 28.0168ZM46.8387 26.6592C46.9716 26.0173 47.5259 25.6472 48.1435 25.5966L48.2823 27.2925C47.6663 27.2502 46.9148 27.5901 46.9895 28.5026L47.1457 30.4106L45.6156 30.5357L45.2383 25.9272L46.7684 25.8019L46.8387 26.6592Z" fill="white" style="fill:white;fill-opacity:1;"/>+</g>+</svg>diff --git a/mobile/apps/photos/lib/ui/payment/subscription_locker_sheet.dart b/mobile/apps/photos/lib/ui/payment/subscription_locker_sheet.dartnew file mode 100644index 0000000000..59d9a92a49--- /dev/null+++ b/mobile/apps/photos/lib/ui/payment/subscription_locker_sheet.dart@@ -0,0 +1,212 @@+import "dart:math" as math;++import "package:ente_components/ente_components.dart";+import "package:ente_strings/ente_strings.dart";+import "package:flutter/material.dart";+import "package:flutter_svg/flutter_svg.dart";+import "package:hugeicons/hugeicons.dart";+import "package:url_launcher/url_launcher_string.dart";++Future<void> showSubscriptionLockerSheet(BuildContext context) {+ return showBottomSheetComponent<void>(+ context: context,+ builder: (_) => const SubscriptionLockerSheet(),+ );+}++class SubscriptionLockerSheet extends StatelessWidget {+ const SubscriptionLockerSheet({super.key});++ @override+ Widget build(BuildContext context) {+ final colors = context.componentColors;+ final mediaQuery = MediaQuery.of(context);+ return LayoutBuilder(+ builder: (context, constraints) {+ final scale = constraints.maxWidth / 375;+ final height = math.min(+ 642 * scale,+ mediaQuery.size.height - mediaQuery.padding.top,+ );+ return ClipRRect(+ borderRadius: const BorderRadius.vertical(+ top: Radius.circular(Radii.bottomSheet),+ ),+ child: Material(+ color: colors.blue,+ child: SizedBox(+ height: height,+ child: Stack(+ children: [+ Positioned.fill(+ child: RepaintBoundary(+ child: ShaderMask(+ blendMode: BlendMode.dstIn,+ shaderCallback: (bounds) =>+ LinearGradient(+ begin: Alignment.topCenter,+ end: Alignment.bottomCenter,+ colors: [+ Colors.transparent,+ colors.specialWhite.withValues(alpha: 0.28),+ ],+ ).createShader(+ Rect.fromLTRB(+ 0,+ (287.5 - 33) * scale,+ bounds.width,+ (922 - 33) * scale,+ ),+ ),+ child: Stack(+ children: [+ Positioned(+ top: -33 * scale,+ left: -67 * scale,+ width: 745 * scale,+ height: 1066 * scale,+ child: SvgPicture.asset(+ "assets/onboarding_doodle.svg",+ excludeFromSemantics: true,+ ),+ ),+ ],+ ),+ ),+ ),+ ),+ Positioned(+ top: 198 * scale,+ left: -93 * scale,+ child: Container(+ width: 530 * scale,+ height: 530 * scale,+ decoration: BoxDecoration(+ shape: BoxShape.circle,+ gradient: RadialGradient(+ colors: [+ const Color(0xFF73B8FF).withValues(alpha: 0.5),+ const Color(0x001A73FF),+ ],+ stops: const [0.423739, 1],+ ),+ ),+ ),+ ),+ SingleChildScrollView(+ child: ConstrainedBox(+ constraints: BoxConstraints(minHeight: height),+ child: Column(+ mainAxisAlignment: MainAxisAlignment.spaceBetween,+ crossAxisAlignment: CrossAxisAlignment.stretch,+ children: [+ Padding(+ padding: const EdgeInsets.fromLTRB(+ Spacing.xxl,+ 36,+ Spacing.xxl,+ 0,+ ),+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.stretch,+ children: [+ Row(+ mainAxisAlignment:+ MainAxisAlignment.spaceBetween,+ children: [+ SvgPicture.asset(+ "assets/subscription/locker_wordmark.svg",+ width: 59.2,+ height: 40,+ semanticsLabel:+ context.strings.enteLocker,+ ),+ DecoratedBox(+ decoration: BoxDecoration(+ color: colors.specialWhite.withValues(+ alpha: 0.22,+ ),+ shape: BoxShape.circle,+ ),+ child: IconButtonComponent(+ variant:+ IconButtonComponentVariant.unfilled,+ size: 44,+ icon: HugeIcon(+ icon: HugeIcons.strokeRoundedCancel01,+ size: 20,+ color: colors.specialWhite,+ ),+ tooltip: context.strings.close,+ onTap: () =>+ Navigator.of(context).pop(),+ ),+ ),+ ],+ ),+ const SizedBox(height: Spacing.lg),+ Text(+ context.strings.subscriptionLockerTitle,+ style: TextStyles.display1.copyWith(+ color: colors.specialWhite,+ fontWeight: FontWeight.w700,+ letterSpacing: -0.7,+ ),+ ),+ const SizedBox(height: Spacing.sm),+ Text(+ context.strings.subscriptionLockerDescription,+ style: TextStyles.body.copyWith(+ color: colors.specialWhite,+ fontSize: 15,+ height: 21 / 15,+ fontWeight: FontWeight.w400,+ ),+ ),+ ],+ ),+ ),+ Align(+ alignment: Alignment.centerRight,+ child: Image.asset(+ "assets/subscription/locker_phone.png",+ width: 319.414 * scale,+ height: 393.965 * scale,+ excludeFromSemantics: true,+ ),+ ),+ ],+ ),+ ),+ ),+ Positioned(+ right: Spacing.md,+ bottom: math.max(14, mediaQuery.padding.bottom),+ child: TextButton(+ style: TextButton.styleFrom(+ foregroundColor: colors.specialWhite,+ backgroundColor: colors.specialScrim.withValues(+ alpha: 0.22,+ ),+ padding: const EdgeInsets.symmetric(+ horizontal: Spacing.md,+ vertical: Spacing.xs,+ ),+ textStyle: TextStyles.mini.copyWith(height: 18 / 12),+ ),+ onPressed: () => launchUrlString(+ "https://ente.com/locker",+ mode: LaunchMode.externalApplication,+ ),+ child: Text(context.strings.subscriptionLearnMore),+ ),+ ),+ ],+ ),+ ),+ ),+ );+ },+ );+ }+}diff --git a/mobile/apps/photos/pubspec.yaml b/mobile/apps/photos/pubspec.yamlindex 6fcbc7a2ca..e91976964b 100644--- a/mobile/apps/photos/pubspec.yaml+++ b/mobile/apps/photos/pubspec.yaml@@ -282,6 +282,7 @@ flutter:assets:- assets/+ - assets/subscription/- assets/rituals/- assets/rewind_badges/- assets/video-editor/diff --git a/mobile/packages/strings/lib/l10n/arb/strings_en.arb b/mobile/packages/strings/lib/l10n/arb/strings_en.arbindex 4af9c6585e..de49f4dde9 100644--- a/mobile/packages/strings/lib/l10n/arb/strings_en.arb+++ b/mobile/packages/strings/lib/l10n/arb/strings_en.arb@@ -4398,6 +4398,35 @@"subscribe": "Subscribe","subscribeToChangeLinkSetting": "You need a paid subscription to change this link setting.","subscribeToEnableSharing": "You need an active paid subscription to enable sharing.",+ "subscriptionLearnMore": "Learn more",+ "subscriptionCurrentPlan": "Current plan",+ "subscriptionFaqDescription": "Your questions, answered",+ "subscriptionFamilyDescription": "Share your plan with your family",+ "subscriptionContinueWithPlan": "Continue with {storage} plan",+ "@subscriptionContinueWithPlan": {+ "description": "Continue button on the Photos plan picker with the selected storage allowance",+ "placeholders": {+ "storage": {+ "type": "String"+ }+ }+ },+ "subscriptionLockerItems": "+ {count} items on {appName}",+ "@subscriptionLockerItems": {+ "description": "Locker allowance included with a Photos plan",+ "placeholders": {+ "count": {+ "type": "int",+ "format": "decimalPattern"+ },+ "appName": {+ "type": "String",+ "description": "Placeholder for the styled Locker app name"+ }+ }+ },+ "subscriptionLockerTitle": "Some things\ndeserve a Locker.",+ "subscriptionLockerDescription": "Passports, certificates, and life’s important documents. Keep them private and together.","subscription": "Subscription","subscriptionRequiredForSharing": "You need a paid subscription to share links","subWillBeCancelledOn": "Your subscription will be cancelled on {endDate}",