I´m starting to implement the Material Theme on my newest project, preparing it for the launch of the new L version.
I´ve been reading the Material design guidelines and
Given solution did not work for me.
I simple extended and used this instead.
class SwipeToRefreshLayout(context: Context, attrs: AttributeSet): SwipeRefreshLayout(context, attrs) {
var listener: OnRefreshListener? = null
fun setRefreshing(refreshing: Boolean, fireCallback: Boolean) {
super.setRefreshing(refreshing)
listener?.onRefresh()
}
override fun setOnRefreshListener(listener: OnRefreshListener?) {
super.setOnRefreshListener(listener)
this.listener = listener
}
}
I hope someone finds it helpful.