B4J Library [B4X] [XUI] [B4XLib] SD_ShopListView

netsistemas

Active Member
Licensed User
Longtime User
Attach a sample with error .
To use:
- Install
- Open and press upper button to DOWNLOAD IMAGEN from url (when finish, the app are close).
- Reopen app and press button VIEW.


for load with no error:
comment this code in loadimages:

B4X:
Private Sub LoadImages
    
    
    ShopListView1.ButtonAddVisible = False
    ShopListView1.ButtonExitVisible = False
    
    Dim Lista As List
    Lista = File.ListFiles(File.DirInternal)
    Lista.sort(True)
    Dim Fotos As Long
    
    For f = 0 To Lista.Size - 1
        Dim FN As String
        FN = Lista.Get(f)
        
        If FN.EndsWith("jpg") Then
            '    File.Delete(File.DirInternal,FN)
            ShopListView1.AddItem($"ID${f}"$ ,xui.LoadBitmap(File.DirInternal,FN ),FN,FN,$"Price: ${Rnd(20,100)}.00"$)
            Fotos = Fotos + 1
        Else
            Log(FN)
        End If
    Next
    
'    For i=0 To 17
'        ShopListView1.AddItem($"ID${i}"$ ,xui.LoadBitmap(File.DirAssets,$"${i}.jpg"$),$"Shoe model ${Chr(Rnd(65,90))}${Rnd(1000,9999)}"$,"Description shoes",$"Price: ${Rnd(20,100)}.00"$)
'    Next


    ShopListView1.Invalidate
    
    'dont do this... crack!
    'when?
    'COMMENT THIS LINEA to get NO eror.
    ShopListView1.TurnToList
End Sub


the error with line are uncommend is:

shoplistview_visualizegrid (java line: 2051)
jaa.lang.ArithmeticException: divide by zero
...
 

Attachments

  • ShopListDemo.zip
    6.3 KB · Views: 197

netsistemas

Active Member
Licensed User
Longtime User
i update the photos in internet (other zip) and now, all is ok.
no error are returned. (all photos are the same!!)
 

amorosik

Expert
Licensed User
Now library file is visible and downloadable

Using the library and the example in the first post, with the images of netsistemas (23 jpg files of 120 Kbytes each) I must note that it is impossible to use the list
In the sense that trying to scroll through the various articles, scrolling does not occur, without reporting any errors
While using the grid scrolling occurs correctly
 

netsistemas

Active Member
Licensed User
Longtime User
I view/have this error executing in one old table: (view logs in b4x)
(in me phone are ok)
Downsampling image due to lack of memory.
Downsampling image due to lack of memory.; 4
Downsampling image due to lack of memory: 8
....
and finally crack.
but, this ocurreme in other proyect.
memory problem!!

in other situation (i don't remeber) a view other error: division by cero.
 

Attachments

  • errpr.jpg
    140.8 KB · Views: 176
Last edited:

netsistemas

Active Member
Licensed User
Longtime User
change the image load method , some like this:
B4X:
ShopListView1.AddItem($"ID${f}"$ ,xui.LoadBitmapResize(File.DirInternal,FN,150,150,True  ),FN,FN,$"Price: ${Rnd(20,100)}.00"$)

LoadBitmapResize instead of LoadBitmap(i put 150, but i don't know what is the ideal size)
 

Star-Dust

Expert
Licensed User
Longtime User
Note: In the asset file you must always put the empty.png file. The file can be found in the examples. If not inserted, the library crashes.
 

Star-Dust

Expert
Licensed User
Longtime User
It is not necessary to automatically resize.
Your example does not crash if you enter empty.png. But slow down a lot if you put the list.

At the moment I cannot establish the reason for this excessive memory absorption.
Your original request was a grid, only use it with grid until I can diagnose the problem
 

Star-Dust

Expert
Licensed User
Longtime User
Update 0.07
  • FilterVisible As Boolean (Only Write)
  • Fix Bugs
 

Theera

Well-Known Member
Licensed User
Longtime User
Hi Star-Dust,
How I know the filter editText parameter name? How can I edit Label of filter to be my language?
Please answer to me.(You're one of my Idols,I would like to be good at coding alike you ,but I'm not.)

Best Regards,
Theera
 

swamisantosh

Member
Licensed User
Longtime User
Hi Star-Dust, I getting this error in B4j, it works fine with B4A
B4J Version: 9.30
Parsing code. (0.09s)
Java Version: 8
Building folders structure. (0.02s)
Compiling code. Error
Error compiling program.
Error description: Unknown member: textsize
Error occurred on line: 861
T.TextSize=14
Word: textsize
 

Star-Dust

Expert
Licensed User
Longtime User
Update 0.08
  • fix bugs B4j
  • Added FillterHint As String ' you can customize the Hint text for the filter
  • FilterFont As B4XFont ''you can customize the Font Hint-text for the filter
 

Theera

Well-Known Member
Licensed User
Longtime User
Hi Star-Dust,
I would like to disturb you ,how do I know parameter of edittext as filter. it will be completed my learning code tutorial how tranfer parameter between APP1 and APP2.
I can't change filter in edittext 's box.
I hope your kindness help me learning code.

Best Regards,
Theera
 

netsistemas

Active Member
Licensed User
Longtime User
Surely the developer offers you a better solution.
But you can try to access the controls that are embedded through code similar to this
B4X:
    'this make NO VISIBLE  controls,'
    ShopListView1.GetBase.GetView (5) .Visible = False
    ShopListView1.GetBase.GetView (4) .Visible = False
    ShopListView1.GetBase.GetView (0).Visible  = False
    
    'may be somenthin like this'
    control =  ShopListView1.GetBase.GetView (5)    'or 4 or 3 or 2...'
    'and then:
    control.property = somthing
    'controls.text = ""
    'etc...
 

Star-Dust

Expert
Licensed User
Longtime User
In the next update you will be able to access the filter field.
 

Theera

Well-Known Member
Licensed User
Longtime User
In the future,If we set FilterSearchText =ProductA+ProductB and then it can show all of them(Product A and Porduct B). I' m sorry my English.
 

Star-Dust

Expert
Licensed User
Longtime User
Update 0.11
  • Fix Bugs
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…