From ae4e57abc0011ff9ee6888b80c808f4f8ff43f9d Mon Sep 17 00:00:00 2001 From: Mygod Date: Fri, 16 Dec 2016 23:14:34 +0800 Subject: [PATCH] Fix profile selection --- .../scala/com/github/shadowsocks/ProfilesFragment.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/scala/com/github/shadowsocks/ProfilesFragment.scala b/src/main/scala/com/github/shadowsocks/ProfilesFragment.scala index ebbc30cf..9ad70a1c 100644 --- a/src/main/scala/com/github/shadowsocks/ProfilesFragment.scala +++ b/src/main/scala/com/github/shadowsocks/ProfilesFragment.scala @@ -91,7 +91,12 @@ final class ProfilesFragment extends ToolbarFragment with OnMenuItemClickListene } } - def onClick(v: View): Unit = app.switchProfile(item.id) + def onClick(v: View) { + val old = app.profileId + app.switchProfile(item.id) + profilesAdapter.refreshId(old) + bind(item) + } } private class ProfilesAdapter extends RecyclerView.Adapter[ProfileViewHolder] {