>I like device-diagonal - especially as it would avoid the need for a style >update.
I like it too. It's so obvious ;-) > would be good to have this measurement available to the app in same way as > osVersion, eg: Platform.diagonalSizeInInches Good idea. Does it matter if it 's not bindable ? (this is because Platform is all static, so can't have any bindable props). Also, it will return a qualified object (CssDimension) with the following props: - value: Number - unit: String - pixelValue: int - compare operator - toString(). Good ? Maurice -----Message d'origine----- De : Lee Burrows [mailto:subscripti...@leeburrows.com] Envoyé : mercredi 19 mars 2014 19:29 À : dev@flex.apache.org Objet : Re: Advice needed on FLEX-33994 I like device-diagonal - especially as it would avoid the need for a style update. Also, would be good to have this measurement available to the app in same way as osVersion, eg: Platform.diagonalSizeInInches On 19/03/2014 14:48, Maurice Amsellem wrote: > I agree it's mainly for mobile. > >> see if you can put in a flag so folks can get back to the old behavior: > I propose the new "device-diagonal" selector, which doesn't change with the > orientation. > > So the test could be: > - if device-width or device-height is used, update styles on > orientation change > - if device-diagonal is used, don't update styles on orientation > - if no device-xxx is used, don't update styles on orientation change. > > WDYT? > > Maurice > > -----Message d'origine----- > De : Alex Harui [mailto:aha...@adobe.com] Envoyé : mercredi 19 mars > 2014 15:40 À : dev@flex.apache.org Objet : Re: Advice needed on > FLEX-33994 > > IIRC, pixel density is not reported accurately on the desktop, so computing > inches and cms will have a certain amount of inaccuracy. > > That said, see if you can put in a flag so folks can get back to the old > behavior if they find this one too slow, and go for it. Large desktop UI's > with tons of widgets could be slow, but the main point is for mobile where > there are probably fewer widgets at a time. > > -Alex > > > > On 3/19/14 7:32 AM, "Maurice Amsellem" <maurice.amsel...@systar.com> wrote: > >> Hi, >> >> I am preparing for https://issues.apache.org/jira/browse/FLEX-33994 >> ( media size CSS ) and have a few interrogations: >> >> 1) Specs: this is how I intend to implement the new media selectors: >> >> @media selectors: >> device-width, device-height >> >> Supports the following units: >> (no unit), px, pt, in, cm, dp >> - no unit / px => physical pixels >> - pt => pixels-equivalent at 72 ppi >> - cm & in => self explanatory >> - dp => pixels-equivalent at 160 ppi (bucket ppi) >> >> If I understand correctly the explanations from Justin, "dp" uses the >> bucket DPIs, not the real ppis. >> So I will use the real device ppi to compute pt, inch and cm pixel >> equivalent and bucket-ppi to compute the pixel equivalent for "dp" unit. >> >> 2) Supporting resize / orientation change: >> Ideally, when resizing the SWF (on desktop) or changing the device >> orientation / going full screen on mobile, the media queries should >> be re-evaluated, like in HTML, with potentially different results. >> >> I am not an expert of the Style Management in Flex, but I am worried >> that this would be very slow , especially on mobile, and may even >> break the application. >> >> Since the initial need was to be able to distinguish mobile / tablet >> / screen / tv, and there are other means of handling orientation >> change in the UI , I thought it could be acceptable to compute width >> / height independently of the actual device orientation (eg. always >> in portrait mode). >> >> Another possibility , which is not W3C, is to provide new >> "device-diagonal" measure, which is a common measurement for display >> sizes Eg. >> @media (max-device-diagonal: 5in) { >> /* phone css*/ >> } >> @media (min-device-diagonal: 5in) and (max-device-diagonal: 11in) { >> /* tablet css*/ >> } >> @media (min-device-diagonal: 11in) and (max-device-diagonal: 24in) { >> /* screen*/ >> } >> @media (min-device-diagonal: 24in) { >> /* TV*/ >> } >> What do you think? >> >> Maurice >> >> >> >> >> > -- Lee Burrows ActionScripter