Greetings,
I built a CLV using this coding:
One of the views in the CLV item is called LabelSchedule. Elsewhere in my coding, the label will need to be changed to reflect a change in the schedule. I would like to change the text property of that label which happens to be at index number 3. For example I would like to change the text to "This is the new schedule...". I only want to change the text at that index. Can this be done without rebuilding the CLV?
The file attachment shows LabelSchedule in the Designer.
Thanks.
I built a CLV using this coding:
B4X:
Activity.LoadLayout("SongList") ' This layout also contains a custom list view.
CSelections.Initialize(clvSongList)
CSelections.Mode = CSelections.MODE_SINGLE_ITEM_PERMANENT
' Make panel slide down out of site.
'-----------------------------------
PanelMenu.SetLayoutAnimated(300, 0, Activity.Height, Activity.Width, _
Activity.Height)
' Add 10 items to the list view.
'-------------------------------
For intIndex = 0 To 9
' typValues will be used to store values into the Type elements for the list views.
'----------------------------------------------------------------------------------
Dim typValues As typListItemValues
' Adding items to the list view requires a Panel created in code.
'----------------------------------------------------------------
Dim p As B4XView = xui.CreatePanel("")
' This is the size for the panel and it will be animated.
'--------------------------------------------------------
p.SetLayoutAnimated(100, 0, 0, PanelSongList.Width, 200dip)
p.LoadLayout("SongListCard")
' Populate the views with values from the database.
'--------------------------------------------------
Select intIndex
Case 0
LabelSongTitle.Text = kvs.Get("Song1Title")
LabelSchedule.Text = kvs.Get("Song1Schedule")
If kvs.Get("Song1ScheduleIsActivated") Then
ImageViewSongIsActivated.Bitmap = _
LoadBitmap(File.DirAssets, "light-on-icon.png")
Else
ImageViewSongIsActivated.Bitmap = _
LoadBitmap(File.DirAssets, "light-off-icon.png")
End If
typValues.strSomeMoreText = "One"
Case 1
LabelSongTitle.Text = kvs.Get("Song2Title")
LabelSchedule.Text = kvs.Get("Song2Schedule")
If kvs.Get("Song2ScheduleIsActivated") Then
ImageViewSongIsActivated.Bitmap = _
LoadBitmap(File.DirAssets, "light-on-icon.png")
Else
ImageViewSongIsActivated.Bitmap = _
LoadBitmap(File.DirAssets, "light-off-icon.png")
End If
typValues.strSomeMoreText = "Two"
Case 2
LabelSongTitle.Text = kvs.Get("Song3Title")
LabelSchedule.Text = kvs.Get("Song3Schedule")
If kvs.Get("Song3ScheduleIsActivated") Then
ImageViewSongIsActivated.Bitmap = _
LoadBitmap(File.DirAssets, "light-on-icon.png")
Else
ImageViewSongIsActivated.Bitmap = _
LoadBitmap(File.DirAssets, "light-off-icon.png")
End If
typValues.strSomeMoreText = "Three"
End Select
typValues.LabelSongTitle = LabelSongTitle.Text
ImageViewPlayPauseSong.Tag = intIndex
' This is where the item row is added to the list view.
' Each list item has a set of Type structure elements associated with it.
'------------------------------------------------------------------------
clvSongList.Add(p,typValues)
Next
One of the views in the CLV item is called LabelSchedule. Elsewhere in my coding, the label will need to be changed to reflect a change in the schedule. I would like to change the text property of that label which happens to be at index number 3. For example I would like to change the text to "This is the new schedule...". I only want to change the text at that index. Can this be done without rebuilding the CLV?
The file attachment shows LabelSchedule in the Designer.
Thanks.