You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by chris_d_k <ck...@christiankiefer.de> on 2015/03/04 14:57:38 UTC

Use styles for another applicationDPI possible?

Hi I am develloping a flex mobile App... I looks great on a nexus 4.7 but not
on the huge Sony Xperia Z Ultra (6 Inch). Is it possible to use for a big
Phablet or Tablet the css styles for another applicationDPI as the device
actually has or can I manipulate the
FlexGlobals.topLevelApplication.applicationDPI for this case in any way?

Best regards

Christian



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Use-styles-for-another-applicationDPI-possible-tp9732.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Use styles for another applicationDPI possible?

Posted by Deepak MS <me...@gmail.com>.
These may help you:

http://help.adobe.com/en_US/flex/mobileapps/WS19f279b149e7481c682e5a9412cf5976c17-8000.html#WS19f279b149e7481c217eb0ed12cf4f2cdf1-8000

http://flex.apache.org/asdoc/mx/core/RuntimeDPIProvider.html

On Wed, Mar 4, 2015 at 7:27 PM, chris_d_k <ck...@christiankiefer.de> wrote:

> Hi I am develloping a flex mobile App... I looks great on a nexus 4.7 but
> not
> on the huge Sony Xperia Z Ultra (6 Inch). Is it possible to use for a big
> Phablet or Tablet the css styles for another applicationDPI as the device
> actually has or can I manipulate the
> FlexGlobals.topLevelApplication.applicationDPI for this case in any way?
>
> Best regards
>
> Christian
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Use-styles-for-another-applicationDPI-possible-tp9732.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Use styles for another applicationDPI possible?

Posted by Greg Dove <gr...@gmail.com>.
In the past I have have had issues with accurate calculation of screen
sizes/diagonals from AIR on android with certain devices.
I definiitely recall issues with this on kindle devices where we had a
cutoff of 7 inches for tablet layout vs. phone layout and the actionscript
value was not accurate leading to a phone classification when the device
was 7 inches on the diagonal. The actionscript Capabilities screenDPI value
was wrong and led to a lower diagonal result than was actually the case.

I ended up writing an extension to get the android values for x_dpi and
y_dpi from this android class:
http://developer.android.com/reference/android/util/DisplayMetrics.html:

Once I had these in actionscript, all was well.




Greg Dove
Dove Software Development Ltd
http://greg-dove.com

On Thu, Mar 5, 2015 at 2:21 PM, kevin.godell <ke...@gmail.com> wrote:

> Your best option might be to use some css and target the screen diagonal
> size:
>
> @media (-flex-min-device-diagonal: 6in) {
>
>         s|ActionBar s|Group#titleGroup s|Label.title {
>                 fontSize : 40;
>         }
> }
>
> Or maybe you can create a top level variable and calculate the screen
> diagonal when the app is created, and use that value to derive a multiplier
> that you can use to size some objects with properties that are not affected
> by css:
>
> Number(MediaQueryParser.instance.flexDeviceDiagonal)/Capabilities.screenDPI
> gives the diagonal inches of screen. I used mediaqueryparser because it
> will
> have correct size even when debugging on computer.
>
> And yet another option would be to use this screen diagonal size and set
> some custom states like phonePortrait or phabletLandscape to further layout
> control of the content.
>
> Personally, I incorporate these 3 techniques in my current project that is
> designed for android and ios devices, including phone, phablet, and tablet.
>
>
>
> -----
> .
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Use-styles-for-another-applicationDPI-possible-tp9732p9745.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Use styles for another applicationDPI possible?

Posted by "kevin.godell" <ke...@gmail.com>.
Your best option might be to use some css and target the screen diagonal
size:

@media (-flex-min-device-diagonal: 6in)	{
	
	s|ActionBar s|Group#titleGroup s|Label.title {
		fontSize : 40;
	}
}

Or maybe you can create a top level variable and calculate the screen
diagonal when the app is created, and use that value to derive a multiplier
that you can use to size some objects with properties that are not affected
by css:

Number(MediaQueryParser.instance.flexDeviceDiagonal)/Capabilities.screenDPI
gives the diagonal inches of screen. I used mediaqueryparser because it will
have correct size even when debugging on computer.

And yet another option would be to use this screen diagonal size and set
some custom states like phonePortrait or phabletLandscape to further layout
control of the content.

Personally, I incorporate these 3 techniques in my current project that is
designed for android and ios devices, including phone, phablet, and tablet.



-----
.
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Use-styles-for-another-applicationDPI-possible-tp9732p9745.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.