Back to project page cube-sdk.
The source code is released under:
Apache License
If you think the Android project cube-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package in.srain.cube.views.banner; //from www . ja v a2s . c o m import android.support.v4.view.PagerAdapter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public abstract class BannerAdapter extends PagerAdapter { @Override public Object instantiateItem(ViewGroup container, int position) { View view = getView(LayoutInflater.from(container.getContext()), position); container.addView(view); return view; } public int getPositionForIndicator(int position) { return position; } @Override public void destroyItem(ViewGroup container, int position, Object object) { container.removeView((View) object); } public abstract View getView(LayoutInflater layoutInflater, int position); @Override public boolean isViewFromObject(View view, Object o) { return view == o; } }