admin 管理员组

文章数量: 887021


2024年1月13日发(作者:特效素材中国免费素材网)

XXXPresenter(IView view) {mView = view;mModel = newModel();}@OverridepublicvoidinitData(){ading();t(xx, xx, mCallback);}@Overridepublicvoidcommit(){ading();t(xx, xx, mCallback);}}View:interfaceIView{voidupdateHeader(String header);voidupdateContent(String content);voidshowLoading();voidcancelLoading();voidshowError(String error);}publicclassXXXActivityextendsBaseActivityimplementsIView{privateIPresenter mPresenter;privateTextView tvHeader;privateTextView tvContent;publicvoidonCreate(Bundle saveInstanceState){

publicvoidonCreate(Bundle saveInstanceState){te(saveInstanceState);setContentView(layout);initView();initData();}publicvoidinitView(){tvHeader = findViewById(..);tvContent = findViewById(..);lickListener( newOnClickListener(){publicvoidonClick(View v){();}});}publicvoidinitData(){mPresenter = newXXXPresenter( this);ta();}@OverridepublicvoidupdateHeader(String header){t(header);}@OverridepublicvoidupdateContent(String content){t(content);}

publicinterfaceBaseView{publicvoidshowLoading();publicvoidcancelLoading();publicvoidshowError();}// BaseActivitypublicclassBaseActivityextendsActivityimplementsBaseView{publicvoidshowLoading(){ading( this);}publicvoidcancelLoading(){Loading( this);}publicvoidshowError(){ror( this);}}BasePresenter// BasePresenterpublicabstractclassBasePresenter {privateView mView;protectedCallback mCallback = newCallback() {publicvoidonStart(){ading();}publicvoidonSuccess(Response r){Loading();

onRequestSuccess(r);}publicvoid(Error e){ror();onRequestFailed(e);}};protectedabstractvoidonRequestSuccess(Response r);protectedabstractvoidonRequestFailed(Error e);}Contract// Contractinterace Contract {interfaceViewextendsBaseView{voidupdateHeader(String header);voidupdateContent(String content);}abstractclassPresenterextendsBasePresenter {protectedPresenter(View view){super(view);}protectedabstractvoidinitData();protectedabstractvoidcommit();}}具体的XXPresenter// 具体的XXPresenter

{ter mPresenter;privateTextView tvHeader;privateTextView tvContent;publicvoidonCreate(Bundle saveInstanceState){te(saveInstanceState);setContentView(layout);initView();initData();}publicvoidinitView(){tvHeader = findViewById(..);tvContent = findViewById(..);lickListener( newOnClickListener(){publicvoidonClick(View v){();}});}publicvoidinitData(){mPresenter = newXXPresenter( this);ta();}@OverridepublicvoidupdateHeader(String header){t(header);}


本文标签: 素材 中国 素材网 免费 作者