Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23993] Android: Override contextual bar contents inside webview when selecting text

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.2.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterTim Poulsen
AssigneeGary Mathews
Created2016-10-06T15:03:29.000+0000
Updated2018-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

Comments

  1. Farzad Merzadyan 2016-10-10

    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.
  2. Farzad Merzadyan 2016-10-19

  3. Christopher Williams 2016-10-28

    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
  4. Farzad Merzadyan 2016-11-29

    As [~cwilliams] mentioned, we will consider refactoring architecture for this feature and releasing at a later date.
  5. Eric Merriman 2017-11-01

    Due to the schedule for 7.0.0 versus the remaining work, moving to 7.1.0
  6. Gary Mathews 2018-02-13

    I'm bumping this out of 7.1.0, this needs discussing more including platform parity.

JSON Source