Skip to content

Commit

Permalink
添加README
Browse files Browse the repository at this point in the history
  • Loading branch information
wanglu1209 committed Sep 3, 2016
1 parent caba7d8 commit c351b15
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/src/main/java/com/github/wanglu1209/banner/Banner.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ private void init() {
* 设置小圆点Group的方向为水平
*/
mDotGroup.setOrientation(LinearLayout.HORIZONTAL);
/**
* 如果不设置则小圆点在中间
*/
mDotGroup.setGravity(CENTER | Gravity.BOTTOM);
/**
* 两个Group的大小都为match_parent
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected void onCreate(Bundle savedInstanceState) {

AdapterDemo ad = new AdapterDemo(this, data);

Banner bv = (Banner) findViewById(R.id.bv);
Banner banner = (Banner) findViewById(R.id.banner);

/**
* 关于这里的设置参数问题,是需要这样使用的
Expand All @@ -36,7 +36,7 @@ protected void onCreate(Bundle savedInstanceState) {
* 最后需要调用开始轮播
* 个人建议在onPause()/onDestroy()方法中来停止 -- stopAutoPlay()
*/
bv. setDot(R.drawable.no_selected_dot, R.drawable.selected_dot).
banner. setDot(R.drawable.no_selected_dot, R.drawable.selected_dot).
setDotGravity(Banner.CENTER).
setAdapter(ad).
setOnItemClickListener(new BannerPagerAdapter.onItemClickListener() {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


<com.github.wanglu1209.banner.Banner
android:id="@+id/bv"
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="200dp"></com.github.wanglu1209.banner.Banner>
</RelativeLayout>

0 comments on commit c351b15

Please sign in to comment.