B4A Library [B4X] [XUI] SD XUIView2

Dependence: SD CreativeBackground


SD_XUIView2

Author:
Star-Dust
Version: 0.16
  • B4XRangeSeekBar
    • Events:
      • ChangeValue (MinValue As Float, MaxValue As Float)
    • Fields:
      • Tag As Object
    • Functions:
      • AddToParent (PanelToAdd As B4XView, Left As Int, Top As Int, Width As Int, Height As Int) As String
      • BringToFront As String
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • GetBase As Panel
      • GetView (Index As Int) As B4XView
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • RemoveViewFromParent As String
      • RequestFocus As String
      • ReSetEvent (Callback As Object, EventName As String) As String
      • Rotate (AngleX As Float, AngleY As Float, AngleZ As Float) As String
      • SendToBack As String
      • SetColorBase (C As Int) As String
      • SetColorLevel (C As Int) As String
      • SetColorStick (C As Int) As String
      • Snapshot As B4XView
    • Properties:
      • Enable As Boolean
      • Height As Int
      • Left As Int
      • MaxValue As Float
      • MinValue As Float
      • Top As Int
      • Visible As Boolean
      • Width As Int
  • B4XTrimmer
    • Events:
      • ChangeValue (Value As Int)
      • TouchRelease (Value As Int)
    • Fields:
      • Tag As Object
    • Functions:
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • GetBase As Panel
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • Rotate (AngleX As Float, AngleY As Float, AngleZ As Float) As String
    • Properties:
      • Value As Int
  • xGridListView
    • Events:
      • ItemClick (Text As String, Value As Object)
      • ItemLongClick (Text As String, Value As Object)
    • Fields:
      • InfoFont As B4XFont
      • InfoTextColor As Int
      • SecondLineAlignment As String
      • SecondLineColor As Int
      • SecondLineFont As B4XFont
      • StepItem As Int
      • TextAlignment As String
      • TextColor As Int
      • TextFont As B4XFont
      • TimeAnimation As Int
    • Functions:
      • Add (Text As String, SecondLine As String, Info As String, ID As Object) As String
      • AddWithImage (Text As String, SecondLine As String, Info As String, ID As Object, Image As B4XBitmap, ImageToRight As Boolean) As String
      • Class_Globals As String
      • Clear As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • Initialize (Callback As Object, EventName As String) As String
      • InsertAt (Position As Int, Text As String, Info As String, ID As Object) As String
      • InsertWithImageAt (Position As Int, Text As String, SecondLine As String, Info As String, ID As Object, Image As B4XBitmap, ImageToRight As Boolean) As String
      • Invalidate As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • removeAt (Pos As Int) As String
      • ScrollToBottom As String
      • SetCol (N As Int) As String
      • setInfo (ID As Object, Text As String) As String
      • setSecondLine (ID As Object, Text As String) As String
      • setSingleItemColorBackground (ID As Object, Color As Int) As String
      • setText (ID As Object, Text As String) As String
    • Properties:
      • Base As B4XView [read only]
      • ElementBackgroundColor As Int
      • Height As Int
      • ItemCornerRadius As Int
      • ItemCornerWidth As Int
      • ItemHeight As Int
      • ItemWidth As Int
      • LatelarBarWidth As Int
      • Left As Int
      • MaxCol As Int [read only]
      • Size As Int [read only]
      • Tag As Object
      • Top As Int
      • Width As Int
      • WidthbetweenItem As Int
  • xListView
    • Events:
      • ItemClick (Text As String, Value As Object)
      • ItemLongClick (Text As String, Value As Object)
    • Fields:
      • HeightItem As Int
      • InfoFont As B4XFont
      • InfoTextColor As Int
      • SecondLineAlignment As String
      • SecondLineColor As Int
      • SecondLineFont As B4XFont
      • StepItem As Int
      • TextAlignment As String
      • TextColor As Int
      • TextFont As B4XFont
      • TimeAnimation As Int
    • Functions:
      • Add (Text As String, SecondLine As String, Info As String, ID As Object) As String
      • AddWithImage (Text As String, SecondLine As String, Info As String, ID As Object, Image As B4XBitmap, ImageToRight As Boolean) As String
      • Class_Globals As String
      • Clear As String
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • Initialize (Callback As Object, EventName As String) As String
      • InsertAt (Position As Int, Text As String, Info As String, ID As Object) As String
      • InsertWithImageAt (Position As Int, Text As String, SecondLine As String, Info As String, ID As Object, Image As B4XBitmap, ImageToRight As Boolean) As String
      • Invalidate As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • removeAt (Pos As Int) As String
      • ScrollToBottom
    • Properties:
      • Base As B4XView [read only]
      • ElementBackgroundColor As Int
      • Height As Int
      • ItemCornerRadius As Int
      • ItemCornerWidth As Int
      • ItemHeight As Int
      • Left As Int
      • Size As Int [read only]
      • Tag As Object
      • Top As Int
      • Width As Int
      • WidthbetweenItem As Int


Video1.gif
Video2.gif
Video5.gif


1631459150791.gif
 

Attachments

  • xListView_Sample.zip
    45.6 KB · Views: 680
  • Sample1.zip
    15.3 KB · Views: 675
  • xGridListViewSample.zip
    121.2 KB · Views: 443
  • SD_XUIView2 0.16.zip
    34.6 KB · Views: 80
  • iSD_XUIView2 0.16.zip
    324.8 KB · Views: 50
  • jSD_XUIView2 0.16.zip
    35.9 KB · Views: 64
Last edited:

FrankDev

Active Member
Licensed User
Longtime User
I have another problem
when I click nothing happens

xgridlistview_sample

B4X:
Private Sub xListView1_ItemClick(Text As String,Value As Object)
    ToastMessageShow("Click " & Value,True)
End Sub
 

Star-Dust

Expert
Licensed User
Longtime User
Correct the sub name like this:
B4X:
Private Sub xGridListView1_ItemClick(Text As String,Value As Object)
    Log("Click " & Value)
End Sub
It was a typo. I corrected the example
 

FrankDev

Active Member
Licensed User
Longtime User
I have one more question

do I set
xGridListView1.ElementBackgroundColor = Colors.Gray

with 'xGridListView1.AddWithImage' the background is uniformly gray.

At
'xGridListView1.InsertWithImageAt' it is a gradient.

Can I change this with the shadow too ?
or the line around the button.
(there is a black line with width 1 pix ?)

regards
Frank
 

Star-Dust

Expert
Licensed User
Longtime User
I'm not sure I understand what you want to achieve

Both AddWithImageAt and InsertWithImageAt get the same result, because the first inserts at the end of the list and the second at a precise position, but graphically nothing changes. The image refers to the Logo next to the text.

What exactly do you need to achieve?
 

FrankDev

Active Member
Licensed User
Longtime User
I put this at the very beginning

xGridListView1.ElementBackgroundColor = Colors.Gray

the backgrounds do not look the same.
with some there is a gradient
 

Star-Dust

Expert
Licensed User
Longtime User
Yes, it automatically inserts a gradient and shadow effect
 

Star-Dust

Expert
Licensed User
Longtime User
Update rel 0.12

  • Fixed bug in xGridLisrView class. Second Line Colors and Info now take effect
 
Last edited:

JGParamo

Active Member
Licensed User

Attachments

  • 1686886864335.png
    1686886864335.png
    4.3 KB · Views: 152

Star-Dust

Expert
Licensed User
Longtime User
Update rel 0.13

  • Fixed bug in xListView class. Second Line Colors and Info now take effect
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Update 0.15
  • Addedd ScrollToBottom to xListView and xGridListview
 

Star-Dust

Expert
Licensed User
Longtime User
Update 0.16
  • Added LatelarBarWidth to xGridListView
  • Fix bug
 

javiers

Active Member
Licensed User
Longtime User
I'll be adding a new view to the library soon.

A ListView that divides items into multiple columns of a predetermined width by design or code. Also the possibility to change the background of a single element of the list. It is always a ListView because it scrolls only vertically, but more elements will be arranged per row

As well as some xListView bug fixes

View attachment 112258


I can't get the background color of some items to remain the desired color. At the moment they have the design color again...

B4J:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
'    xGridListView1.ItemWidth=300dip
'    xGridListView1.ItemHeight=400dip
    'log("Num cols max (for 150dip) is:" & xGridListView1.MaxCol)
    xGridListView1.SetCol(2)
    
    For i=1 To 12
'        xGridListView1.AddWithImage($"Voce ${i}"$,"Second","info",i,xui.LoadBitmap(File.DirAssets,"sd.png"),True)
        xGridListView1.Add($"Voce ${i}"$,"Second","info",i)
        If (i Mod 2)=0 Then
            ' Es un número par
            xGridListView1.setSingleItemColorBackground(i,0xFFFF0000)
        Else
            'Es un número impar
            xGridListView1.setSingleItemColorBackground(i,0xFF00FF06)
        End If
    Next
End Sub

1730491099631.png


1730491134353.png
 
Top