Skip to content

Commit

Permalink
fix fuck bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Labradors committed Oct 11, 2016
1 parent b20c07a commit 78d5ed4
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.github.wanglu1209.bannerlibrary;

import android.content.Context;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.util.Log;
Expand Down Expand Up @@ -94,10 +96,10 @@ private void init() {
* 添加到任务栈,当前所有任务完事之后添加已经选中的那个小圆点
*/
post(new Runnable() {
@Override public void run() {
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @Override public void run() {
ImageView iv = new ImageView(mContext);
Log.d("--------->", "run: ");
iv.setImageDrawable(mContext.getResources().getDrawable(mDot[1]));
iv.setImageDrawable(mContext.getResources().getDrawable(mDot[1],null));
FrameLayout.LayoutParams params =
new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
Expand Down Expand Up @@ -143,7 +145,7 @@ public void onPageScrolled(int position, float positionOffset, int positionOffse
});
}

public Banner setAdapter(BannerPagerAdapter adapter) {
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public Banner setAdapter(BannerPagerAdapter adapter) {
mAdapter = adapter;
mPager.setAdapter(mAdapter);
mPager.setCurrentItem(mAdapter.size);
Expand All @@ -159,7 +161,7 @@ public Banner setAdapter(BannerPagerAdapter adapter) {
*/
for (int i = 0; i < mAdapter.size; i++) {
ImageView iv = new ImageView(mContext);
iv.setImageDrawable(mContext.getResources().getDrawable(mDot[0]));
iv.setImageDrawable(mContext.getResources().getDrawable(mDot[0],null));
iv.setLayoutParams(dotParams);
mDotGroup.addView(iv);
}
Expand Down

0 comments on commit 78d5ed4

Please sign in to comment.