Android Question Using one timer for more than one record

Mehrzad238

Member
I wonder is it possible to use a time for 5 or 10 or more rows, like a recycler view or xcustomlistview or ...
I have a count down for almost every row I just want to know how to do this

something like this image

1588443112330.png

I attached the way I want to use countdown
 

Attachments

  • a6.zip
    2.1 KB · Views: 126
Last edited:

Mehrzad238

Member
ok, thanks for the reply @Erel

So I create a countdown long variable in onCreateViewHolder of my recycle view to I have unique millisecond for every row

my problem is with this Sub :

B4X:
Sub timerPishnahadat_Tick

    Dim t As Long = [COLOR=rgb(226, 80, 65)]Countdown [/COLOR]-DateTime.Now
    Dim sHours, sMinutes, sseconds As Int
    sHours = t / DateTime.TicksPerHour
    sMinutes = (t Mod DateTime.TicksPerHour) / DateTime.TicksPerMinute
    sseconds = (t Mod DateTime.TicksPerMinute) / DateTime.TicksPerSecond
    
End Sub

that I do not know how to make timerPishnahadat_Tick work separately for every row
and countdown long variable is not global anymore so how can I use it on Tick Sub

my guess is if I solve this:


and countdown long variable is not global anymore so how can I use it on Tick Sub

I had solved this too:

that I do not know how to make timerPishnahadat_Tick work separately for every row

I really could use your bits of help with this
 
Upvote 0
Top