Android Question hiding items from WheelView if number gone over 9999 seconds

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

I am using the WheelView - https://www.b4x.com/android/forum/threads/wheelview-library.17028/#content

I have made it so it has 3 WheelViews.

First WheelView is for hours.
Second WheelView is for minutes.
Third WheelView is for seconds.

I am then making it convert it to seconds after the selection is made.
For Example:
Select 1 hour, 5 minutes, 10 seconds would become 3910

So far I have this part working.

However, the maximum I want it to be 9999 seconds.

So in the above example 3910 is OK since it's below 9999.

So if the user selected 2 hours, 46 minutes, 39 seconds, then I am trying to work out how to remove 3-23 hours, 47-59 minutes, 40-59 seconds from the list so the user can't select it.

But if the user changes it from 2 hours to 1 hour, then minutes 1-59 and 1-59 should then appear again.

Can't seem to work out a formula to work out if the selection is more than 9999 seconds, and then to hide other items in the lists so the user can't select the item when it has gone over the 9999 seconds.

Any ideas ?
 

AnandGupta

Expert
Licensed User
Longtime User
Instead of hiding and showing, which in fact is complex; show message that can not allow more than 9999 seconds, ask to select again.

Regards,

Anand
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Can't seem to work out a formula to work out if the selection is more than 9999 seconds,
Surely I'm missing something since a simple formula is : hours * 3600 + minutes * 60 + seconds.
You seem to plan a continous "redrawing" of each wheel based on the current selection on the others.
 
Upvote 0
Top