B4A Library [Library] B4aGridView v3.80

Douglas Farias

Expert
Licensed User
Longtime User
nono is another problem i have try add images normal
for example
GridView.AddImage(File.DirAssets, "1.jpg")
GridView.AddImage(File.DirAssets, "2.jpg")

and dont show the images too this is very strange

gridview.ShowFromMediaStore dont show images too *-*

its very strange, its a problem on the v3.3 and v3.4, the v3.2 its working fine

if i make a new project the same happens, i cant see the images at 3.3 and 3.4


if i donwload your old v3.2 and put this at libraries folder and compile again works fine.

My phone is MOTO G
 

lonleystar

Well-Known Member
Licensed User
Longtime User


Hi, I really dont understand why it doesnt work to u it work great also with emulator.

P.S.

if U use JSON check in your json's page to use this way:

http:\/\/www.Your_Adresse.com\/images\/album\/thumb90524855.jpg
 

Douglas Farias

Expert
Licensed User
Longtime User
here
B4X:
#Region  Project Attributes
    #ApplicationLabel: asdasww
    #VersionCode: 1
    #VersionName: 1.0
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: True
#End Region

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

Sub Process_Globals
End Sub

Sub Globals
    Private GridView As PhotoGridView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    GridView.Initialize("GridView")
    Activity.AddView(GridView,0%x,0%y, 100%x, 100%y)
    GridView.ItemWidth=100%x
    GridView.ItemHeight=100%y
    GridView.HorizontalSpacing = 4dip
    GridView.VerticalSpacing = 4dip
    GridView.NumColumns = 4
    GridView.FadeInTime = 300
    GridView.SetBorderColor = Colors.White
    GridView.SetCornerRadius = 20
    GridView.SetBorderWidth = 2
    GridView.CacheOnDisk = True
    GridView.SetNoEffect = True

End Sub

Sub Activity_Resume
    GridView.ShowFromMediaStore(False)
End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


this code works fine with your lib v3.2 and dont work with 3.3 and 3.4
 

lonleystar

Well-Known Member
Licensed User
Longtime User



Hi, as I say just now i tried AddImage, AddImageAt,AddImageFromWeb,AddImageFromWebAt,ShowFromSdCard,ShowFromWeb,ShowFromAssets,and ShowFromMediaStore in Activity_Resume it WORK GREAT so if u cant send your code also via email i cant help u.
 

Douglas Farias

Expert
Licensed User
Longtime User
the post #223 is one code can u copy and compile this, this works with v3.2 and no v3.3 and v3.4

the code on the #223 works fine here with v3.2 only

dont need send u, only copy the #223 and compile *-*
 

Ionut Indigo

Member
Licensed User
Longtime User
Thank you for the update Giuseppe.
I'm having some new issues with the 3.40 (fix) library :
1. With GridView.ShowText = True i get java.lang.IndexOutOfBoundsException error. Rewrote the code order and now it works.
2. Clicking on thumbnail gives me java.lang.Exception: Sub gridview_itemclick signature does not match expected signature.

 
Last edited:

lonleystar

Well-Known Member
Licensed User
Longtime User

Hi, U R right but I fixed the library till 3.30 a.m. this morning. I was very tired and I dint tried it, but thanks to have reported this issue. Please download B4AGridView v3.40_New_Fix.zip and let me know.

I'm sorry for the inconvenience.
 

Ionut Indigo

Member
Licensed User
Longtime User
Same error.
B4X:
java.lang.Exception: Sub gridview_itemclick signature does not match expected signature.
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:177)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:163)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
    at it.giuseppe.salvi.gridview.library.core.GridViewActivityWrapper$1.onItemClick(GridViewActivityWrapper.java:157)
    at android.widget.AdapterView.performItemClick(AdapterView.java)
    at android.widget.AbsListView.performItemClick(AbsListView.java)
    at android.widget.AbsListView$PerformClick.run(AbsListView.java)
    at android.widget.AbsListView$1.run(AbsListView.java)
    at android.os.Handler.handleCallback(Handler.java)
    at android.os.Handler.dispatchMessage(Handler.java)
    at android.os.Looper.loop(Looper.java)
    at android.app.ActivityThread.main(ActivityThread.java)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
    at dalvik.system.NativeStart.main(Native Method)
java.lang.Exception: Sub gridview_itemclick signature does not match expected signature.
 

lonleystar

Well-Known Member
Licensed User
Longtime User


Hi, GridView_ItemClick(Position As Int, Value As Object) not GridView_ItemClick(Position As Int, Value As Object, Tag As Object).

Sorry I'm still tired.
 

Douglas Farias

Expert
Licensed User
Longtime User
thx @lonleystar today i go make u a dontation , i cant make much because euro on brazil is hard xD

but very thx for u work, and fast suport man u the best
 

Ionut Indigo

Member
Licensed User
Longtime User
Well i have a question about the sorting by numbers in a gridview. I have 25 images named 0.jpg, 1.jpg, 2.jpg, ... , 24.jpg; and when the images are displayed in the gridview they get sorted as 0.jpg, 1.jpg, 10.jpg, 11.jpg, ... 19.jpg, 2.jpg, 20.jpg, 21.jpg ...
How can i get them be sorted the correct way, without changing the file names? (in my case there is no difference in sorting using GridView.ShowFromAssets("Images", True / False))

Never mind, i got it working with :
B4X:
For n = 0 To 24
    GridView.AddImage(File.DirAssets, "gallery1/" & n & ".jpg")
Next
 
Last edited:

Shahid Saeed

Active Member
Licensed User
Longtime User
@lonleystar the last update is working as it should be, there is still one thing when we scroll between pictures it reload the pictures for example if on my phone it shows first 6 pictures and move to the next 6 it will start loading as I will be moving and when I move back to previous 6 these will also start loading again? I have attached the video shot.

B4X:
GridView.initialize("GridView")
PGV.AddView(GridView,0dip,0dip,100%x,100%y)
GridView.CacheInMemory = False
GridView.CacheOnDisk = True
 

Attachments

  • screencapture.zip
    249.9 KB · Views: 193

lonleystar

Well-Known Member
Licensed User
Longtime User

Hi , give me some time to check it.
 

Douglas Farias

Expert
Licensed User
Longtime User
@lonleystar
how can i use the
GridView3.ScaleType.Center Fit_CenterCenter and etc...??

im trying to use GridView3.ScaleType = GridView3.ScaleType.Fit_CenterCenter
but give
it.giuseppe.salvi.gridview.library.core.exception.B4AExceptionWrapper: You can not use [ ScaleType.Center_Crop or ScaleType.Center ]
 

Ionut Indigo

Member
Licensed User
Longtime User
I'm only having problems with scale types Center_Crop / Center, receiving the in-app error "You can not use [ ScaleType.Center_Crop or ScaleType.Center ]". There is no Fit_CenterCenter scale type, only Fit_Center.
And I'm having a issue with SetImageOnLoading / SetImageOnFail, I'm declaring them in Activity_Create, with the images set in the assets folder and i still get the default images.
 

deltacode

Member
Licensed User
Longtime User
Hi lonleystar,

I've been on vacation for 2 weeks and excitedly tried 3.40 but still the settext is not working correctly, have you an estimate to when this will be fixed ?

Cheers
 

deltacode

Member
Licensed User
Longtime User
as reported in post 158 in July:

add 2 gridviews to two different panels, both are initialized with 2 different names

use SetText and it changes the text to the same in both gridviews

also there for 2 different activities
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…