Android Example UltimateListView Image Grid Example

Attachments

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 :

Code: Copy
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
 
What about this:
Code: Copy
Dim MyPicture As String   'Proces_GLobals
Code: Copy
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:
Code: Copy
Sub Activity_Create(FirstTime As Boolean)
    Activity.SetBackgroundImage(LoadBitmap(File.DirAssets,Main.MyPicture))
End Sub
 
Is it OK using this code to show larger images when clicking one cell :

Code: Copy
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.
 
What about this:
Code: Copy
Dim MyPicture As String   'Proces_GLobals
Code: Copy
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:
Code: Copy
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).
 
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

Hello Informatix, ia have the some problem, can you send me a solution ?
Thanks Raffaele
 
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?
 
Back
Top