Skip to content

armgit / ente

Public Imported from GitHub
0

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

Merge branch 'main' into aman/photos-albums-search-fixes

Aman Raj3a2f21160dbd
diff --cc mobile/apps/photos/lib/ui/tabs/albums_tab.dart
index 2a0c2c3122,ae708ad2b4..6ad285c385
--- a/mobile/apps/photos/lib/ui/tabs/albums_tab.dart
+++ b/mobile/apps/photos/lib/ui/tabs/albums_tab.dart
@@@ -538,92 -404,100 +538,95 @@@ class _AlbumsTabState extends State<Alb
padding: const EdgeInsets.symmetric(horizontal: 8),
child: SizedBox(
height: _kHeaderToolbarHeight,
- child: Row(
- children: [
- Expanded(
- child: AnimatedSwitcher(
- duration: const Duration(milliseconds: 220),
- switchInCurve: Curves.easeOutCubic,
- switchOutCurve: Curves.easeInCubic,
- layoutBuilder: (currentChild, previousChildren) =>
- Stack(
- alignment: Alignment.centerLeft,
- children: [
- ...previousChildren,
- if (currentChild != null) currentChild,
- ],
- ),
- transitionBuilder: (child, animation) {
- final curvedAnimation = CurvedAnimation(
- parent: animation,
- curve: Curves.easeOutCubic,
- reverseCurve: Curves.easeInCubic,
- );
- final beginOffset =
- child.key == const ValueKey("search_title")
- ? const Offset(0.04, 0)
- : const Offset(-0.04, 0);
- return FadeTransition(
- opacity: curvedAnimation,
- child: SlideTransition(
- position: Tween<Offset>(
- begin: beginOffset,
- end: Offset.zero,
- ).animate(curvedAnimation),
- child: child,
- ),
- );
- },
- child: _isSearchActive
- ? Row(
- key: const ValueKey("search_title"),
- children: [
- Expanded(
- child: TextInputComponent(
- controller: _searchController,
- focusNode: _searchFocusNode,
- hintText: strings.searchAlbums,
- autofocus: true,
- prefix: HugeIcon(
- icon: HugeIcons.strokeRoundedSearch01,
- size: 18,
- color: componentColors.textLight,
- ),
- suffix: GestureDetector(
- behavior: HitTestBehavior.opaque,
- onTap: _deactivateSearch,
- child: HugeIcon(
- icon:
- HugeIcons.strokeRoundedCancel01,
- size: 18,
- color: componentColors.textLight,
- ),
- ),
- onChanged: (value) {
- setState(() {
- _searchQuery = value;
- });
- },
- ),
+ child: AnimatedSwitcher(
+ duration: _kSearchTransitionDuration,
+ switchInCurve: Curves.easeOutCubic,
+ switchOutCurve: Curves.easeInCubic,
+ layoutBuilder: (currentChild, previousChildren) => Stack(
+ alignment: Alignment.centerLeft,
+ children: [
+ ...previousChildren,
+ if (currentChild != null) currentChild,
+ ],
+ ),
+ transitionBuilder: (child, animation) {
+ final curvedAnimation = CurvedAnimation(
+ parent: animation,
+ curve: Curves.easeOutCubic,
+ reverseCurve: Curves.easeInCubic,
+ );
+ final beginOffset =
+ child.key == const ValueKey("albums_search_toolbar")
+ ? const Offset(0.035, 0)
+ : const Offset(-0.035, 0);
+ return FadeTransition(
+ opacity: curvedAnimation,
+ child: SlideTransition(
+ position: Tween<Offset>(
+ begin: beginOffset,
+ end: Offset.zero,
+ ).animate(curvedAnimation),
+ child: child,
+ ),
+ );
+ },
+ child: _isSearchActive
+ ? Row(
+ key: const ValueKey("albums_search_toolbar"),
+ children: [
+ Expanded(
+ child: TextInputComponent(
+ controller: _searchController,
+ focusNode: _searchFocusNode,
+ hintText: strings.searchAlbums,
+ autofocus: true,
+ prefix: HugeIcon(
+ icon: HugeIcons.strokeRoundedSearch01,
+ size: 18,
+ color: componentColors.textLight,
+ ),
+ suffix: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: _deactivateSearch,
+ child: HugeIcon(
+ icon: HugeIcons.strokeRoundedCancel01,
+ size: 18,
+ color: componentColors.textLight,
),
- const SizedBox(width: 20),
- albumsOptionsButton,
- ],
- )
- : Text(
+ ),
+ onChanged: (value) {
+ setState(() {
+ _searchQuery = value;
+ });
+ },
+ ),
+ ),
+ ],
+ )
+ : Row(
+ key: const ValueKey("albums_title_toolbar"),
+ children: [
+ Expanded(
+ child: Text(
strings.albums,
- style: textTheme.h4Bold,
+ key: const ValueKey("albums_title"),
+ style: TextStyles.h1Bold.copyWith(
+ color: textTheme.h4Bold.color,
+ ),
),
- ),
- ),
- if (!_isSearchActive) ...[
- IconButtonComponent(
- variant: IconButtonComponentVariant.primary,
- shouldSurfaceExecutionStates: false,
- icon: const HugeIcon(
- icon: HugeIcons.strokeRoundedSearch01,
+ ),
+ IconButtonComponent(
+ variant: IconButtonComponentVariant.primary,
+ shouldSurfaceExecutionStates: false,
+ icon: const HugeIcon(
+ icon: HugeIcons.strokeRoundedSearch01,
+ ),
+ onTap: _activateSearch,
+ ),
+ const SizedBox(width: 6),
+ albumsOptionsButton,
+ ],
),
- onTap: _activateSearch,
- ),
- const SizedBox(width: 6),
- albumsOptionsButton,
- ],
- ],
),
),
),