Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19701] Android: Support extending native types in hyperloop

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-11-12T17:30:30.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsAndroid, Hyperloop
Labelsn/a
ReporterChristopher Williams
AssigneeChristopher Williams
Created2015-10-09T14:10:22.000+0000
Updated2018-08-06T17:49:16.000+0000

Description

Support some syntax that allows users to subclass existing native types in Hyperloop JS.

Comments

  1. Christopher Williams 2015-11-12

    https://github.com/appcelerator/hyperloop-android-module/pull/10
  2. Christopher Williams 2016-02-02

    Example syntax/impl:
       var AuthenticationCallback = require('android.hardware.fingerprint.FingerprintManager.AuthenticationCallback');
       
       var callback = AuthenticationCallback.extend({
           onAuthenticationError: function(code, msg) {
               console.log('onAuthenticationError');
           },
           onAuthenticationHelp: function (code, help) {
               console.log('onAuthenticationHelp');
           },
           onAuthenticationSucceeded: function (result) {
               console.log('onAuthenticationSucceeded');
           },
           onAuthenticationFailed: function () {
               console.log('onAuthenticationFailed');
           },
           onAuthenticationAcquired: function (code) {
               console.log('onAuthenticationAcquired');
           }
       });
       
    you call Supertype.extend({}); the argument is a JSObject with overriding method implementations. The key is the overriden method name, the value is the overriding function implementation
  3. Chee Kiat Ng 2016-08-04

    Expected Result: console.log will appear when executed. Without this PR, there's no logging.
  4. Lokesh Choudhary 2016-08-08

    [~cng], I see no console logs when I run the code above. Any thoughts ?
  5. Chee Kiat Ng 2016-08-08

    [~cwilliams] ^ ?
  6. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source