Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

double click one profile and drag upwards, profiles would be displayed incorrectly #2752

Closed
17 tasks
iamsad3508 opened this issue Jun 28, 2021 · 8 comments · Fixed by #3035
Closed
17 tasks

Comments

@iamsad3508
Copy link

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
20210628_162554

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.

@iamsad3508 iamsad3508 added the bug label Jun 28, 2021
@Mygod
Copy link
Contributor

Mygod commented Jun 28, 2021

Umm do not double click? 😭

@iamsad3508
Copy link
Author

🤣 it's ok to me, if you won't fix it

@DescargarDixmax
Copy link

And what is the fault for that double click operation?

@shadowsocks shadowsocks deleted a comment from yndue736 May 31, 2022
@MSVhora
Copy link
Contributor

MSVhora commented Apr 10, 2023

Is anyone working on this issue?

@Mygod
Copy link
Contributor

Mygod commented Apr 10, 2023

Not as far as I'm concerned. Feel free to submit a PR.

@MSVhora
Copy link
Contributor

MSVhora commented Apr 10, 2023

Can you assign it to me?

@MSVhora
Copy link
Contributor

MSVhora commented Apr 11, 2023

@Mygod There are a couple of optimizations we can do in the move function of ProfileAdapter.

  1. I think instead of swapping each item in the [from, to] range, we can just swap [from, to] object's userOrder and [from, to] objects themselves in the array.
  2. Instead of updated HashSet 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 index 20 to index 0 and back to index 20, which added 53 objects in the updated HashSet, where we only need to update at most 20.

@MSVhora
Copy link
Contributor

MSVhora commented Apr 11, 2023

@Mygod There are a couple of optimizations we can do in the move function of ProfileAdapter.

  1. I think instead of swapping each item in the [from, to] range, we can just swap [from, to] object's userOrder and [from, to] objects themselves in the array.
  2. Instead of updated HashSet 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 index 20 to index 0 and back to index 20, which added 53 objects in the updated HashSet, where we only need to update at most 20.

@Mygod Should I implement above optimization ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@Mygod @iamsad3508 @MSVhora @DescargarDixmax and others