double click one profile and drag upwards, profiles would be displayed incorrectly
Please read contributing guidelines. Thanks.
Describe the bug select one profile, and double click the profile and drag upwards, profiles would be displayed incorrectly
To Reproduce Steps to reproduce the behavior: 1.select one profile 2.double click the profile fast 3.don't let go your finger and draw it upwards immediately
Expected behavior normal
Screenshots

Smartphone (please complete the following information):
- Android/Chrome OS version: android 8.10
- Device: [e.g. Google nexus 6P
- Version:5.2.4
- Last version that did not exhibit the issue: [not applicable]
Configuration
Put an x inside the [ ] that applies.
- [ ] IPv4 server address
- [ ] IPv6 server address
- [ ] Client IPv4 availability
- [ ] Client IPv6 availability
- Encrypt method:
- Route
- [ ] All
- [ ] Bypass LAN
- [ ] Bypass China
- [ ] Bypass LAN & China
- [ ] GFW List
- [ ] China List
- [ ] Custom rules
- [ ] IPv6 route
- [ ] Apps VPN mode
- [ ] Bypass mode
- Remote DNS: 8.8.8.8
- [ ] DNS over UDP
- Plugin configuration (if applicable):
- [ ] Auto Connect
- [ ] TCP Fast Open
- If you're not using VPN mode, please supply more details here:
Additional context Add any other context about the problem here.
Umm do not double click? 😭
🤣 it's ok to me, if you won't fix it
And what is the fault for that double click operation?
Is anyone working on this issue?
Not as far as I'm concerned. Feel free to submit a PR.
Can you assign it to me?
@Mygod There are a couple of optimizations we can do in the move function of ProfileAdapter.
- I think instead of swapping each item in the [from, to] range, we can just swap [from, to] object's
userOrderand [from, to] objects themselves in the array. - Instead of
updatedHashSet of Profile object, we can use HashMap of <profileId, Profile> to reduce the number of update operations on DB. For example, I dragged the item at index20to index0and back to index20, which added 53 objects in theupdatedHashSet, where we only need to update at most 20.
@Mygod There are a couple of optimizations we can do in the move function of ProfileAdapter.
- I think instead of swapping each item in the [from, to] range, we can just swap [from, to] object's
userOrderand [from, to] objects themselves in the array.- Instead of
updatedHashSet of Profile object, we can use HashMap of <profileId, Profile> to reduce the number of update operations on DB. For example, I dragged the item at index20to index0and back to index20, which added 53 objects in theupdatedHashSet, where we only need to update at most 20.
@Mygod Should I implement above optimization ?