Add a fading when switching profiles

This commit is contained in:
Mygod
2017-01-05 21:25:59 +08:00
parent 69d2bc1ee5
commit 115fbcb2fe
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<selector>
<selector android:enterFadeDuration="@android:integer/config_mediumAnimTime"
android:exitFadeDuration="@android:integer/config_mediumAnimTime">
<item android:state_selected="true">
<shape android:shape="rectangle">
<solid android:color="@color/material_green_700" />
@@ -155,7 +155,7 @@ final class ProfilesFragment extends ToolbarFragment with Toolbar.OnMenuItemClic
val old = app.profileId
app.switchProfile(item.id)
profilesAdapter.refreshId(old)
bind(item)
itemView.setSelected(true)
if (activity.state == State.CONNECTED) activity.bgService.use(item.id) // reconnect to new profile
}