Android Example UltimateListView Image Grid Example

Attachments

  • ulv_grid.zip
    221.3 KB · Views: 1,676

somed3v3loper

Well-Known Member
Licensed User
Longtime User
The panel of your cell layout serves no purpose. You should remove it.
"bmp.InitializeSample" in the ContentFiller sub is to avoid. You should load images asynchronously with LoadImageAsync.
I modified your code with these changes.

Is it OK using this code to show larger images when clicking one cell :

B4X:
Sub ULV_CellClick(RowID As Long, CellIndex As Byte, Position As Int, ClickedPanel As Panel)
    Dim ImgIdx As Int = Position * NB_COL + CellIndex
    Log("ImgIndex = " & ImgIdx)
    ToastMessageShow(ListImg.Get(ImgIdx), False)
   
    Dim over As Panel
    over.Initialize("over")
   
    Activity.AddView(over,0,0,100%x,100%y)
    over.SetBackgroundImage(LoadBitmap(File.DirAssets,ListImg.Get(ImgIdx)))
   
End Sub

Sub over_Click
    Dim s As Panel=Sender
    s.RemoveView
End Sub
 

Mahares

Expert
Licensed User
Longtime User
What about this:
B4X:
Dim MyPicture As String   'Proces_GLobals
B4X:
Sub ULV_CellClick(RowID As Long, CellIndex As Byte, Position As Int, ClickedPanel As Panel)
    Dim ImgIdx As Int = Position * NB_COL + CellIndex
    MyPicture =ListImg.Get(ImgIdx)
    StartActivity("expand")
End Sub

Create a new activity called: expand that has only the below code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Activity.SetBackgroundImage(LoadBitmap(File.DirAssets,Main.MyPicture))
End Sub
 

Informatix

Expert
Licensed User
Longtime User
Is it OK using this code to show larger images when clicking one cell :

B4X:
Sub ULV_CellClick(RowID As Long, CellIndex As Byte, Position As Int, ClickedPanel As Panel)
    Dim ImgIdx As Int = Position * NB_COL + CellIndex
    Log("ImgIndex = " & ImgIdx)
    ToastMessageShow(ListImg.Get(ImgIdx), False)
  
    Dim over As Panel
    over.Initialize("over")
  
    Activity.AddView(over,0,0,100%x,100%y)
    over.SetBackgroundImage(LoadBitmap(File.DirAssets,ListImg.Get(ImgIdx)))
  
End Sub

Sub over_Click
    Dim s As Panel=Sender
    s.RemoveView
End Sub
Yes.
 

Informatix

Expert
Licensed User
Longtime User
What about this:
B4X:
Dim MyPicture As String   'Proces_GLobals
B4X:
Sub ULV_CellClick(RowID As Long, CellIndex As Byte, Position As Int, ClickedPanel As Panel)
    Dim ImgIdx As Int = Position * NB_COL + CellIndex
    MyPicture =ListImg.Get(ImgIdx)
    StartActivity("expand")
End Sub

Create a new activity called: expand that has only the below code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Activity.SetBackgroundImage(LoadBitmap(File.DirAssets,Main.MyPicture))
End Sub
I prefer the first method because I cannot see the benefit of this alternative (if the purpose is just to show an enlarged version).
 

georgelbs

Member
Licensed User
Longtime User
I have a little sample of the ULV grid, trying to load images from a Sqlite database (base64 image fields), the only problem is that cell layout is loading the same data at each row, instead a different one for each cell. Please help me to understand what is wrong.
 

Attachments

  • ulv_grid.zip
    240.9 KB · Views: 963

Lello1964

Well-Known Member
Licensed User
Longtime User
Hello Informatix, ia have the some problem, can you send me a solution ?
Thanks Raffaele
 

Matteo Granatiero

Active Member
Licensed User
I have a little sample of the ULV grid, trying to load images from a Sqlite database (base64 image fields), the only problem is that cell layout is loading the same data at each row, instead a different one for each cell. Please help me to understand what is wrong.
i saw this post, were you able to solve?
 
Top