Created
October 4, 2017 15:18
-
-
Save PierceZ/5e716b9fd66abbc21e7be57dec75e98d 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
... | |
ZooFragmentViewModel viewModel = ViewModelProviders.of(this).get(ZooFragmentViewModel.class); | |
viewModel.getZooUpdateResponse().observe(this, response -> { | |
if (response != null) { | |
switch (response.getStatus()) { | |
case Response.STATUS_LOADING: | |
showProgressBar(true); | |
break; | |
case Response.STATUS_SUCCESS: | |
dismiss(); | |
break; | |
case Response.STATUS_FAIL: | |
showProgressBar(false); | |
Toast.makeText(getContext(), response.getErrorMessage(), Toast.LENGTH_SHORT).show(); | |
break; | |
} | |
} | |
}); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment