π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
update theme, buttons
AmanRajSinghMouryacf3433adebfc
diff --git a/mobile/apps/photos/lib/ui/notification/update/change_log_entry.dart b/mobile/apps/photos/lib/ui/notification/update/change_log_entry.dartindex d167ebd326..a754bf20ab 100644--- a/mobile/apps/photos/lib/ui/notification/update/change_log_entry.dart+++ b/mobile/apps/photos/lib/ui/notification/update/change_log_entry.dart@@ -1,5 +1,5 @@-import 'package:flutter/widgets.dart';-import 'package:photos/theme/ente_theme.dart';+import "package:ente_components/ente_components.dart";+import 'package:flutter/material.dart';class ChangeLogEntry {final bool isFeature;@@ -22,51 +22,43 @@ class ChangeLogEntryWidget extends StatelessWidget {@overrideWidget build(BuildContext context) {- final enteTheme = getEnteTextTheme(context);- final colorScheme = getEnteColorScheme(context);+ final colors = context.componentColors;final hasDescription =entry.description != null && entry.description!.isNotEmpty;final hasItems = entry.items.isNotEmpty;-+ final mutedStyle = TextStyles.body.copyWith(color: colors.textLight);return Column(crossAxisAlignment: CrossAxisAlignment.start,children: [Text(entry.title,textAlign: TextAlign.left,- style: enteTheme.largeBold.copyWith(- color: entry.isFeature- ? colorScheme.primary700- : colorScheme.textMuted,+ style: TextStyles.large.copyWith(+ color: entry.isFeature ? colors.primary : colors.textLight,),),- const SizedBox(height: 10),+ const SizedBox(height: Spacing.sm),if (hasDescription)Padding(- padding: EdgeInsets.only(bottom: hasItems ? 12 : 0),+ padding: EdgeInsets.only(bottom: hasItems ? Spacing.md : 0),child: Text(entry.description!,textAlign: TextAlign.left,- style: enteTheme.body.copyWith(color: colorScheme.textMuted),+ style: mutedStyle,),),...entry.items.map((item) => Padding(- padding: const EdgeInsets.only(bottom: 8),+ padding: const EdgeInsets.only(bottom: Spacing.sm),child: Row(crossAxisAlignment: CrossAxisAlignment.start,children: [- Text(- 'β’ ',- style: enteTheme.body.copyWith(color: colorScheme.textMuted),- ),+ Text('β’ ', style: mutedStyle),Expanded(child: Text(item,textAlign: TextAlign.left,- style: enteTheme.body.copyWith(- color: colorScheme.textMuted,- ),+ style: mutedStyle,),),],diff --git a/mobile/apps/photos/lib/ui/notification/update/change_log_page.dart b/mobile/apps/photos/lib/ui/notification/update/change_log_page.dartindex 1d0a08fc09..5e04b34618 100644--- a/mobile/apps/photos/lib/ui/notification/update/change_log_page.dart+++ b/mobile/apps/photos/lib/ui/notification/update/change_log_page.dart@@ -1,13 +1,10 @@import 'dart:io';+import "package:ente_components/ente_components.dart";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/ente_theme.dart';-import 'package:photos/ui/components/buttons/button_widget.dart';-import 'package:photos/ui/components/divider_widget.dart';-import 'package:photos/ui/components/models/button_type.dart';-import 'package:photos/ui/components/title_bar_title_widget.dart';import 'package:photos/ui/notification/update/change_log_entry.dart';import 'package:photos/ui/notification/update/change_log_strings.dart';@@ -31,75 +28,45 @@ class _ChangeLogPageState extends State<ChangeLogPage> {@overrideWidget build(BuildContext context) {- final enteColorScheme = getEnteColorScheme(context);+ final l10n = AppLocalizations.of(context);+ final colors = context.componentColors;final isLocalGallery = isLocalGalleryMode;- return Material(- color: enteColorScheme.backgroundElevated,- child: Column(- mainAxisSize: MainAxisSize.min,- mainAxisAlignment: MainAxisAlignment.center,- children: [- const SizedBox(height: 36),- Container(- alignment: Alignment.centerLeft,- child: Padding(- padding: const EdgeInsets.symmetric(horizontal: 16.0),- child: TitleBarTitleWidget(- title: AppLocalizations.of(context).whatsNew,- ),- ),- ),- const SizedBox(height: 24),- Flexible(child: _getChangeLog()),- const DividerWidget(dividerType: DividerType.solid),- SafeArea(- child: Padding(- padding: const EdgeInsets.only(- left: 16.0,- right: 16,- top: 16,- bottom: 8,- ),- child: Column(- crossAxisAlignment: CrossAxisAlignment.start,- children: [- ButtonWidget(- buttonType: ButtonType.trailingIconPrimary,- buttonSize: ButtonSize.large,- labelText: AppLocalizations.of(context).continueLabel,- icon: Icons.arrow_forward_outlined,- onTap: () async {- if (Navigator.of(context).canPop()) {- Navigator.of(context).pop();- }- },- ),- const SizedBox(height: 8),- ButtonWidget(- buttonType: ButtonType.trailingIconSecondary,- buttonSize: ButtonSize.large,- labelText: isLocalGallery- ? AppLocalizations.of(context).rateUs- : AppLocalizations.of(context).changeLogReferralCta,- icon: Icons.favorite_rounded,- iconColor: enteColorScheme.primary500,- onTap: () async {- if (isLocalGallery) {- await updateService.launchReviewUrl();- } else if (Navigator.of(context).canPop()) {- Navigator.of(- context,- ).pop(ChangeLogPageAction.openReferrals);- }- },- ),- const SizedBox(height: 16),- ],- ),- ),+ return BottomSheetComponent(+ title: l10n.whatsNew,+ showCloseButton: false,+ crossAxisAlignment: CrossAxisAlignment.stretch,+ actionsTopSpacing: Spacing.xxl,+ content: _getChangeLog(),+ actions: [+ ButtonComponent(+ variant: ButtonComponentVariant.primary,+ size: ButtonComponentSize.large,+ label: l10n.continueLabel,+ shouldSurfaceExecutionStates: false,+ onTap: () async {+ if (Navigator.of(context).canPop()) {+ Navigator.of(context).pop();+ }+ },+ ),+ ButtonComponent(+ variant: ButtonComponentVariant.secondary,+ size: ButtonComponentSize.large,+ label: isLocalGallery ? l10n.rateUs : l10n.changeLogReferralCta,+ leading: HugeIcon(+ icon: HugeIcons.strokeRoundedFavourite,+ color: colors.primary,),- ],- ),+ shouldSurfaceExecutionStates: false,+ onTap: () async {+ if (isLocalGallery) {+ await updateService.launchReviewUrl();+ } else if (Navigator.of(context).canPop()) {+ Navigator.of(context).pop(ChangeLogPageAction.openReferrals);+ }+ },+ ),+ ],);}@@ -145,8 +112,10 @@ class _ChangeLogPageState extends State<ChangeLogPage> {entry.items.isNotEmpty,).toList(growable: false);- return Container(- padding: const EdgeInsets.only(left: 16),+ return ConstrainedBox(+ constraints: BoxConstraints(+ maxHeight: MediaQuery.sizeOf(context).height * 0.5,+ ),child: Scrollbar(controller: _scrollController,thumbVisibility: true,@@ -155,13 +124,11 @@ class _ChangeLogPageState extends State<ChangeLogPage> {controller: _scrollController,shrinkWrap: true,physics: const BouncingScrollPhysics(),+ padding: const EdgeInsets.only(right: Spacing.md),itemBuilder: (context, index) {- return Padding(- padding: const EdgeInsets.only(right: 16.0),- child: ChangeLogEntryWidget(entry: items[index]),- );+ return ChangeLogEntryWidget(entry: items[index]);},- separatorBuilder: (_, _) => const SizedBox(height: 16),+ separatorBuilder: (_, _) => const SizedBox(height: Spacing.lg),itemCount: items.length,),),