Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: saiwu-bigkoo/Android-ConvenientBanner
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: CommonOpenSourceOrganization-Android/Android-ConvenientBanner
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 3 commits
  • 5 files changed
  • 2 contributors

Commits on Jul 19, 2017

  1. Update Holder.java

    blazecake authored Jul 19, 2017
    Copy the full SHA
    f0d2873 View commit details
  2. 修改

    blazecake committed Jul 19, 2017
    Copy the full SHA
    5bc6a23 View commit details

Commits on Jan 8, 2018

  1. Update README.md

    blazecake authored Jan 8, 2018
    Copy the full SHA
    5c54f1a View commit details
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ ConvenientBanner

demo是用Module方式依赖,你也可以使用gradle 依赖:
```java
compile 'com.bigkoo:convenientbanner:2.0.5'
com.github.CommonOpenSourceOrganization-Android:Android-ConvenientBanner:2.0.9
```


Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
*/
public class LocalImageHolderView implements Holder<Integer> {
private ImageView imageView;

@Override
public View createView(Context context) {
imageView = new ImageView(context);
@@ -20,7 +21,7 @@ public View createView(Context context) {
}

@Override
public void UpdateUI(Context context, int position, Integer data) {
public void updateUI(Context context, int position, Integer data) {
imageView.setImageResource(data);
}
}
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
*/
public class NetworkImageHolderView implements Holder<String> {
private ImageView imageView;

@Override
public View createView(Context context) {
//你可以通过layout文件来创建,也可以像我一样用代码创建,不一定是Image,任何控件都可以进行翻页
@@ -22,8 +23,8 @@ public View createView(Context context) {
}

@Override
public void UpdateUI(Context context,int position, String data) {
public void updateUI(Context context, int position, String data) {
imageView.setImageResource(R.drawable.ic_default_adimage);
ImageLoader.getInstance().displayImage(data,imageView);
ImageLoader.getInstance().displayImage(data, imageView);
}
}
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
public class CBPageAdapter<T> extends PagerAdapter {
protected List<T> mDatas;
protected CBViewHolderCreator holderCreator;
// private View.OnClickListener onItemClickListener;
// private View.OnClickListener onItemClickListener;
private boolean canLoop = true;
private CBLoopViewPager viewPager;
private final int MULTIPLE_COUNT = 300;
@@ -32,7 +32,7 @@ public int toRealPosition(int position) {

@Override
public int getCount() {
return canLoop ? getRealCount()*MULTIPLE_COUNT : getRealCount();
return canLoop ? getRealCount() * MULTIPLE_COUNT : getRealCount();
}

public int getRealCount() {
@@ -44,7 +44,7 @@ public Object instantiateItem(ViewGroup container, int position) {
int realPosition = toRealPosition(position);

View view = getView(realPosition, null, container);
// if(onItemClickListener != null) view.setOnClickListener(onItemClickListener);
// if(onItemClickListener != null) view.setOnClickListener(onItemClickListener);
container.addView(view);
return view;
}
@@ -65,7 +65,8 @@ public void finishUpdate(ViewGroup container) {
}
try {
viewPager.setCurrentItem(position, false);
}catch (IllegalStateException e){}
} catch (IllegalStateException e) {
}
}

@Override
@@ -96,11 +97,11 @@ public View getView(int position, View view, ViewGroup container) {
holder = (Holder<T>) view.getTag(R.id.cb_item_tag);
}
if (mDatas != null && !mDatas.isEmpty())
holder.UpdateUI(container.getContext(), position, mDatas.get(position));
holder.updateUI(container.getContext(), position, mDatas.get(position));
return view;
}

// public void setOnItemClickListener(View.OnClickListener onItemClickListener) {
// this.onItemClickListener = onItemClickListener;
// }
// public void setOnItemClickListener(View.OnClickListener onItemClickListener) {
// this.onItemClickListener = onItemClickListener;
// }
}
Original file line number Diff line number Diff line change
@@ -10,5 +10,5 @@

public interface Holder<T>{
View createView(Context context);
void UpdateUI(Context context,int position,T data);
}
void updateUI(Context context,int position,T data);
}