todo-mvp-loaders/ - Based on todo-mvp, fetches data using Loaders. • todo-databinding/ - Based on todo-mvp, uses the Data Binding Library. • todo-mvp-clean/ - Based on todo-mvp, uses concepts from Clean Architecture. • todo-mvp-dagger/ - Based on todo-mvp, uses Dagger2 for Dependency Injection • todo-mvp-contentproviders/ - Based on todo-mvp-loaders, fetches data using Loaders and uses Content Providers • todo-mvp-rxjava/ - Based on todo-mvp, uses RxJava for concurrency and data layer abstraction. https://github.com/googlesamples/android-architecture
forceUpdate, final boolean showLoadingUI) mUseCaseHandler.execute(mGetTasks, requestValue, new UseCase.UseCaseCallback<GetTasks.ResponseValue>() { @Override public void onSuccess(GetTasks.ResponseValue response) { List<Task> tasks = response.getTasks(); // The view may not be able to handle UI updates anymore if (!mTasksView.isActive()) { return; } if (showLoadingUI) { mTasksView.setLoadingIndicator(false); } processTasks(tasks); } @Override public void onError() { // The view may not be able to handle UI updates anymore if (!mTasksView.isActive()) { return; } mTasksView.showLoadingTasksError(); } }); } ... } Presenter
extends RxUseCase.ResponseValues> { protected abstract Observable<P> buildUseCase(Q requestValues); /** * Data passed to a request. */ public interface RequestValues { } /** * Data received from a response. */ public interface ResponseValues { } }