Skip to content

feat(note-list): add option to disable swipe actions#3088

Open
markus-kreft wants to merge 1 commit intonextcloud:mainfrom
markus-kreft:feat/disable-swipe-actions
Open

feat(note-list): add option to disable swipe actions#3088
markus-kreft wants to merge 1 commit intonextcloud:mainfrom
markus-kreft:feat/disable-swipe-actions

Conversation

@markus-kreft
Copy link

This PR adds a toggle in Settings > Appearance and behavior to enable or disable swipe gestures (delete and favorite) in the note list.

Motivation

Destructive actions like deletion can currently be triggered too easily by accident. I experienced this when I unknowingly deleted a note via a swipe and only noticed it two weeks later. While the "Undo" snackbar is helpful, it is easy to miss. This option allows users to make deletions more intentional via the long-press menu.

Changes

  • New Setting: "Swipe actions" toggle in the settings menu.
  • Default Enabled: Swipe actions are enabled by default, so existing behavior is preserved.
  • Gesture Control: Deactivates ItemTouchHelper gestures when the setting is toggled off.
  • Consistent UI: Added a matching grey-tinted icon (ic_swipe_grey600_24dp.xml) for the settings entry.

Testing

  • Verified build and unit tests pass.
  • Manually tested on physical device (debug build) to confirm the toggle correctly enables/disables swipe gestures.

Addresses #1774

@AndyScherzinger AndyScherzinger self-requested a review March 10, 2026 14:12
@AndyScherzinger AndyScherzinger added this to the 4.7.0 milestone Mar 10, 2026
@AndyScherzinger
Copy link
Member

@markus-kreft code looks good, still will need to test it though. Can you sign the commits/DCO, see https://github.com/nextcloud/notes-android/pull/3088/checks?check_run_id=65779085624 for details on how to do it.

Add a toggle in the "Appearance and behavior" settings to enable or
disable swipe gestures (delete and favorite) in the note list.

The default value is set to enabled, preserving existing behavior while
allowing users who accidentally trigger these actions to disable them.

Changes:
- Add `swipe_actions` preference to `preferences.xml`
- Add `isSwipeEnabled` global state in `NotesApplication`
- Update `NotesListViewItemTouchHelper` to respect the setting
- Create `ic_swipe_grey600_24dp.xml` for the settings icon

Signed-off-by: Markus Kreft <129367085+markus-kreft@users.noreply.github.com>
@markus-kreft markus-kreft force-pushed the feat/disable-swipe-actions branch from ba14d75 to 5206334 Compare March 10, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants