Use new bottom bar for gallery folder page
This commit is contained in:
parent
b06fc72614
commit
66c5e0f24f
|
@ -46,6 +46,24 @@ extension GalleyTypeExtension on GalleryType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// showDeleteTopOption indicates whether we should show
|
||||||
|
// delete icon as iconButton
|
||||||
|
bool showDeleteIconOption() {
|
||||||
|
switch (this) {
|
||||||
|
case GalleryType.ownedCollection:
|
||||||
|
case GalleryType.searchResults:
|
||||||
|
case GalleryType.homepage:
|
||||||
|
case GalleryType.favorite:
|
||||||
|
case GalleryType.localFolder:
|
||||||
|
return true;
|
||||||
|
case GalleryType.trash:
|
||||||
|
case GalleryType.archive:
|
||||||
|
case GalleryType.hidden:
|
||||||
|
case GalleryType.sharedCollection:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool showDeleteOption() {
|
bool showDeleteOption() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case GalleryType.ownedCollection:
|
case GalleryType.ownedCollection:
|
||||||
|
@ -54,8 +72,8 @@ extension GalleyTypeExtension on GalleryType {
|
||||||
case GalleryType.favorite:
|
case GalleryType.favorite:
|
||||||
case GalleryType.archive:
|
case GalleryType.archive:
|
||||||
case GalleryType.hidden:
|
case GalleryType.hidden:
|
||||||
return true;
|
|
||||||
case GalleryType.localFolder:
|
case GalleryType.localFolder:
|
||||||
|
return true;
|
||||||
case GalleryType.trash:
|
case GalleryType.trash:
|
||||||
case GalleryType.sharedCollection:
|
case GalleryType.sharedCollection:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -40,9 +40,7 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
showDeleteOption = (widget.galleryType == GalleryType.homepage ||
|
showDeleteOption = widget.galleryType.showDeleteIconOption();
|
||||||
widget.galleryType == GalleryType.ownedCollection ||
|
|
||||||
widget.galleryType == GalleryType.favorite);
|
|
||||||
widget.selectedFiles.addListener(_selectedFilesListener);
|
widget.selectedFiles.addListener(_selectedFilesListener);
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,9 @@ import 'package:photos/models/device_collection.dart';
|
||||||
import 'package:photos/models/gallery_type.dart';
|
import 'package:photos/models/gallery_type.dart';
|
||||||
import 'package:photos/models/selected_files.dart';
|
import 'package:photos/models/selected_files.dart';
|
||||||
import 'package:photos/services/remote_sync_service.dart';
|
import 'package:photos/services/remote_sync_service.dart';
|
||||||
|
import 'package:photos/ui/viewer/actions/file_selection_overlay_bar.dart';
|
||||||
import 'package:photos/ui/viewer/gallery/gallery.dart';
|
import 'package:photos/ui/viewer/gallery/gallery.dart';
|
||||||
import 'package:photos/ui/viewer/gallery/gallery_app_bar_widget.dart';
|
import 'package:photos/ui/viewer/gallery/gallery_app_bar_widget.dart';
|
||||||
import 'package:photos/ui/viewer/gallery/gallery_overlay_widget.dart';
|
|
||||||
|
|
||||||
class DeviceFolderPage extends StatelessWidget {
|
class DeviceFolderPage extends StatelessWidget {
|
||||||
final DeviceCollection deviceCollection;
|
final DeviceCollection deviceCollection;
|
||||||
|
@ -61,7 +61,7 @@ class DeviceFolderPage extends StatelessWidget {
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
children: [
|
children: [
|
||||||
gallery,
|
gallery,
|
||||||
GalleryOverlayWidget(
|
FileSelectionOverlayBar(
|
||||||
GalleryType.localFolder,
|
GalleryType.localFolder,
|
||||||
_selectedFiles,
|
_selectedFiles,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue