) { val feedObservable = ObservableField<FeedData>() val bannerObservable = ObservableField<BannerData>() val bannerShimmerObservable = ObservableField<BannerData>() val bannerRetryObservable = ObservableField<BannerData>() val feedContentObservable = ObservableField<Boolean>() val shimmerObservable = ObservableField<Boolean>() val retryObservable = ObservableField<Boolean>() val shimmerObservable = ObservableField<Boolean>() val retryObservable = ObservableField<Boolean>() val retryObservable = ObservableField<Boolean>() val shimmerObservable = ObservableField<Boolean>() val retryObservable = ObservableField<Boolean>() var hasValue = feedRepository.hasValue() init { feedView.onRefreshListener.subscribe { ... } feedView.retryListener.subscribe { loadFeed() } feedView.bannerRetryListener.subscribe { loadBanners() } } fun loadFeed() { retryObservable.set(false) feedContentObservable.set(hasValue) shimmerObservable.set(! hasValue) feedRepository .getFeed() .map { feedData(it) } .subscribe { feedObservable.set(it) shimmerObservable.set(false) retryObservable.set(false) hasValue = true }, { feedContentObservable.set(false) shimmerObservable.set(false) retryObservable.set(!hasValue) } } fun loadBanners() { bannerShimmerObservable.set(hasValue) bannerRetryObservable.set(false) bannerRepository .getData() .map { bannerData(it) } .subscribe { bannerShimmerObservable.set(false) bannerRetryObservable.set(false) if (!hasValue) { bannerObservable.set(it) } else { (. show some toast) } }, { bannerShimmerObservable.set(false) if (!hasValue) { bannerRetryObservable.set(true) } else { (. show some toast) } } } fun addSearch() { bannerShimmerObservable.set(hasValue) bannerRetryObservable.set(false) bannerRepository .getData() .map { bannerData(it) } .subscribe { bannerShimmerObservable.set(false) bannerRetryObservable.set(false) if (!hasValue) { bannerObservable.set(it } }, { bannerShimmerObservable.set(false) if (!hasValue) { bannerRetryObservable.set(true) } else { (. show some toast) } } } fun paginate() { bannerShimmerObservable.set(hasValue) bannerRetryObservable.set(false) bannerRepository .getData() .map { bannerData(it) } .subscribe { bannerShimmerObservable.set(false) bannerShimmerObservable.set(false) if (!hasValue) { bannerRetryObservable.set(true) } else { (. show some toast) } } fun collapse() { bannerShimmerObservable.set(hasValue) bannerRetryObservable.set(false) bannerRepository .getData() bannerShimmerObservable.set(false) if (!hasValue) { bannerRetryObservable.set(true) } else { (. show some toast) } } } } And it goes on Adding Search Pagination Collapsable Toolbar