Skip to content

Commit 0c0bec6

Browse files
fix: display album image in selection mode (#22087)
* fix: display album image in selection mode * fix: align MultiSelectStatusButton to display instead of back button in album * small styling tweak --------- Co-authored-by: Alex <[email protected]>
1 parent 61c3f27 commit 0c0bec6

File tree

3 files changed

+81
-80
lines changed

3 files changed

+81
-80
lines changed

mobile/lib/presentation/widgets/bottom_sheet/remote_album_bottom_sheet.widget.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ class _RemoteAlbumBottomSheetState extends ConsumerState<RemoteAlbumBottomSheet>
8484

8585
return BaseBottomSheet(
8686
controller: sheetController,
87-
initialChildSize: 0.45,
87+
initialChildSize: 0.22,
88+
minChildSize: 0.22,
8889
maxChildSize: 0.85,
8990
shouldCloseOnMinExtent: false,
9091
actions: [

mobile/lib/presentation/widgets/timeline/timeline.widget.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,14 @@ class _SliverTimelineState extends ConsumerState<_SliverTimeline> {
356356
children: [
357357
timeline,
358358
if (!isSelectionMode && isMultiSelectEnabled) ...[
359-
const Positioned(top: 60, left: 25, child: _MultiSelectStatusButton()),
359+
Positioned(
360+
top: MediaQuery.paddingOf(context).top,
361+
left: 25,
362+
child: const SizedBox(
363+
height: kToolbarHeight,
364+
child: Center(child: _MultiSelectStatusButton()),
365+
),
366+
),
360367
if (widget.bottomSheet != null) widget.bottomSheet!,
361368
],
362369
],

mobile/lib/widgets/common/remote_album_sliver_app_bar.dart

Lines changed: 71 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -75,86 +75,79 @@ class _MesmerizingSliverAppBarState extends ConsumerState<RemoteAlbumSliverAppBa
7575
const Shadow(offset: Offset(0, 2), blurRadius: 0, color: Colors.transparent),
7676
];
7777

78-
if (isMultiSelectEnabled) {
79-
return SliverToBoxAdapter(
80-
child: switch (_scrollProgress) {
81-
< 0.8 => const SizedBox(height: 120),
82-
_ => const SizedBox(height: 452),
83-
},
84-
);
85-
} else {
86-
return SliverAppBar(
87-
expandedHeight: 400.0,
88-
floating: false,
89-
pinned: true,
90-
snap: false,
91-
elevation: 0,
92-
leading: IconButton(
93-
icon: Icon(
94-
Platform.isIOS ? Icons.arrow_back_ios_new_rounded : Icons.arrow_back,
95-
color: actionIconColor,
96-
shadows: actionIconShadows,
97-
),
98-
onPressed: () => context.navigateTo(const TabShellRoute(children: [DriftAlbumsRoute()])),
99-
),
100-
actions: [
101-
if (widget.onToggleAlbumOrder != null)
102-
IconButton(
103-
icon: Icon(Icons.swap_vert_rounded, color: actionIconColor, shadows: actionIconShadows),
104-
onPressed: widget.onToggleAlbumOrder,
105-
),
106-
if (currentAlbum.isActivityEnabled && currentAlbum.isShared)
107-
IconButton(
108-
icon: Icon(Icons.chat_outlined, color: actionIconColor, shadows: actionIconShadows),
109-
onPressed: widget.onActivity,
78+
return SliverAppBar(
79+
expandedHeight: 400.0,
80+
floating: false,
81+
pinned: true,
82+
snap: false,
83+
elevation: 0,
84+
leading: isMultiSelectEnabled
85+
? const SizedBox.shrink()
86+
: IconButton(
87+
icon: Icon(
88+
Platform.isIOS ? Icons.arrow_back_ios_new_rounded : Icons.arrow_back,
89+
color: actionIconColor,
90+
shadows: actionIconShadows,
91+
),
92+
onPressed: () => context.navigateTo(const TabShellRoute(children: [DriftAlbumsRoute()])),
11093
),
111-
if (widget.onShowOptions != null)
112-
IconButton(
113-
icon: Icon(Icons.more_vert, color: actionIconColor, shadows: actionIconShadows),
114-
onPressed: widget.onShowOptions,
94+
actions: [
95+
if (widget.onToggleAlbumOrder != null)
96+
IconButton(
97+
icon: Icon(Icons.swap_vert_rounded, color: actionIconColor, shadows: actionIconShadows),
98+
onPressed: widget.onToggleAlbumOrder,
99+
),
100+
if (currentAlbum.isActivityEnabled && currentAlbum.isShared)
101+
IconButton(
102+
icon: Icon(Icons.chat_outlined, color: actionIconColor, shadows: actionIconShadows),
103+
onPressed: widget.onActivity,
104+
),
105+
if (widget.onShowOptions != null)
106+
IconButton(
107+
icon: Icon(Icons.more_vert, color: actionIconColor, shadows: actionIconShadows),
108+
onPressed: widget.onShowOptions,
109+
),
110+
],
111+
title: Builder(
112+
builder: (context) {
113+
final settings = context.dependOnInheritedWidgetOfExactType<FlexibleSpaceBarSettings>();
114+
final scrollProgress = _calculateScrollProgress(settings);
115+
116+
return AnimatedSwitcher(
117+
duration: const Duration(milliseconds: 200),
118+
child: scrollProgress > 0.95
119+
? Text(
120+
currentAlbum.name,
121+
style: TextStyle(color: context.primaryColor, fontWeight: FontWeight.w600, fontSize: 18),
122+
)
123+
: null,
124+
);
125+
},
126+
),
127+
flexibleSpace: Builder(
128+
builder: (context) {
129+
final settings = context.dependOnInheritedWidgetOfExactType<FlexibleSpaceBarSettings>();
130+
final scrollProgress = _calculateScrollProgress(settings);
131+
132+
// Update scroll progress for the leading button
133+
WidgetsBinding.instance.addPostFrameCallback((_) {
134+
if (mounted && _scrollProgress != scrollProgress) {
135+
setState(() {
136+
_scrollProgress = scrollProgress;
137+
});
138+
}
139+
});
140+
141+
return FlexibleSpaceBar(
142+
background: _ExpandedBackground(
143+
scrollProgress: scrollProgress,
144+
icon: widget.icon,
145+
onEditTitle: widget.onEditTitle,
115146
),
116-
],
117-
title: Builder(
118-
builder: (context) {
119-
final settings = context.dependOnInheritedWidgetOfExactType<FlexibleSpaceBarSettings>();
120-
final scrollProgress = _calculateScrollProgress(settings);
121-
122-
return AnimatedSwitcher(
123-
duration: const Duration(milliseconds: 200),
124-
child: scrollProgress > 0.95
125-
? Text(
126-
currentAlbum.name,
127-
style: TextStyle(color: context.primaryColor, fontWeight: FontWeight.w600, fontSize: 18),
128-
)
129-
: null,
130-
);
131-
},
132-
),
133-
flexibleSpace: Builder(
134-
builder: (context) {
135-
final settings = context.dependOnInheritedWidgetOfExactType<FlexibleSpaceBarSettings>();
136-
final scrollProgress = _calculateScrollProgress(settings);
137-
138-
// Update scroll progress for the leading button
139-
WidgetsBinding.instance.addPostFrameCallback((_) {
140-
if (mounted && _scrollProgress != scrollProgress) {
141-
setState(() {
142-
_scrollProgress = scrollProgress;
143-
});
144-
}
145-
});
146-
147-
return FlexibleSpaceBar(
148-
background: _ExpandedBackground(
149-
scrollProgress: scrollProgress,
150-
icon: widget.icon,
151-
onEditTitle: widget.onEditTitle,
152-
),
153-
);
154-
},
155-
),
156-
);
157-
}
147+
);
148+
},
149+
),
150+
);
158151
}
159152
}
160153

0 commit comments

Comments
 (0)