Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19702] Android: Support implementing native interfaces in hyperloop

GitHub Issuen/a
TypeStory
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-10-22T17:44:17.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsAndroid, Hyperloop
Labelsn/a
ReporterChristopher Williams
AssigneeChristopher Williams
Created2015-10-09T14:11:05.000+0000
Updated2016-07-19T21:05:57.000+0000

Description

Support some syntax that allows users to implement a native interface in Hyperloop JS.

Comments

  1. Christopher Williams 2015-10-22

    https://github.com/appcelerator/hyperloop-android-module/commit/48ad605150bd14700bec5ec095c98b9880cc4017
  2. Christopher Williams 2016-02-03

       // Instantiate a Java interface anonymously:
       var OnClickListener  = require('android.view.View.OnClickListener');
       var instance = new OnClickListener({
            onClick: function() {
                // Perform action on click
                console.log("On click from JS!");
            }
       });
       instance.onClick();
       // Now you could set this onclicklistener on a native button and should see the log message when the button is clicked...
       
  3. Lokesh Choudhary 2016-07-19

    Verified the fix. Closing. Environment: Appc Studio : 4.7.0.201607111053 Ti SDK : 5.4.0.v20160713141635 Ti CLI : 5.0.9 Alloy : 1.9.1 MAC El Capitan : 10.11.5 Appc NPM : 4.2.8-1 Appc CLI : 5.4.0-33 Node: 4.4.4 Nexus 6 - Android 6.0.1

JSON Source