💚 End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Merge remote-tracking branch 'origin/main' into smart-album-nothingelse
Prateek Sunal6ea6493cbc4f
diff --cc mobile/apps/photos/lib/generated/intl/messages_lt.dartindex 267868e660,267868e660..62295208ad--- a/mobile/apps/photos/lib/generated/intl/messages_lt.dart+++ b/mobile/apps/photos/lib/generated/intl/messages_lt.dart@@@ -421,6 -421,6 +421,9 @@@ class MessageLookup extends MessageLookMessageLookupByLibrary.simpleMessage("Išsaugoti visi prisiminimai"),"allPersonGroupingWillReset": MessageLookupByLibrary.simpleMessage("Visi šio asmens grupavimai bus iš naujo nustatyti, o jūs neteksite visų šiam asmeniui pateiktų pasiūlymų"),++ "allUnnamedGroupsWillBeMergedIntoTheSelectedPerson":++ MessageLookupByLibrary.simpleMessage(++ "Visos nepavadintos grupės bus sujungtos su pasirinktu asmeniu. Tai vis dar galima atšaukti iš asmens pasiūlymų istorijos apžvalgos."),"allWillShiftRangeBasedOnFirst": MessageLookupByLibrary.simpleMessage("Tai – pirmoji šioje grupėje. Kitos pasirinktos nuotraukos bus automatiškai perkeltos pagal šią naują datą."),"allow": MessageLookupByLibrary.simpleMessage("Leisti"),@@@ -473,6 -473,6 +476,10 @@@"archiveAlbum":MessageLookupByLibrary.simpleMessage("Archyvuoti albumą"),"archiving": MessageLookupByLibrary.simpleMessage("Archyvuojama..."),++ "areThey": MessageLookupByLibrary.simpleMessage("Ar jie "),++ "areYouSureRemoveThisFaceFromPerson":++ MessageLookupByLibrary.simpleMessage(++ "Ar tikrai norite pašalinti šį veidą iš šio asmens?"),"areYouSureThatYouWantToLeaveTheFamily":MessageLookupByLibrary.simpleMessage("Ar tikrai norite palikti šeimos planą?"),@@@ -483,8 -483,8 +490,16 @@@"Ar tikrai norite keisti planą?"),"areYouSureYouWantToExit":MessageLookupByLibrary.simpleMessage("Ar tikrai norite išeiti?"),++ "areYouSureYouWantToIgnoreThesePersons":++ MessageLookupByLibrary.simpleMessage(++ "Ar tikrai norite ignoruoti šiuos asmenis?"),++ "areYouSureYouWantToIgnoreThisPerson":++ MessageLookupByLibrary.simpleMessage(++ "Ar tikrai norite ignoruoti šį asmenį?"),"areYouSureYouWantToLogout": MessageLookupByLibrary.simpleMessage("Ar tikrai norite atsijungti?"),++ "areYouSureYouWantToMergeThem": MessageLookupByLibrary.simpleMessage(++ "Ar tikrai norite juos sujungti?"),"areYouSureYouWantToRenew":MessageLookupByLibrary.simpleMessage("Ar tikrai norite pratęsti?"),"areYouSureYouWantToResetThisPerson":@@@ -576,6 -576,6 +591,29 @@@"blackFridaySale": MessageLookupByLibrary.simpleMessage("Juodojo penktadienio išpardavimas"),"blog": MessageLookupByLibrary.simpleMessage("Tinklaraštis"),++ "cLDesc1": MessageLookupByLibrary.simpleMessage(++ "Po vaizdo įrašų srauto perdavimo beta versijos ir darbo prie tęsiamų įkėlimų ir atsisiuntimų, dabar padidinome failų įkėlimo ribą iki 10 GB. Tai dabar pasiekiama tiek kompiuterinėse, tiek mobiliosiose programėlėse."),++ "cLDesc2": MessageLookupByLibrary.simpleMessage(++ "Fono įkėlimai dabar palaikomi ir sistemoje „iOS“ bei „Android“ įrenginiuose. Nebereikia atverti programėlės, kad būtų galima sukurti naujausių nuotraukų ir vaizdo įrašų atsarginę kopiją."),++ "cLDesc3": MessageLookupByLibrary.simpleMessage(++ "Mes žymiai patobulinome prisiminimų patirtį, įskaitant automatinį peržiūrėjimą, braukimą į kitą prisiminimą ir daug daugiau."),++ "cLDesc4": MessageLookupByLibrary.simpleMessage(++ "Kartu su daugybe vidinių patobulinimų, dabar daug lengviau matyti visus aptiktus veidus, pateikti atsiliepimus apie panašius veidus ir pridėti / pašalinti veidus iš vienos nuotraukos."),++ "cLDesc5": MessageLookupByLibrary.simpleMessage(++ "Dabar gausite pranešimą apie galimybę atsisakyti visų gimtadienių, kuriuos išsaugojote platformoje „Ente“, kartu su geriausių jų nuotraukų rinkiniu."),++ "cLDesc6": MessageLookupByLibrary.simpleMessage(++ "Nebereikia laukti įkėlimų / atsisiuntimų užbaigti, kad užvertumėte programėlę. Dabar visus įkėlimus ir atsisiuntimus galima pristabdyti ir tęsti nuo tos vietos, kurioje sustojote."),++ "cLTitle1": MessageLookupByLibrary.simpleMessage(++ "Įkeliami dideli vaizdo įrašų failai"),++ "cLTitle2": MessageLookupByLibrary.simpleMessage("Fono įkėlimas"),++ "cLTitle3": MessageLookupByLibrary.simpleMessage(++ "Automatiniai peržiūros prisiminimai"),++ "cLTitle4": MessageLookupByLibrary.simpleMessage(++ "Patobulintas veido atpažinimas"),++ "cLTitle5":++ MessageLookupByLibrary.simpleMessage("Gimtadienio pranešimai"),++ "cLTitle6": MessageLookupByLibrary.simpleMessage(++ "Tęsiami įkėlimai ir atsisiuntimai"),"cachedData":MessageLookupByLibrary.simpleMessage("Podėliuoti duomenis"),"calculating": MessageLookupByLibrary.simpleMessage("Skaičiuojama..."),@@@ -828,10 -828,10 +866,11 @@@"deviceLock":MessageLookupByLibrary.simpleMessage("Įrenginio užraktas"),"deviceLockExplanation": MessageLookupByLibrary.simpleMessage(-- "Išjunkite įrenginio ekrano užraktą, kai „Ente“ yra priekiniame fone ir kuriama atsarginės kopijos. Paprastai to nereikia, bet tai gali padėti greičiau užbaigti didelius įkėlimus ir pradinį didelių bibliotekų importą."),++ "Išjunkite įrenginio ekrano užraktą, kai „Ente“ yra priekiniame fone ir kuriama atsarginės kopijos. Paprastai to nereikia, bet tai gali padėti sparčiau užbaigti didelius įkėlimus ir pradinį didelių bibliotekų importą."),"deviceNotFound":MessageLookupByLibrary.simpleMessage("Įrenginys nerastas"),"didYouKnow": MessageLookupByLibrary.simpleMessage("Ar žinojote?"),++ "different": MessageLookupByLibrary.simpleMessage("Skirtingas"),"disableAutoLock":MessageLookupByLibrary.simpleMessage("Išjungti automatinį užraktą"),"disableDownloadWarningBody": MessageLookupByLibrary.simpleMessage(@@@ -998,6 -998,6 +1037,8 @@@"Veidas dar nesugrupuotas. Grįžkite vėliau."),"faceRecognition":MessageLookupByLibrary.simpleMessage("Veido atpažinimas"),++ "faceThumbnailGenerationFailed": MessageLookupByLibrary.simpleMessage(++ "Nepavyksta sugeneruoti veido miniatiūrų."),"faces": MessageLookupByLibrary.simpleMessage("Veidai"),"failed": MessageLookupByLibrary.simpleMessage("Nepavyko"),"failedToApplyCode":@@@ -1033,6 -1033,6 +1074,8 @@@"feastingWithThem": m34,"feedback": MessageLookupByLibrary.simpleMessage("Atsiliepimai"),"file": MessageLookupByLibrary.simpleMessage("Failas"),++ "fileAnalysisFailed": MessageLookupByLibrary.simpleMessage(++ "Nepavyksta išanalizuoti failo."),"fileFailedToSaveToGallery": MessageLookupByLibrary.simpleMessage("Nepavyko išsaugoti failo į galeriją"),"fileInfoAddDescHint":@@@ -1050,9 -1050,9 +1093,9 @@@"filesSavedToGallery":MessageLookupByLibrary.simpleMessage("Failai išsaugoti į galeriją"),"findPeopleByName": MessageLookupByLibrary.simpleMessage(-- "Greitai suraskite žmones pagal vardą"),++ "Sparčiai suraskite asmenis pagal vardą"),"findThemQuickly":-- MessageLookupByLibrary.simpleMessage("Raskite juos greitai"),++ MessageLookupByLibrary.simpleMessage("Raskite juos sparčiai"),"flip": MessageLookupByLibrary.simpleMessage("Apversti"),"food": MessageLookupByLibrary.simpleMessage("Kulinarinis malonumas"),"forYourMemories":@@@ -1126,6 -1126,6 +1169,7 @@@"iOSLockOut": MessageLookupByLibrary.simpleMessage("Biometrinis tapatybės nustatymas išjungtas. Kad jį įjungtumėte, užrakinkite ir atrakinkite ekraną."),"iOSOkButton": MessageLookupByLibrary.simpleMessage("Gerai"),++ "ignore": MessageLookupByLibrary.simpleMessage("Ignoruoti"),"ignoreUpdate": MessageLookupByLibrary.simpleMessage("Ignoruoti"),"ignored": MessageLookupByLibrary.simpleMessage("ignoruota"),"ignoredFolderUploadReason": MessageLookupByLibrary.simpleMessage(@@@ -1146,6 -1146,6 +1190,8 @@@MessageLookupByLibrary.simpleMessage("Neteisingas atkūrimo raktas"),"indexedItems":MessageLookupByLibrary.simpleMessage("Indeksuoti elementai"),++ "indexingPausedStatusDescription": MessageLookupByLibrary.simpleMessage(++ "Indeksavimas pristabdytas. Jis bus automatiškai tęsiamas, kai įrenginys bus parengtas. Įrenginys laikomas parengtu, kai jo akumuliatoriaus įkrovos lygis, akumuliatoriaus būklė ir terminė būklė yra normos ribose."),"ineligible": MessageLookupByLibrary.simpleMessage("Netinkami"),"info": MessageLookupByLibrary.simpleMessage("Informacija"),"insecureDevice":@@@ -1334,6 -1334,6 +1380,7 @@@"Pasirinkite, kokius prisiminimus norite matyti savo pradžios ekrane."),"memoryCount": m50,"merchandise": MessageLookupByLibrary.simpleMessage("Atributika"),++ "merge": MessageLookupByLibrary.simpleMessage("Sujungti"),"mergeWithExisting":MessageLookupByLibrary.simpleMessage("Sujungti su esamais"),"mergedPhotos":@@@ -1474,6 -1474,6 +1521,8 @@@MessageLookupByLibrary.simpleMessage("Arba pasirinkite esamą"),"orPickFromYourContacts": MessageLookupByLibrary.simpleMessage("arba pasirinkite iš savo kontaktų"),++ "otherDetectedFaces":++ MessageLookupByLibrary.simpleMessage("Kiti aptikti veidai"),"pair": MessageLookupByLibrary.simpleMessage("Susieti"),"pairWithPin": MessageLookupByLibrary.simpleMessage("Susieti su PIN"),"pairingComplete":@@@ -1606,6 -1606,6 +1655,7 @@@MessageLookupByLibrary.simpleMessage("Vieša nuoroda sukurta"),"publicLinkEnabled":MessageLookupByLibrary.simpleMessage("Įjungta viešoji nuoroda"),++ "questionmark": MessageLookupByLibrary.simpleMessage("?"),"queued": MessageLookupByLibrary.simpleMessage("Įtraukta eilėje"),"quickLinks": MessageLookupByLibrary.simpleMessage("Sparčios nuorodos"),"radius": MessageLookupByLibrary.simpleMessage("Spindulys"),@@@ -1722,6 -1722,6 +1772,7 @@@MessageLookupByLibrary.simpleMessage("Pranešti apie riktą"),"resendEmail":MessageLookupByLibrary.simpleMessage("Iš naujo siųsti el. laišką"),++ "reset": MessageLookupByLibrary.simpleMessage("Atkurti"),"resetIgnoredFiles":MessageLookupByLibrary.simpleMessage("Atkurti ignoruojamus failus"),"resetPasswordTitle": MessageLookupByLibrary.simpleMessage(@@@ -1748,7 -1748,7 +1799,11 @@@"rotateLeft": MessageLookupByLibrary.simpleMessage("Sukti į kairę"),"rotateRight": MessageLookupByLibrary.simpleMessage("Sukti į dešinę"),"safelyStored": MessageLookupByLibrary.simpleMessage("Saugiai saugoma"),++ "same": MessageLookupByLibrary.simpleMessage("Tas pats"),++ "sameperson": MessageLookupByLibrary.simpleMessage("Tas pats asmuo?"),"save": MessageLookupByLibrary.simpleMessage("Išsaugoti"),++ "saveAsAnotherPerson":++ MessageLookupByLibrary.simpleMessage("Išsaugoti kaip kitą asmenį"),"saveChangesBeforeLeavingQuestion":MessageLookupByLibrary.simpleMessage("Išsaugoti pakeitimus prieš išeinant?"),@@@ -1775,7 -1775,7 +1830,7 @@@"searchByExamples": MessageLookupByLibrary.simpleMessage("• Albumų pavadinimai (pvz., „Fotoaparatas“)\n• Failų tipai (pvz., „Vaizdo įrašai“, „.gif“)\n• Metai ir mėnesiai (pvz., „2022“, „sausis“)\n• Šventės (pvz., „Kalėdos“)\n• Nuotraukų aprašymai (pvz., „#džiaugsmas“)"),"searchCaptionEmptySection": MessageLookupByLibrary.simpleMessage(-- "Pridėkite aprašymus, pavyzdžiui, „#kelionė“, į nuotraukos informaciją, kad greičiau jas čia rastumėte."),++ "Pridėkite aprašus, pavyzdžiui, „#kelionė“, į nuotraukos informaciją, kad sparčiau jas čia rastumėte."),"searchDatesEmptySection": MessageLookupByLibrary.simpleMessage("Ieškokite pagal datą, mėnesį arba metus"),"searchDiscoverEmptySection": MessageLookupByLibrary.simpleMessage(@@@ -1915,8 -1915,8 +1970,12 @@@"sharing": MessageLookupByLibrary.simpleMessage("Bendrinima..."),"shiftDatesAndTime":MessageLookupByLibrary.simpleMessage("Pastumti datas ir laiką"),++ "showLessFaces":++ MessageLookupByLibrary.simpleMessage("Rodyti mažiau veidų"),"showMemories":MessageLookupByLibrary.simpleMessage("Rodyti prisiminimus"),++ "showMoreFaces":++ MessageLookupByLibrary.simpleMessage("Rodyti daugiau veidų"),"showPerson": MessageLookupByLibrary.simpleMessage("Rodyti asmenį"),"signOutFromOtherDevices": MessageLookupByLibrary.simpleMessage("Atsijungti iš kitų įrenginių"),@@@ -2042,6 -2042,6 +2101,10 @@@"theLinkYouAreTryingToAccessHasExpired":MessageLookupByLibrary.simpleMessage("Nuoroda, kurią bandote pasiekti, nebegalioja."),++ "thePersonGroupsWillNotBeDisplayed": MessageLookupByLibrary.simpleMessage(++ "Asmenų grupės nebebus rodomos asmenų sekcijoje. Nuotraukos liks nepakitusios."),++ "thePersonWillNotBeDisplayed": MessageLookupByLibrary.simpleMessage(++ "Asmuo nebebus rodomas asmenų sekcijoje. Nuotraukos liks nepakitusios."),"theRecoveryKeyYouEnteredIsIncorrect":MessageLookupByLibrary.simpleMessage("Įvestas atkūrimo raktas yra neteisingas."),@@@ -2240,6 -2240,6 +2303,7 @@@"yesDelete": MessageLookupByLibrary.simpleMessage("Taip, ištrinti"),"yesDiscardChanges":MessageLookupByLibrary.simpleMessage("Taip, atmesti pakeitimus"),++ "yesIgnore": MessageLookupByLibrary.simpleMessage("Taip, ignoruoti"),"yesLogout": MessageLookupByLibrary.simpleMessage("Taip, atsijungti"),"yesRemove": MessageLookupByLibrary.simpleMessage("Taip, šalinti"),"yesRenew": MessageLookupByLibrary.simpleMessage("Taip, pratęsti"),diff --cc mobile/apps/photos/lib/generated/intl/messages_vi.dartindex 8f44e52987,8f44e52987..badbcef73e--- a/mobile/apps/photos/lib/generated/intl/messages_vi.dart+++ b/mobile/apps/photos/lib/generated/intl/messages_vi.dart@@@ -226,7 -226,7 +226,7 @@@ class MessageLookup extends MessageLookstatic String m76(name) => "Đi bộ với ${name}";static String m77(count) =>-- "${Intl.plural(count, other: '${count} kết quả được tìm thấy')}";++ "${Intl.plural(count, other: '${count} kết quả đã tìm thấy')}";static String m78(snapshotLength, searchLength) =>"Độ dài các phần không khớp: ${snapshotLength} != ${searchLength}";@@@ -1272,7 -1272,7 +1272,7 @@@"loadMessage9": MessageLookupByLibrary.simpleMessage("Chúng tôi sử dụng Xchacha20Poly1305 để mã hóa dữ liệu của bạn"),"loadingExifData":-- MessageLookupByLibrary.simpleMessage("Đang tải thông số Exif..."),++ MessageLookupByLibrary.simpleMessage("Đang lấy thông số Exif..."),"loadingGallery":MessageLookupByLibrary.simpleMessage("Đang tải thư viện..."),"loadingMessage":@@@ -1412,8 -1412,8 +1412,7 @@@MessageLookupByLibrary.simpleMessage("✨ Không có trùng lặp"),"noEnteAccountExclamation":MessageLookupByLibrary.simpleMessage("Chưa có tài khoản Ente!"),-- "noExifData":-- MessageLookupByLibrary.simpleMessage("Không có thông số Exif"),++ "noExifData": MessageLookupByLibrary.simpleMessage("Không có Exif"),"noFacesFound":MessageLookupByLibrary.simpleMessage("Không tìm thấy khuôn mặt"),"noHiddenPhotosOrVideos":diff --cc mobile/apps/photos/lib/generated/l10n.dartindex a9de1eabf9,1045fba5f2..bc7e101342--- a/mobile/apps/photos/lib/generated/l10n.dart+++ b/mobile/apps/photos/lib/generated/l10n.dart@@@ -12316,95 -12366,25 +12366,115 @@@ class S);}+ /// `Edit auto-add people`+ String get editAutoAddPeople {+ return Intl.message(+ 'Edit auto-add people',+ name: 'editAutoAddPeople',+ desc: '',+ args: [],+ );+ }++ /// `Auto-add people`+ String get autoAddPeople {+ return Intl.message(+ 'Auto-add people',+ name: 'autoAddPeople',+ desc: '',+ args: [],+ );+ }++ /// `Auto-add to album`+ String get autoAddToAlbum {+ return Intl.message(+ 'Auto-add to album',+ name: 'autoAddToAlbum',+ desc: '',+ args: [],+ );+ }++ /// `Should the files related to the person that were previously selected in smart albums be removed?`+ String get shouldRemoveFilesSmartAlbumsDesc {+ return Intl.message(+ 'Should the files related to the person that were previously selected in smart albums be removed?',+ name: 'shouldRemoveFilesSmartAlbumsDesc',+ desc: '',+ args: [],+ );+ }++ /// `Adding photos`+ String get addingPhotos {+ return Intl.message(+ 'Adding photos',+ name: 'addingPhotos',+ desc: '',+ args: [],+ );+ }++ /// `Getting ready`+ String get gettingReady {+ return Intl.message(+ 'Getting ready',+ name: 'gettingReady',+ desc: '',+ args: [],+ );+ }++ /// `Add some photos or pick `+ String get addSomePhotosDesc1 {+ return Intl.message(+ 'Add some photos or pick ',+ name: 'addSomePhotosDesc1',+ desc: '',+ args: [],+ );+ }++ /// `familiar faces`+ String get addSomePhotosDesc2 {+ return Intl.message(+ 'familiar faces',+ name: 'addSomePhotosDesc2',+ desc: '',+ args: [],+ );+ }++ /// `\nto begin with`+ String get addSomePhotosDesc3 {+ return Intl.message(+ '\nto begin with',+ name: 'addSomePhotosDesc3',+ desc: '',+ args: [],+ );+ }+++ /// `Layout`+ String get layout {+ return Intl.message(+ 'Layout',+ name: 'layout',+ desc: '',+ args: [],+ );+ }++ /// `Day`+ String get day {+ return Intl.message(+ 'Day',+ name: 'day',+ desc: '',+ args: [],+ );+ }}class AppLocalizationDelegate extends LocalizationsDelegate<S> {diff --cc mobile/apps/photos/lib/l10n/intl_en.arbindex a9c69cab56,a4b2c471ec..2dbcf7b7a1--- a/mobile/apps/photos/lib/l10n/intl_en.arb+++ b/mobile/apps/photos/lib/l10n/intl_en.arb@@@ -1789,15 -1789,13 +1789,22 @@@"cLTitle6": "Resumable Uploads and Downloads","cLDesc6": "No more waiting for uploads/downloads to complete before you can close the app. All uploads and downloads now have the ability to be paused midway, and resume from where you left off.","indexingPausedStatusDescription": "Indexing is paused. It will automatically resume when the device is ready. The device is considered ready when its battery level, battery health, and thermal status are within a healthy range.",+ "thisWeek": "This week",+ "lastWeek": "Last week",+ "thisMonth": "This month",+ "thisYear": "This year",+ "groupBy": "Group by","faceThumbnailGenerationFailed": "Unable to generate face thumbnails","fileAnalysisFailed": "Unable to analyze file",- "layout" : "Layout",+ "editAutoAddPeople": "Edit auto-add people",+ "autoAddPeople": "Auto-add people",+ "autoAddToAlbum": "Auto-add to album",+ "shouldRemoveFilesSmartAlbumsDesc": "Should the files related to the person that were previously selected in smart albums be removed?",+ "addingPhotos": "Adding photos",+ "gettingReady": "Getting ready",+ "addSomePhotosDesc1": "Add some photos or pick ",+ "addSomePhotosDesc2": "familiar faces",- "addSomePhotosDesc3": "\nto begin with"++ "addSomePhotosDesc3": "\nto begin with",++ "layout": "Layout",+ "day": "Day"-}+}diff --cc mobile/apps/photos/lib/ui/viewer/gallery/collection_page.dartindex 303a98192f,ebcf5de96d..ed97a5b973--- a/mobile/apps/photos/lib/ui/viewer/gallery/collection_page.dart+++ b/mobile/apps/photos/lib/ui/viewer/gallery/collection_page.dart@@@ -94,8 -93,7 +94,8 @@@ class CollectionPage extends StatelessWinitialFiles: initialFiles,albumName: c.collection.displayName,sortAsyncFn: () => c.collection.pubMagicMetadata.asc ?? false,- showSelectAllByDefault: galleryType != GalleryType.sharedCollection,+ addHeaderOrFooterEmptyState: false,+ showSelectAll: galleryType != GalleryType.sharedCollection,emptyState: galleryType == GalleryType.ownedCollection? EmptyAlbumState(c.collection,diff --cc mobile/apps/photos/lib/ui/viewer/gallery/gallery.dartindex ae66b49228,3901c23d40..9d3279696f--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart@@@ -79,11 -94,9 +96,10 @@@ class Gallery extends StatefulWidgetthis.removalEventTypes = const {},this.header,this.footer = const SizedBox(height: 212),+ this.addHeaderOrFooterEmptyState = true,this.emptyState = const EmptyState(),- this.scrollBottomSafeArea = 120.0,this.albumName = '',- this.groupType = GroupType.day,+ this.groupType,this.enableFileGrouping = true,this.loadingWidget = const EnteLoadingWidget(),this.disableScroll = false,@@@ -381,92 -552,317 +555,319 @@@ class GalleryState extends State<Gallerreturn GalleryContextState(sortOrderAsc: _sortOrderAsc,inSelectionMode: widget.inSelectionMode,- type: widget.groupType,- child: MultipleGroupsGalleryView(- itemScroller: _itemScroller,- groupedFiles: currentGroupedFiles,- disableScroll: widget.disableScroll,- emptyState: widget.emptyState,- asyncLoader: widget.asyncLoader,- removalEventTypes: widget.removalEventTypes,- tagPrefix: widget.tagPrefix,- scrollBottomSafeArea: widget.scrollBottomSafeArea,- limitSelectionToOne: widget.limitSelectionToOne,- enableFileGrouping:- widget.enableFileGrouping && widget.groupType.showGroupHeader(),- logTag: _logTag,- logger: _logger,- reloadEvent: widget.reloadEvent,- header: widget.header,- footer: widget.footer,- addHeaderOrFooterEmptyState: widget.addHeaderOrFooterEmptyState,- selectedFiles: widget.selectedFiles,- showSelectAllByDefault:- widget.showSelectAllByDefault && widget.groupType.showGroupHeader(),- isScrollablePositionedList: widget.isScrollablePositionedList,- ),+ type: _groupType,+ child: _allGalleryFiles.isEmpty+ ? Column(+ mainAxisAlignment: MainAxisAlignment.spaceBetween,+ children: [- widget.header ?? const SizedBox.shrink(),++ if (widget.addHeaderOrFooterEmptyState)++ widget.header ?? const SizedBox.shrink(),+ Expanded(child: widget.emptyState),- widget.footer ?? const SizedBox.shrink(),++ if (widget.addHeaderOrFooterEmptyState)++ widget.footer ?? const SizedBox.shrink(),+ ],+ )+ : CustomScrollBar(+ scrollController: _scrollController,+ galleryGroups: galleryGroups,+ inUseNotifier: scrollBarInUseNotifier,+ heighOfViewport: MediaQuery.sizeOf(context).height,+ topPadding: widget.disableVerticalPaddingForScrollbar+ ? 0.0+ : groupHeaderExtent!,+ bottomPadding: widget.disableVerticalPaddingForScrollbar+ ? ValueNotifier(0.0)+ : scrollbarBottomPaddingNotifier,+ child: NotificationListener<SizeChangedLayoutNotification>(+ onNotification: (notification) {+ final renderBox = _headerKey.currentContext+ ?.findRenderObject() as RenderBox?;+ if (renderBox != null) {+ _headerHeightNotifier.value = renderBox.size.height;+ } else {+ _logger.info(+ "Header render box is null, cannot get height",+ );+ }++ return true;+ },+ child: Stack(+ clipBehavior: Clip.none,+ children: [+ CustomScrollView(+ physics: widget.disableScroll+ ? const NeverScrollableScrollPhysics()+ : const ExponentialBouncingScrollPhysics(),+ controller: _scrollController,+ slivers: [+ SliverToBoxAdapter(+ child: SizeChangedLayoutNotifier(+ child: SizedBox(+ key: _headerKey,+ child: widget.header ?? const SizedBox.shrink(),+ ),+ ),+ ),+ SectionedListSliver(+ sectionLayouts: galleryGroups.groupLayouts,+ ),+ SliverToBoxAdapter(+ child: widget.footer,+ ),+ ],+ ),+ galleryGroups.groupType.showGroupHeader() &&+ !widget.disablePinnedGroupHeader+ ? PinnedGroupHeader(+ scrollController: _scrollController,+ galleryGroups: galleryGroups,+ headerHeightNotifier: _headerHeightNotifier,+ selectedFiles: widget.selectedFiles,+ showSelectAll: widget.showSelectAll &&+ !widget.limitSelectionToOne,+ scrollbarInUseNotifier: scrollBarInUseNotifier,+ showGallerySettingsCTA:+ widget.showGallerySettingsCTA,+ )+ : const SizedBox.shrink(),+ ],+ ),+ ),+ ),);}+ }++ class PinnedGroupHeader extends StatefulWidget {+ final ScrollController scrollController;+ final GalleryGroups galleryGroups;+ final ValueNotifier<double?> headerHeightNotifier;+ final SelectedFiles? selectedFiles;+ final bool showSelectAll;+ final ValueNotifier<bool> scrollbarInUseNotifier;+ final bool showGallerySettingsCTA;+ static const kScaleDurationInMilliseconds = 200;+ static const kTrailingIconsFadeInDelayMs = 0;+ static const kTrailingIconsFadeInDurationMs = 200;++ const PinnedGroupHeader({+ required this.scrollController,+ required this.galleryGroups,+ required this.headerHeightNotifier,+ required this.selectedFiles,+ required this.showSelectAll,+ required this.scrollbarInUseNotifier,+ required this.showGallerySettingsCTA,+ super.key,+ });- // create groups of 200 files for performance- List<List<EnteFile>> _genericGroupForPerf(List<EnteFile> files) {- if (widget.groupType == GroupType.size) {- // sort files by fileSize on the bases of _sortOrderAsc- files.sort((a, b) {- if (_sortOrderAsc) {- return a.fileSize!.compareTo(b.fileSize!);+ @override+ State<PinnedGroupHeader> createState() => _PinnedGroupHeaderState();+ }++ class _PinnedGroupHeaderState extends State<PinnedGroupHeader> {+ String? currentGroupId;+ final _enlargeHeader = ValueNotifier<bool>(false);+ Timer? _enlargeHeaderTimer;+ late final ValueNotifier<bool> _atZeroScrollNotifier;+ Timer? _timer;+ bool lastInUseState = false;+ bool fadeInTrailingIcons = false;+ @override+ void initState() {+ super.initState();+ widget.scrollbarInUseNotifier.addListener(scrollbarInUseListener);+ widget.scrollController.addListener(_setCurrentGroupID);+ _atZeroScrollNotifier = ValueNotifier<bool>(+ widget.scrollController.offset == 0,+ );+ widget.scrollController.addListener(+ _scrollControllerListenerForZeroScrollNotifier,+ );+ widget.headerHeightNotifier.addListener(_headerHeightNotifierListener);+ }++ @override+ void didUpdateWidget(covariant PinnedGroupHeader oldWidget) {+ super.didUpdateWidget(oldWidget);+ _setCurrentGroupID();+ }++ @override+ void dispose() {+ widget.scrollController.removeListener(_setCurrentGroupID);+ widget.scrollbarInUseNotifier.removeListener(scrollbarInUseListener);+ _atZeroScrollNotifier.removeListener(+ _scrollControllerListenerForZeroScrollNotifier,+ );+ widget.headerHeightNotifier.removeListener(_headerHeightNotifierListener);+ _enlargeHeader.dispose();+ _atZeroScrollNotifier.dispose();+ _enlargeHeaderTimer?.cancel();+ _timer?.cancel();+ super.dispose();+ }++ void _setCurrentGroupID() {+ if (widget.headerHeightNotifier.value == null) return;+ final normalizedScrollOffset =+ widget.scrollController.offset - widget.headerHeightNotifier.value!;+ if (normalizedScrollOffset < 0) {+ // No change in group ID, no need to call setState+ if (currentGroupId == null) return;+ currentGroupId = null;+ } else {+ final groupScrollOffsets = widget.galleryGroups.groupScrollOffsets;++ // Binary search to find the index of the largest scrollOffset in+ // groupScrollOffsets which is <= scrollPosition+ int low = 0;+ int high = groupScrollOffsets.length - 1;+ int floorIndex = 0;++ // Handle the case where scrollPosition is smaller than the first key.+ // In this scenario, we associate it with the first heading.+ if (normalizedScrollOffset < groupScrollOffsets.first) {+ return;+ }++ while (low <= high) {+ final mid = low + (high - low) ~/ 2;+ final midValue = groupScrollOffsets[mid];++ if (midValue <= normalizedScrollOffset) {+ // This key is less than or equal to the target scrollPosition.+ // It's a potential floor. Store its index and try searching higher+ // for a potentially closer floor value.+ floorIndex = mid;+ low = mid + 1;} else {- return b.fileSize!.compareTo(a.fileSize!);+ // This key is greater than the target scrollPosition.+ // The floor must be in the lower half.+ high = mid - 1;}- });- }- // todo:(neeraj) Stick to default group behaviour for magicSearch and editLocationGallery- // In case of Magic search, we need to hide the scrollbar title (can be done- // by specifying none as groupType)- if (widget.groupType != GroupType.size) {- return [files];+ }+ if (currentGroupId ==+ widget.galleryGroups+ .scrollOffsetToGroupIdMap[groupScrollOffsets[floorIndex]]) {+ // No change in group ID, no need to call setState+ return;+ }+ currentGroupId = widget.galleryGroups+ .scrollOffsetToGroupIdMap[groupScrollOffsets[floorIndex]];}- final List<List<EnteFile>> resultGroupedFiles = [];- List<EnteFile> singleGroupFile = [];- const int groupSize = 40;- for (int i = 0; i < files.length; i += 1) {- singleGroupFile.add(files[i]);- if (singleGroupFile.length == groupSize) {- resultGroupedFiles.add(singleGroupFile);- singleGroupFile = [];+ setState(() {});+ if (widget.scrollbarInUseNotifier.value) {+ if (Platform.isIOS) {+ HapticFeedback.selectionClick();+ } else {+ HapticFeedback.vibrate();}}- if (singleGroupFile.isNotEmpty) {- resultGroupedFiles.add(singleGroupFile);- }- _logger.info('Grouped files into ${resultGroupedFiles.length} groups');- return resultGroupedFiles;}- List<List<EnteFile>> _groupBasedOnTime(List<EnteFile> files) {- List<EnteFile> dailyFiles = [];+ void _scrollControllerListenerForZeroScrollNotifier() {+ _atZeroScrollNotifier.value = widget.scrollController.offset == 0;+ }- final List<List<EnteFile>> resultGroupedFiles = [];- for (int index = 0; index < files.length; index++) {- if (index > 0 &&- !widget.groupType.areFromSameGroup(files[index - 1], files[index])) {- resultGroupedFiles.add(dailyFiles);- dailyFiles = [];- }- dailyFiles.add(files[index]);- }- if (dailyFiles.isNotEmpty) {- resultGroupedFiles.add(dailyFiles);- }- if (_sortOrderAsc) {- resultGroupedFiles- .sort((a, b) => a[0].creationTime!.compareTo(b[0].creationTime!));+ void scrollbarInUseListener() {+ _enlargeHeaderTimer?.cancel();+ if (widget.scrollbarInUseNotifier.value) {+ _enlargeHeader.value = true;+ lastInUseState = true;+ fadeInTrailingIcons = false;} else {- resultGroupedFiles- .sort((a, b) => b[0].creationTime!.compareTo(a[0].creationTime!));+ _enlargeHeaderTimer = Timer(const Duration(milliseconds: 250), () {+ _enlargeHeader.value = false;+ if (lastInUseState) {+ fadeInTrailingIcons = true;+ Future.delayed(+ const Duration(+ milliseconds: PinnedGroupHeader.kTrailingIconsFadeInDelayMs ++ PinnedGroupHeader.kTrailingIconsFadeInDurationMs ++ 100,+ ), () {+ setState(() {+ if (!mounted) return;+ fadeInTrailingIcons = false;+ });+ });+ }+ lastInUseState = false;+ });}- return resultGroupedFiles;+ }++ void _headerHeightNotifierListener() {+ _timer?.cancel();+ _timer = Timer(const Duration(milliseconds: 500), () {+ _setCurrentGroupID();+ });+ }++ @override+ Widget build(BuildContext context) {+ return currentGroupId != null+ ? ValueListenableBuilder(+ valueListenable: _enlargeHeader,+ builder: (context, inUse, _) {+ return AnimatedScale(+ scale: inUse ? 1.2 : 1.0,+ alignment: Alignment.topLeft,+ duration: const Duration(+ milliseconds: PinnedGroupHeader.kScaleDurationInMilliseconds,+ ),+ curve: Curves.easeInOutSine,+ child: ValueListenableBuilder<bool>(+ valueListenable: _atZeroScrollNotifier,+ builder: (context, atZeroScroll, child) {+ return AnimatedContainer(+ duration: const Duration(milliseconds: 250),+ curve: Curves.easeOut,+ decoration: BoxDecoration(+ boxShadow: atZeroScroll+ ? []+ : [+ const BoxShadow(+ color: Color(0x26000000),+ blurRadius: 4,+ offset: Offset(0, 2),+ ),+ ],+ ),+ child: child,+ );+ },+ child: ColoredBox(+ color: getEnteColorScheme(context).backgroundBase,+ child: GroupHeaderWidget(+ title: widget.galleryGroups+ .groupIdToGroupDataMap[currentGroupId!]!.groupType+ .getTitle(+ context,+ widget.galleryGroups.groupIDToFilesMap[currentGroupId]!+ .first,+ ),+ gridSize: localSettings.getPhotoGridSize(),+ height: widget.galleryGroups.groupHeaderExtent,+ filesInGroup: widget+ .galleryGroups.groupIDToFilesMap[currentGroupId!]!,+ selectedFiles: widget.selectedFiles,+ showSelectAll: widget.showSelectAll,+ showGalleryLayoutSettingCTA:+ widget.showGallerySettingsCTA,+ showTrailingIcons: !inUse,+ isPinnedHeader: true,+ fadeInTrailingIcons: fadeInTrailingIcons,+ ),+ ),+ ),+ );+ },+ )+ : const SizedBox.shrink();}}