Last active
March 13, 2020 08:48
-
-
Save PhamNgocPhi/b16ce7e702a87eceae48bc6b614ffa40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
initView() | |
viewModel.viewState.observe(viewLifecycleOwner, Observer { viewState -> | |
viewState?.run { | |
when (viewState) { | |
ViewState.SHOW_LOADING -> (activity as? BaseActivity<*, *>)?.showLoading() | |
ViewState.HIDE_LOADING -> (activity as? BaseActivity<*, *>)?.hideLoading() | |
else -> handleViewState(viewState) | |
} | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment