Is there a way to set dynamic default values for the custom view properties in the designer ?
I have default values that are set to something like 16 * BA.getDensity. They cannot be set to a constant.
???
Yes I need it. I set some default values to the value returned by the system and I need to express them in pixels, like in my example. My users expect to set a divider height or a minimum distance for a swipe gesture with a value like 1%y or 3dip. It's what they are used to with B4A.
Note that the question concerns only properties that has no relation with the layout or the screen.
I want to be consistent with the values set by default when creating the view by code but it seems I cannot for now.
Ok, but my problem is to set the default values when they are not constants, when they are based on system settings or computations. By default, my minimum distance for the swipe gesture, for example, is the value set by the OS. Setting it to 0 because I cannot read the value in the designer is stupid, so I'm stuck. I have to remove the property from the designer...
The same layout file will be loaded on different devices with different versions. It doesn't make sense to read the default value of a specific device.
You have two options:
1. Decide that a specific value such as -1 behaves as the default value.
2. Add a Boolean field that if set then the default value will be used (and the other field will be ignored).
You will be able to set the default value in the library code.