B4A Library [Lib] CoverFlow v2.0

ronovar

Active Member
Licensed User
Longtime User
It's ok..i know that is very complicated way of doing java code to make library...so i have just ask..just make it when you have time...i know that making vertical flow scroller is not an easy task.
 

udg

Expert
Licensed User
Longtime User
Edit: below problem solved modifying ItemWidth larger than smallest image width. Using ItemWidth/ItemHeight exactly as the smallest image dimensions raises the problem.

Hi lonleystar,

on a working project using this library, I simply modified the image files dimensions and the ItemWidth/Itemheight properties set in code, but suddenly received the following runtime error:
B4X:
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@416129b8
    at android.graphics.Canvas.throwIfRecycled(Canvas.java:1026)
    at android.graphics.Canvas.drawBitmap(Canvas.java:1096)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:646)
    at it.giuseppe.salvi.downloader.PhotoFlowDownloader.reflectionBitmap(PhotoFlowDownloader.java:328)
    at it.giuseppe.salvi.downloader.PhotoFlowDownloader$BitmapDownloaderTask.onPostExecute(PhotoFlowDownloader.java:179)
    at it.giuseppe.salvi.downloader.PhotoFlowDownloader$BitmapDownloaderTask.onPostExecute(PhotoFlowDownloader.java:1)
    at android.os.AsyncTask.finish(AsyncTask.java:631)
    at android.os.AsyncTask.access$600(AsyncTask.java:177)
    at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:175)
    at android.app.ActivityThread.main(ActivityThread.java:5279)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
    at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
I tried with ClearCache, commenting out the whole cache creation, even loading again the png files in the Files folder. Nothing.
What else should I try?

TIA

Umberto
 
Last edited:

udg

Expert
Licensed User
Longtime User
Hi Giuseppe,

thank you for your response.
Is there any reason the value set for ItemWidth should be larger than actual width of the smallest image? I ask because that cured the problem.
BTW, same project with same images (but smaller) worked until I resized original pictures and reloaded them in Files folder. And the error seems to lead to a "cached" bitmap that the library tries to load instead of sampling again the new version of the same image. Here I refer to "image" instead of "file" because I even tried to rename the png file and to modifiy a couple of pixels just to produce a "different" image, but to no avail.
Hope the above could be useful to trace an eventual devious quirk somewhere in the lib code.

Umberto
 

udg

Expert
Licensed User
Longtime User
<ENG>
Hi Giuseppe,
thank you for your response. I'll try to setup a minimal project with the offending image in order to reproduce the problem.
It's even possible that it is caused by something on my device (I manually deleted old folders and files) so don't waste your time on it until we discover an eventually reproducible quirk.
</ENG>

<ITA>
Ciao Giuseppe,
ti ringrazio per la risposta ed il tempo che avrai già dedicato al problema da me segnalato. Spero di poter postare in giornata un progetto di esempio corredato dall'immagine che provoca il problema segnalato. In effetti, il tutto potrebbe essere confinato al mio device dove, tra l'altro, ho cancellato manualmente alcune vecchie dir e file.. Per ora non perderci altro tempo; prima verifichiamo se riusciamo a predisporre un caso riproducibile.

P.S. quando vuoi fare due chiacchiere in italiano, vedo che il forum in lingua è sempre attivo e frequentato da gente simpatica.
</ITA>
 

M.LAZ

Active Member
Licensed User
Longtime User


Hiii,,
How did u solve this problem mr. lonleystar?
 

sorex

Expert
Licensed User
Longtime User
what are the minimum OS requirements for this library?
 

sorex

Expert
Licensed User
Longtime User
don't worry, it was just out of curriosity that I asked. so it should work on 2.x devices aswell?
 

georgelbs

Member
Licensed User
Longtime User
Hi lonleystar
Is possible to add a image from a bitmap?
I want show images from a database, the images are encoded in base64, then are decoded to bitmap
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…