chrisbanes / insetter

Insetter is a library to help apps handle WindowInsets more easily
https://chrisbanes.github.io/insetter
Apache License 2.0
1.13k stars 42 forks source link

Bug: Custom listener + consuming insets #102

Closed mlykotom closed 3 years ago

mlykotom commented 3 years ago

In method applyToView and checking for custom listener, there's probably a bug with checking if insets should be consumed. https://github.com/chrisbanes/insetter/blob/2724d4692ef78d81241579314c2a74ff9b492671/library/src/main/java/dev/chrisbanes/insetter/Insetter.kt#L373

The problem is in the if condition - it should be reverted and therefore if(consume == CONSUME_NONE) insets else WindowInsetsCompat.CONSUMED because when none consumed, then we should return the initial insets, right?

This breaks insetter when custom listener is applied somewhere in the view hierarchy.

dimsuz commented 3 years ago

Aha! So that's why it broke for me after upgrade. I heavily rely on custom listener in my setup.

Any chance this will be released soon?

dimsuz commented 3 years ago

Friendly ping @chrisbanes. Currently have to use an obsolete library version and also getting a lot of insets-related @Deprecated warnings. I can't easily work around this bug (or can I?).

Do you plan on releasing a new minor version in the near future?

chrisbanes commented 3 years ago

My bad, I’ll release a new version tomorrow!

dimsuz commented 3 years ago

Hurray, thank you!