Skip to content

Instantly share code, notes, and snippets.

@alana-mullen
Created October 18, 2019 16:14
Show Gist options
  • Save alana-mullen/51488622a5fb398cbe4712c848657b2b to your computer and use it in GitHub Desktop.
Save alana-mullen/51488622a5fb398cbe4712c848657b2b to your computer and use it in GitHub Desktop.
SwipeRefreshLayout Kotlin extensions
package uk.co.thewirelessguy.thewirelessguy.extensions
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
fun SwipeRefreshLayout?.start() {
this?.apply {
isRefreshing = true
isEnabled = false
}
}
fun SwipeRefreshLayout?.stop() {
this?.apply {
isRefreshing = false
isEnabled = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment