B4A Library [Library] B4aGallery v3.55

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi, open the demo with notepad and change this below:

Version=3.5
IconFile=
NumberOfModules=1
Module1=PhotoViewPager
ModuleVisible1=1
Package=it.giuseppe.salvi.gallery.pager

instead of this below if really U don't want to install the v3.80

Version=3.8
IconFile=
NumberOfModules=0
Build1=Default,it.giuseppe.salvi.galleryview


*******************************
in to the module too Version=3.8 to Version=3.5
*******************************

P.S.
Erel I'm sorry about that, this is for the guys as not yet installed or not yet got the v3.80

This is intended as tip.
 

Informatix

Expert
Licensed User
Longtime User
I tried the version 3.10 and it works now. BUT this library has exactly the same problem that I reported for other libs from you: the aspect ratio is not respected. It's obvious with vertical pictures, but that's also the case with horizontal ones. A comparison side-by-side:



This only reason is why I find most of your libs completely useless for me. I can't see what real use I can have of a gallery of stretched pictures. No app handling images that I could try on my devices do that. Either the image has black bars when it cannot fit the frame, or it is panned, or even better: the frame is resized.
 

ronovar

Active Member
Licensed User
Longtime User
Hi,

I im using b4a v3.80

and i im using

Gallery.AddImageFromWebAt(0,"https://lh4.googleusercontent.com/-...AAAAAAbs/ZRZR1VJ84QA/s1024/Sin%2520Lights.jpg")

but every time i run it exits apk and b4a log does not write anything...i tried your demo and the result is the same. here is my code:

B4X:
Sub Globals
      Dim Gallery As PhotoGallery
End Sub

Sub GetCovers
    Gallery.Initialize("Gallery")
    Activity.AddView(Gallery, 0, 0, 100%x, 100%y)
    Gallery.ItemWidth = 296
    Gallery.ItemHeight = 436
    Gallery.Spacing = 50
   
    Gallery.ScaleType = Gallery.ScaleType.Center_Crop
    Gallery.SetNoEffect = False
    Gallery.SetBorderColor=Colors.Yellow
    Gallery.SetCornerRadius = 10
    Gallery.SetBorderWidth = 2
    Gallery.SetOval = False
   
   
    Gallery.AddImageFromWebAt(0,"https://lh4.googleusercontent.com/-Z4zGiC5nWdc/URqvBdEwivI/AAAAAAAAAbs/ZRZR1VJ84QA/s1024/Sin%252520Lights.jpg")
End Sub

So in this example code i was trying to get one image on the screen, so after i get one then i can go to add selected image position etc...but this is error i im getting using logcat:
B4X:
Installing file.
PackageAdded: package:b4a.example
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Message longer than Log limit (4000). Message was truncated.
java.lang.StackOverflowError
    at java.lang.Throwable.<init>(Throwable.java:67)
    at java.lang.Throwable.<init>(Throwable.java:95)
    at java.lang.Exception.<init>(Exception.java:47)
    at java.io.IOException.<init>(IOException.java:44)
    at java.io.FileNotFoundException.<init>(FileNotFoundException.java:42)
    at android.content.res.AssetManager.openAsset(Native Method)
    at android.content.res.AssetManager.open(AssetManager.java:315)
    at android.content.res.AssetManager.open(AssetManager.java:289)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:241)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGalleryDownloader.getBitmapFromAssets(PhotoGalleryDownloader.java:243)
    at it.giuseppe.salvi.library.photogallery.downloader.PhotoGaller
Message longer than Log limit (4000). Message was truncated.

Where i im doing wrong? I added last library from this first page and demo and this example code does not run.
 

ronovar

Active Member
Licensed User
Longtime User
I know that your library work...but i don't know where the problem is by me. Do you have any clue or ideas where i can try to fix error? I spend two hours today and can't find where is the error my me.
 

ronovar

Active Member
Licensed User
Longtime User
I think that the problem is by me..so can you please post what version do you have installed on your pc?

I have installed this:

Java SE Development Kit 7u55 (http://download.oracle.com/otn-pub/...m=1401195210_95b9c8ebe41f91b08d6c32c64e6bead5)
TOOLS - Android SDK Tools 22.6.3
Android SDK Platform-Tools 19.0.2
Android SDK Build-Tools 19.1
Android SDK Build-Tools 19.0.3

Android 4.4.2 (API19)

SDK Platform 19 rev 3
ARM EABI v7a


I now have it finally run but it does not want to get other images in link i put into variable...it shows only links from demo you have posted on first page, so after i put my own link app exits and i im get error that above i have posted. If i put only link like you posted in your demo example it works.

I have put this but app exits..

Gallery.AddImageFromWebAt(0,"http://zdravilkaduha.files.wordpress.com/2011/01/veverica-za-lep-dan.jpg")

In i found the error fix for above post, i must first run this:

Gallery.ShowFromAssets("Immagini") ' or Gallery.ShowFromAssets(source)
Gallery.Selection = posSelected

Then i can call Gallery.AddImageFrinWebAt()

Can You please insert only link above and atatch here zip file of project so that i can test then.

Many Thanks.
 

lonleystar

Well-Known Member
Licensed User
Longtime User
Hi ronovar, it work fine but anyway try with this code below.

B4X:
Sub Globals
    Dim Gallery As PhotoGallery
End Sub

Sub Activity_Create(FirstTime As Boolean)

    Gallery.Initialize("Gallery")

    Activity.AddView(Gallery, 0, 0, 100%x, 100%y)
 
    Gallery.CreateCache = "Pippo.Pluto.Paperino"

    Gallery.TextSize = 16
    Gallery.TextColor = Colors.Yellow
    Gallery.ShowText = False
    Gallery.ItemWidth = 436

    Gallery.ItemHeight = 336
    Gallery.Spacing = 50
 
    '*************************************
 
    Gallery.ScaleType = Gallery.ScaleType.Fit_XY
    Gallery.SetNoEffect = False
    Gallery.SetBorderColor=Colors.Yellow
    Gallery.SetCornerRadius = 10
    Gallery.SetBorderWidth = 2
    Gallery.SetOval = False
 
    '************************************

    Gallery.AddImageFromWebAt(0,"http://zdravilkaduha.files.wordpress.com/2011/01/veverica-za-lep-dan.jpg")
End Sub



 

ronovar

Active Member
Licensed User
Longtime User
I tried your code and it doest not work on my device..i try on htc desire hd and android S18HD2 box device and after running apk it quits.

here is zip of my cide and compiled apk. so maybe you can find where is problem by me...i studied two days and no go..i can't find what is causing apk to quit after putting url.

I woukld liek to finish one apk that have cover scrolling using this, and will switch to coverflow vertical when you finish..but if you have time to try this apk and zip and report igf the compiled apk is working on your device?

Many Thanks.
 

Attachments

  • demo2.zip
    6.3 KB · Views: 217
  • demo2.apk
    122.7 KB · Views: 176

ronovar

Active Member
Licensed User
Longtime User
Hi..have You tried apk and code above? Please post Your results if its working..by me on two devices after starting apk it exits.

Thanks.
 

ronovar

Active Member
Licensed User
Longtime User
Ok...i finnaly found a solution that works...i have made a mistake...when i compile and using b4a bridge i get every time clicked install only NEW code and then apk exits...so now i clicked install ALL code apk and apk works flawessly-
 

ronovar

Active Member
Licensed User
Longtime User
I will use using usb cable..thanks for tip. Nw is app working flawlessly...how is going progress on vertical flow? Is there some beta that you can posto to forum?

And thanks for sharing your excellent library...this scroller is amazing work.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…