Correctly determine y-position with/wihout status.bar

Hi guys,

Here’s what I notice. When using display.topStatusBarContentHeight, it will ALWAYS return a value even though the status bar is hidden. With this, i need an extra step to re-calculate the actual y-position depending on the status bar.

On my Android 4.1, the status bar is at the BOTTOM, which complicates stuff. See attached photos below. How to determine whether the status bar is on TOP or BOTTOM ? Not sure whether other Android versions will have the same issue.

I have read Android 3.x does not have a status bar.

All this will also affect the ‘height’.

Is there another way to correctly determine the status bar, instead of me writing an algo to calculate it ? On native Android java, it should be something like Gravity.TOP. (http://stackoverflow.com/questions/10076872/move-android-status-bar-in-ice-cream-sandwich)

Here is how I am currently doing it, but I don’t think it is good enough.

Thanks

-- Determine the actual origin, based on the whether status bar is there or not! function myScreenOriginY() local hasStatusBar = false local yPos = display.screenOriginY if myPreferences.isStatusBarHidden == false then hasStatusBar = true    end -- Android 3.x does NOT have status bar. Remove this height. -- MUST BE HERE! if system.getInfo( "platformVersion" ) ~= nil then if string.find(system.getInfo( "platformVersion" ), "3.") ~= nil then hasStatusBar = false end end if hasStatusBar == true then yPos = yPos + display.topStatusBarContentHeight end return yPos end

Anyone that have an idea to how to accomplish this ?

Appreciate if anyone has any idea on how to deal with this, as I am temporarily using ‘full screen’ mode to counter this issue.

Thx

Anyone that have an idea to how to accomplish this ?

Appreciate if anyone has any idea on how to deal with this, as I am temporarily using ‘full screen’ mode to counter this issue.

Thx