Advertisement
BlackZerg

Untitled

Jul 28th, 2022
1,356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.38 KB | None | 0 0
  1. class BaseFragment() {
  2.    private val viewHandler = Handler(Looper.getMainLooper())
  3.  
  4.    protected fun postViewAction(action: () -> Unit) {
  5.         viewHandler.post(action)
  6.    }
  7. }
  8.  
  9. class ShowcaseFragment : BaseFragment() {
  10.    override fun showRefreshProgress(visible: Boolean) {
  11.         postViewAction {
  12.             showcaseRefreshLayout?.isRefreshing = visible
  13.         }
  14.    }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement