Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.27 KB

README.md

File metadata and controls

60 lines (42 loc) · 1.27 KB

MVP Architecture lib for android

Download

[toc]

MVP arch

  • BasePresenter

    //ExampleData.java
    public class ExampleData{
    
    }
    
    //ExampleP.java
    public class ExampleP extends BasePresenter<ExampleData,ExampleMvpView>{
        public ExampleP(@NonNull MainMvpView mvpView) {
            super(mvpView);
        }
        ...
    }
  • BaseMvpView

      //ExampleMvpView.java
      public interface ExampleMvpView extends BaseMvpView<ExampleData> {
           //add other method if needed
      }
    
      //MainActivity.java
      public class MainActivity entends AppCompatActivity implement ExampleMvpView{
    
          public void onDataLoadSuccess(DATA dataSet, boolean isReload){
            //do something
          }
    
          public void onDataLoadFailed(Throwable throwable, boolean isReload){
            //do something
          }
    
          public void showLoadingView(){
             //do something
          }
          public void hideLoadingView(){
             //do something
          }
    
      }
    
    
    
  • MyLog

    A simplified log util class