Java Question Float value resolution problem in a Custom View

agraham

Expert
Licensed User
I have the following Property description in DesignerProperties of a Custom View

B4X:
@Property(key="CircleRadius", displayName="Circle Radius", defaultValue="0.003", fieldType="Float", minRange= "0", maxRange = "0.5", description="Factor between 0 and 0.5 of the width of the view if EnableCircleScale is False or of the full image if EnableCircleScale is True"),
Meaningful values for this property range from 0.001 up to 0.125 with a resolution of at least three decimal places. Unfortunately the the designer rounds the display of any value entered to a single decimal place so in practice it usually ends up displaying "0.0" which is not very helpful as you can't see the current value :(

Is there a way to increase the displayed resolution of the value?
 

agraham

Expert
Licensed User
It's "Float" in Erel's example RatingBarWrapper I have used as an example so it doesn't mattter.

More information. The problem is related to the value of "maxRange". If it is set to "1" or less the display is restricted to a single decimal point. Setting it to "1.1" seems to allow unlimited decimals. I guess I had better change to percentage values when it might work OK.
 

agraham

Expert
Licensed User
Yup, percentage values with maxRange now set to 50 will work for me, but it's a pity as I use factors between 0 and 1 elsewhere as I regard them as more intuitive and this now breaks that convention as a special case.

EDIT: Second thought. I'll just set maxRange to 1.1 as its not important to have an upper limit anyway.
 
Top