I am using CLVSwipe in order to show actions at a listview. I edit code from CLVSwipe in order to show material icon:
I face two problems:
1) I can't set the button color because even i set:
it just get the default white color
2) I can't get the ActionText in order to do my delete/edit action on a clv Item
i recieve this: Action clicked: 1,
Material icons are shown correctly.
Thank you for your time.
B4X:
Private Sub CreateActionButtons (actions As List) As Int
ActionsPanel.RemoveAllViews
Dim LastX As Int = 0
For Each action As String In actions
Dim l As Label
l.Initialize("lbl")
Dim xlbl As B4XView = l
xlbl.Text = action
xlbl.Color = ActionColors.GetDefault(action, xui.Color_White)
xlbl.SetTextAlignment("CENTER", "CENTER")
xlbl.Font = xui.CreateMaterialIcons(20)
xlbl.TextColor = xui.Color_Black
Dim width As Int = Max(40dip, cvs.MeasureText(action, xlbl.Font).Width + 20dip)
ActionsPanel.AddView(xlbl, ActionsPanel.Width - width - LastX, 0, width, ActionsPanel.Height)
LastX = LastX + width
Next
Return LastX
End Sub
I face two problems:
1) I can't set the button color because even i set:
B4X:
swipe.ActionColors = CreateMap(Chr(0xE3C9): xui.Color_Red)
2) I can't get the ActionText in order to do my delete/edit action on a clv Item
B4X:
Sub Swipe_ActionClicked (Index As Int, ActionText As String)
Log($"Action clicked: ${Index}, ${ActionText}"$)
End Sub
i recieve this: Action clicked: 1,
Material icons are shown correctly.
Thank you for your time.