diff --git a/CHANGELOG.md b/CHANGELOG.md index 470b1bada..ef8c773d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. ### Changed +- long press actions trigger haptic feedback according to OS settings - target Android 14 (API 34) - upgraded Flutter to stable v3.13.9 diff --git a/lib/widgets/common/grid/header.dart b/lib/widgets/common/grid/header.dart index 4769eae1e..732fa5c18 100644 --- a/lib/widgets/common/grid/header.dart +++ b/lib/widgets/common/grid/header.dart @@ -40,7 +40,7 @@ class SectionHeader extends StatelessWidget { child: GestureDetector( onTap: onTap, onLongPress: selectable - ? () { + ? Feedback.wrapForLongPress(() { final selection = context.read>(); if (selection.isSelecting) { _toggleSectionSelection(context); @@ -48,7 +48,7 @@ class SectionHeader extends StatelessWidget { selection.select(); selection.addToSelection(_getSectionEntries(context)); } - } + }, context) : null, child: Text.rich( TextSpan( diff --git a/lib/widgets/common/grid/selector.dart b/lib/widgets/common/grid/selector.dart index 675be6834..ba1eeb6cf 100644 --- a/lib/widgets/common/grid/selector.dart +++ b/lib/widgets/common/grid/selector.dart @@ -98,6 +98,7 @@ class _GridSelectionGestureDetectorState extends State>(); selection.toggleSelection(fromItem); _selecting = selection.isSelected([fromItem]); diff --git a/lib/widgets/common/identity/aves_filter_chip.dart b/lib/widgets/common/identity/aves_filter_chip.dart index 4022b6553..601aaba16 100644 --- a/lib/widgets/common/identity/aves_filter_chip.dart +++ b/lib/widgets/common/identity/aves_filter_chip.dart @@ -247,11 +247,11 @@ class _AvesFilterChipState extends State { } : null; final onLongPress = widget.onLongPress != null - ? () { + ? Feedback.wrapForLongPress(() { if (_tapPosition != null) { widget.onLongPress?.call(context, filter, _tapPosition!); } - } + }, context) : null; Widget? content; diff --git a/lib/widgets/common/map/leaflet/map.dart b/lib/widgets/common/map/leaflet/map.dart index 4f7e9bfbc..439d67a7b 100644 --- a/lib/widgets/common/map/leaflet/map.dart +++ b/lib/widgets/common/map/leaflet/map.dart @@ -137,7 +137,7 @@ class _EntryLeafletMapState extends State> with TickerProv // marker tap handling prevents the default handling of focal zoom on double tap, // so we reimplement the double tap gesture here onDoubleTap: interactive ? () => _zoomBy(1, focalPoint: latLng) : null, - onLongPress: () => widget.onMarkerLongPress?.call(geoEntry, LatLng(geoEntry.latitude!, geoEntry.longitude!)), + onLongPress: Feedback.wrapForLongPress(() => widget.onMarkerLongPress?.call(geoEntry, LatLng(geoEntry.latitude!, geoEntry.longitude!)), context), child: widget.markerWidgetBuilder(markerKey), ), width: markerSize.width,