B4J Question [ABMaterial] My ABMFlexWall Help Please!!!

Mashiane

Expert
Licensed User
Longtime User
Hi there

I'm experimenting with the flexwall. Im building up a dynamic one where the photos will resize in a gallery folder and these get displayed during runtime depending on whatever internal album photos a user chooses.

1. In the ABMDemo example, all the flexwall photos have the same size, mine dont.
2. My loaded ABMFlexWall does not show like the ABMDemo way i.e. nicely placed photos
3. How do I make mine work and display just like the demos as mine the pics are shown one after the other vertically?

FlexWall.png


This is my ABMFlexWall loading code...

B4X:
Private Sub RefreshOnLoad_flex598()
    Dim flex598 As ABMFlexWall
    flex598 = page.Component("flex598")
    'Get the album folder from session
    Dim Album As String = page.ws.Session.GetAttribute("album")
    Dim ParentFolder As String = page.ws.Session.GetAttribute("parentfolder")
    If Album.Length = 0 Then Return
    page.NavigationBar.Title = Album
    Dim fStructure As String = "www" & "/" & AppName & "/"
    If ParentFolder.Length > 0 Then
        fStructure = fStructure & ParentFolder & "/"
    End If
    fStructure = fStructure & Album
    Dim pStructure As String = fStructure
    pStructure = pStructure.Replace("www/" & AppName, "..")
    fStructure = File.Combine(File.DirApp, fStructure)
    'Define list to store the results of the query
    page.Pause
    Dim albumPhotos As List = File.ListFiles(fStructure)
    Dim photoCnt As Int = 0
    Dim photoID As String
    For Each strPhoto As String In albumPhotos
        photoCnt = photoCnt + 1
        photoID = "photo" & photoCnt
        strPhoto = pStructure & "/" & strPhoto
        Dim img As ABMImage
        img.Initialize(page, photoID, strPhoto, 1)
        img.IsResponsive = True
        img.Caption = strPhoto
        img.IsCircular = False
        img.IsClickable = False
        img.IsMaterialBoxed = True
        flex598.AddImage(img, 350, 350)
    Next
    flex598.Refresh
    page.Resume
End Sub

I could use some advise please, thanks in advance!!!
 
Top