Navigation bar question
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Navigation bar question
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
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
-
- VIP Livecode Opensource Backer
- Posts: 9751
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Navigation bar question
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
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
-
- VIP Livecode Opensource Backer
- Posts: 7258
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Navigation bar question
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
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 7258
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Navigation bar question
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.The function working screenRect respects whether the status bar is visible or not, but ignores the navigation bar.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9751
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Navigation bar question
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.
Craig
Touche, sort of. I access new posts through the "Quick Links/New Posts" drop-down, and do not pay attention to the forum slot.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 7258
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Navigation bar question
@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.
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.
Code: Select all
screenrect: 0,0,412,815
working screenrect 0,51,412,867
rect of this card 0,0,412,816
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com