Skip to content

Add Android Support #147

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

Merged
merged 6 commits into from
Jul 28, 2017

Conversation

Swordsman-Inaction
Copy link
Collaborator

Hey!

We'll have Android Support now! You guys can check the README about this.

This feature is not perfect, since there is no keyboardWillShow on Android, we cannot be notified before the keyboard is showed. So sometimes we could get wrong position of focused TextInput because it's already in the process of showing keyboard which makes keyboardSpace not accurate occasionally.

Feel free to review the code and test on your app!

Fix #2

@Swordsman-Inaction
Copy link
Collaborator Author

@chirag04 @Palisand @Jose4gg @tizzyapunkt Would you like to test this feature? 😀

@Palisand
Copy link

Palisand commented Jul 24, 2017

@Swordsman-Inaction Unfortunately, I am unable to test this. Since I am using Expo, windowSoftInputMode is set to adjustResize and I cannot change it to adjustPan unless I detach.

@Swordsman-Inaction
Copy link
Collaborator Author

@Palisand OK... I don't use adjustResize because this option will change the window size which makes positioning more difficult. Also this option doesn't have scroll animation.

@Palisand
Copy link

Palisand commented Jul 25, 2017

@Swordsman-Inaction With these changes, space gets added below the view holding the input, so it works just fine if I scroll manually. By the way, are there any plans for making the view scroll to the text input cursor (for multiline inputs) rather than the bottom of the input? I've tried to accomplish this myself, but found that RN doesn't expose the cursor's location.

@benhannel
Copy link

I used this as a drop in replacement for the APSL version for my project and it worked perfect. Thanks Swordsman-Inaction! When will this request get merged?

@Palisand
Copy link

@alvaromb ^

@Swordsman-Inaction
Copy link
Collaborator Author

@Palisand The first issue, space gets added below the view, is it been introduced in this PR? Is it related to #142?
About the second one, scroll to the text input cursor, as you mentioned RN doesn't expose the cursor's location, it might be impossible to do it. I haven't got time to do the research, I'll do it later, maybe try to work on the native level.

@Palisand
Copy link

Palisand commented Jul 26, 2017

@Swordsman-Inaction I've only compared APSL's master version and your forked repo's android-support branch and with the latter, space does get added below the view when I focus on the input. I wasn't treating it as an issue as I thought this was intentional (and it's a welcome change).

From what I've learned, the second one appears possible only on the native level.

@Swordsman-Inaction
Copy link
Collaborator Author

@Palisand I see, you are saying extraHeight and extraScrollHeight works on Android now, right?

@Palisand
Copy link

@Swordsman-Inaction I never included nor tested those props, only enableOnAndroid. What I'm saying is that before your changes, I was unable to scroll (manually) to an input on Android when the keyboard was shown. Since I can now, I am assuming there is some space being added below the view holding the input.

@Swordsman-Inaction
Copy link
Collaborator Author

@Palisand Yes, that's right. 😀

Copy link
Collaborator

@alvaromb alvaromb left a comment

Choose a reason for hiding this comment

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

Seems good to merge! Have you tested it under Android?

@alvaromb
Copy link
Collaborator

@Swordsman-Inaction ping me when all the PRs are merged and I'll perform a release. Thanks for your work!

@Swordsman-Inaction Swordsman-Inaction merged commit 5ad78bc into APSL:master Jul 28, 2017
@nicotroia
Copy link

I've upgraded to react-native 0.46.+, changed my AndroidManifest file, and set enableOnAndroid to true, and still cannot get any extra padding via extraHeight or extraScrollHeight. Neither work for me

@alliecurry
Copy link

@nicotroia I don't believe there was a new release of this library, yet even though this is merged in.

@alvaromb
Copy link
Collaborator

I'm waiting for @Swordsman-Inaction confirmation to release 0.3.0.

@apaul314
Copy link

apaul314 commented Aug 3, 2017

@Swordsman-Inaction any updates?

@Swordsman-Inaction
Copy link
Collaborator Author

@hose314 Should be released soon, already confirmed with @alvaromb before. 😄

@alvaromb
Copy link
Collaborator

alvaromb commented Aug 3, 2017

I can confirm it will be released tomorrow morning CEST.

Thanks!

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

Successfully merging this pull request may close these issues.

7 participants