Skip to content

armgit / ente

Public Imported from GitHub
0

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

update name face banner

AmanRajSinghMourya1b0cfbcd25fc
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 0996a1accf..429b70ef7a 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
@@ -1,13 +1,9 @@
-import "dart:async";
-
import "package:flutter/material.dart";
import "package:hugeicons/hugeicons.dart";
-import "package:intl/intl.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/account/email_entry_page.dart";
-import "package:photos/utils/ml_util.dart";
+import "package:photos/ui/home/landing_page_widget.dart";
class NameFaceBanner extends StatefulWidget {
const NameFaceBanner({super.key});
@@ -18,23 +14,6 @@ class NameFaceBanner extends StatefulWidget {
class _NameFaceBannerState extends State<NameFaceBanner> {
bool _dismissed = false;
- IndexStatus? _indexStatus;
- Timer? _pollTimer;
-
- @override
- void initState() {
- super.initState();
- _fetchStatus();
- _pollTimer = Timer.periodic(const Duration(seconds: 10), (_) {
- _fetchStatus();
- });
- }
-
- @override
- void dispose() {
- _pollTimer?.cancel();
- super.dispose();
- }
@override
Widget build(BuildContext context) {
@@ -46,126 +25,105 @@ class _NameFaceBannerState extends State<NameFaceBanner> {
final colorScheme = getEnteColorScheme(context);
final l10n = AppLocalizations.of(context);
- final format = NumberFormat();
- final status = _indexStatus;
-
- final indexed = status?.indexedItems ?? 78;
- final total =
- (status?.indexedItems ?? 78) + (status?.pendingItems ?? 25601);
- final safeTotal = total <= 0 ? 1 : total;
- final progress = (indexed / safeTotal).clamp(0.0, 1.0);
return Padding(
padding: const EdgeInsets.all(12),
- child: GestureDetector(
- behavior: HitTestBehavior.opaque,
- onTap: () async {
- await Navigator.of(context).push(
- MaterialPageRoute(
- builder: (_) => const EmailEntryPage(),
- ),
- );
- },
- child: Container(
- padding: const EdgeInsets.all(16),
- decoration: BoxDecoration(
- color: colorScheme.backgroundColour,
- borderRadius: BorderRadius.circular(14.331),
- ),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ child: Container(
+ padding: const EdgeInsets.symmetric(vertical: 24),
+ decoration: BoxDecoration(
+ color: colorScheme.backgroundColour,
+ borderRadius: BorderRadius.circular(20),
+ ),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
children: [
- Text(
- l10n.mlProgressBannerTitle,
- style: TextStyle(
- fontFamily: "Nunito",
- fontWeight: FontWeight.w800,
- fontSize: 18,
- height: 27.132 / 18,
- letterSpacing: -0.9554,
- color: colorScheme.greenBase,
+ Expanded(
+ child: Text(
+ l10n.offlineNameFaceBannerTitle,
+ textAlign: TextAlign.center,
+ style: TextStyle(
+ fontFamily: "Nunito",
+ fontWeight: FontWeight.w800,
+ fontSize: 16,
+ height: 20 / 16,
+ letterSpacing: -1.0,
+ color: colorScheme.textBase,
+ ),
),
),
GestureDetector(
onTap: _onDismiss,
behavior: HitTestBehavior.opaque,
- child: SizedBox(
- width: 20,
- height: 20,
- child: Center(
- child: HugeIcon(
- icon: HugeIcons.strokeRoundedCancel01,
- color: colorScheme.contentLight,
- size: 20,
- strokeWidth: 2,
- ),
+ child: Padding(
+ padding: const EdgeInsets.all(4),
+ child: HugeIcon(
+ icon: HugeIcons.strokeRoundedCancel01,
+ color: colorScheme.contentLight,
+ size: 18,
+ strokeWidth: 2,
),
),
),
],
),
- const SizedBox(height: 8),
- Text(
- l10n.mlProgressBannerDescription,
+ ),
+ const SizedBox(height: 8),
+ ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 250),
+ child: Text(
+ l10n.offlineNameFaceBannerSubtitle,
+ textAlign: TextAlign.center,
style: TextStyle(
- fontFamily: "Montserrat",
- fontWeight: FontWeight.w600,
- fontSize: 12,
- height: 15.287 / 12,
- color: colorScheme.contentLighter,
+ fontFamily: "Inter",
+ fontWeight: FontWeight.w500,
+ fontSize: 10,
+ height: 16 / 10,
+ color: colorScheme.contentLight,
),
),
- const SizedBox(height: 24),
- ClipRRect(
- borderRadius: BorderRadius.circular(57),
- child: LinearProgressIndicator(
- value: progress,
- minHeight: 5,
- backgroundColor: const Color.fromRGBO(193, 193, 193, 0.11),
- valueColor:
- AlwaysStoppedAnimation<Color>(colorScheme.greenBase),
+ ),
+ const SizedBox(height: 16),
+ GestureDetector(
+ onTap: () {
+ Navigator.of(context).push(
+ MaterialPageRoute(
+ builder: (_) => const LandingPageWidget(),
+ ),
+ );
+ },
+ child: Container(
+ width: 140,
+ alignment: Alignment.center,
+ decoration: BoxDecoration(
+ color: colorScheme.greenBase,
+ borderRadius: BorderRadius.circular(12),
+ ),
+ padding: const EdgeInsets.symmetric(
+ vertical: 18,
),
- ),
- const SizedBox(height: 8),
- Align(
- alignment: Alignment.centerRight,
child: Text(
- l10n.mlProgressBannerStatus(
- indexed: format.format(indexed),
- total: format.format(safeTotal),
- ),
- style: TextStyle(
+ l10n.signUp,
+ style: const TextStyle(
fontFamily: "Montserrat",
fontWeight: FontWeight.w600,
fontSize: 10,
- height: 15.287 / 10,
- color: colorScheme.contentLighter,
+ height: 12 / 10,
+ color: Colors.white,
),
),
),
- ],
- ),
+ ),
+ ],
),
),
);
}
- Future<void> _fetchStatus() async {
- try {
- final status = await getIndexStatus();
- if (!mounted) return;
- setState(() {
- _indexStatus = status;
- });
- } catch (_) {
- // Keep fallback values if indexing status is unavailable.
- }
- }
-
void _onDismiss() {
setState(() {
_dismissed = true;