Skip to content

Commit

Permalink
发发发
Browse files Browse the repository at this point in the history
  • Loading branch information
qssq committed Dec 14, 2017
1 parent 60f9f22 commit 31f52c7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions banner2/src/main/java/cn/qssq666/banner/Banner.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

public class Banner extends FrameLayout {
protected final static String TAG = "Banner";
private static final boolean DEBUG = false;
private ViewGroup mTitleGroup;

public ViewPager getViewPager() {
Expand Down Expand Up @@ -202,7 +203,7 @@ public boolean isAutoScrolling() {
*/
public void startAutoScroll() {
if (mItems == null) {
Log.d(TAG, "不能开始startAutoScroll因为item数据为空");
Log.w(TAG, "不能开始startAutoScroll因为item数据为空");
return;
}
if (mEnableAutoScroll == false) {
Expand Down Expand Up @@ -337,7 +338,10 @@ public void onPageSelected(int position) {
mTvTitle.setText(mItems.get(position).getBannerTitle());
onSelect(position);
currentP = position;
Log.w(TAG, "当前位置:" + position + "," + mItems.get(position).getBannerTitle());
if (DEBUG) {

Log.w(TAG, "当前位置:" + position + "," + mItems.get(position).getBannerTitle());
}
}

@Override
Expand Down Expand Up @@ -468,4 +472,12 @@ public void setBindHolderProvider(OnViewBindHolderProvider<? extends IImgInfo> b

OnViewBindHolderProvider bindHolderProvider;


@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (isAutoScrolling()) {
stopAutoScroll();
}
}
}

0 comments on commit 31f52c7

Please sign in to comment.