drag-sort-listview icon indicating copy to clipboard operation
drag-sort-listview copied to clipboard

Crashes when the item is bigger than the screen

Open mkpazon opened this issue 11 years ago • 1 comments

mkpazon avatar Aug 02 '13 14:08 mkpazon

I meet the same situation. Here is the solution: in SimpleFloatViewManager.onCreateFloatView(int position), change: mFloatBitmap = Bitmap.createBitmap(v.getDrawingCache()); to mFloatBitmap = loadBitmapFromView(v); Here is the loadBitmapFromView(View v): public static Bitmap loadBitmapFromView(View v) { final int width = v.getMeasuredWidth(); final int height = v.getMeasuredHeight(); Bitmap b = Bitmap.createBitmap( width, height, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b); v.layout(0, 0, width, height); v.draw(c); return b; }

I think this is mainly because view.getDrawingCache() returns null when view is bigger than screen.

adouggy avatar Oct 23 '14 03:10 adouggy