Implement dragging to move profiles

This commit is contained in:
Mygod
2015-12-25 15:51:18 +08:00
parent eed7ec6eba
commit 164becfed0
5 changed files with 55 additions and 7 deletions
@@ -438,9 +438,10 @@ class Shadowsocks
currentProfile = ShadowsocksApplication.currentProfile match {
case Some(profile) => profile // updated
case None => // removed
val profiles = ShadowsocksApplication.profileManager.getAllProfiles.getOrElse(List[Profile]())
if (profiles.isEmpty) ShadowsocksApplication.profileManager.createDefault()
else ShadowsocksApplication.switchProfile(profiles.head.id)
ShadowsocksApplication.profileManager.getFirstProfile match {
case Some(first) => ShadowsocksApplication.switchProfile(first.id)
case None => ShadowsocksApplication.profileManager.createDefault()
}
}
updatePreferenceScreen()