Commit 115fbcb2 authored by Mygod's avatar Mygod

Add a fading when switching profiles

parent 69d2bc1e
<?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" />
......
...@@ -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
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment