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

Toast padding is being removed with fitsSystemWindows set to true. #18

Closed
rayliverified opened this issue Apr 13, 2017 · 9 comments
Closed
Labels

Comments

@rayliverified
Copy link
Contributor

Hi @GrenderG , thanks for the great library!
I have a question about how the text padding for Toasty is set. Usually, text in Toasty has a 16-20dp left right margin. However, when I am using the library in a fullscreen activity, the text padding disappears. What is setting the toast's text padding?

P.S. I am currently adding spaces around my toast messages like " Toast Message " to simulate padding. It works great :D

@GrenderG
Copy link
Owner

Mmm, that's so weird, can you provide example images of what's happening? The padding belongs to the original Toast 9patch image.

@rayliverified
Copy link
Contributor Author

rayliverified commented Apr 13, 2017

Here is the correct display with good padding.
screenshot_2017-04-13-13-28-54
Here is the incorrect padding in my fullscreen application.
screenshot_2017-04-13-13-28-33
Not a top priority issue but I am curious as to why the padding would change?

@GrenderG
Copy link
Owner

GrenderG commented Apr 13, 2017

Which Android version / device are u using? Also, post the code too.

@rayliverified
Copy link
Contributor Author

I have tested this in my emulator and actual device. So far, I have tested it in 7.0, 6.0. I am going to try to reproduce the problem in the app where the toast padding is correct to see if my theory that the activity theme has something to do with the padding.

@rayliverified
Copy link
Contributor Author

Got it, found the culprit 🎆
It appears that setting fitsSystemWindows to true eliminates the padding.
<item name="android:fitsSystemWindows">true</item>
Any idea the reason behind this?

@GrenderG
Copy link
Owner

GrenderG commented Apr 13, 2017

I have tried with the same text and it seems to work well in Android 5.1.1, 6.x and 7.x.
image
EDIT: Let me try with <item name="android:fitsSystemWindows">true</item>

@GrenderG
Copy link
Owner

I'm going to release an update to fix this issue, would you mind waiting some minutes? It'll be available in a moment, the version code will be 1.1.5.

@GrenderG GrenderG added the bug label Apr 13, 2017
@GrenderG
Copy link
Owner

Issue solved, sorry for any inconveniences and thanks for reporting! Remember to udpate it: compile 'com.github.GrenderG:Toasty:1.1.5'

@GrenderG GrenderG changed the title What controls toast text padding? Toast padding is being removed with fitsSystemWindows set to true. Apr 13, 2017
@rayliverified
Copy link
Contributor Author

Wow, nice fix! Thank you so much, now I don't have to use spaces for padding 😁

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