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
924 stars 273 forks source link

Bug on emulator and Galaxy SIII i9300 #35

Closed sebastian-ziegler closed 10 years ago

sebastian-ziegler commented 10 years ago

Hi, when the sample app opens in my cellphone (Galaxy SIII - i9300), the upper half keeps white and the other one is displaying correctly, after you swipe to the next page, you look all correctly. This bug happens even when you're swiping up or down, it looks a half correct and the otherone looks white. This happens with the Android Emulator too, I'm compiling with 3.0 and I'm testing it over Android 4.3 on both devices.

There is a way to make the flipview look good in all devices? Thanks

This one is when you open the app:

screenshot_2014-03-03-19-22-53

This one is swipping from page 1 to 0:

screenshot_2014-03-03-19-23-03

zhuofengli commented 10 years ago

I'm facing the same issue on a Genymotion emulator

wzy865100 commented 10 years ago

I'm facing the same issue on Galaxy 7100(note2) and note3 Please provide a solution thanks

redirect11 commented 10 years ago

Same problem on Galaxy S4 (GT-i9500)...

wzy865100 commented 10 years ago

Same problem on Android4.3

redirect11 commented 10 years ago

Hi, seems to be a bug in the canvas.save()/canvas.restore() system in the skia library. I'm not so expert to find a workaround for your code. If someone can point me on the right way i can implement the WA and fill a pull requests with the edits

Bug report on Aosp issue traker: https://code.google.com/p/android/issues/detail?id=58737

Buggy code: FlipView.java

    private void drawFlippingHalf(Canvas canvas) {
        canvas.save();
        mCamera.save();

        ....

        if (degreesFlipped > 90) {
            canvas.clipRect(isFlippingVertically() ? mTopRect : mLeftRect);
                        ....
        } else {
            canvas.clipRect(isFlippingVertically() ? mBottomRect : mRightRect);
                        ....
        }

        ....
        canvas.concat(mMatrix);

        setDrawWithLayer(mCurrentPage.v, true);
        drawChild(canvas, mCurrentPage.v, 0);

        ....

        mCamera.restore();
        canvas.restore();
    }
emilsjolander commented 10 years ago

duplicate of #13