Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Brioal authored Sep 29, 2016
1 parent 2c59dc8 commit 7ac4a91
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,24 @@
}
```

```
mList = new ArrayList<>();
mList.add(new BannerEntity(1, "http://123.206.20.217/testimage/img_1.png", "第一个提示", "第一个链接"));
mList.add(new BannerEntity(2, "http://123.206.20.217/testimage/img_2.png", "第二个提示", "第二个链接"));
mList.add(new BannerEntity(3, "http://123.206.20.217/testimage/img_3.png", "第三个提示", "第三个链接"));
mList.add(new BannerEntity(4, "http://123.206.20.217/testimage/img_4.png", "第四个提示", "第四个链接"));
mList.add(new BannerEntity(5, "http://123.206.20.217/testimage/img_5.png", "第五个提示", "第五个链接"));
mBanner.setList(mList);
mBanner.setPagerClickListener(new OnPagerClickListener() {
@Override
public void onClick(BannerEntity entity, int position) {
if (mToast == null) {
mToast = Toast.makeText(MainActivity.this, entity.getTip(), Toast.LENGTH_SHORT);
} else {
mToast.setText(entity.getClickUrl());
}
mToast.show();
}
});
```

0 comments on commit 7ac4a91

Please sign in to comment.