Bug 43429 - Slider with minimum greater than 0 gets incorrect bound value on Android
Summary: Slider with minimum greater than 0 gets incorrect bound value on Android
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.1
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-08-16 18:32 UTC by E.Z. Hart [MSFT]
Modified: 2017-02-03 17:24 UTC (History)
4 users (show)

See Also:
Tags: Android ac
Is this bug a regression?: ---
Last known good build:


Attachments
Repro project (279.26 KB, application/x-zip-compressed)
2016-08-16 18:32 UTC, E.Z. Hart [MSFT]
Details

Description E.Z. Hart [MSFT] 2016-08-16 18:32:22 UTC
Created attachment 17055 [details]
Repro project

On Android, a slider with its Value property databound gets the incorrect value if the Minimum property is set to a value greater than zero. If the Minimum property is set to zero, the databinding works as expected.

To reproduce:
Run the attached project on Android. The top Slider has a Maximum value of 10 and a Minimum value of 1; the view model has the value set to 5. The Label above the Sliders is also bound to the value from the ViewModel - instead of displaying 5 as expected, it displays 4.996.

The bottom Slide is bound to the same value but has a Minimum of zero - the Slider appears to display the correct value (halfway).
Comment 1 adrianknight89 2016-09-25 03:56:31 UTC
The problem is Control.Progress is an int in the renderer. As the slider moves, progress will only show int values. This results in precision loss when Value is being calculated.
Comment 2 adrianknight89 2016-09-25 04:46:02 UTC
See https://github.com/xamarin/Xamarin.Forms/pull/378
Comment 3 Rui Marinho 2016-12-19 12:46:42 UTC
Should be fixed in 2.3.4-pre2
Comment 4 Parmendra Kumar 2017-02-03 17:24:45 UTC
I have checked this issue with Xamarin.Forms 2.3.4.184-pre1 and observed that this issue as been fixed with Android hence marked this issue as Verified Fixed.
But I am still getting issue with WindowsPhone/UWP so I have filed separate issue for the same.
Bug: https://bugzilla.xamarin.com/show_bug.cgi?id=52292

Note You need to log in before you can comment on or make changes to this bug.