Skip to content

fix: menu items drag#21047

Open
BrayanDSO wants to merge 2 commits into
ankidroid:mainfrom
BrayanDSO:fix/drag
Open

fix: menu items drag#21047
BrayanDSO wants to merge 2 commits into
ankidroid:mainfrom
BrayanDSO:fix/drag

Conversation

@BrayanDSO
Copy link
Copy Markdown
Member

Purpose / Description

Note

Assisted-by: Gemini 3.1 Pro - diagnostics

Fixes

How Has This Been Tested?

Emulator 37

Dragged elements quickly on the reviewer menu settings. No visual bugs

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

BrayanDSO added 2 commits May 15, 2026 08:10
only the initial and final elements were swapped. On a quick move, intermediate elements wouldn't get correctly moved.

so now, swap each element sequentially
the items list is fixed, so it should improve the recycler view inner performance
@BrayanDSO BrayanDSO changed the title Fix/drag fix: menu items drag May 15, 2026
Copy link
Copy Markdown
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

if (toPosition == 0) return false

Collections.swap(items, fromPosition, toPosition)
if (fromPosition < toPosition) {
Copy link
Copy Markdown
Member

@david-allison david-allison May 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract to a well named extension method: reposition or similar with docs on how it differs from swap

@Giyutomioka-SS
Copy link
Copy Markdown
Contributor

LGTM!

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Second Approval Has one approval, one more approval to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dragging the items in the toolbar actions screen is buggy

3 participants