Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Statusbar shows white text on almost-white background - unreadable
Started by henrik5 Jul 06 2018 04:35 AM

5 replies to this topic
statusbar background readability
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

henrik5

[GLOBAL: userInfoPane.html]
henrik5
  • Contributor

  • 245 posts
  • Corona SDK

See the attached screenshot from an Android 8.1.0 phone

 

I tried changing from display.setStatusBar(display.DefaultStatusBar) to display.setStatusBar(display.DarkStatusBar) to no avail.

 

The background color is the same as the "navbar", but obviously the OS doesn't know it's anything more than a rect in a displaygroup.

So it's very curious, since I set display.setDefault("background",0).

Edit: I did draw behind the statusbar. Since I didn't request a transparent statusbar, I thought this was safe.

 

So what remains is a side note that the Corona Simulator doesn't display a statusbar at all if an Android model is chosen, and if an Iphone model is chosen to preview with, Dark and Default statusbars don't show light statusbar text against the new black background.

Attached File  Screenshot_20180706-141312.png   112.9KB   0 downloads



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,578 posts
  • Corona Staff

Have you tried the status bar sample app in SampleCode/Interface/StatusBar and cycled through the various status bar options there? Android is using new names for their status bars today.

 

Rob



[TOPIC: post.html]
#3

henrik5

[GLOBAL: userInfoPane.html]
henrik5
  • Contributor

  • 245 posts
  • Corona SDK

Thx Rob. Unfortunately I can't find a setting there that will do what I want. Strangely, LightTransparentStatusBar seems to do what I want, but makes Corona SDK's app screen overlap the system buttons. See screenshot from the StatusBar sample app, taken on a Nexus 6P running Oreo 8.1.0.

DefaultStatusBar will behave differently and overlap the top of the screen workspace, where typically there's a Back button or Menu button, which is why I can't use it for non-game apps.

Attached File  Screenshot_20180806-132303.png   190.32KB   0 downloads

This is my config.lua:

local newh=math.floor(320*display.pixelHeight/display.pixelWidth)

application = {
content = {
width = 320,
height = newh, 
scale = "letterBox",
fps=60,
},




}
 

If I subtract display.topStatusBarContentHeight from newh, it removes "too much"; there's more black space at top and bottom than it should be, and it seems it centers the display vertically, which means that even if I calculate the amount to subtract, I can never use the full space between the statusbar and the system buttons.

I suppose I could use the default statusbar, and modify all the views to put a black strip behind it and adapt the screen content to suit for each one. Will this work the same on Iphone and Ipad, if I read the status bar height dynamically?

If the behavior is fixed/changed, then of course I'd have to do the same work again, or at least put some conditional to do the strip and moving content or not. If there's a good way to solve this, I'm very interested since I did all the views and didn't check on device until nearing completion. Cheers.

It seems to me like if you subtract half the status bar height (as reported) and align the top of the application content area to the bottom of the status bar, it would display correctly/as expected on devices.



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,578 posts
  • Corona Staff

Have you tried testing the various androidSystemUiVisibitlity buttons in combination with the status bar settings?

 

Rob



[TOPIC: post.html]
#5

henrik5

[GLOBAL: userInfoPane.html]
henrik5
  • Contributor

  • 245 posts
  • Corona SDK

I did try all combinations as you suggested, in case there was a magic one, but those settings just keep or remove the system buttons. (The bottom 3 ones in the screenshots.)

So, I think the content area isn't set correctly for at least darkTransparent and lightTransparent.



[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,578 posts
  • Corona Staff

It seems to work fine on my Nexus 9 tablet, but I'm running Android 7. I'm asking if anyone on the team has a 6P with Oreo and see if they can reproduce the problem.

 

Rob




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: statusbar, background, readability