This repository has been archived by the owner on Feb 18, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix text input scroll when status bar is translucent
Summary:Changed the implementation of `setTranslucent` because the old one used the view flag SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN which has the sad side effect of making the ScrollViews not adjust properly when the keyboard is opened. Instead I use `setOnApplyWindowInsetsListener` to hook in the insets calculation process and consume the top offset so the decor view doesn't add top padding for the status bar. I also limited the translucent prop to API 21+ because `setOnApplyWindowInsetsListener` is not available before that and anyway the translucent prop is only useful with a semi-transparent status bar color which only works on API 21+. **Test plan** Reproduced the bug using this code in UIExplorer. https://gist.github.com/janicduplessis/217b9994e35f960a1793 Tapping a text field that would be hidden by the soft keyboard should scroll the view so it is not hidden. Also tested that setting the translucent prop on and off still works as before. Fixes facebook#6455 Closes facebook#6481 Differential Revision: D3067199 Pulled By: mkonicek fb-gh-sync-id: aa115f8688ac7e461e62c18ebb8ab77350d000f8 shipit-source-id: aa115f8688ac7e461e62c18ebb8ab77350d000f8
- Loading branch information