Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][locker] Align Locker action icon surfaces

aman-pilot871c7c6776b5
diff --git a/mobile/apps/locker/lib/ui/components/file_list_widget.dart b/mobile/apps/locker/lib/ui/components/file_list_widget.dart
index 9a4f61eba8..20695dc430 100644
--- a/mobile/apps/locker/lib/ui/components/file_list_widget.dart
+++ b/mobile/apps/locker/lib/ui/components/file_list_widget.dart
@@ -191,7 +191,6 @@ class FileListWidget extends StatelessWidget {
return FileIconUtils.getFileIcon(
context,
file.displayName,
- showBackground: true,
backgroundColor: backgroundColor,
);
}
diff --git a/mobile/apps/locker/lib/ui/pages/collection_page.dart b/mobile/apps/locker/lib/ui/pages/collection_page.dart
index 3f26fdedd1..409644ec0b 100644
--- a/mobile/apps/locker/lib/ui/pages/collection_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/collection_page.dart
@@ -149,6 +149,7 @@ class _CollectionPageState extends UploaderPageState<CollectionPage>
Configuration.instance.getUserID()!,
);
isFavorite = collectionViewType == CollectionViewType.favorite;
+ isQuickLink = collectionViewType == CollectionViewType.quickLink;
}
Future<void> _initializeData(Collection collection) async {
@@ -229,6 +230,7 @@ class _CollectionPageState extends UploaderPageState<CollectionPage>
IconButtonComponent(
icon: const HugeIcon(icon: HugeIcons.strokeRoundedShare08),
variant: IconButtonComponentVariant.primary,
+ shouldSurfaceExecutionStates: false,
onTap: _shareCollection,
),
);
diff --git a/mobile/apps/locker/lib/ui/pages/file_upload_screen.dart b/mobile/apps/locker/lib/ui/pages/file_upload_screen.dart
index 0efae52c1c..be9dd69178 100644
--- a/mobile/apps/locker/lib/ui/pages/file_upload_screen.dart
+++ b/mobile/apps/locker/lib/ui/pages/file_upload_screen.dart
@@ -263,7 +263,6 @@ class _FileUploadScreenState extends State<FileUploadScreen> {
return FileIconUtils.getFileIcon(
context,
fileName,
- showBackground: true,
backgroundColor: context.componentColors.backgroundBase,
);
}
diff --git a/mobile/apps/locker/lib/ui/pages/save_page.dart b/mobile/apps/locker/lib/ui/pages/save_page.dart
index 7df6c91d6c..12a12547ce 100644
--- a/mobile/apps/locker/lib/ui/pages/save_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/save_page.dart
@@ -8,6 +8,7 @@ import 'package:locker/models/info/info_item.dart';
import 'package:locker/ui/pages/account_credentials_page.dart';
import 'package:locker/ui/pages/personal_note_page.dart';
import 'package:locker/ui/pages/physical_records_page.dart';
+import 'package:locker/utils/file_icon_utils.dart';
import 'package:locker/utils/info_item_utils.dart';
enum SaveOptionType { document, note, physicalRecord, credentials }
@@ -59,10 +60,13 @@ class SaveBottomSheet extends StatelessWidget {
_buildSaveOption(
context,
rootContext: rootContext,
- icon: HugeIcon(
- icon: HugeIcons.strokeRoundedFileUpload,
- size: 24,
- color: colors.primary,
+ icon: IconTile(
+ backgroundColor: colors.primaryLight,
+ icon: HugeIcon(
+ icon: HugeIcons.strokeRoundedFileUpload,
+ size: 24,
+ color: colors.primary,
+ ),
),
title: context.l10n.saveDocumentTitle,
description: context.l10n.saveDocumentDescription,
@@ -75,7 +79,6 @@ class SaveBottomSheet extends StatelessWidget {
icon: InfoItemUtils.getInfoIcon(
context,
InfoType.note,
- showBackground: false,
size: 24,
),
title: context.l10n.personalNote,
@@ -89,7 +92,6 @@ class SaveBottomSheet extends StatelessWidget {
icon: InfoItemUtils.getInfoIcon(
context,
InfoType.physicalRecord,
- showBackground: false,
size: 24,
),
title: context.l10n.physicalRecords,
@@ -103,7 +105,6 @@ class SaveBottomSheet extends StatelessWidget {
icon: InfoItemUtils.getInfoIcon(
context,
InfoType.accountCredential,
- showBackground: false,
size: 24,
),
title: context.l10n.accountCredentials,
diff --git a/mobile/apps/locker/lib/ui/viewer/actions/collection_selection_overlay_bar.dart b/mobile/apps/locker/lib/ui/viewer/actions/collection_selection_overlay_bar.dart
index bfec844369..0a95a18b22 100644
--- a/mobile/apps/locker/lib/ui/viewer/actions/collection_selection_overlay_bar.dart
+++ b/mobile/apps/locker/lib/ui/viewer/actions/collection_selection_overlay_bar.dart
@@ -96,9 +96,7 @@ class _CollectionSelectionOverlayBarState
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
),
- border: Border(
- top: BorderSide(color: colors.strokeFaint),
- ),
+ border: Border(top: BorderSide(color: colors.strokeDark)),
),
child: Padding(
padding: EdgeInsets.fromLTRB(16, 16, 16, bottomPadding),
diff --git a/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart b/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart
index 9ba91b7aa7..33600a6c24 100644
--- a/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart
+++ b/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart
@@ -164,7 +164,7 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {
topRight: Radius.circular(20),
),
border: Border(
- top: BorderSide(color: colors.strokeFaint),
+ top: BorderSide(color: colors.strokeDark),
),
),
child: Padding(
diff --git a/mobile/apps/locker/lib/utils/file_icon_utils.dart b/mobile/apps/locker/lib/utils/file_icon_utils.dart
index c79a34e9ab..7eba2cd770 100644
--- a/mobile/apps/locker/lib/utils/file_icon_utils.dart
+++ b/mobile/apps/locker/lib/utils/file_icon_utils.dart
@@ -69,28 +69,17 @@ class FileIconUtils {
static Widget getFileIcon(
BuildContext context,
String fileName, {
- bool showBackground = true,
double size = 24,
Color? backgroundColor,
}) {
final colors = context.componentColors;
final config = _getFileConfig(fileName);
- final foregroundColor = _foregroundColor(config.colorRole, colors);
-
- final icon = HugeIcon(
+ return buildRoleIcon(
icon: config.icon,
- color: foregroundColor,
+ foregroundColor: _foregroundColor(config.colorRole, colors),
+ roleBackgroundColor: _backgroundColor(config.colorRole, colors),
size: size,
- );
-
- if (!showBackground) {
- return icon;
- }
-
- return IconTile(
- icon: icon,
- backgroundColor:
- backgroundColor ?? _backgroundColor(config.colorRole, colors),
+ backgroundColor: backgroundColor,
);
}
@@ -113,6 +102,19 @@ class FileIconUtils {
}
}
+Widget buildRoleIcon({
+ required dynamic icon,
+ required Color foregroundColor,
+ required Color roleBackgroundColor,
+ double size = 24,
+ Color? backgroundColor,
+}) {
+ return IconTile(
+ icon: HugeIcon(icon: icon, color: foregroundColor, size: size),
+ backgroundColor: backgroundColor ?? roleBackgroundColor,
+ );
+}
+
class IconTile extends StatelessWidget {
final Widget icon;
final Color backgroundColor;
@@ -146,9 +148,9 @@ class SelectionCheckBadge extends StatelessWidget {
height: 18,
alignment: Alignment.center,
decoration: BoxDecoration(color: colors.primary, shape: BoxShape.circle),
- child: const HugeIcon(
+ child: HugeIcon(
icon: HugeIcons.strokeRoundedTick02,
- color: Colors.white,
+ color: colors.specialWhite,
size: 12,
strokeWidth: 2,
),
diff --git a/mobile/apps/locker/lib/utils/info_item_utils.dart b/mobile/apps/locker/lib/utils/info_item_utils.dart
index 9ba8a8706f..febb88de82 100644
--- a/mobile/apps/locker/lib/utils/info_item_utils.dart
+++ b/mobile/apps/locker/lib/utils/info_item_utils.dart
@@ -41,28 +41,17 @@ class InfoItemUtils {
static Widget getInfoIcon(
BuildContext context,
InfoType type, {
- bool showBackground = true,
double size = 24,
Color? backgroundColor,
}) {
final colors = context.componentColors;
final config = _getInfoConfig(type);
- final foregroundColor = _foregroundColor(config.colorRole, colors);
-
- final icon = HugeIcon(
+ return buildRoleIcon(
icon: config.icon,
- color: foregroundColor,
+ foregroundColor: _foregroundColor(config.colorRole, colors),
+ roleBackgroundColor: _backgroundColor(config.colorRole, colors),
size: size,
- );
-
- if (!showBackground) {
- return icon;
- }
-
- return IconTile(
- icon: icon,
- backgroundColor:
- backgroundColor ?? _backgroundColor(config.colorRole, colors),
+ backgroundColor: backgroundColor,
);
}