1.config.gradle     改包名   并且在工程的gradle  里 写上

apply from:'config.gradle'
 
 
  ext {android = [compileSdkVersion: 26,applicationId    : "com.************",minSdkVersion    : 15,targetSdkVersion : 26,versionCode      : 1,versionName      : "1.0"]dependencies = ["appcompat-v7"     : "com.android.support:appcompat-v7:26.1.0","constraint-layout": "com.android.support.constraint:constraint-layout:1.1.0","retrofit2"        : "com.squareup.retrofit2:retrofit:2.4.0","converter-gson"   : "com.squareup.retrofit2:converter-gson:2.4.0","adapter-rxjava"  :  "com.squareup.retrofit2:adapter-rxjava2:2.4.0","rxjava2"          : "io.reactivex.rxjava2:rxjava:2.1.13","rxjava2:rxandroid": "io.reactivex.rxjava2:rxandroid:2.0.2","dagger"           : "com.google.dagger:dagger:2.8","dagger-compiler" : "com.google.dagger:dagger-compiler:2.7"]
}
2.创建 bean包   bean类  
 
public class ProductsBean implements Serializable {/*** msg : 请求成功* code : 0* data : [{"bargainPrice":111.99,"createtime":"2017-10-14T21:39:05","detailUrl":"https://item.m.jd* .com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term* =QQfriends","images":"https://m.360buyimg* .com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","itemtype":1,"pid":20,* "price":599,"pscid":1,"salenum":10000,"sellerid":13,* "subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼* 老北京月饼礼盒655g"},{"bargainPrice":111.99,"createtime":"2017-10-03T23:53:28","detailUrl":"https://item.m.jd* .com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term* =QQfriends","images":"https://m.360buyimg* .com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","itemtype":0,"pid":8,"price":324,* "pscid":1,"salenum":3000,"sellerid":1,* "subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼* 老北京月饼礼盒655g"},{"bargainPrice":111.99,"createtime":"2017-10-14T21:48:08","detailUrl":"https://item.m.jd* .com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term* =QQfriends","images":"https://m.360buyimg* .com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","itemtype":2,"pid":9,* "price":78.99,"pscid":1,"salenum":2356,"sellerid":2,* "subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼* 老北京月饼礼盒655g"},{"bargainPrice":111.99,"createtime":"2017-10-14T21:48:08","detailUrl":"https://item.m.jd* .com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term* =QQfriends","images":"https://m.360buyimg* .com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","itemtype":2,"pid":22,* "price":799,"pscid":1,"salenum":1300,"sellerid":15,* "subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼* 老北京月饼礼盒655g"},{"bargainPrice":111.99,"createtime":"2017-10-03T23:53:28","detailUrl":"https://item.m.jd* .com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term* =QQfriends","images":"https://m.360buyimg* .com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","itemtype":0,"pid":21,* "price":699,"pscid":1,"salenum":1299,"sellerid":14,* "subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼* 老北京月饼礼盒655g"},{"bargainPrice":111.99,"createtime":"2017-10-14T21:39:05","detailUrl":"https://item.m.jd* .com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term* =QQfriends","images":"https://m.360buyimg* .com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","itemtype":1,"pid":7,* "price":120.01,"pscid":1,"salenum":1266,"sellerid":23,* "subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼* 老北京月饼礼盒655g"},{"bargainPrice":111.99,"createtime":"2017-10-03T23:53:28","detailUrl":"https://item.m.jd* .com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term* =QQfriends","images":"https://m.360buyimg* .com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","itemtype":0,"pid":3,"price":198,* "pscid":1,"salenum":1234,"sellerid":19,* "subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼* 老北京月饼礼盒655g"},{"bargainPrice":111.99,"createtime":"2017-10-14T21:39:05","detailUrl":"https://item.m.jd* .com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term* =QQfriends","images":"https://m.360buyimg* .com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","itemtype":1,"pid":19,* "price":499,"pscid":1,"salenum":1111,"sellerid":12,* "subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼* 老北京月饼礼盒655g"},{"bargainPrice":111.99,"createtime":"2017-10-14T21:39:05","detailUrl":"https://item.m.jd* .com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term* =QQfriends","images":"https://m.360buyimg* .com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","itemtype":1,"pid":2,"price":299,* "pscid":1,"salenum":999,"sellerid":18,* "subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼* 老北京月饼礼盒655g"},{"bargainPrice":111.99,"createtime":"2017-10-03T23:53:28","detailUrl":"https://item.m.jd* .com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term* =QQfriends","images":"https://m.360buyimg* .com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg* .com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","itemtype":0,"pid":17,* "price":299,"pscid":1,"salenum":888,"sellerid":10,* "subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼 老北京月饼礼盒655g"}]* page : 1*/private String msg;private String code;private String page;private List<DataBean> data;public String getMsg() {return msg;}public void setMsg(String msg) {this.msg = msg;}public String getCode() {return code;}public void setCode(String code) {this.code = code;}public String getPage() {return page;}public void setPage(String page) {this.page = page;}public List<DataBean> getData() {return data;}public void setData(List<DataBean> data) {this.data = data;}public static class DataBean implements Serializable {/*** bargainPrice : 111.99* createtime : 2017-10-14T21:39:05* detailUrl : https://item.m.jd.com/product/4719303.html?utm_source=androidapp&utm_medium=appshare* &utm_campaign=t_335139774&utm_term=QQfriends* images : https://m.360buyimg.com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg* |https://m.360buyimg.com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https* ://m.360buyimg.com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg* itemtype : 1* pid : 20* price : 599.0* pscid : 1* salenum : 10000* sellerid : 13* subhead : 每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下* title : 北京稻香村 稻香村中秋节月饼 老北京月饼礼盒655g*/private double bargainPrice;private String createtime;private String detailUrl;private String images;private int itemtype;private int pid;private double price;private int pscid;private int salenum;private int sellerid;private String subhead;private String title;public double getBargainPrice() {return bargainPrice;}public void setBargainPrice(double bargainPrice) {this.bargainPrice = bargainPrice;}public String getCreatetime() {return createtime;}public void setCreatetime(String createtime) {this.createtime = createtime;}public String getDetailUrl() {return detailUrl;}public void setDetailUrl(String detailUrl) {this.detailUrl = detailUrl;}public String getImages() {return images;}public void setImages(String images) {this.images = images;}public int getItemtype() {return itemtype;}public void setItemtype(int itemtype) {this.itemtype = itemtype;}public int getPid() {return pid;}public void setPid(int pid) {this.pid = pid;}public double getPrice() {return price;}public void setPrice(double price) {this.price = price;}public int getPscid() {return pscid;}public void setPscid(int pscid) {this.pscid = pscid;}public int getSalenum() {return salenum;}public void setSalenum(int salenum) {this.salenum = salenum;}public int getSellerid() {return sellerid;}

3. 桥梁包 类

 
@Component (modules= HttpModule.class)
public interface HttpComponent {void inject(ListActivity listActivity);
}

4.module 包 HttpModule

@Module
public class HttpModule {@ProvidesOkHttpClient.Builder provideOkHttpClientBuilder(){return new OkHttpClient.Builder().writeTimeout(20, TimeUnit.SECONDS).readTimeout(20, TimeUnit.SECONDS).connectTimeout(10, TimeUnit.SECONDS);}@ProvidesListApi provideListApi(OkHttpClient.Builder builder) {Retrofit retrofit = new Retrofit.Builder().baseUrl(Api.BASEURL).addCallAdapterFactory(RxJava2CallAdapterFactory.create()).addConverterFactory(GsonConverterFactory.create()).client(builder.build()).build();ListApiService listApiService = retrofit.create(ListApiService.class);return ListApi.getListApi(listApiService);}
}

5.inter包 IBase类

public interface IBase {int getContentLayout();void inject();void initView(View view);
}

onItemClickListener

public interface OnItemClickListener {void onItemClick(int position);void onLongItemClick(int position);
}

6.写 Api 和 ApiService

Api
public interface Api {String  BASEURL="https://www.zhaoapi.cn/";
}
ApiService
public interface ListApiService {@FormUrlEncoded@POST("product/getProducts")Observable<ProductsBean> getProduct(@Field("pscid") String pscid);
}
ListApi
public class ListApi {private static ListApi listApi;private ListApiService listApiService;private ListApi(ListApiService listApiService) {this.listApiService = listApiService;}public static ListApi getListApi(ListApiService listApiService) {if (listApi == null) {listApi = new ListApi(listApiService);}return listApi;}public Observable<ProductsBean> getProduct(String pscid) {return listApiService.getProduct(pscid);}
}

8.utils的ImageLoaderUtils

 
public class GlideImageLoader extends ImageLoader {@Overridepublic void displayImage(Context context, Object path, ImageView imageView) {/**注意:1.图片加载器由自己选择,这里不限制,只是提供几种使用方法2.返回的图片路径为Object类型,由于不能确定你到底使用的那种图片加载器,传输的到的是什么格式,那么这种就使用Object接收和返回,你只需要强转成你传输的类型就行,切记不要胡乱强转!*///用fresco加载图片简单用法,记得要写下面的createImageView方法Uri uri = Uri.parse((String) path);imageView.setImageURI(uri);}//提供createImageView 方法,如果不用可以不重写这个方法,主要是方便自定义ImageView的创建@Overridepublic ImageView createImageView(Context context) {//使用fresco,需要创建它提供的ImageView,当然你也可以用自己自定义的具有图片加载功能的ImageViewSimpleDraweeView simpleDraweeView=new SimpleDraweeView(context);return simpleDraweeView;}
}

9.ui包 ---->base包 4个类

BasePresenter
public class BasePresenter<T extends BaseContract.BaseView> implements BaseContract.BasePresenter<T> {protected T mView;@Overridepublic void attachView(T view) {this.mView=view;}@Overridepublic void detachView() {if (mView != null) {mView = null;}}
}

然后 basecontract

public interface BaseContract {interface  BasePresenter<T extends BaseView>{void  attachView(T view);void  detachView();}interface  BaseView{void  showLoading();void  dismissLoading();}}

baseActivity

 
public abstract class BaseActivity<T extends BaseContract.BasePresenter> extends AppCompatActivity implements IBase,BaseContract.BaseView{@Injectprotected T mPresenter;@Overrideprotected void onCreate(@Nullable Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(getContentLayout());inject();//绑定mPresenter.attachView(this);}@Overridepublic void initView(View view) {}@Overrideprotected void onDestroy() {super.onDestroy();//解绑mPresenter.detachView();}@Overridepublic void showLoading() {}@Overridepublic void dismissLoading() {}
}

baseFragment

 
 
public  abstract class BaseFragment<T extends BaseContract.BasePresenter> extends Fragment implements IBase,BaseContract.BaseView{@Injectprotected T mPresenter;@Overridepublic void onCreate(@Nullable Bundle savedInstanceState) {super.onCreate(savedInstanceState);inject();mPresenter.attachView(this);}@Overridepublic void onDestroy() {super.onDestroy();mPresenter.detachView();}@Nullable@Overridepublic View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable BundlesavedInstanceState) {View view = inflater.inflate(getContentLayout(), null);initView(view);return view;}@Overridepublic void showLoading() {}@Overridepublic void dismissLoading() {}
}

ui下的包  具体实现     ListContract

 interface View extends BaseContract.BaseView {void onSuccess(List<DuanziBean.DataBean> list);}interface Presenter extends BaseContract.BasePresenter<View> {void getDuanzi(String page);}

listPresenter

public class JokesPresenter extends BasePresenter<JokesContract.View> implementsJokesContract.Presenter {JokesApi jokesApi;@Injectpublic JokesPresenter(JokesApi jokesApi) {this.jokesApi = jokesApi;}@Overridepublic void getJokes(String page) {jokesApi.getJokes(page).observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()).subscribe(new Observer<JokesBean>() {@Overridepublic void onSubscribe(Disposable d) {}@Overridepublic void onNext(JokesBean jokesBean) {mView.getJokesSuccess(jokesBean);}@Overridepublic void onError(Throwable e) {}@Overridepublic void onComplete() {}});}
}

ui------list包

xrvListViewAdapter
public class XrvListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {private Context context;private List<ProductsBean.DataBean> list;private LayoutInflater inflater;private OnListItemClickListener onListItemClickListener;public interface OnListItemClickListener {void OnItemClick(ProductsBean.DataBean dataBean);}public XrvListAdapter(Context context, List<ProductsBean.DataBean> list) {this.context = context;this.list = list;inflater = LayoutInflater.from(context);}public void setOnListItemClickListener(OnListItemClickListener onListItemClickListener) {this.onListItemClickListener = onListItemClickListener;}@NonNull@Overridepublic RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {View view = inflater.inflate(R.layout.rvlist_item, parent, false);XlvViewHolder xlvViewHolder = new XlvViewHolder(view);return xlvViewHolder;}@Overridepublic void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, final int position) {XlvViewHolder xlvViewHolder = (XlvViewHolder) holder;final ProductsBean.DataBean dataBean = list.get(position);String imgUrl = dataBean.getImages().split("\\|")[0];
//        Glide.with(context).load(imgUrl).into(xlvViewHolder.iv);xlvViewHolder.iv.setImageURI(imgUrl);xlvViewHolder.tvTitle.setText(dataBean.getTitle());xlvViewHolder.tvPrice.setText("¥" + dataBean.getBargainPrice() + "");//设置条目监听xlvViewHolder.ll.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {if (onListItemClickListener != null) {onListItemClickListener.OnItemClick(dataBean);}}});}@Overridepublic int getItemCount() {return list.size();}class XlvViewHolder extends RecyclerView.ViewHolder {private final LinearLayout ll;private final SimpleDraweeView iv;private final TextView tvTitle;private final TextView tvPrice;public XlvViewHolder(View itemView) {super(itemView);ll = itemView.findViewById(R.id.ll);iv = itemView.findViewById(R.id.iv);tvTitle = itemView.findViewById(R.id.tvTitle);tvPrice = itemView.findViewById(R.id.tvPrice);}}/*** 刷新** @param templist*/public void refresh(List<ProductsBean.DataBean> templist) {this.list.clear();this.list.addAll(templist);notifyDataSetChanged();}/*** 加载更多** @param list*/public void loadMore(List<ProductsBean.DataBean> list) {this.list.addAll(list);notifyDataSetChanged();}}

ListActivity

public class ListActivity extends BaseActivity <ListPresenter> implements ListContract.View{private XRecyclerView mXrv;private int pscid;private boolean isRefresh = true;private XrvListAdapter adapter;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);//获取pscidIntent intent = getIntent();pscid = intent.getIntExtra("pscid", 0);initView();mPresenter.getProducts(pscid + "");}private void initView() {mXrv = (XRecyclerView) findViewById(R.id.xrv);//设置布局管理器LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);mXrv.setLayoutManager(linearLayoutManager);//设置刷新和加载更多监听mXrv.setLoadingListener(new XRecyclerView.LoadingListener() {@Overridepublic void onRefresh() {//刷新isRefresh = true;mPresenter.getProducts(pscid + "");}@Overridepublic void onLoadMore() {//加载更多isRefresh = false;mPresenter.getProducts(pscid + "");}});}@Overridepublic int getContentLayout() {return R.layout.activity_list;}@Overridepublic void inject() {DaggerHttpComponent.builder().httpModule(new HttpModule()).build().inject(this);}@Overridepublic void onSuccess(List<ProductsBean.DataBean> list) {final List<ProductsBean.DataBean> tempList = new ArrayList<>();tempList.addAll(list);//创建适配器if (isRefresh) {adapter = new XrvListAdapter(this, list);mXrv.setAdapter(adapter);adapter.refresh(tempList);mXrv.refreshComplete();//设置刷新完成} else {if (adapter != null) {//判断适配器是否创建过adapter.loadMore(tempList);mXrv.loadMoreComplete();//设置加载更多完成}}if (adapter == null) {return;}adapter.setOnListItemClickListener(new XrvListAdapter.OnListItemClickListener() {@Overridepublic void OnItemClick(ProductsBean.DataBean dataBean) {Intent intent = new Intent(ListActivity.this, ListDetailsActivity.class);intent.putExtra("bean", dataBean);startActivity(intent);}});}
}

布局

 
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:orientation="vertical"android:layout_height="match_parent"tools:context=".ui.classify.ListActivity"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="50dp"android:background="#ff3660"android:gravity="center_vertical"android:orientation="horizontal"><ImageViewandroid:id="@+id/ivZxing"android:layout_width="30dp"android:layout_height="30dp"android:layout_marginLeft="15dp"android:background="@drawable/a_s"/><LinearLayoutandroid:layout_width="match_parent"android:layout_height="30dp"android:layout_marginLeft="15dp"android:layout_marginRight="15dp"android:layout_weight="1"android:background="@drawable/shape_search"></LinearLayout><ImageViewandroid:layout_width="30dp"android:layout_height="30dp"android:layout_alignParentRight="true"android:layout_marginRight="15dp"android:background="@drawable/my_msg_bai"/></LinearLayout><com.jcodecraeer.xrecyclerview.XRecyclerViewandroid:id="@+id/xrv"android:layout_width="match_parent"android:layout_height="match_parent"></com.jcodecraeer.xrecyclerview.XRecyclerView>
</LinearLayout>
 
 

rxjava dagger2 retrofit 框架相关推荐

  1. Android 教你一步步搭建MVP+Retrofit+RxJava网络请求框架

    目录 1.什么是MVP? 2.什么是Retrofit? 3.RxJava 4.实践 之前公司的项目用到了MVP+Retrofit+RxJava的框架进行网络请求,所以今天特此写一篇文章以做总结.相信很 ...

  2. android搭建网络框架,Android 搭建MVP+Retrofit+RxJava网络请求框架(三)

    上一篇中主要是将mvp+rxjava+retrofit进行了结合,本篇主要是对mvp框架的优化:建议先去看上一篇:Android 搭建MVP+Retrofit+RxJava网络请求框架(二) 针对vi ...

  3. RxJava 与 Retrofit 结合的最佳实践

    前言 RxJava和Retrofit也火了一段时间了,不过最近一直在学习ReactNative和Node相关的姿势,一直没有时间研究这些新东西,最近有个项目准备写,打算先用Android写一个Demo ...

  4. Rxjava、Retrofit返回json数据解析异常处理

    每个App都避免不了要进行网络请求,从最开始的用谷歌封装的volley到再到android-async-http再到OKHttpUtils再到现在的Retrofit和RxJava,从我自己用后的体验来 ...

  5. java编写一个框架_手把手教你写一个基于 RxJava 的扩展框架

    背景 现在 RxJava 在 Android 开发中可谓时炽手可热,其受欢迎程度不言而喻,也因此在 github 上出现了一系列的基于 RxJava 的框架,如 RxBinding.RxPermiss ...

  6. 3. fooView rxjava + rxandroid + retrofit 安卓开发框架搭配 az kj

    3. fooView rxjava + rxandroid + retrofit 转载于:https://www.cnblogs.com/cczh/p/9724382.html

  7. (仿有道精品课App)RxJava+OkHttp+Retrofit+Dagger2+MVP框架

    Education An unofficial youdao client for android Remark 该项目为仿有道精品课App的kotlin混编版本,采用rxjava2+okhttp+r ...

  8. Android Retrofit+Rxjava+MVP三大框架集成男人帮APP

    前言 相信大家都有听说过这三大框架吧,这是最近很火的框架 Retrofit的详解 主要参考于 Retrofit2.0使用详解 retrofit是基于okhttp的封装工具类,功能十分丰富.我能力还是有 ...

  9. java如何把方法封装成接口,RxJava配合Retrofit实现网络封装

    那么呢,首先呢,我们呢,来记录一下Android中比较火的两种技术,火了大半壁江山的RxJava和垄断了大部分的网络请求Retrofit.这两者的结合其实不需要太多的封装,只要简简单单的搞两下子基本就 ...

最新文章

  1. 软件安装(ubuntu) --Linux基础编程
  2. colease函数 mysql_SqlConnection 概述
  3. Enterprise Library 2.0 技巧(4):如何用编程的方法来配置Logging Application Block
  4. 湖北省武汉科技大学计算机报名,湖北武汉科技大学第33次计算机等级考试报名通知...
  5. Android在全球的市场份额跃居全球第一
  6. 前端学习(1745):前端调试值之查看元素最终样式
  7. 应用程序、虚拟目录、应用程序池
  8. python有哪些游戏模块_python游戏模块 Pygame常用方法
  9. SPOOLing技术的再思考
  10. 北邮有高考日语学计算机专业的吗,学计算机去北邮好还是去成电好呢?没有最好只有最合适...
  11. golang key map 所有_Golang语言小技巧(踩坑)
  12. python 实现简单画板_Python图像处理之简单画板实现方法示例
  13. 实现钉钉开放平台扫码登录内部应用
  14. Task watchdog got triggered错误
  15. 英谷Oracle答案,火焰纹章风花雪月各角色能学什么魔法 各角色可习得魔法与熟练度要求一览...
  16. IBM笔记本电池保养细则
  17. html制作钢铁侠心脏,钢铁侠胸部的“心脏”并非特效,那是怎么放进身体的?...
  18. python基础坑点
  19. Directsound 与 Waveout 有何不同
  20. “不喝就是不给我面子”,酒局领导逼你喝酒咋办?坚守这条底线

热门文章

  1. bob战队 rust_Rust战队系统
  2. vue echarts地图省市区下钻
  3. Springboot 读取配置文件参数(yml\properties)
  4. C语言 九九乘法口诀表 实现从大到小排序
  5. 为何技术人员很难做好售前工作?
  6. The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _itoa. See onl
  7. 受伤的皇后 蓝桥杯 python
  8. SLIC超像素分割详解
  9. 2个月的程序员当了高中信息技术教师
  10. css设置超出几行显示省略号(单行、多行),兼容数字英文不换行问题,兼容中文字符隔空换行问题