Back to project page HexNanoController_Android.
The source code is released under:
Code license GNU GPL v2 http://www.gnu.org/licenses/gpl.html Content license CC BY-NC-SA 4.0 http://creativecommons.org/licenses/by-nc-sa/4.0/
If you think the Android project HexNanoController_Android 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 com.hexairbot.hexmini.adapter; /*from ww w. ja v a2s . com*/ import java.util.List; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.view.View; import android.view.ViewGroup; public class SettingsViewAdapter extends PagerAdapter { private List<View> views; public SettingsViewAdapter(List<View> views) { this.views = views; } @Override public Object instantiateItem(ViewGroup container, int position) { View view = views.get(position); ((ViewPager)container).addView(view, 0); return view; } @Override public void destroyItem(ViewGroup container, int position, Object object) { ((ViewPager)container).removeView((View)object); } @Override public int getCount() { return views.size(); } @Override public boolean isViewFromObject(View arg0, Object arg1) { return arg0.equals(arg1); } }