B4A Library [Lib] CoverFlow v2.0

luke2012

Well-Known Member
Licensed User
Longtime User
Ciao @lonleystar.
First of all thanks for your support!
I'm experiencing a little issue with the CleaeCache method because I get the attached error.

Ciao @lonleystar .
Prima di tutto grazie per il tuo supporto.
Sto avendo un problema quando chiamo il metodo .ClearCache in quanto mi produce l'errore allegato.
 

Attachments

  • ClearCache.png
    70.3 KB · Views: 226

luke2012

Well-Known Member
Licensed User
Longtime User

Thanks for your quick response @lonleystar .
I'll check as soon as possible and I'll let you known.

P.S.

Tu di dove sei ?
 
Last edited:

luke2012

Well-Known Member
Licensed User
Longtime User

Hi @lonleystar !

I tested the v.1.7 library :

The good :
The text above the images is now OK

The Issue :
I still have the problem with the .ClearCache method that raise a Java error
See my previous post : http://www.b4x.com/android/forum/threads/lib-coverflow-v1-70.27696/page-6#post-231974
 

luke2012

Well-Known Member
Licensed User
Longtime User
Hi luke, i tested it with G.tab 7 P1000, G Tab 7 v2, G. Tab Note 2, and G.S4 it work fine i've no error.

I call clear cache by menu and by button still work fine, let me know.

The error is raised if clearcache il called before PopulateCoverFlow.

1) Doesn't work
Coverflow.ClearCache
Coverflow.PopulateCoverflow(File.DirDefaultExternal, CoverflowFolder)

2) Work Fine (the cache is pruned but sometime I got an error*)
Coverflow.PopulateCoverflow(File.DirDefaultExternal, CoverflowFolder)
Coverflow.ClearCache

* for example : when the CoverFlow folder doesn't exist on SD
 
Last edited:

DSD

Member
Licensed User
Longtime User
I'm also experiencing the NullPointerException.

Can I populate the Coverflow by using the AddImage method or do I need to first call the PopulateCoverFlow?
My images are under File.DirAssets. Here's the tracelog:

I get this exception every time I call the CoverFlow.AddImage(File.DirAssets,"somefile.jpg")

java.lang.NullPointerException
at it.giuseppe.salvi.PhotoFlowActivity.AddImage(PhotoFlowActivity.java:206)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:680)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:308)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at it.giuseppe.salvi.coverflow.main.afterFirstLayout(main.java:98)
at it.giuseppe.salvi.coverflow.main.access$100(main.java:16)
at it.giuseppe.salvi.coverflow.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:5225)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)

I'm running the sample app on a Sony Xperia Tablet Z.
 

luke2012

Well-Known Member
Licensed User
Longtime User
ciao luca, u call clearcache before to populate? let me know with some little example code.

I understand tomorrow after work i'll fix it, sorry for the inconvenients.

Well done @lonleystar !
The important thing is to solve the problems!

In this way we also test and improve the library.
Thanks for your outstanding support!
 

DSD

Member
Licensed User
Longtime User
Hi luke and dsd, the coverflow is to update to v1.80,

As Luke ask the clearcache work fine.
Aas DSD ask now can add images from assets too but u've to populate it before.

Thank's for adding support for AddImage.
Unfortunately calling the following will only show the name of the file not the image itself...
It seems as though the image is not loaded...

Coverflow.AddImage(File.DirAssets,"House.jpg")
 

DSD

Member
Licensed User
Longtime User
Hi DSD, I test it now just in this moment i write u and it work fine.

Hi,

I think I'm doing something wrong then.

Here's the code, I'm running the sample app:

B4X:
Sub Activity_Create(FirstTime As Boolean)
    Activity.AddMenuItem("Clear Disk And Memory Cache","a")
    'Activity.AddMenuItem("Add ImageAt","b")
    Coverflow.InitializeCoverflow("Coverflow")
    Coverflow.CreateCache = "it.giuseppe.salvi"
    Activity.AddView(Coverflow, 0dip, 0dip, 100%x, 100%y)
    Coverflow.Spacing= -20
    Coverflow.ItemWidth = 30%x
    Coverflow.ItemHeight = 90%y   
    Coverflow.AnimationDuration=800
    Coverflow.PopulateCoverflow(File.DirRootExternal, "DCIM")
    Activity.Title = "G.S - Items = " & Coverflow.Length
    Coverflow.ShowText = True
    Coverflow.TextColor = Colors.Yellow
    Coverflow.TextSize = 12
    'Coverflow.Carousel = True
    'Coverflow.Reverse = True
    Coverflow.Selection = 3

   
End Sub

B4X:
Sub a_Click
    Coverflow.AddImage(File.DirAssets,"House1.jpg")
    Coverflow.AddImage(File.DirAssets,"House2.jpg")
    'Coverflow.ClearCache
    'Coverflow.AddImage(File.DirRootExternal,"ANY IMAGE HERE")
End Sub

The PopulateCoverFlow does not contain any images, it's an empty folder.
But the two images that are added when calling a_click is embedded with the app.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…