Back to project page Paginize.
The source code is released under:
Copyright (c) 2014 neevek <i at neevek.net> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal ...
If you think the Android project Paginize 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 net.neevek.android.lib.paginize; //w ww . ja v a2 s. co m import android.support.v4.view.PagerAdapter; import android.view.View; import android.view.ViewGroup; /** * Created by neevek on 6/16/14. */ public abstract class PagePagerAdapter extends PagerAdapter { public abstract ViewWrapper getItem(int position); @Override public Object instantiateItem(ViewGroup container, int position) { ViewWrapper viewWrapper = getItem(position); container.addView(viewWrapper.getView()); viewWrapper.onAttach(); return viewWrapper; } @Override public void destroyItem(ViewGroup container, int position, Object object) { ViewWrapper viewWrapper = (ViewWrapper) object; container.removeView(viewWrapper.getView()); viewWrapper.onDetach(); } @Override public boolean isViewFromObject(View view, Object object) { ViewWrapper viewWrapper = (ViewWrapper) object; return viewWrapper.getView() == view; } }