B4A Library [Library] B4aGridView v3.80

Carlos marin

Active Member
Licensed User
Longtime User
hello friends, could raise some complete example to use this library. thank you very much


 

Dave61

Member
Licensed User
Longtime User
I was planning to use the gridview as a grid of buttons for the user to select a task. The interface looks good cosmetically and the person using it is happy with it apart from 1 problem:

The grid only takes up half the screen. When the user clicks on a button/image then some more Views appear to be filled in and finally a Send button is used to complete the task and clear the extra views until the next button/image is pressed.
I cannot find a way to 'highlight' the button/image that has been pressed in the grid. Ideally I would like either a highlight border around the selected image or all the non-selected images to be 'greyed-out'. Are either of those possible or is there another way that anyone has found to highlight the selected image?

As an alternative to that, I thought that I could have the Activity title show the name of the button pressed as a reminder. I use:
gridview1.ShowFromAssets
to load the grid from a list of files in the Files folder. However, I can't see any way to retrieve the filename (which has a good description of the task if I just trim off the '.jpg' from the end) from the selected item. All I can get is the Position which shows the number of the button being pushed. Is there any way to get the original filename without me having to include an extra list or had code a list?

Thanks,

Dave
 

Ferdari

Active Member
Licensed User
Longtime User

i support this, @lonleystar did you have any update of why the error occurs?
 

Mashiane

Expert
Licensed User
Longtime User

Hi, this is such a lovely library, you might have to consider moving this post to the first post, It's easier when updates are done there as we now have to read all the posts to get important information about updates.
 

cwkoomy

Member
Licensed User
Longtime User
hi big bro/sis, im still learning, have any sample for 3.6? im try 3.2 sample but cant use in 3.6 lib
 

aidymp

Well-Known Member
Licensed User
Longtime User
Just come across this today, and I cant initialise the gridview using 3.60 of the lib. as I see a few others have found. i can however use 3.50 but I was hoping to use the features of 3.6! Any information/news of why it wont even initialise?

Thanks

Aidy
 

scsjc

Well-Known Member
Licensed User
Longtime User
Hello, nice work ...
but I'm try to runing 3.6 but always have a java.lang.StackOverflowError,
anyone have a sample working with 3.6 ???

thanks !!!
 

scsjc

Well-Known Member
Licensed User
Longtime User
Hello again,
i'm trying the library version 3.50, and found a fail with the sort names.... i don't know why the names not sort with images...
the curiosity..is on version 3.20 work perfectly..every text on correct image...
i'm try with index and without but can't good work.... anyone have a solution ?
thanks !!!

B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
End Sub

Sub Globals
    Dim GridView As PhotoGridView
    Dim fromWeb() As String
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    Activity.Color=Colors.white

     GridView.Initialize2("GridView","hola")
    '*************************************
    Activity.AddView(GridView,4dip,4dip,100%x-8dip,100%y)
    '*************************************
    GridView.ItemWidth= 20%x
    GridView.ItemHeight= 20%x
    GridView.HorizontalSpacing = 3dip
    GridView.VerticalSpacing = 3dip
    GridView.NumColumns = 2
    '*************************************
    GridView.ScaleType = GridView.ScaleType.Fit_XY
    '*************************************
    GridView.SetNoEffect = False
    GridView.FadeInTime = 10
    GridView.RoundedBitmap = False
    GridView.SetBorderColor = Colors.white
    GridView.SetCornerRadius = 0
    GridView.SetBorderWidth = 5dip
    '*************************************
    GridView.ProgressBarIndeterminate = False
    GridView.ProgressBarVisible = False
    '*************************************
    GridView.ShowText=True
    GridView.StretchMode=GridView.StretchMode.STRETCH_COLUMN_WIDTH 
    GridView.TextBackGroundAlpha=200
    GridView.TextBackGroundColor(255,255,255)
    GridView.TextColor=Colors.black
    GridView.TextGravity=Gravity.LEFT
    GridView.TextPosition=GridView.TextPosition.Text_Bottom_Inside
    GridView.TextSize=14
    GridView.TextLines=3
    '*************************************
    GridView.CacheInMemory=True
    GridView.CacheOnDisk=True

    fromWeb = Array As String( _
    "https://lh4.googleusercontent.com/-Z4zGiC5nWdc/URqvBdEwivI/AAAAAAAAAbs/ZRZR1VJ84QA/s1024/Sin%252520Lights.jpg", _
            "https://lh4.googleusercontent.com/-_0cYiWW8ccY/URqvBz3iM4I/AAAAAAAAAbs/9N_Wq8MhLTY/s1024/Starry%252520Lake.jpg", _
            "https://lh3.googleusercontent.com/-A9LMoRyuQUA/URqvCYx_JoI/AAAAAAAAAbs/s7sde1Bz9cI/s1024/Starry%252520Night.jpg", _
            "https://lh3.googleusercontent.com/-KtLJ3k858eY/URqvC_2h_bI/AAAAAAAAAbs/zzEBImwDA_g/s1024/Stream.jpg", _
            "https://lh3.googleusercontent.com/-KtLJ3k858eY/URqvC_2h_bI/AAAAAAAAAbs/zzEBImwDA_g/s1024/Stream.jpg", _
            "https://lh3.googleusercontent.com/-KtLJ3k858eY/URqvC_2h_bI/AAAAAAAAAbs/zzEBImwDA_g/s1024/Stream.jpg", _
            "https://lh3.googleusercontent.com/-KtLJ3k858eY/URqvC_2h_bI/AAAAAAAAAbs/zzEBImwDA_g/s1024/Stream.jpg", _
            "https://lh3.googleusercontent.com/-KtLJ3k858eY/URqvC_2h_bI/AAAAAAAAAbs/zzEBImwDA_g/s1024/Stream.jpg", _
            "https://lh3.googleusercontent.com/-KtLJ3k858eY/URqvC_2h_bI/AAAAAAAAAbs/zzEBImwDA_g/s1024/Stream.jpg", _
            "https://lh3.googleusercontent.com/-KtLJ3k858eY/URqvC_2h_bI/AAAAAAAAAbs/zzEBImwDA_g/s1024/Stream.jpg", _
            "https://lh3.googleusercontent.com/-KtLJ3k858eY/URqvC_2h_bI/AAAAAAAAAbs/zzEBImwDA_g/s1024/Stream.jpg", _
            "https://lh3.googleusercontent.com/-KtLJ3k858eY/URqvC_2h_bI/AAAAAAAAAbs/zzEBImwDA_g/s1024/Stream.jpg")

    GridView.SetText2(0,"  hello 0" & CRLF & "  segunda linea" )
    GridView.SetText2(1,"  hello 1" & CRLF & "  segunda linea" )
    GridView.SetText2(2,"  hello 2")
    GridView.SetText2(3,"  hello 3")
    GridView.SetText2(4,"  hello 4")
    GridView.SetText2(5,"  hello 5")
    GridView.SetText2(6,"  hello 6")
    GridView.SetText2(7,"  hello 7")
    GridView.SetText2(8,"  hello 8")
    GridView.SetText2(9,"  hello 9")
    GridView.SetText2(10,"  hello 10")
    GridView.SetText2(11,"  hello 11")
    GridView.SetText2(12,"  hello 12")
 
    GridView.ShowFromWeb(fromWeb,False)
End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
End Sub
 
Last edited:

aidymp

Well-Known Member
Licensed User
Longtime User

Did you get 3.60 to work? I cant even initialise it!

Thanks

Aidy
 

scsjc

Well-Known Member
Licensed User
Longtime User
Hi, yes You ar right I'll find why It does this and something else. Thanks for reminding me.

Hello, Lonleystar... really is very good work, but are problem with a text, can you fix that??? please ....
and the library 3.60 can't start... can you put any sample?

really thanks !!!!
 

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hello to all
you can also use GridView to add buttons or panels? If so, how?
Thank you
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…