Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9807] Android: Create a common namespace for autoLink property in TextArea

GitHub Issuen/a
TypeBug
PriorityMedium
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 2.1.0
Fix Version/sSprint 2012-15 API, Release 3.0.0
ComponentsAndroid
Labelsapi, module_textfield, parity, qe-review, qe-testadded
ReporterHieu Pham
AssigneeUnknown
Created2012-06-26T16:55:23.000+0000
Updated2018-02-28T20:04:07.000+0000

Description

As of now (Release 2.1.0), autoLink constants have 2 different namespaces (for iOS and Android), ie. Ti.UI.iOS.AUTODETECT_ALL vs Ti.UI.Android.LINKIFY_ALL. We need to create a new common namespace for these constants. Test Code: Run this on both Android/iOS to confirm behavior
var win = Ti.UI.createWindow({
    backgroundColor : "white"
});
 
var ta = Ti.UI.createTextArea({
    left:5, top: 5, right: 5, height: 180,
    editable: false, // this needs to be set to false, otherwise data detection type will fail
    backgroundColor:'#ccc',
    autoLink: Titanium.UI.AUTOLINK_ALL,
    value:'Contact\n test@test.com\n 817-555-5555\n http://bit.ly\n 444 Castro Street, Mountain View, CA'
});
 
var b1 = Ti.UI.createButton({title: "Click me!"});
b1.addEventListener('click', function(e) {
	ta.autoLink = Titanium.UI.AUTOLINK_NONE;
});
win.add(ta);
win.add(b1);

win.open();
1. Run code - You should see 4 links 2. Click on button - You should see 0 links.

Comments

  1. Blain Hamon 2012-07-26

    Pull merged.
  2. Anshu Mittal 2012-08-16

    Verified on: SDK:2.2.0.v20120816212512 Studio:2.1.1.201207271312 Devices: iOS simulator, Samsung galaxy note(android v 2.3.6) Autolink property works well in textarea.
  3. Anshu Mittal 2012-09-12

    Reopening to update labels
  4. Shameer Jan 2013-11-07

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4863
  5. Abir Mukherjee 2017-10-24

    Originally tested by Samir during 6.3.0 Mac-Android regression tests and found that this problem exists with 6.3.0. I checked on my own and reproduced Samir's findings with Android. With iOS, the app works as expected. After pressing the button "Click Me!" there should be zero links. However, four links remain. This is the environment: Node Version: 6.10.3 NPM Version: 3.10.10 Mac OS: 10.13 Appc CLI: 6.3.0-master.16 Appc CLI NPM: 4.2.10-2 Titanium SDK version: 6.3.0.v20171018084007 Appcelerator Studio vers 4.10.0 Android 7.1.2 on Pixel Xcode 9.0/iOS 11.0.3 on iPhone 7 Plus

JSON Source