# NoHttpUtil **Repository Path**: zhangyxAI/NoHttpUtil ## Basic Information - **Project Name**: NoHttpUtil - **Description**: 根据nohttp框架2次封装,使用更加方便,同时借鉴了okhttpUtils的链式样式 - **Primary Language**: Android - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 4 - **Created**: 2016-12-12 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 一直想尝试用mvp-rxjava-nohttp 看了不少别人写的mvp的demo,例如T-mvp等 各有各的好,找到适合自己的就行 还好有个大牛出了MVPHelper插件,不然打死我也不会用mvp,因为写的类太多。为了避免model类重名,我就把MVPHelper里面小改了下,把LoginModel 改成ILoginModel,不喜欢可以忽略 看了Author: Othershe写的mvp 就抽走了几个mvp类 我写mvp流程如果下:(仅参考) 1.写view层的回调 2.在写model rx回调 3.在写 实现model层 (业务写在这里) 4.然后再写p层 Map params = new HashMap<>(); IRequest.post(this, mUrl, params) .loading(true) .execute(PuBuLiuModel.class, new RequestArrayListener() { @Override public void onSuccess(Response result) { Toast.makeText(MainActivity.this, JsonUtils.string(result.get()), Toast.LENGTH_SHORT).show(); } @Override public void onFailed(int what, Response result) { super.onFailed(what, result); } }); IRequest.get(this, mUrl) .loading(true) .loadingTitle("努力中...") .execute(new RequestListener() { @Override public void onSuccess(Response result) { Toast.makeText(MainActivity.this, "获取成功", Toast.LENGTH_SHORT).show(); } }); IRequestRx.get(this,mUrl) .execute(new Subscriber() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { } @Override public void onNext(String s) { } }); IRequestRx.get(this,mUrl) .execute(PuBuLiuModel.class, new Subscriber() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { } @Override public void onNext(PuBuLiuModel puBuLiuModel) { } });