App drawer top bar not correct size
App drawer top bar not correct size
I was just setting up lightning in landscape on my new OnePlus 6. I noticed that the top bar is missing it's top right corner. Because the on-screen navbar buttons are on top of it. I think the app drawer itself shows the correct width.
Btw, I am on Android 9. It looks to me that lightning draws the on-screen navbar much thicker/wider than Nova launcher.
Btw, I am on Android 9. It looks to me that lightning draws the on-screen navbar much thicker/wider than Nova launcher.
- Attachments
-
- Nova screenshot
- Screenshot_20190224-232734.jpg (336.82 KiB) Viewed 38352 times
-
- LL screenshot
- Screenshot_20190224-221519.jpg (524.05 KiB) Viewed 38363 times
Re: App drawer top bar not correct size
As of today I don't know how to detect that the nav bar is hidden or not And this is not something that can be tested on an emulator...
Re: App drawer top bar not correct size
You probably now this already,
Could it be, by comparing app-usable screen size with real screen size. I assume that navigation bar is present when app-usable screen size is smaller than real screen size. Then calculate navigation bar size. (This method works with API 14 and up.) I have no idea if it works because it was mentioned in a old(er) post some where.
Could it be, by comparing app-usable screen size with real screen size. I assume that navigation bar is present when app-usable screen size is smaller than real screen size. Then calculate navigation bar size. (This method works with API 14 and up.) I have no idea if it works because it was mentioned in a old(er) post some where.
- TrianguloY
- Posts: 109
- Joined: Thu Jan 24, 2019 9:46 am
Re: App drawer top bar not correct size
@Evelien Could you try this? (If you have time and want) I want to check something:
In the app drawer, long tap the background, settings (top right button in the popup), system bars, check 'navigation bar and content overlap' and set the 'navigation bar tint color' to transparent. (Before making the changes remember the current settings and post them here).
Then make the exact same second screenshot of your post (landscape, app drawer) and post it here too.
In the app drawer, long tap the background, settings (top right button in the popup), system bars, check 'navigation bar and content overlap' and set the 'navigation bar tint color' to transparent. (Before making the changes remember the current settings and post them here).
Then make the exact same second screenshot of your post (landscape, app drawer) and post it here too.
Re: App drawer top bar not correct size
@TrianguloY done.
Looks a little better, but the 3 dots in the top right corner are not clickable. But yeah those are under the navbar. So that's obvious.
Also added a screenshot of the settings view, just to show that that settings menu screen is calculated correctly. And the nav bar isn't too big in the settings menu.
So why is that calculated correct. Just thinking.
Looks a little better, but the 3 dots in the top right corner are not clickable. But yeah those are under the navbar. So that's obvious.
Also added a screenshot of the settings view, just to show that that settings menu screen is calculated correctly. And the nav bar isn't too big in the settings menu.
So why is that calculated correct. Just thinking.
- Attachments
-
- Screenshot_20190227-224054.jpg (548.44 KiB) Viewed 38331 times
-
- Screenshot_20190227-223730.jpg (198.26 KiB) Viewed 38331 times
- TrianguloY
- Posts: 109
- Joined: Thu Jan 24, 2019 9:46 am
Re: App drawer top bar not correct size
Thank you for the screenshots!
It is not exactly what I was expecting, but still interesting.
There are multiple things here:
1) the action bar is drawn behind the nav bar. I can understand it with the 'navigation bar and context overlap' (new screenshot) but it shouldn't happen without that setting (original screenshot). Maybe this is a different bug, the bar shouldn't be drawn under the navbar space, or at least the buttons shouldn't.
2) The status bar is not fully colored. In both screenshots (original and new) it has the same length, so in both cases it simply has less priority as the nav bar. Perhaps it can be extended too, but that can become confusing if you set different colors for both. Android itself does it this way (the nav bar extend to the top, the status bar is cut) so no issue here.
3) the nav bar size is incorrectly calculated. This is obvious in the original screenshot, not visible in the new one (because I told you to set the color to transparent, if you set it to semi-transparent you'll see that it has the exact wrong size. This is noticeable because of the status bar cut). This is the issue. The strange and difficult to try issue.
The way lighting works (based on my experiments) is to always set the content overlap option of the status bar and navbar and then add an extra view (like a colored rectangle) in that place, with the size of the bar. If you do have the context overlap enabled, this rectangle is simply drawn above the desktop view. If not, the desktop view stops at the rectangle. The size of the nabvar is incorrectly calculated in those strange cases. That's the issue here.
In the settings screen for example this is not the case, because the navbars are not set to content overlap, and the rectangles below are not drawn either. The bug doesn't happen, because there is no incorrectly sized rectangle.
This makes me wonder: @Pierrot, what about a 'nabvar fix' setting that will disable that content overlap (and the rectangle) so that it simply isn't wrong computed? You won't be able to colorize the bar or set the content overlap option, but better than a double sized bar, I think?
It is not exactly what I was expecting, but still interesting.
There are multiple things here:
1) the action bar is drawn behind the nav bar. I can understand it with the 'navigation bar and context overlap' (new screenshot) but it shouldn't happen without that setting (original screenshot). Maybe this is a different bug, the bar shouldn't be drawn under the navbar space, or at least the buttons shouldn't.
2) The status bar is not fully colored. In both screenshots (original and new) it has the same length, so in both cases it simply has less priority as the nav bar. Perhaps it can be extended too, but that can become confusing if you set different colors for both. Android itself does it this way (the nav bar extend to the top, the status bar is cut) so no issue here.
3) the nav bar size is incorrectly calculated. This is obvious in the original screenshot, not visible in the new one (because I told you to set the color to transparent, if you set it to semi-transparent you'll see that it has the exact wrong size. This is noticeable because of the status bar cut). This is the issue. The strange and difficult to try issue.
The way lighting works (based on my experiments) is to always set the content overlap option of the status bar and navbar and then add an extra view (like a colored rectangle) in that place, with the size of the bar. If you do have the context overlap enabled, this rectangle is simply drawn above the desktop view. If not, the desktop view stops at the rectangle. The size of the nabvar is incorrectly calculated in those strange cases. That's the issue here.
In the settings screen for example this is not the case, because the navbars are not set to content overlap, and the rectangles below are not drawn either. The bug doesn't happen, because there is no incorrectly sized rectangle.
This makes me wonder: @Pierrot, what about a 'nabvar fix' setting that will disable that content overlap (and the rectangle) so that it simply isn't wrong computed? You won't be able to colorize the bar or set the content overlap option, but better than a double sized bar, I think?
- TrianguloY
- Posts: 109
- Joined: Thu Jan 24, 2019 9:46 am
Re: App drawer top bar not correct size
Sorry for the testing, but if you want here is another thing to try!
In the app drawer settings, set the settings to:
Navigation bar and content overlap: checked
Status bar and content overlap: unchecked
Then, run this script from the app drawer
Edit: the code makes the navbar not transparent, the fix I was thinking in the previous post. To revert it you can restart the launcher or change one of the 'content overlap' settings.
In the app drawer settings, set the settings to:
Navigation bar and content overlap: checked
Status bar and content overlap: unchecked
Then, run this script from the app drawer
Code: Select all
bindClass("android.view.WindowManager");
var w=getAppDrawerScreen().getContext().getWindow();
w.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
w.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
Edit: the code makes the navbar not transparent, the fix I was thinking in the previous post. To revert it you can restart the launcher or change one of the 'content overlap' settings.
Re: App drawer top bar not correct size
Finally time to try but
where do I need to set this "; "?
A little typo error in the script?
where do I need to set this "; "?
A little typo error in the script?
- Attachments
-
- Screenshot_20190301-194604.jpg (256.59 KiB) Viewed 38312 times
- TrianguloY
- Posts: 109
- Joined: Thu Jan 24, 2019 9:46 am
Re: App drawer top bar not correct size
Hmm, I tested the script myself and it should work fine. Did you copied it exactly as shown? (All characters, all line breaks, no extra characters). Anyway, I modified the script a bit, just in case, copy it again (and if you still have an error share a screenshot of the editor with the pasted code)
Re: App drawer top bar not correct size
Thanks, this script is loading. Screenshot Uploaded
- Attachments
-
- Screenshot_20190301-202153.jpg (225.6 KiB) Viewed 38306 times
- TrianguloY
- Posts: 109
- Joined: Thu Jan 24, 2019 9:46 am
Re: App drawer top bar not correct size
Interesting. If you now click where the three dots should be, does it work? (You can change the 'navigation bar tint color' to transparent, perhaps it is better).
Re: App drawer top bar not correct size
When the script is active, the 3 dots menu works. Awesome.
I put a screenshot so you can see how it looks with transparent navigation bar set in lightning.
When I back out of the app drawer, the script stops working. Do you know any work around to keep it enabled?
Thanks for helping.
I put a screenshot so you can see how it looks with transparent navigation bar set in lightning.
When I back out of the app drawer, the script stops working. Do you know any work around to keep it enabled?
Thanks for helping.
- Attachments
-
- Screenshot_20190301-204341.jpg (263.87 KiB) Viewed 38327 times
- TrianguloY
- Posts: 109
- Joined: Thu Jan 24, 2019 9:46 am
Re: App drawer top bar not correct size
Aha, so it seems my theory was correct. Nice.Evelien wrote: ↑Fri Mar 01, 2019 7:56 pmWhen the script is active, the 3 dots menu works. Awesome.
I put a screenshot so you can see how it looks with transparent navigation bar set in lightning.
When I back out of the app drawer, the script stops working. Do you know any work around to keep it enabled?
Thanks for helping.
I don't like the navigation bar being that color, but just a minor issue I guess. Also you can set the status bar color to transparent too (to avoid that ugly cut).
To keep the script active set it in the resumed event of the app drawer. Long tap background, settings, events & actions, resumed event, run script, choose the script. That should work.
Re: App drawer top bar not correct size
I don't like the colour of the navigation bar either. (Noticed it is the background of klwp so I can make a background specific for the navigation bar) But I really like that it is working again. Awesome.
Thank you for taking the time to help.
Thank you for taking the time to help.
- TrianguloY
- Posts: 109
- Joined: Thu Jan 24, 2019 9:46 am
Re: App drawer top bar not correct size
Couldn't resist fixing those ugly bars
Ok, improved version.
First, check both 'content overlap' and set the color to transparent (otherwise you will get duplicated colors).
Then copy this new script (you can substitute the old one) and check the lightning category from the side bar.
Set the script to run in the resumed event of the app drawer (if you just replaced the content you already have this).
Finally, run the script from the container itself (long tap, scripts, choose. If the script isn't show you didn't check the lightning category (check this post for more information). Choose the colors, and should be done.
Ok, improved version.
First, check both 'content overlap' and set the color to transparent (otherwise you will get duplicated colors).
Then copy this new script (you can substitute the old one) and check the lightning category from the side bar.
Set the script to run in the resumed event of the app drawer (if you just replaced the content you already have this).
Finally, run the script from the container itself (long tap, scripts, choose. If the script isn't show you didn't check the lightning category (check this post for more information). Choose the colors, and should be done.
Code: Select all
bindClass("android.view.WindowManager");
var s = getEvent().getScreen();
var sc = getCurrentScript();
if(getEvent().getSource()!="C_RESUMED"){
var sbc=s.pickColor("Choose Status bar color",sc.getTag("sbc")||0,true);
if(sbc!=null) sc.setTag("sbc",sbc);
var nbc = s.pickColor("Choose Navigation bar color",sc.getTag("nbc")||0,true);
if(nbc!=null) sc.setTag("nbc",nbc);
return;
}
var w=s.getContext().getWindow(); w.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
w.setStatusBarColor(sc.getTag("sbc")||0);
w.setNavigationBarColor(sc.getTag("nbc")||0);
Re: App drawer top bar not correct size
Thanks for the new script. Colouring works great. Only the the action bar is off. And the first row of apps is under it.
I could solve it by hiding the action bar, only to show when I scroll. Thanks. This is an improvement.
I could solve it by hiding the action bar, only to show when I scroll. Thanks. This is an improvement.
- Attachments
-
- Screenshot_20190302-083107.jpg (204.69 KiB) Viewed 38320 times
- TrianguloY
- Posts: 109
- Joined: Thu Jan 24, 2019 9:46 am
Re: App drawer top bar not correct size
Arg, right, the 'status bar content overlap' does that.
So better leave it unchecked, but that means that the status bar can't be colored (it can, but will be cut at the end). I'm sure there are other ways, but that isn't so easy as those changes.
To recap: set the 'status bar content overlap' as unchecked, choose a color for the status bar from that screen (the color from the script will be ignored) and add this line to the end of the script (as a new line, below the latest):
So better leave it unchecked, but that means that the status bar can't be colored (it can, but will be cut at the end). I'm sure there are other ways, but that isn't so easy as those changes.
To recap: set the 'status bar content overlap' as unchecked, choose a color for the status bar from that screen (the color from the script will be ignored) and add this line to the end of the script (as a new line, below the latest):
Code: Select all
w.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
Re: App drawer top bar not correct size
Thanks, I tried the new script, it is better to leave the actual status bar transparent. That way it looks better, then the colour being cut off. But when I have this script enabled, I have a problem with some of the menu's. (Screen shot added)
The menu top line is now drawing behind the action bar.
The best option for me would be the previous option. Both bars coloured by script. And disable action bar.
Thanks again for all your help. I really appreciate it.
The menu top line is now drawing behind the action bar.
The best option for me would be the previous option. Both bars coloured by script. And disable action bar.
Thanks again for all your help. I really appreciate it.
- Attachments
-
- Menu top line drawing behind action bar
- Screenshot_20190302-102517.jpg (198.86 KiB) Viewed 38316 times
-
- Status bar transparent colour
- Screenshot_20190302-103026.jpg (558.33 KiB) Viewed 38316 times
-
- Screenshot_20190302-102356.jpg (267.68 KiB) Viewed 38316 times
Re: App drawer top bar not correct size
I saved the scripts inside a landscape template and loaded it again (reset screen to default then load template) now the top icons inside the appdrawer are not positioning under the action bar anymore. That's looking good. I changed the layout a little.
I used script 2 of this thread.
Settings status bar (status bar is hidden) and nav bar, screenshot added.
Both transparent colours inside the settings menu.
Added a colour through your script.
I added an image to the action bar that darkens the AppDrawer tint color a little. (Dark image with transparency) So the action bar has a slightly darker colour.
When I pull down the status bar, the position of the status bar and action bar are good. No strange odd bars.
I thought I share what I have now.
I used script 2 of this thread.
Code: Select all
bindClass("android.view.WindowManager");
var s = getEvent().getScreen();
var sc = getCurrentScript();
if(getEvent().getSource()!="C_RESUMED"){
var sbc=s.pickColor("Choose Status bar color",sc.getTag("sbc")||0,true);
if(sbc!=null) sc.setTag("sbc",sbc);
var nbc = s.pickColor("Choose Navigation bar color",sc.getTag("nbc")||0,true);
if(nbc!=null) sc.setTag("nbc",nbc);
return;
}
var w=s.getContext().getWindow(); w.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
w.setStatusBarColor(sc.getTag("sbc")||0);
w.setNavigationBarColor(sc.getTag("nbc")||0);
Settings status bar (status bar is hidden) and nav bar, screenshot added.
Both transparent colours inside the settings menu.
Added a colour through your script.
I added an image to the action bar that darkens the AppDrawer tint color a little. (Dark image with transparency) So the action bar has a slightly darker colour.
When I pull down the status bar, the position of the status bar and action bar are good. No strange odd bars.
I thought I share what I have now.
- Attachments
-
- Status bar position after pull down
- Screenshot_20190302-134027.jpg (478.69 KiB) Viewed 38311 times
-
- Screenshot AppDrawer layout + colours
- Screenshot_20190302-131357.jpg (494.61 KiB) Viewed 38311 times
-
- Settings navbar and status bar
- Screenshot_20190302-131621.jpg (210.47 KiB) Viewed 38311 times
Re: App drawer top bar not correct size
A fix is coming