Skip to content

Commit

Permalink
更新demo
Browse files Browse the repository at this point in the history
  • Loading branch information
jeasonlzy committed Sep 5, 2016
1 parent db046af commit 502cf12
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions app/src/main/java/com/lzy/okhttpdemo/cache/NewsAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,26 @@
* 修订历史:
* ================================================
*/
public class NewsAdapter extends BaseQuickAdapter<NewsModel.ContentList> implements View.OnClickListener {

private NewsModel.ContentList contentList;
public class NewsAdapter extends BaseQuickAdapter<NewsModel.ContentList> {

public NewsAdapter(List<NewsModel.ContentList> data) {
super(R.layout.item_news, data);
}

@Override
protected void convert(BaseViewHolder baseViewHolder, NewsModel.ContentList contentList) {
this.contentList = contentList;
protected void convert(BaseViewHolder baseViewHolder, final NewsModel.ContentList contentList) {
baseViewHolder.setText(R.id.title, contentList.title)//
.setText(R.id.desc, contentList.desc)//
.setText(R.id.pubDate, contentList.pubDate)//
.setText(R.id.source, contentList.source);

View view = baseViewHolder.getConvertView();
view.setOnClickListener(this);
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
WebActivity.runActivity(mContext, contentList.title, contentList.link);
}
});

NineGridView nineGrid = baseViewHolder.getView(R.id.nineGrid);
ArrayList<ImageInfo> imageInfo = new ArrayList<>();
Expand All @@ -59,9 +61,4 @@ protected void convert(BaseViewHolder baseViewHolder, NewsModel.ContentList cont
nineGrid.setSingleImageRatio(images.get(0).width * 1.0f / images.get(0).height);
}
}

@Override
public void onClick(View v) {
WebActivity.runActivity(mContext, contentList.title, contentList.link);
}
}
Binary file modified okhttputils_v1.8.0.apk
Binary file not shown.

0 comments on commit 502cf12

Please sign in to comment.