Skip to content

armgit / ente

Public Imported from GitHub
0

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

[ mob][photos] Slight changes to UI in all filters view and in app bar and fix clipping issue of overflowing of widget content (of filter chip) by changing the design

ashilknf9d6c5400453
diff --git a/mobile/lib/ui/viewer/hierarchicial_search/filter_chip.dart b/mobile/lib/ui/viewer/hierarchicial_search/filter_chip.dart
index 1c0bb799d5..b7b4b0b51d 100644
--- a/mobile/lib/ui/viewer/hierarchicial_search/filter_chip.dart
+++ b/mobile/lib/ui/viewer/hierarchicial_search/filter_chip.dart
@@ -10,6 +10,7 @@ class GenericFilterChip extends StatefulWidget {
final VoidCallback apply;
final VoidCallback remove;
final bool isApplied;
+ final bool isInAllFiltersView;
const GenericFilterChip({
required this.label,
@@ -17,6 +18,7 @@ class GenericFilterChip extends StatefulWidget {
required this.remove,
required this.isApplied,
this.leadingIcon,
+ this.isInAllFiltersView = false,
super.key,
});
@@ -53,44 +55,56 @@ class _GenericFilterChipState extends State<GenericFilterChip> {
});
},
child: Stack(
- alignment: Alignment.center,
clipBehavior: Clip.none,
children: [
- Container(
- decoration: BoxDecoration(
- color: getEnteColorScheme(context).fillFaint,
- borderRadius: const BorderRadius.all(
- Radius.circular(kFilterChipHeight / 2),
- ),
- border: Border.all(
- color: getEnteColorScheme(context).strokeFaint,
- width: 0.5,
+ SizedBox(
+ height: kFilterChipHeight,
+ child: Container(
+ decoration: BoxDecoration(
+ color: getEnteColorScheme(context).fillFaint,
+ borderRadius: const BorderRadius.all(
+ Radius.circular(kFilterChipHeight / 2),
+ ),
+ border: Border.all(
+ color: getEnteColorScheme(context).strokeFaint,
+ width: 0.5,
+ ),
),
- ),
- child: Padding(
- padding: const EdgeInsets.all(8.0),
- child: Row(
- mainAxisSize: MainAxisSize.min,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- widget.leadingIcon != null
- ? Icon(
- widget.leadingIcon,
- size: 16,
- )
- : const SizedBox.shrink(),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 4),
- child: Text(
- widget.label,
- style: getEnteTextTheme(context).miniBold,
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ widget.leadingIcon != null
+ ? Icon(
+ widget.leadingIcon,
+ size: 16,
+ )
+ : const SizedBox.shrink(),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 4),
+ child: Text(
+ widget.label,
+ style: getEnteTextTheme(context).miniBold,
+ ),
),
- ),
- ],
+ _isApplied && !widget.isInAllFiltersView
+ ? const SizedBox(width: 4)
+ : const SizedBox.shrink(),
+ _isApplied && !widget.isInAllFiltersView
+ ? Icon(
+ Icons.close_rounded,
+ size: 16,
+ color: getEnteColorScheme(context).textMuted,
+ )
+ : const SizedBox.shrink(),
+ ],
+ ),
),
),
),
- _isApplied
+ _isApplied && widget.isInAllFiltersView
? Positioned(
top: -4,
right: -4,
@@ -167,95 +181,112 @@ class _FaceFilterChipState extends State<FaceFilterChip> {
@override
Widget build(BuildContext context) {
- return GestureDetector(
- onTap: () {
- setState(() {
- if (_isApplied) {
- widget.remove();
- } else {
- widget.apply();
- }
- _isApplied = !_isApplied;
- });
- },
- child: Stack(
- alignment: Alignment.center,
- clipBehavior: Clip.none,
- children: [
- Container(
- decoration: BoxDecoration(
- color: getEnteColorScheme(context).fillFaint,
- borderRadius: BorderRadius.all(
- Radius.circular(kFilterChipHeight * scale / 2),
- ),
- border: Border.all(
- color: widget.isInAllFiltersView
- ? getEnteColorScheme(context).strokeMuted
- : getEnteColorScheme(context).strokeFaint,
- width: widget.isInAllFiltersView ? 1 : 0.5,
- ),
- ),
- child: Padding(
- padding: EdgeInsets.only(
- right: !widget.isInAllFiltersView && widget.name.isNotEmpty
- ? 8.0
- : 0,
+ return Stack(
+ clipBehavior: Clip.none,
+ children: [
+ GestureDetector(
+ onTap: () {
+ setState(() {
+ if (_isApplied) {
+ widget.remove();
+ } else {
+ widget.apply();
+ }
+ _isApplied = !_isApplied;
+ });
+ },
+ child: SizedBox(
+ height: kFilterChipHeight * scale,
+ child: Container(
+ decoration: BoxDecoration(
+ color: getEnteColorScheme(context).fillFaint,
+ borderRadius: BorderRadius.all(
+ Radius.circular(kFilterChipHeight * scale / 2),
+ ),
+ border: Border.all(
+ color: widget.isInAllFiltersView
+ ? getEnteColorScheme(context).strokeMuted
+ : getEnteColorScheme(context).strokeFaint,
+ width: widget.isInAllFiltersView ? 1 : 0.5,
+ ),
),
- child: Row(
- mainAxisSize: MainAxisSize.min,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- ClipOval(
- child: SizedBox(
- width: kFilterChipHeight * scale,
- height: kFilterChipHeight * scale,
- child: PersonFaceWidget(
- widget.faceThumbnailFile,
- personId: widget.personId,
- clusterID: widget.clusterId,
- thumbnailFallback: false,
+ child: Padding(
+ padding: EdgeInsets.only(
+ right: !widget.isInAllFiltersView && widget.name.isNotEmpty
+ ? 8.0
+ : 0,
+ ),
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ ClipOval(
+ child: SizedBox(
+ width: kFilterChipHeight * scale,
+ height: kFilterChipHeight * scale,
+ child: PersonFaceWidget(
+ widget.faceThumbnailFile,
+ personId: widget.personId,
+ clusterID: widget.clusterId,
+ thumbnailFallback: false,
+ ),
),
),
- ),
- !widget.isInAllFiltersView && widget.name.isNotEmpty
- ? Padding(
- padding: const EdgeInsets.symmetric(horizontal: 4),
- child: Text(
- widget.name,
- style: getEnteTextTheme(context).miniBold,
- ),
- )
- : const SizedBox.shrink(),
- ],
+ !widget.isInAllFiltersView && widget.name.isNotEmpty
+ ? Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 4),
+ child: Text(
+ widget.name,
+ style: getEnteTextTheme(context).miniBold,
+ ),
+ )
+ : const SizedBox.shrink(),
+ _isApplied && !widget.isInAllFiltersView
+ ? const SizedBox(width: 4)
+ : const SizedBox.shrink(),
+ _isApplied && !widget.isInAllFiltersView
+ ? Icon(
+ Icons.close_rounded,
+ size: 16,
+ color: getEnteColorScheme(context).textMuted,
+ )
+ : const SizedBox.shrink(),
+ _isApplied &&
+ widget.name.isEmpty &&
+ !widget.isInAllFiltersView
+ ? const SizedBox(width: 8)
+ : const SizedBox.shrink(),
+ ],
+ ),
),
),
),
- _isApplied
- ? Positioned(
- top: -4,
- right: -4,
- child: Container(
- padding: const EdgeInsets.all(1),
- decoration: BoxDecoration(
- color: getEnteColorScheme(context).backgroundElevated2,
- border: Border.all(
- color: getEnteColorScheme(context).strokeMuted,
- width: 0.5,
- ),
- borderRadius: BorderRadius.all(
- Radius.circular(8 * scale),
- ),
+ ),
+ _isApplied && widget.isInAllFiltersView
+ ? Positioned(
+ top: -4,
+ right: -4,
+ child: Container(
+ padding: const EdgeInsets.all(1),
+ decoration: BoxDecoration(
+ color: getEnteColorScheme(context).backgroundElevated2,
+ border: Border.all(
+ color: getEnteColorScheme(context).strokeMuted,
+ width: 0.5,
),
- child: Icon(
- Icons.close_rounded,
- size: 14,
- color: getEnteColorScheme(context).textMuted,
+ borderRadius: BorderRadius.all(
+ Radius.circular(8 * scale),
),
),
- )
- : const SizedBox.shrink(),
- ],
- ),
+ child: Icon(
+ Icons.close_rounded,
+ size: 14,
+ color: getEnteColorScheme(context).textMuted,
+ ),
+ ),
+ )
+ : const SizedBox.shrink(),
+ ],
);
}
}
diff --git a/mobile/lib/ui/viewer/hierarchicial_search/filter_options_bottom_sheet.dart b/mobile/lib/ui/viewer/hierarchicial_search/filter_options_bottom_sheet.dart
index a27af88a82..43ff819323 100644
--- a/mobile/lib/ui/viewer/hierarchicial_search/filter_options_bottom_sheet.dart
+++ b/mobile/lib/ui/viewer/hierarchicial_search/filter_options_bottom_sheet.dart
@@ -81,6 +81,7 @@ class _FilterOptionsBottomSheetState extends State<FilterOptionsBottomSheet> {
Navigator.of(context).pop();
},
isApplied: filter.isApplied,
+ isInAllFiltersView: true,
),
],
),