[TIMOB-25500] Hyperloop: Android - Interfaces don't expose access to methods
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-09-05T18:04:11.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Hyperloop |
Labels | n/a |
Reporter | Aminul Islam |
Assignee | Jan Vennemann |
Created | 2017-11-10T19:57:04.000+0000 |
Updated | 2018-09-05T18:04:11.000+0000 |
Description
Hi,
I tried creating a new android.view.SurfaceView, called getHolder() against the new instance, then tried to call lockCanvas() against the returned SurfaceHolder. Hyperloop said:
[ERROR] : TiExceptionHandler: (main) [13701,610730] ----- Titanium Javascript Runtime Error -----
[ERROR] : TiExceptionHandler: (main) [0,610730] - In /Graph/canvas.js:92,20
[ERROR] : TiExceptionHandler: (main) [0,610730] - Message: Uncaught TypeError: holder.lockCanvas is not a function
[ERROR] : TiExceptionHandler: (main) [0,610730] - Source: canvas = holder.lockCanvas();
The problem is that none of the SurfaceHolder interface methods are defined in the SurfaceHolder definition generated by Hyperloop.
*Steps to reproduce:*
1. Create an simple single view apps.
2. Add android.view.SurfaceView instance in index.js
3. Call getHolder() in android.view.SurfaceView
4. Now call lockConvas() with Holder
5. There are no methods on that holder to be called!
*Sample code* :
var Activity = require('android.app.Activity');
var SurfaceView = require('android.view.SurfaceView');
var surfaceView = new SurfaceView(new Activity(Ti.Android.currentActivity));
var surfaceHolder = surfaceView.getHolder();
surfaceHolder.lockCanvas();
Summery :
That means that when Hyperloop generated its javascript definition, it didn't include the methods?
*Test Environment* :
1. Titanium SDK 6.3.0.GA
2. Hyperloop Version 2.2.2
3. Node 6.11.3
Thanks
[~emerriman], checked it again and this issue was resolved with TIMOB-24684. Calling
lockCanvas
on theSurfaceHolder
no longer causes a crash. Tested with the sample code from this ticket and the following environment: SDK: 7.2.0.GA Hyperloop: 3.0.5 OS: Mac OS 10.14 Appc CLI: 7.0.4 Node: 8.11.2 NPM: 6.0.1 Java: 1.8.0_152 Devices: AVD (Nexus 5X API Level 26), BQ Aquaris X (Android 7.1.1)