SHARE
TWEET

Untitled

a guest May 23rd, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
  2.     super.onViewCreated(view, savedInstanceState)
  3.  
  4.     setupRecyclerView()
  5.  
  6.     viewModel.moviesState.observe(this) {
  7.         render(it)
  8.     }
  9. }
  10.  
  11. private fun render(state: MoviesViewState) {
  12.     progressBar.isVisible = state.isLoading
  13.     moviesRecyclerAdapter.submitList(state.movies)
  14.  
  15.     if (state.error != null) {
  16.         Toast.makeText(context, state.error.localizedMessage, Toast.LENGTH_SHORT).show()
  17.     }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top