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

拟墨画扇 提交于 2019-11-27 17:53:09

问题


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..



来源:https://stackoverflow.com/questions/10779862/how-can-we-show-page-curl-animation-on-click-of-the-button-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!