emilsjolander / android-FlipView

A small, easy to use android library for implementing flipping between views as seen in the popular Flipboard application
Apache License 2.0
923 stars 273 forks source link

How to getView in exibition #43

Open vinidelgado opened 10 years ago

vinidelgado commented 10 years ago

I'm using your library and am very happy with it .

But I have a problem , I 'm loading images on the internet .

I need to load the image by index , and the method which I believe is what comes back to me is the onFlippedToPage method.

But when I try to get the corresponding view to display page it returns me null

@Override
public void onFlippedToPage(FlipView v, int position, long id) {
    Log.i("pageflip", "Page: " + position);
    View _view = null;
   _view = v.getChildAt(position);
    if(_view != null){
        ImageView img_left = (ImageView) _view.findViewById(R.id.imgLeftBook);
        if(img_left != null){
            img_left.setImageDrawable(getResources().getDrawable(R.drawable.ic_book_reload));
        }else{
            Log.i("pageflip", "img_left empty: " + position);
        }
    }else{
        Log.i("pageflip", "View empty: " + position);
    }
}