Code example for AbsListView

Methods: getChildAt

0
 
        if (mTabCarousel == null || mTabCarousel.isTabCarouselIsAnimating()) {
            return; 
        } 
 
        final View top = view.getChildAt(firstVisibleItem);
        if (top == null) {
            return; 
        } 
 
        if (firstVisibleItem != 0) {
            mTabCarousel.moveToYCoordinate(mPageIndex,
                    -mTabCarousel.getAllowedVerticalScrollLength());
            return; 
        } 
 
        float y;
        if (ApolloUtils.hasHoneycomb()) { 
            y = view.getChildAt(firstVisibleItem).getY();
        } else { 
            y = view.getChildAt(firstVisibleItem).getTop();
        } 
        final float amtToScroll = Math.max(y, -mTabCarousel.getAllowedVerticalScrollLength());
        mTabCarousel.moveToYCoordinate(mPageIndex, amtToScroll);
    }