The effect of freezing Android page layout / s

I am working on a project where I need to twist the whole view / layout, where I have textview, edittexts, buttons, etc. The challenge is that I have to twist the entire layout along with these buttons and all. I can’t figure out how to do this to twist the whole layout, not just the images.

Please, help

+8
android
source share
2 answers

I did this using the gismub harism project. All you have to do is capture a bitmap of the layout, inflating it. Here is the code that replaces the loadBitmap function in CurlActivity.java .

 // Bitmap resources. private int[] mBitmapIds = { R.layout.infopage0,R.layout.infopage1, R.layout.infopage2, R.layout.infopage3 }; @Override public int getPageCount() { return 4; } private Bitmap loadBitmap(int width, int height, int index) { LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = inflater.inflate(mBitmapIds[index],null); v.measure( MeasureSpec.makeMeasureSpec(width,MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)); v.layout(0, 0, v.getMeasuredWidth(), v.getMeasuredHeight()); Bitmap b = Bitmap.createBitmap(v.getWidth(), v.getHeight() ,Bitmap.Config.ARGB_8888); Canvas c = new Canvas(b); v.draw(c); return b; } 

The mBitmapIds array mBitmapIds now an array of xml layout identifiers.

+8
source share

I did not work on the Curl effect, but I found a project for you that can help you.

https://github.com/harism/android_page_curl/

0
source share

All Articles