Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
6608355e
Commit
6608355e
authored
Dec 06, 2017
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a crash when reordering profiles
parent
8f14bc88
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt
.../src/main/java/com/github/shadowsocks/ProfilesFragment.kt
+2
-2
No files found.
mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt
View file @
6608355e
...
...
@@ -244,10 +244,10 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
fun
move
(
from
:
Int
,
to
:
Int
)
{
undoManager
.
flush
()
val
step
=
if
(
from
<
to
)
1
else
-
1
val
first
=
profiles
[
from
]
var
previousOrder
=
first
.
userOrder
for
(
i
in
if
(
from
<
to
)
from
until
to
else
from
..
to
+
1
step
-
1
)
{
val
(
step
,
range
)
=
if
(
from
<
to
)
Pair
(
1
,
from
until
to
)
else
Pair
(-
1
,
to
+
1
downTo
from
)
for
(
i
in
range
)
{
val
next
=
profiles
[
i
+
step
]
val
order
=
next
.
userOrder
next
.
userOrder
=
previousOrder
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment