Android Question [SOLVED] a little problem with xCustomListView

sirjo66

Well-Known Member
Licensed User
Longtime User
Hello,
I have a little problem with xCustomViewList version 1.20
Please take a look at the attached project.
If you click on an even Item (0, 2, 4, 6, and so on), the app show a MsgBox and it work perfect,
but if you click on a odd Item (1, 3, 5, 7 and so on) the app call another activity, you click on OK, but the Item clicked show "pressed color" and don't change to normal color.
Is it a bug on xCustomListView ???

I try also with xCustomListView version 1.50 but no change

Many thanks
Sergio

P.S.: another question about xCustomListView:
if I want to add a CustomListView on an Activity, how can I do it ??
This code don't work:
B4X:
Sub Globals

   Dim clv As CustomListView
  
End Sub

Sub Activity_Create(FirstTime As Boolean)

   clv.Initialize("", "clv")
   Activity.AddView(clv.AsView, 0, 0, 100%x, 100%y)
  
End Sub
 

Attachments

  • clv.zip
    13.9 KB · Views: 160
Last edited:

LucaMs

Expert
Licensed User
Longtime User
I don't know why and I have not time now to study cvl but you can solve the problem writing Sleep(200) before StartActivity. [most likely this command should be inserted in the source of clv.]

if I want to add a CustomListView on an Activity, how can I do it ??
The initialization method must not be called directly. I think a routine to add a clv by code is not part of the current clv. It is possible to create it (as mentioned, time...).

You can learn how to do it studying the code of other customviews that can be added both by Designer and code.
 
Last edited:
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
I don't know why and I have not time now to study cvl but
...but I did it, because I'm too curious

I should write this in the related thread but I'm sure Erel will read this post.
Lines 392-393 of CLV must be inverted:

Original:
B4X:
Sleep(200)
SenderPanel.SetColorAnimated(200, PressedColor, clr)

Correct:
B4X:
SenderPanel.SetColorAnimated(200, PressedColor, clr)
Sleep(200)

Then you don't need to add Sleep in your code, @sirjo66
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…