-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
fix(android): Always display HTML banner when suggestions aren't available #9696
Merged
+763
−61
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
4273140
change(android): Add image banner
darcywong00 9b06591
fix(android/engine): Try green banner
darcywong00 d3872ee
fix(web): Start with image banner
darcywong00 3a785f5
chore(android/app): Use white banner theme
darcywong00 b46d50f
chore(web): Revert initial banner
darcywong00 3df2668
refactor(android/engine): Move constants to KMManager
darcywong00 131180c
refactor(android): Change set/getBanner
darcywong00 db728df
fix(android): Set image path
darcywong00 b91d651
chore(web): Default to image banner on Android
darcywong00 7d3de5a
fix(web): Handle banner initialization
darcywong00 018abd4
fix(android/engine): Use white and Keyman theme banners
darcywong00 a5aef7a
fix(web): Update image path when setting Options
darcywong00 510de72
fix(android/engine): Remove refresh that wasn't working
darcywong00 d366f33
chore(web): Add Android tablet theme
darcywong00 b45c61e
chore(android): Merge remote-tracking branch 'origin/master' into fix…
darcywong00 8a48fd2
chore(android): Merge remote-tracking branch 'origin/master' into fix…
darcywong00 bb5a9f8
chore(android/engine): Move banner names
darcywong00 a6b7b95
feat(oem/fv/android): Add banner theme
darcywong00 926a2a2
feat(android/samples): Add sample code for theme on KMSample2
darcywong00 6247a52
chore(android): Merge remote-tracking branch 'origin/master' into fix…
darcywong00 8630121
fix(android/engine): Replace png's with svg's
darcywong00 1e30002
chore(android): Cleanup
darcywong00 6535acd
chore(android/app): Adjust svg dimensions
darcywong00 6593ae2
chore(android): Merge remote-tracking branch 'origin/master' into fix…
darcywong00 11af550
fix(android/engine): Try more svg
darcywong00 1d40beb
fix(android/engine): Get svg to fill banner
darcywong00 8961e9d
fix(android/app): Revert keyman_banner.svg
darcywong00 6170e04
refactor(android/engine): Pass contents of banner.html to KMW
darcywong00 c619873
chore(android): Merge remote-tracking branch 'origin/refactor/web/ina…
darcywong00 cb431fe
refactor(android): Use showBanner
darcywong00 879129e
chore(android): Merge remote-tracking branch 'origin/refactor/web/ina…
darcywong00 263da40
fix(android/engine): Handle mayPredict
darcywong00 712b2a2
refactor(android): Move banner logic to app
darcywong00 856ed13
fix(android/app): Always use Keyman theme
darcywong00 830c282
chore(android): Cleanup code
darcywong00 27480eb
chore(android): Additional cleanup
darcywong00 095b823
chore(android): More cleanup
darcywong00 c83410a
fix(oem/fv/android): Apply teal banner theme
darcywong00 d6a14a8
fix(oem/fv/android): Tweak FV banner theme
darcywong00 35a37bc
chore(android): Additional cleanup
darcywong00 76eab6e
fix(android/engine): Don't set banner on test mode
darcywong00 0bcdea1
chore(android): Merge remote-tracking branch 'origin/master' into fix…
darcywong00 887e6b2
chore(web): Revert 2 files to master
darcywong00 68f2661
chore(web): Revert take 2
darcywong00 44fa59b
chore(android/engine): Revert some changes in android-host.js
darcywong00 8249abd
fix(android): Handle single quotes in HTMl banner
darcywong00 37e9cf5
fix(android/app): Move banner asset folder
darcywong00 37e9bbd
fix(oem/fv/android): Move banner asset folder
darcywong00 b41f049
chore(android): Tweak banner sizing
darcywong00 2b34c64
Apply suggestions from code review
darcywong00 4c453cc
chore(android): Move banner.html up to assets/ folder
darcywong00 d77df39
fix(android): Refresh HTML banner when KeymanWeb reloads
darcywong00 4ebc1e2
fix(android/engine): Fix typo
darcywong00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Custom banner theme --> | ||
<div style="background: white; width: 100%; height: 100%; position: absolute; left: 0; top: 0; display: flex"> | ||
|
||
<!-- svg path is relative to assets/ folder --> | ||
<img src="banner/keyman_banner.svg" style="height:60%; background: white; display: block; margin: auto 2%;"> | ||
|
||
<!-- Tri-color line --> | ||
<div style='height: 7%; left: 0; position: absolute; bottom: 0; width: 56%; background: #F68924'></div> | ||
<div style='height: 7%; left: 56%; position: absolute; bottom: 0; width: 23%; background: #CC3846'></div> | ||
<div style='height: 7%; left: 79%; position: absolute; bottom: 0; width: 21%; background: #79C3DA'></div> | ||
</div> |
372 changes: 372 additions & 0 deletions
372
android/KMAPro/kMAPro/src/main/assets/banner/keyman_banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions
29
android/KMAPro/kMAPro/src/main/java/com/keyman/android/BannerController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.keyman.android; | ||
|
||
import android.content.Context; | ||
|
||
import com.keyman.engine.KMManager; | ||
import com.keyman.engine.util.FileUtils; | ||
|
||
import java.io.File; | ||
|
||
public class BannerController { | ||
|
||
// Paths relative to assets folder for banner themes | ||
public static final String KM_BANNER_DIR = "banner"; | ||
public static final String KM_BANNER_THEME_KEYMAN = "banner.html"; | ||
|
||
public static void setHTMLBanner(Context context, KMManager.KeyboardType keyboardType) { | ||
if (keyboardType == KMManager.KeyboardType.KEYBOARD_TYPE_UNDEFINED) { | ||
return; | ||
} | ||
|
||
KMManager.copyHTMLBannerAssets(context, KM_BANNER_DIR); | ||
|
||
// Always use Keyman banner theme | ||
String contents = FileUtils.readContents(context, KM_BANNER_THEME_KEYMAN); | ||
KMManager.setHTMLBanner(keyboardType, contents); | ||
KMManager.setBanner(keyboardType, KMManager.BannerType.HTML); | ||
KMManager.showBanner(true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tells KMW whether predictions are enabled or not