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

Keyboard will show documentation #14350

Closed

Conversation

TinoADev
Copy link
Contributor

@TinoADev TinoADev commented Jun 6, 2017

Clarified documentation for keyboardWillShow on Android as seen in issue #14275

Motivation (required)

Clarifies documentation of keyboardWillShow

Test Plan (required)

None as it is just a comment that changed.

TinoADev added 2 commits June 6, 2017 23:33
Clarified documentation for keyboardWillShow on Android
@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Jun 6, 2017
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@@ -101,6 +101,10 @@ let Keyboard = {
*
* Note that if you set `android:windowSoftInputMode` to `adjustResize` or `adjustNothing`,
* only `keyboardDidShow` and `keyboardDidHide` events will available on Android.
*
* Limitation for keyboardWillShow: On Android no event is fired when the keyboard is about
* to be opened. Instead you can use a layout listener to check if the height of the layout
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can delete this new text and add clarification on to the end of the previous sentence, something like this but maybe better wording:

only keyboardDidShow and keyboardDidHide events will available on Android because it is not possible to listen for keyboardWillShow or keyboardWillHide events in the underlying Android APIs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we workaround it on native side (use another event)? Or it is just conceptually impossible/meaningless.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This StackOverflow page and several others suggest that there is indeed no way on Android to do this.

* only `keyboardDidShow` and `keyboardDidHide` events will available on Android.
* only `keyboardDidShow` and `keyboardDidHide` events will be available on Android and
* `keyboardWillShow` as well as `keyboardWillHide` are generally not available on Android
* since there is no corresponding event.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relationship between android:windowSoftInputMode, [keyboardDidShow + keyboardDidHide], and [keyboardWillShow + keyboardWillHide] is still unclear to me. Does android:windowSoftInputMode affect [keyboardWillShow + keyboardWillHide], or this pair of events generally unavailable on Android?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyboardWillShow and keyboardWillHide are not available on Android. There is just no event for that. (As of now, might of course change in the future (hopefully)).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anything more you like to know?

@facebook-github-bot facebook-github-bot added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Jun 19, 2017
@facebook-github-bot
Copy link
Contributor

@shergin has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants