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

Added ability to set input type on android #2405

Merged

Conversation

dwmoffatt
Copy link
Contributor

@dwmoffatt dwmoffatt commented Jan 9, 2021

This PR added ability to set input type for keyboard on android. It needs to be merged with kivy/kivy#7231

this is just a new PR with a successful rebase so the CI builds.

closes #2361

@dwmoffatt
Copy link
Contributor Author

@AndreMiras Rebased and just re-generated PR.

Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

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

LGTM, ready for the merge.
I've only asked a couple of questions for something I wasn't sure of if you could confirm

Handler commandHandler = new SDLCommandHandler();

// Send a message from the SDLMain thread
- boolean sendCommand(int command, Object data) {
+ protected boolean sendCommand(int command, Object data) {
Copy link
Member

Choose a reason for hiding this comment

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

Oh god it's so hard to read a diff of a diff, I initially tought you changed that.
You actually just removed some trailing whitespace so GitHub is showing the context which contains the previous diff, that's so confusing to read 🤯 but that's fine I'll manage

// This is what SDL runs in. It invokes SDL_main(), eventually
protected static Thread mSDLThread;

+ public static int keyboardInputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
Copy link
Member

Choose a reason for hiding this comment

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

So at the end the changes you made to this SDLActivity.java.patch file is only using this const and clearing some trailing whitespaces, correct or I'm missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct.

InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.restartInput(mTextEdit);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

OK nice, then someone could write the Python wrapper in pythonforandroid/recipes/android/src/android/ later, correct?
If you already have done so for your project you could share the code snipped in some comments. Or better make a follow up PR after this one is merged

Copy link
Contributor Author

@dwmoffatt dwmoffatt Jan 10, 2021

Choose a reason for hiding this comment

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

Yes it could be.

This change keyboard function is being utilized kivy/kivy#7231

@AndreMiras AndreMiras merged commit 6a9f28a into kivy:develop Jan 10, 2021
@AndreMiras
Copy link
Member

Merged, thanks for getting back to me on my questions

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.

2 participants