Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sneaker doesn't appear when statusbar is translucent #26

Open
mbiamont opened this issue Jun 19, 2018 · 4 comments
Open

Sneaker doesn't appear when statusbar is translucent #26

mbiamont opened this issue Jun 19, 2018 · 4 comments
Labels

Comments

@mbiamont
Copy link

Hi, as explained in my PR, the Sneaker isn't shown when I remove the statusbar from the Activity (and I'm not talking about Toolbar/Actionbar).

This is the code I use to remove the statusbar in any activity :

protected void onCreate(Bundle savedInstanceState) {
(...)
   Window w = getWindow();
   w.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
   w.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
@Hamadakram Hamadakram added the bug label Jun 21, 2018
@mbiamont
Copy link
Author

Sorry to be so insistent, but this problem can be easily solved by merging this PR : #25.

In few words, what I've changed is just putting a min height of 26dp to the Sneaker's view.

@Hamadakram
Copy link
Owner

Hi, the fix you suggested is working for only your senario. For your case you are not removing status bar, you are making status bas Translucent. If you make status bar hidden by
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
then Sneaker is working fine.

About your fix this will work for Translucent status bar but for no status bar its adding top padding that should not be there. Thats why i added this issue as a bug.

@Hamadakram
Copy link
Owner

If you need to customize the library according to your requirement. You can clone and make the changes and use it.

@mbiamont mbiamont changed the title Sneaker doesn't appear when I remove statusbar Sneaker doesn't appear when statusbar is translucent Jun 23, 2018
@mbiamont
Copy link
Author

OK, understood.

So, the fix is simple (to avoid any changes in other modes than translucent statusbar).
The method Utils.getStatusBarHeight() must return at min 0 (neither -10000 nor 26dp).
With that, it should work for normal/fullscreen/translucent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants