Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.view.View;
import android.widget.AdapterView;

public class Main {
    public static View getItemViewIfVisible(AdapterView<?> holder, int itemPos) {
        int firstPosition = holder.getFirstVisiblePosition();
        int wantedChild = itemPos - firstPosition;
        if (wantedChild < 0 || wantedChild >= holder.getChildCount())
            return null;
        return holder.getChildAt(wantedChild);
    }
}