android - Animating screen over long image -
i have long image need screen hover on origin till end.
any suggestions how implement this?
thanks, ilan
if sure memory plenty load required bitmap can load bitmap in background thread before displaying required part of bitmap on visible imageviewer object here sample code off-screen bitmap processing
class bitmapworkertask extends asynctask<integer, void, bitmap> { private final weakreference<imageview> imageviewreference; private int info = 0; public bitmapworkertask(imageview imageview) { // utilize weakreference ensure imageview can garbage collected imageviewreference = new weakreference<imageview>(imageview); } // decode image in background. @override protected bitmap doinbackground(integer... params) { info = params[0]; homecoming decodesampledbitmapfromresource(getresources(), data, 100, 100)); } // 1 time complete, see if imageview still around , set bitmap. @override protected void onpostexecute(bitmap bitmap) { if (imageviewreference != null && bitmap != null) { final imageview imageview = imageviewreference.get(); if (imageview != null) { imageview.setimagebitmap(bitmap); } } } }
android android-animation android-imageview
No comments:
Post a Comment