chore(android): add intent to broadcast font name#15193
chore(android): add intent to broadcast font name#15193mcdurdin merged 3 commits intokeymanapp:masterfrom
Conversation
User Test ResultsTest specification and instructions User tests are not required |
|
This pull request is from an external repo and will not automatically be built. The build must still be passed before it can be merged. Ask one of the team members to make a manual build of this PR. |
| if (keyboardInfo != null) { | ||
| String fontName = keyboardInfo.getFont(); | ||
|
|
||
| Intent intent = new Intent("com.keyman.android.keyboard_changed"); |
There was a problem hiding this comment.
Do we need to document this Intent in the API documentation, @darcywong00?
There was a problem hiding this comment.
So far, all our API documentation has been KMManager in Keyman Engine for Android.
afaict, we haven't had any Keyman app APIs
There was a problem hiding this comment.
In that past, we've used KMManager.KeyboardEventHandler to signal events (not with intents though)
https://help.keyman.com/developer/engine/android/current-version/KeyboardEventHandler/
There was a problem hiding this comment.
That signalling with KMManager.KeyboardEventHandler is inside the one app isn't it? This is looking at an external API surface.
afaict, we haven't had any Keyman app APIs
So we should establish a public API document then for the app for exactly this.
There was a problem hiding this comment.
Would it be a new page at
https://help.keyman.com/products/android/current-version/basic/
Seems this would be separate from
https://help.keyman.com/developer/engine/android/
There was a problem hiding this comment.
I think it belongs more closely with Engine docs than end user docs. It's about integration, just at another level. Let's go with putting it into the Engine docs, under a new section. If we have to reorg Engine docs, that's also okay.
| if (keyboardInfo != null) { | ||
| String fontName = keyboardInfo.getFont(); | ||
|
|
||
| Intent intent = new Intent("com.keyman.android.keyboard_changed"); |
There was a problem hiding this comment.
2 things. I think the Keyman application ID is still com.tavultesoft.kmapro and on Debug builds, it's com.tavultesoft.kmapro.debug.
Maybe you can try the following (distinguishing com.tavultesoft.kmea.BuildConfig from com.tavultesoft.kmapro.BuildConfig)
| Intent intent = new Intent("com.keyman.android.keyboard_changed"); | |
| Intent intent = new Intent(com.tavultesoft.kmapro.BuildConfig.APPLICATION_ID . ".keyboard_changed"); |
There was a problem hiding this comment.
Should we only broadcast this when the font is not empty/null?
There was a problem hiding this comment.
Should we only broadcast this when the font is not empty/null?
Definitely should always broadcast. It is also helpful to know that a keyboard has changed. And if changing from a non-null font to a null font, we need to know that too.
There was a problem hiding this comment.
I think the Keyman application ID is still
com.tavultesoft.kmaproand on Debug builds, it'scom.tavultesoft.kmapro.debug.
Is it possible to change the application ID without impacting play store? I don't think so? If it is then com.keyman.android would be so much better!
There was a problem hiding this comment.
Is it possible to change the application ID without impacting play store? I don't think so?
From what I've read, we'd have to unpublish the current Keyman app (com.tavultesoft.kmapro) and then publish a "new" Keyman app (com.keyman.android). There's no user migration between the apps.
There was a problem hiding this comment.
From what I've read, we'd have to unpublish the current Keyman app (com.tavultesoft.kmapro) and then publish a "new" Keyman app (com.keyman.android). There's no user migration between the apps.
yeah so that's a no then 😁
There was a problem hiding this comment.
Separate question is whether we can use a different identifier for things like this moving forward?
There was a problem hiding this comment.
@darcywong00 I couldn't access BuildConfig from Keyman browser. but I can make it works with "com.tavultesoft.kmapro.keyboard_changed".
There was a problem hiding this comment.
ahh. I see.
Do we assume if you're using a debug version of Keyman Browser, then you're also using a debug version of Keyman for Android?
Then we could do
Intent intent;
if (BuildConfig.DEBUG) {
intent = new Intent(com.tavultesoft.kmapro.debug.keyboard_changed");
} else {
intent = new Intent(com.tavultesoft.kmapro.keyboard_changed");
}There was a problem hiding this comment.
Thank you. It works now and I have already committed it.
|
Changes in this pull request will be available for download in Keyman version 19.0.168-alpha |
This makes it possible for the Keyman Browser app to read the currently selected font name from the active Keyman keyboard
Test-bot: skip