use isActivated for selecting items

This commit is contained in:
tibbi 2016-11-17 11:12:58 +01:00
parent 06c3645bf9
commit 60596b7e5c
3 changed files with 4 additions and 4 deletions

View file

@ -33,9 +33,9 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList<Direc
fun toggleItemSelection(itemView: View, select: Boolean) { fun toggleItemSelection(itemView: View, select: Boolean) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
itemView.dir_frame.isSelected = select itemView.dir_frame.isActivated = select
else else
itemView.dir_thumbnail.isSelected = select itemView.dir_thumbnail.isActivated = select
} }
} }

View file

@ -4,7 +4,7 @@
<selector> <selector>
<item <item
android:drawable="@color/activated_item_foreground" android:drawable="@color/activated_item_foreground"
android:state_selected="true"/> android:state_activated="true"/>
</selector> </selector>
</item> </item>
<item> <item>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/selected_pressed_mask" android:state_pressed="true"/> <item android:drawable="@drawable/selected_pressed_mask" android:state_pressed="true"/>
<item android:drawable="@drawable/selected_mask" android:state_selected="true"/> <item android:drawable="@drawable/selected_mask" android:state_activated="true"/>
</selector> </selector>