Hello community
Attached a small ListView
With (ListView1_ItemLongClick) I can delete individual entries
However, what I am missing is the effect of highlighting, or the event on a click
So a short flash, brighten up.
Could somebody give a guy or even adjust the sample program
Attached a small ListView
With (ListView1_ItemLongClick) I can delete individual entries
However, what I am missing is the effect of highlighting, or the event on a click
So a short flash, brighten up.
Could somebody give a guy or even adjust the sample program
B4X:
#Region Module Attributes
#FullScreen: False
#IncludeTitle: True
#ApplicationLabel: B4A Exemple
#VersionCode: 1
#VersionName:
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
Type tListItem(Eintrag1 As String, Eintrag2 As String)
Dim ListItems As List
Dim ListView1 As ListView
Dim GtrX(99) As String
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Create(FirstTime As Boolean)
ListView1.Initialize("ListView1")
Activity.AddView(ListView1, 0, 20, 100%X, 88%Y)
ListItems.Initialize
ListView1.SingleLineLayout.Label.Color = Colors.White
ListView1.SingleLineLayout.ItemHeight = 100
ListView1.SingleLineLayout.Label.TextSize = 16
ListView1.SingleLineLayout.Label.Typeface = Typeface.MONOSPACE
ListView1.SingleLineLayout.Label.TextColor = Colors.Black
' ListView1.SingleLineLayout.Label.Typeface = Typeface.DEFAULT_BOLD
LoadGTR
Dim i As Int
For i = 1 To 15
ListView1.AddSingleLine(" " & GtrX(i))
Next
For Counter = 0 To ListItems.Size - 1
Dim ListItem As tListItem
ListItem = ListItems.Get(Counter)
ListView1.AddSingleLine(ListItem.Eintrag1)
Next
End Sub
Sub ListView1_ItemClick (Position As Int, Value As Object)
Dim GetrIndex As Int
Dim GetrText As String
GetrIndex = Position
GetrText = Value
End Sub
Sub ListView1_ItemLongClick (Position As Int, Value As Object)
Dim GetrIndex As Int
Dim GetrText As String
GetrIndex = Position
GetrText = Value
ListView1.RemoveAt(GetrIndex)
End Sub
Sub LoadGTR
GtrX(1) = "Cola 0,2l 2.20"
GtrX(2) = "Fanta 0,2l 2.20"
GtrX(3) = "Sprite 0,2l 2.30"
GtrX(4) = "Pils 0,3 2.50"
GtrX(5) = "Export 0,3 2.90"
GtrX(6) = "Desperados 3.50"
GtrX(7) = "Riesling Schorle 0,5 3.20"
GtrX(8) = "Weisßherbst Schorle 0,5 3.20"
GtrX(9) = "Burgunder 0,2 2.80"
GtrX(10) = "Café 1.80"
GtrX(11) = "Espresso 1.80"
GtrX(12) = "Milchcafé 2.50"
GtrX(13) = "Latte Macchiato 2.50"
GtrX(14) = "Cappuccino 2.50"
GtrX(15) = "Heiße Schokolade 2.50"
End Sub