I am currently developping a set of custom components that follow the material design guidelines (https://material.io/guidelines/). To this end, I needed to handle the dp (and sp for fonts) mesurement unit (https://material.io/guidelines/layout/units-measurements.html#units-measurements-pixel-density). As dp are density independent, like milimeters (1mm ~= 6.299dp), I take a look at the way CN1 was handeling mm. I was a bit surprised by the fact that it uses density ranges (like the density in android DisplayMetrics: https://developer.android.com/reference/android/util/DisplayMetrics) to approximate millimeters distances whereas, on some platforms, most precise informations are available and could be used (like xdpi and ydpi on android for example). I think an improvment would be to use these more precise mesures, when available (and to default to the current way of converting mm to physical pixels when not), to compute mm distances. Also I think supporting the dp and sp units in layout constraints would be desirable as most android developpers (and beyond, as material design is becoming a standard for mobile GUIs ) are familiar with those. What do you think?
-- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at https://groups.google.com/group/codenameone-discussions. To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/4c4c8a87-e441-4899-8235-b92b5d1aeec0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
