How can we show Page Curl Animation on click of th

2019-01-24 05:24发布

问题:

I am using the Page curl animation in my application.

Code can be found here: https://github.com/harism/android_page_curl/.

That code is working fine but i want to make some Modifications in it.

1.To display the image on full screen with no background.

2.I want to show this curl animation on click of the button also.

The code for the mail CurlActvity class is http://pastebin.com/ZLzP6Zxt at there.

If anyone have some Idea about where i have to made changes the code then please help me. Any help is appreciated.

Edit: The 1st problem To display the image on full screen with no background is solved by some modifications in the private class SizeChangedObserver . The only issue is to set the animation onClick of the button.

回答1:

For the full screen display you have to use like that

private class SizeChangedObserver implements CurlView.SizeChangedObserver {
        public void onSizeChanged(int w, int h) {
            if (w > h) {
                mCurlView.setViewMode(CurlView.SHOW_TWO_PAGES);
                mCurlView.setMargins(0f, 0f, 0f, 0f);
            } else {
                mCurlView.setViewMode(CurlView.SHOW_ONE_PAGE);
                mCurlView.setMargins(0f, 0f, 0f, 0f);
            }
        }
    }

}

Also to show the animation see that link Page curl animation - issue



回答2:

  1. Have you tried changing

    int margin = 7;

    int border = 3;

to eks.

int margin = 0;
int border = 0; 

the loadBitmap(..) function?

I actually removed the boarder and margins within loadBitmap some time ago in a project i worked on, but i dont have the code anymore..