B4A Library CustomGridView

This library will create a simple yet useful grid view.

Requirements:

- B4A 3.82.


How to install:

- Copy the CustomGridView.jar and CustomGridView.xml to your additional libraries directory.

Usage:
B4X:
Private grid As CustomGridView

'Initialize the library.
grid.Initialize(Activity, Me, "Grid", 3, "S")

'Prepare the CustomGridView to receive data.
grid.PrepareGridView

'Add data to the grid, it supports images from URLs or local files.
'The "Link" parameter is whatever you need the grid to return.
grid.AddToGridView("http://wac.450f.edgecastcdn.net/80450F/ultimateclassicrock.com/files/2012/06/BJ.jpg", "Bon Jovi", "Bon_Jovi")

'Show the picture titles (optional)
grid.TitleBoxVisible = True

'Display the grid.
grid.ShowGridView


NOTES:

- The grid supports up to 4 columns (if an invalid number is entered it will default to 3).

- The "cells" can be Square or Rectangular (the content will be resized).

See the attached sample for more details.

WARNING: This version will BREAK the previous one since the new one contains 1 more initialization argument.


Screenshot:

ky3eiYxl.jpg
 

Attachments

  • CustomGridView_1.5_Lib.zip
    11.2 KB · Views: 437
  • CustomGridView_Sample.zip
    35.4 KB · Views: 390
Last edited:

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Hello MarcoRome,
I use a custom dialog with this library Dialog.
 

MarcoRome

Expert
Licensed User
Longtime User
Hi NjDude, Thank again for this library.
One question. When i try to click 10 times or more about pictures on your example, the message does not come back... ise very slow.


B4X:
Sub Grid_ItemClicked(Item As String)
 
    Msgbox(Item, "Item Clicked")
   
End Sub

Why ??

Thank you
 

aidymp

Well-Known Member
Licensed User
Longtime User
Hi, is there a similar library to this that does not force square images? or any tips on how to make a similar scrolling view, for say dvd style images?
I have seen the other lib similar to this, but that dont work very well, if at all!

Thanks

Aidy
 

NJDude

Expert
Licensed User
Longtime User
Hi, is there a similar library to this that does not force square images? or any tips on how to make a similar scrolling view, for say dvd style images?
I have seen the other lib similar to this, but that dont work very well, if at all!

Thanks

Aidy
I'm not promising anything but I "might" update the library to accommodate that, depends on how much "coding" time I will have available.
 

aidymp

Well-Known Member
Licensed User
Longtime User
If you do that would be great, if you dont! its still great! thank you for all your time!

Thanks

Aidy
 

aidymp

Well-Known Member
Licensed User
Longtime User
Library updated to version 1.5, see first post for details.

Hi I get this error, with 1.50 of the lib

Cannot find: C:\Program Files (x86)\Anywhere Software\Basic4android\libraries\imgflipmemes.jar

Thanks

Aidy
 

basil99

Active Member
Licensed User
Longtime User
Hi, NJDude! First of all, thank you very much for this lib, i'm using it in my current project and totally satisfied.

One question, do you plan to develope this lib with more functions ?
Like, after i have grid filled, i may want to change image/title text at dedicated position, or delete some items from grid, or just hide/show items

Thank you
 

NJDude

Expert
Licensed User
Longtime User
Hi, NJDude! First of all, thank you very much for this lib, i'm using it in my current project and totally satisfied.

One question, do you plan to develope this lib with more functions ?
Like, after i have grid filled, i may want to change image/title text at dedicated position, or delete some items from grid, or just hide/show items

Thank you

Hi there,

This is a very simple grid and what you see is what you get, the purpose is just to have a quick and simple way to display items, to do what you want, you will need a more robust library.
 

Mashiane

Expert
Licensed User
Longtime User
Hi, NJDude! First of all, thank you very much for this lib, i'm using it in my current project and totally satisfied.

One question, do you plan to develope this lib with more functions ?
Like, after i have grid filled, i may want to change image/title text at dedicated position, or delete some items from grid, or just hide/show items

Thank you
I think if you want that, perhaps store your images in a map variable, then change the title from there, delete an item from the map etc and then reload.
 

aidymp

Well-Known Member
Licensed User
Longtime User
Hi there,

This is a very simple grid and what you see is what you get, the purpose is just to have a quick and simple way to display items, to do what you want, you will need a more robust library.

But who will make such a library? I would donate for such a library!!!!!

I wish it had these features!

Rectangle portrait & landscape! (i know you did portrait)
Longpress event
Scroll To
Oh and custom loading image whilst it populates!

If it did those, i would pay around 15euro. Im sure may other would too!
 
Top