I have two extension method
Function A is:
fun Activity.postDelay1s(run: () -> Unit) {
Handler().postDelayed({ run() }, 1000)
}
Function B is:
fun CustomRefreshLayout.setUp(containerRecycleView: RecyclerView, onResfresh: () -> Unit) {
with(this) {
recyclerView = containerRecycleView
setColorSchemeColors(Color.BLUE,
Color.GREEN,
Color.YELLOW,
Color.RED)
setDistanceToTriggerSync(300)
setProgressBackgroundColorSchemeColor(Color.WHITE)
setSize(SwipeRefreshLayout.LARGE)
setOnRefreshListener { onResfresh() }
}
}
When I call function a
I use this way postDelay1s { initData() }
, but call b
I need use this way swipe.setUp(trade_list, this::initData)
.
I want to kown what different with initData()
between this::initData
in this two extension function