Zwinąć stronę od lewej do prawej android

Używam więc zawijania stron przez harism,https://github.com/harism/android_page_curl i z powodzeniem wdrożyłem go do ładowania obrazów za pośrednictwem transmisji strumieniowej. Ale nie można go uruchomić, gdy wrócę do poprzednich zdjęć lub stron, ponieważ obrazy nie mają właściwego indeksu. tj. nie odświeżają się prawidłowo. Nie mogę tego rozgryźć.

To jest moja implementacja, w której ładuję obrazy doPageProvider

private class PageProvider implements CurlView.PageProvider {


        @Override
        public int getPageCount() {
            return data1.size()-1;
        } 

        private Bitmap loadBitmap(int width, int height, final int index) throws MalformedURLException, IOException {
            Bitmap b = Bitmap.createBitmap(width, height,Bitmap.Config.ARGB_8888);
            b.eraseColor(0xFFFFFFFF);
            Canvas c = new Canvas(b);

            System.out.println("value of current page index "+mCurlView.getCurrentIndex()+" and index is "+index);

            System.out.println("url forward");
            aq.ajax(data1.get(index+1), Bitmap.class,0, new AjaxCallback<Bitmap>() {

                @Override
                public void callback(String url, Bitmap object, AjaxStatus status) {
                    if(object!=null)
                           try {
                                System.out.println("url image downloaded "+url);
                                y=object;

                                aq.ajax(data1.get(index).replace(".png", ".mp3"), File.class,0,new AjaxCallback<File>() {
                                    @Override
                                    public void callback(String url, File object, AjaxStatus status) {

                                        System.out.println("url sound downloaded "+url);
                                        try {
                                              if(object!=null)
                                               {    
                                                FileInputStream inputStream = new FileInputStream(object);

                                                if(index>0)
                                                 {  
                                                  mPlayer.stop();
                                                  mPlayer.reset();
                                                 }

                                                prepareMediaPlayer(inputStream.getFD());
                                                inputStream.close();
                                               }
                                            }
                                        catch (Exception e) {}
                                   }
                                });     
                        } catch (Exception e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                        }
                }
            }); 


            d = new BitmapDrawable(getResources(),y);

            if(y!=null)
            {   
            int margin = 7; 
            int border = 3;
            Rect r = new Rect(margin, margin, width - margin, height - margin);

            int imageWidth = r.width() - (border * 2);
            int imageHeight = imageWidth * d.getIntrinsicHeight()
                    / d.getIntrinsicWidth();
            if (imageHeight > r.height() - (border * 2)) {
                imageHeight = r.height() - (border * 2);
                imageWidth = imageHeight * d.getIntrinsicWidth()
                        / d.getIntrinsicHeight();
            }

            r.left += ((r.width() - imageWidth) / 2) - border;
            r.right = r.left + imageWidth + border + border;
            r.top += ((r.height() - imageHeight) / 2) - border;
            r.bottom = r.top + imageHeight + border + border;

            Paint p = new Paint();
            p.setColor(0xFFC0C0C0);
            c.drawRect(r, p);
            r.left += border;
            r.right -= border;
            r.top += border;
            r.bottom -= border;

            d.setBounds(r);
            d.draw(c);
            }
            //}
            if(y==null)
            return null;

            else
            return b;   
        }

        @Override
        public void updatePage(CurlPage page, final int width, final int height, final int index) {

                Bitmap front = null;

                System.out.println("motion / index value /countIteration / size of map "+motionDirection+"/"+index+"/"+countIteration+"/"+imageFilexxSm.size());

                try {


                     front=loadBitmap(width, height,index);

                    if(front!=null)
                    {
                    page.setTexture(front, CurlPage.SIDE_FRONT);
                    page.setColor(Color.rgb(180, 180, 180), CurlPage.SIDE_BACK);
                    }

                } catch (MalformedURLException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }}}

Próbowałem również ustawić indeks za pomocągetCurrentIndex metoda dostarczana wewnątrz klasy CurlView, ale nawet nie działa. Odkryłem, że indeks jest poprawnie przekazywany, ale bitmapy nie są odświeżane.

Wyraźniej problem polega na:

Kiedy poruszam się w kierunku do przodu, tj. 1, 2, 3, 4, 5 ... obrazy i dźwięki działają poprawnie, ale kiedy wykonuję 5, 4, 3, 2, 1, to tylko 5 do 4 curl jest właściwe, ale 3., 2. i 1. nie działają. Dlaczego to się dzieje?

questionAnswers(2)

yourAnswerToTheQuestion