Hello,
If i add chips inside a clv item then "+2 chip" (or whetever number), is at the begining instead of the end, at the top of the first visible chip.
Here is the code CLV and PreoptimizedCLV:
Same behavior b4a and b4i
If i add chips inside a clv item then "+2 chip" (or whetever number), is at the begining instead of the end, at the top of the first visible chip.
Here is the code CLV and PreoptimizedCLV:
B4X:
Private Sub clvGym_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int)
For Each i As Int In PCLVgyms.VisibleRangeChanged(FirstIndex, LastIndex)
Dim item As CLVItem = clvGym.GetRawListItem(i)
Dim pnl As B4XView = xui.CreatePanel("")
item.Panel.AddView(pnl, 0, 0, item.Panel.Width, item.Panel.Height)
Dim gymData As gym = item.Value
'Create the item layout
pnl.LoadLayout("clvGym")
#if b4a
MediaManager.SetMediaWithExtra(pnl.GetView(0).GetView(0),$"${B4XPages.MainPage.downloadLink}?name=${gymData.photo}.jpg"$,"image/*",CreateMap(MediaManager.REQUEST_ROUNDIMAGE:True,MediaManager.REQUEST_HEADERS: CreateMap("command":"image","id": B4XPages.MainPage.user.id,"token":B4XPages.MainPage.user.token)))
#else
misc.DownloadAndSetImage(ImageLoader,gymData.bitmap,gymData.photo,gymData.id,pnl.GetView(0).GetView(0).tag)
#End If
pnl.GetView(0).GetView(1).Text = gymData.name
Private chipType As AS_Chips = pnl.GetView(0).GetView(2).Tag
chipType.ChipPropertiesGlobal.BackgroundColor = xui.Color_White
chipType.ChipPropertiesGlobal.TextColor = xui.Color_Black
For i = 0 To gymData.gymType.Size-1
If gymData.gymType.Get(i)<>"null" Then
chipType.AddChip(gymData.gymType.Get(i),misc.FontToBitmap(misc.Chr32(0xF1300),32,xui.Color_Black),"")
End If
Next
Sleep(0)
chipType.RefreshChips
cs.Initialize.Color(xui.Color_RGB(255,172,11)).Append($"★ $1.2{gymData.all_time_rating}"$).Pop.Append($" (${gymData.total_ratings})"$).PopAll
#if b4a
pnl.GetView(0).GetView(3).Text = cs '$"★ $1.0{gymData.all_time_rating} (${gymData.total_ratings})"$
#else
pnl.GetView(0).GetView(3).As(Label).AttributedText = cs
#End If
Next
#if b4a
MediaManager.TrimMediaCache
#End If
End If
End Sub
Same behavior b4a and b4i