Advertisement
andyshon

MainContract

Jun 23rd, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.84 KB | None | 0 0
  1. package com.andyshon.thumbsandtasks;
  2.  
  3. import com.andyshon.thumbsandtasks.Entities.Task;
  4.  
  5. import io.realm.OrderedRealmCollection;
  6. import io.realm.RealmObject;
  7. import io.realm.RealmResults;
  8.  
  9. /**
  10.  * Created by andyshon on 23.06.18.
  11.  */
  12.  
  13. public interface MainContract {
  14.  
  15.     interface PresenterMain {
  16.         void getTasks();
  17.         void onDestroy();
  18.     }
  19.  
  20.     interface PresenterCoverDetail {
  21.         void addTask(Task task);
  22.         void getTaskById(String id);
  23.         void updateTaskById(Task task);
  24.         void deleteTaskById(String id);
  25.         void onDestroy();
  26.     }
  27.  
  28.     interface PresenterCover {
  29.         void getTaskById(String id);
  30.         void deleteTaskById(String id);
  31.         void onDestroy();
  32.     }
  33.  
  34.     interface MainView {
  35.         void showProgress();
  36.         void hideProgress();
  37.         void setTasksToRecyclerView(OrderedRealmCollection<Task> noticeArrayList);
  38.         void onResponseFailure(Throwable throwable);
  39.     }
  40.  
  41.     interface CoverView {
  42.         void showProgress();
  43.         void hideProgress();
  44.         void setTask(RealmObject object);
  45.         void onResponseDeleteTask(String name);
  46.         void onResponseFailure(Throwable throwable);
  47.     }
  48.  
  49.     interface CoverDetailView {
  50.         void showProgress();
  51.         void hideProgress();
  52.         void setTask(RealmObject object);
  53.         void setUpdateTask(String name);
  54.         void addTaskResult(String name);
  55.         void deleteTaskResult(String name);
  56.         void onResponseFailure(Throwable throwable);
  57.     }
  58.  
  59.     interface Model {
  60.         void getTasks(OnFinishedListenerMain onFinishedListenerMain);
  61.  
  62.         void getTaskById(OnFinishedListenerCover onFinishedListenerCover, String id);
  63.         void deleteTaskById(OnFinishedListenerCover onFinishedListenerCover, String id);
  64.  
  65.         void getTaskById(OnFinishedListenerCoverDetail onFinishedListenerCoverDetail, String id);
  66.         void addTask(OnFinishedListenerCoverDetail onFinishedListenerCoverDetail, Task task);
  67.         void deleteTaskById(OnFinishedListenerCoverDetail onFinishedListenerCoverDetail, String id);
  68.         void updateTaskById(OnFinishedListenerCoverDetail onFinishedListenerCoverDetail, Task task);
  69.  
  70.  
  71.         interface OnFinishedListenerMain {
  72.             void onFinished(RealmResults<Task> noticeArrayList);
  73.             void onFailure(Throwable t);
  74.         }
  75.  
  76.         interface OnFinishedListenerCoverDetail {
  77.             void onFinished(RealmObject object);
  78.             void onFinishedDelete(String name);
  79.             void onFinishedUpdate(String name);
  80.             void onFinishedAdd(String name);
  81.             void onFailure(Throwable throwable);
  82.         }
  83.  
  84.         interface OnFinishedListenerCover {
  85.             void onFinished(RealmObject object);
  86.             void onFinished(String name);
  87.             void onFailure(Throwable throwable);
  88.         }
  89.     }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement