Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we show Page Curl Animation on click of the Button in android

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.

like image 561
Naresh Sharma Avatar asked May 28 '12 05:05

Naresh Sharma


1 Answers

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

like image 75
ADB Avatar answered Sep 18 '22 17:09

ADB