Android Question ListView to canvas does not reproduce the Items

Cableguy

Expert
Licensed User
Longtime User
Hi Guys

This one is for the Canvas specialists in this forum

I've been trying to copy a Listview to a canvas, but having only half success...
I can copy the background of the Listview, being it an image or just a drawable, BUT the items are not
copied to the canvas...

So the question is... Is there a way to do this, maybe using reflection to capture the rectangle on the screen where the listview is drawn???
I would try it myself, but reflection is not something I normally handle
 

Cableguy

Expert
Licensed User
Longtime User
I found this Java code that claims to do what I need:

B4X:
View v = rootView.findViewById(R.id.layout1);
if (v != null) {
    v.buildDrawingCache();
    Bitmap bitmap = v.getDrawingCache();
    canvas.drawBitmap(bitmap, dummyMatrix, null);
    v.destroyDrawingCache();  
}

Need help converting this to b4a
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
THANK YOU @JordiCP , just tried it, twraked it, and added a Listview to the origin panel, and IT WORKS!!!!
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Video "proof" of concept working... I used this snippet to solve an animation issue, see the videos:

BUG SOLVED
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…