Slider resolution fixed at 100 units?

183 views
Skip to first unread message
Assigned to kkas...@gmail.com by taifu...@gmail.com

A2Zog

unread,
Aug 20, 2014, 3:46:38 PM8/20/14
to mitappinv...@googlegroups.com
When I introduce a slider into my app, it seems that the resolution is fixed at 100 units, i.e. if I set the minimum to 0 and the maximum to 364, the values I get back are all multiples of 3.64.

Can anyone confirm/deny?

How can this be changed? i.e. if I want to pick a day of the year, I need a resolution of 365, but there doesn't seem to be any setting controlling this even if my screen resolution is much larger than this, i.e. 1920 or 1200 depending on landscape or portrait.

Enis

unread,
Aug 20, 2014, 4:10:13 PM8/20/14
to
Simple calculation, isn't it? 

365 = 100%.  Each day is .2739726th of a standard year, little less in leap years.

aehe...@gmail.com

unread,
Aug 20, 2014, 5:01:22 PM8/20/14
to mitappinv...@googlegroups.com
A simple calculation, yes, although I think your decimal point is misplaced.

Sorry, but I don't seem to understand the answer you're offering.

M. Hossein Amerkashi

unread,
Aug 20, 2014, 5:34:31 PM8/20/14
to mitappinv...@googlegroups.com
I think by resolution, You mean step. If that is what you mean, then you are correct. Android SDK provides only 0 to 100 for slider. We are providing flexibility do that you can provide minimum and maximum. We then automatically compute steps and provide you the value of thumb position as it is dragged.
So, no. You can't change step.


Hossein.
Http://Amerkashi.WordPress.com

A2Zog

unread,
Aug 23, 2014, 3:35:21 PM8/23/14
to mitappinv...@googlegroups.com
My understanding of the underlying Android SDK is that it takes a range from 0 - <some max integer value> and returns an integer value within that range, not necessarily a percent of that range?

If that understanding it true, instead of App Inventor using the range  0 - 100, why doesn't it make the range 0 - 10000 (for example for 2 decimal place precision). Then the underlying SDK could return integer values in that range, which App Inventor could then use as it currently does, but providing greater precision? This would provide full precision comparable to that of the underlying devices and SDK.

Thoughts? 
Reply all
Reply to author
Forward
0 new messages