Navigation bar question

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SteveB
Posts: 40
Joined: Mon Sep 30, 2019 4:49 pm

Navigation bar question

Post by SteveB » Fri Sep 01, 2023 6:07 pm

Hi All,

I'm updating an old app that was first created when devices had physical buttons, but now most devices use soft buttons on the navigation bar.

While you can hide the status bar in Livecode, you cannot hide the navigation bar.

The function working screenRect respects whether the status bar is visible or not, but ignores the navigation bar.

Now I know the reason for this but how do you design an app to miss the bar?

There is an immersive mode in Android, but LC have never implemented this. It was reported as a bug in 2014!

https://quality.livecode.com/show_bug.cgi?id=13041

I could estimate the size of the bar and make an allowance for it at the bottom of the screen. However, in the simulator the navigation bar is always at the bottom of the screen in both portrait and landscape modes, but on my Samsung phone the bar stays put and doesn't move when the screen rotates. This means that in portrait mode it is at the bottom, but in landscape mode it is on the right.

So to guarantee missing the bar and to have the app appear symmetrical I would have to leave equal areas top and bottom, and left and right, clear of any objects.

Does anyone have any better ideas?

Thanks
Steve

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Navigation bar question

Post by dunbarx » Fri Sep 01, 2023 7:47 pm

Not sure what you mean, and I do not use widgets.

Widgets have the "visible" property just like ordinary controls. They also have all the "rect", "top", etc. properties.

What do you need to do?

Or is this purely a mobile problem, since I do not do mobile?

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7239
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Navigation bar question

Post by jacque » Sat Sep 02, 2023 6:17 pm

dunbarx wrote:
Fri Sep 01, 2023 7:47 pm
Or is this purely a mobile problem, since I do not do mobile?
Hints:

Forum: Android deployment
"portrait mode",, "landscape mode"
"navigation bar"
"Samsung phone"
😂

Don't fret, I do this all the time.
Last edited by jacque on Sat Sep 02, 2023 6:23 pm, edited 1 time in total.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7239
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Navigation bar question

Post by jacque » Sat Sep 02, 2023 6:21 pm

The function working screenRect respects whether the status bar is visible or not, but ignores the navigation bar.
I'll have to test this but I was pretty sure the working screenrect accounted for both. If not I'd say it's a bug.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Navigation bar question

Post by dunbarx » Sun Sep 03, 2023 8:07 pm

Jacque,

Touche, sort of. I access new posts through the "Quick Links/New Posts" drop-down, and do not pay attention to the forum slot. :oops:

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7239
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Navigation bar question

Post by jacque » Sun Sep 03, 2023 10:48 pm

@Steve, you're right. I just did a few tests and this might be a bug. The screenrect accounts for the nav bar but not the status bar. The working screenrect accounts for the status bar but not the nav bar. However, when working on mobile it's more useful to use the rect of the card, which accounts for both.

Code: Select all

screenrect:          0,0,412,815
working screenrect   0,51,412,867
rect of this card    0,0,412,816
On my Pixel 7, "816" is the top of the nav bar. "0,0" is the top left corner below the status bar. I'm not sure why item 4 of the screenrect is one pixel shy of the card rect. Both work, it might be a rounding difference.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Android Deployment”