mirror of
https://github.com/immich-app/immich.git
synced 2025-09-29 15:31:13 -04:00
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 <alex.tran1502@gmail.com>
This commit is contained in:
parent
61c3f27fdc
commit
0c0bec6ae2
@ -84,7 +84,8 @@ class _RemoteAlbumBottomSheetState extends ConsumerState<RemoteAlbumBottomSheet>
|
|||||||
|
|
||||||
return BaseBottomSheet(
|
return BaseBottomSheet(
|
||||||
controller: sheetController,
|
controller: sheetController,
|
||||||
initialChildSize: 0.45,
|
initialChildSize: 0.22,
|
||||||
|
minChildSize: 0.22,
|
||||||
maxChildSize: 0.85,
|
maxChildSize: 0.85,
|
||||||
shouldCloseOnMinExtent: false,
|
shouldCloseOnMinExtent: false,
|
||||||
actions: [
|
actions: [
|
||||||
|
@ -356,7 +356,14 @@ class _SliverTimelineState extends ConsumerState<_SliverTimeline> {
|
|||||||
children: [
|
children: [
|
||||||
timeline,
|
timeline,
|
||||||
if (!isSelectionMode && isMultiSelectEnabled) ...[
|
if (!isSelectionMode && isMultiSelectEnabled) ...[
|
||||||
const Positioned(top: 60, left: 25, child: _MultiSelectStatusButton()),
|
Positioned(
|
||||||
|
top: MediaQuery.paddingOf(context).top,
|
||||||
|
left: 25,
|
||||||
|
child: const SizedBox(
|
||||||
|
height: kToolbarHeight,
|
||||||
|
child: Center(child: _MultiSelectStatusButton()),
|
||||||
|
),
|
||||||
|
),
|
||||||
if (widget.bottomSheet != null) widget.bottomSheet!,
|
if (widget.bottomSheet != null) widget.bottomSheet!,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
@ -75,86 +75,79 @@ class _MesmerizingSliverAppBarState extends ConsumerState<RemoteAlbumSliverAppBa
|
|||||||
const Shadow(offset: Offset(0, 2), blurRadius: 0, color: Colors.transparent),
|
const Shadow(offset: Offset(0, 2), blurRadius: 0, color: Colors.transparent),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (isMultiSelectEnabled) {
|
return SliverAppBar(
|
||||||
return SliverToBoxAdapter(
|
expandedHeight: 400.0,
|
||||||
child: switch (_scrollProgress) {
|
floating: false,
|
||||||
< 0.8 => const SizedBox(height: 120),
|
pinned: true,
|
||||||
_ => const SizedBox(height: 452),
|
snap: false,
|
||||||
},
|
elevation: 0,
|
||||||
);
|
leading: isMultiSelectEnabled
|
||||||
} else {
|
? const SizedBox.shrink()
|
||||||
return SliverAppBar(
|
: IconButton(
|
||||||
expandedHeight: 400.0,
|
icon: Icon(
|
||||||
floating: false,
|
Platform.isIOS ? Icons.arrow_back_ios_new_rounded : Icons.arrow_back,
|
||||||
pinned: true,
|
color: actionIconColor,
|
||||||
snap: false,
|
shadows: actionIconShadows,
|
||||||
elevation: 0,
|
|
||||||
leading: IconButton(
|
|
||||||
icon: Icon(
|
|
||||||
Platform.isIOS ? Icons.arrow_back_ios_new_rounded : Icons.arrow_back,
|
|
||||||
color: actionIconColor,
|
|
||||||
shadows: actionIconShadows,
|
|
||||||
),
|
|
||||||
onPressed: () => context.navigateTo(const TabShellRoute(children: [DriftAlbumsRoute()])),
|
|
||||||
),
|
|
||||||
actions: [
|
|
||||||
if (widget.onToggleAlbumOrder != null)
|
|
||||||
IconButton(
|
|
||||||
icon: Icon(Icons.swap_vert_rounded, color: actionIconColor, shadows: actionIconShadows),
|
|
||||||
onPressed: widget.onToggleAlbumOrder,
|
|
||||||
),
|
|
||||||
if (currentAlbum.isActivityEnabled && currentAlbum.isShared)
|
|
||||||
IconButton(
|
|
||||||
icon: Icon(Icons.chat_outlined, color: actionIconColor, shadows: actionIconShadows),
|
|
||||||
onPressed: widget.onActivity,
|
|
||||||
),
|
|
||||||
if (widget.onShowOptions != null)
|
|
||||||
IconButton(
|
|
||||||
icon: Icon(Icons.more_vert, color: actionIconColor, shadows: actionIconShadows),
|
|
||||||
onPressed: widget.onShowOptions,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
title: Builder(
|
|
||||||
builder: (context) {
|
|
||||||
final settings = context.dependOnInheritedWidgetOfExactType<FlexibleSpaceBarSettings>();
|
|
||||||
final scrollProgress = _calculateScrollProgress(settings);
|
|
||||||
|
|
||||||
return AnimatedSwitcher(
|
|
||||||
duration: const Duration(milliseconds: 200),
|
|
||||||
child: scrollProgress > 0.95
|
|
||||||
? Text(
|
|
||||||
currentAlbum.name,
|
|
||||||
style: TextStyle(color: context.primaryColor, fontWeight: FontWeight.w600, fontSize: 18),
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
flexibleSpace: Builder(
|
|
||||||
builder: (context) {
|
|
||||||
final settings = context.dependOnInheritedWidgetOfExactType<FlexibleSpaceBarSettings>();
|
|
||||||
final scrollProgress = _calculateScrollProgress(settings);
|
|
||||||
|
|
||||||
// Update scroll progress for the leading button
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
if (mounted && _scrollProgress != scrollProgress) {
|
|
||||||
setState(() {
|
|
||||||
_scrollProgress = scrollProgress;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return FlexibleSpaceBar(
|
|
||||||
background: _ExpandedBackground(
|
|
||||||
scrollProgress: scrollProgress,
|
|
||||||
icon: widget.icon,
|
|
||||||
onEditTitle: widget.onEditTitle,
|
|
||||||
),
|
),
|
||||||
);
|
onPressed: () => context.navigateTo(const TabShellRoute(children: [DriftAlbumsRoute()])),
|
||||||
},
|
),
|
||||||
),
|
actions: [
|
||||||
);
|
if (widget.onToggleAlbumOrder != null)
|
||||||
}
|
IconButton(
|
||||||
|
icon: Icon(Icons.swap_vert_rounded, color: actionIconColor, shadows: actionIconShadows),
|
||||||
|
onPressed: widget.onToggleAlbumOrder,
|
||||||
|
),
|
||||||
|
if (currentAlbum.isActivityEnabled && currentAlbum.isShared)
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(Icons.chat_outlined, color: actionIconColor, shadows: actionIconShadows),
|
||||||
|
onPressed: widget.onActivity,
|
||||||
|
),
|
||||||
|
if (widget.onShowOptions != null)
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(Icons.more_vert, color: actionIconColor, shadows: actionIconShadows),
|
||||||
|
onPressed: widget.onShowOptions,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
title: Builder(
|
||||||
|
builder: (context) {
|
||||||
|
final settings = context.dependOnInheritedWidgetOfExactType<FlexibleSpaceBarSettings>();
|
||||||
|
final scrollProgress = _calculateScrollProgress(settings);
|
||||||
|
|
||||||
|
return AnimatedSwitcher(
|
||||||
|
duration: const Duration(milliseconds: 200),
|
||||||
|
child: scrollProgress > 0.95
|
||||||
|
? Text(
|
||||||
|
currentAlbum.name,
|
||||||
|
style: TextStyle(color: context.primaryColor, fontWeight: FontWeight.w600, fontSize: 18),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
flexibleSpace: Builder(
|
||||||
|
builder: (context) {
|
||||||
|
final settings = context.dependOnInheritedWidgetOfExactType<FlexibleSpaceBarSettings>();
|
||||||
|
final scrollProgress = _calculateScrollProgress(settings);
|
||||||
|
|
||||||
|
// Update scroll progress for the leading button
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
if (mounted && _scrollProgress != scrollProgress) {
|
||||||
|
setState(() {
|
||||||
|
_scrollProgress = scrollProgress;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return FlexibleSpaceBar(
|
||||||
|
background: _ExpandedBackground(
|
||||||
|
scrollProgress: scrollProgress,
|
||||||
|
icon: widget.icon,
|
||||||
|
onEditTitle: widget.onEditTitle,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user