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
115fbcb2
Commit
115fbcb2
authored
Jan 05, 2017
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a fading when switching profiles
parent
69d2bc1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
src/main/res/drawable/background_profile.xml
src/main/res/drawable/background_profile.xml
+2
-1
src/main/scala/com/github/shadowsocks/ProfilesFragment.scala
src/main/scala/com/github/shadowsocks/ProfilesFragment.scala
+1
-1
No files found.
src/main/res/drawable/background_profile.xml
View file @
115fbcb2
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item>
<item>
<selector>
<selector
android:enterFadeDuration=
"@android:integer/config_mediumAnimTime"
android:exitFadeDuration=
"@android:integer/config_mediumAnimTime"
>
<item
android:state_selected=
"true"
>
<item
android:state_selected=
"true"
>
<shape
android:shape=
"rectangle"
>
<shape
android:shape=
"rectangle"
>
<solid
android:color=
"@color/material_green_700"
/>
<solid
android:color=
"@color/material_green_700"
/>
...
...
src/main/scala/com/github/shadowsocks/ProfilesFragment.scala
View file @
115fbcb2
...
@@ -155,7 +155,7 @@ final class ProfilesFragment extends ToolbarFragment with Toolbar.OnMenuItemClic
...
@@ -155,7 +155,7 @@ final class ProfilesFragment extends ToolbarFragment with Toolbar.OnMenuItemClic
val
old
=
app
.
profileId
val
old
=
app
.
profileId
app
.
switchProfile
(
item
.
id
)
app
.
switchProfile
(
item
.
id
)
profilesAdapter
.
refreshId
(
old
)
profilesAdapter
.
refreshId
(
old
)
bind
(
item
)
itemView
.
setSelected
(
true
)
if
(
activity
.
state
==
State
.
CONNECTED
)
activity
.
bgService
.
use
(
item
.
id
)
// reconnect to new profile
if
(
activity
.
state
==
State
.
CONNECTED
)
activity
.
bgService
.
use
(
item
.
id
)
// reconnect to new profile
}
}
...
...
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