Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix delete all button getting cut by system navigation bar

ashilkn9f469bb2cf5d
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/cleanup_hidden_from_device_page.dart b/mobile/apps/photos/lib/ui/viewer/gallery/cleanup_hidden_from_device_page.dart
index ec0edb9d00..ee2a121f28 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/cleanup_hidden_from_device_page.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/cleanup_hidden_from_device_page.dart
@@ -1,3 +1,4 @@
+import "dart:math";
import "dart:ui";
import "package:flutter/material.dart";
@@ -60,6 +61,8 @@ class _CleanupHiddenFromDevicePageState
@override
Widget build(BuildContext context) {
final filesAreSelected = _selectedFiles.files.isNotEmpty;
+ final bottomPadding = MediaQuery.of(context).padding.bottom;
+ final deleteAllButtonHeight = 40.0 + max(bottomPadding, 6.0) + 12.0;
final gallery = Gallery(
asyncLoader: (creationStartTime, creationEndTime, {limit, asc}) async {
@@ -100,7 +103,7 @@ class _CleanupHiddenFromDevicePageState
AnimatedContainer(
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
- height: filesAreSelected ? 0 : 80,
+ height: filesAreSelected ? 0 : deleteAllButtonHeight,
child: AnimatedOpacity(
duration: const Duration(milliseconds: 100),
opacity: filesAreSelected ? 0.0 : 1.0,
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/trash_page.dart b/mobile/apps/photos/lib/ui/viewer/gallery/trash_page.dart
index e7d3444966..fda7bfb928 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/trash_page.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/trash_page.dart
@@ -1,3 +1,4 @@
+import 'dart:math';
import 'dart:ui';
import 'package:collection/collection.dart' show IterableExtension;
@@ -33,6 +34,8 @@ class TrashPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final bool filesAreSelected = _selectedFiles.files.isNotEmpty;
+ final bottomPadding = MediaQuery.of(context).padding.bottom;
+ final deleteAllButtonHeight = 40.0 + max(bottomPadding, 6.0) + 12.0;
final gallery = Gallery(
asyncLoader: (creationStartTime, creationEndTime, {limit, asc}) {
@@ -82,7 +85,7 @@ class TrashPage extends StatelessWidget {
AnimatedContainer(
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
- height: filesAreSelected ? 0 : 80,
+ height: filesAreSelected ? 0 : deleteAllButtonHeight,
child: AnimatedOpacity(
duration: const Duration(milliseconds: 100),
opacity: filesAreSelected ? 0.0 : 1.0,