Example usage for android.support.v4.view PagerAdapter isViewFromObject

List of usage examples for android.support.v4.view PagerAdapter isViewFromObject

Introduction

In this page you can find the example usage for android.support.v4.view PagerAdapter isViewFromObject.

Prototype

public abstract boolean isViewFromObject(View view, Object object);

Source Link

Document

Determines whether a page View is associated with a specific key object as returned by #instantiateItem(ViewGroup,int) .

Usage

From source file:com.insalyon.les24heures.JazzyViewPager.JazzyViewPager.java

public View findViewFromObject(int position) {
    Object o = mObjs.get(Integer.valueOf(position));
    if (o == null) {
        return null;
    }/*from www  . jav a  2s  .  co  m*/
    PagerAdapter a = getAdapter();
    View v;
    for (int i = 0; i < getChildCount(); i++) {
        v = getChildAt(i);
        if (a.isViewFromObject(v, o))
            return v;
    }
    return null;
}

From source file:metro.k.cover.view.JazzyViewPager.java

public View findViewFromObject(int position) {
    Object o = mObjs.get(Integer.valueOf(position));
    if (o == null) {
        return null;
    }//from w w  w  .j  a  v  a2 s. c  o  m
    PagerAdapter a = getAdapter();
    View v;
    for (int i = 0; i < getChildCount(); i++) {
        v = getChildAt(i);
        if (a.isViewFromObject(v, o)) {
            return v;
        }
    }
    return null;
}