blob: 206c66b1126bb13992f35c8fb5f63835f4f76109 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package ca.allanwang.kau.adapters
import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.IAdapter
import com.mikepenz.fastadapter.IItem
import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter
/**
* Created by Allan Wang on 2017-11-08.
*/
/**
* Add kotlin's generic syntax to better support out types
*/
fun <T : IItem<*, *>> fastAdapter(vararg adapter: IAdapter<out T>) =
FastAdapter.with<T, IAdapter<out T>>(adapter.toList())!!
/**
* Helper to get an [IAdapter] directly from a [FastItemAdapter]
*/
fun <T : IItem<*, *>> fastAdapter(adapter: IAdapter<out T>, fastAdapter: FastItemAdapter<out T>) =
fastAdapter(adapter, fastAdapter.itemAdapter)
|