[TIMOB-23993] Android: Override contextual bar contents inside webview when selecting text
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 3.2.0 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Tim Poulsen |
Assignee | Gary Mathews |
Created | 2016-10-06T15:03:29.000+0000 |
Updated | 2018-02-26T19:36:02.000+0000 |
Description
Initial proposal. We should look at our other APIs to see if we have something similar to use as basis for how we'd structure this.
var webView = Ti.UI.createWebView({
disableTextSelection: false,
disableContextMenu: true,
contextMenuItems: [{
title: "Share",
identifier: "share",
icon: "myIcon.png", // Android-only
}]
});
webView.addEventListener("contextmenuclick", function(e) {
Ti.API.info("Clicked at item with identifier: " + e.identifier);
});
Some similar-ish APIs to consider:
- http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Windows.CommandBar
- http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.iOS.PreviewContext
- http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TabGroup
https://github.com/appcelerator/titanium_mobile/pull/8494 test code: var window = Ti.UI.createWindow( { title: 'timob-23993' } ); //toggle disableTextSelection values to test out functionality var webView = Ti.UI.createWebView({ url: 'http://lipsum.com', disableTextSelection: false }); webView.addEventListener("contextmenuclick", function(e) { Ti.API.info("Clicked at item with identifier: " + e.identifier); }); window.add(webView); window.open(); Removed disableContextMenu for parity with iOS and removed custom contextMenuItems since that's a separate issue and future update.
PR was specifically for disabling the content action bar contents, not overriding them. If we do want to override them we need to do some more work defining the API and schedule it for another release like 7.x
As [~cwilliams] mentioned, we will consider refactoring architecture for this feature and releasing at a later date.
Due to the schedule for 7.0.0 versus the remaining work, moving to 7.1.0
I'm bumping this out of 7.1.0, this needs discussing more including platform parity.