Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19943] Android: Support casting hyperloop proxies to different native types

GitHub Issuen/a
TypeStory
PriorityHigh
StatusClosed
ResolutionDone
Resolution Date2016-08-04T03:20:01.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsAndroid, Hyperloop
Labelsn/a
ReporterChristopher Williams
AssigneeChristopher Williams
Created2015-11-12T16:48:15.000+0000
Updated2016-08-04T03:20:01.000+0000

Description

Previously we'd return/wrap any arguments and return types as the actual Java type we received, rather than the type declared by the method return/param type. this led to an issue where we'd receive types that weren't available in our hyperloop JS wrappers (either because they weren't in the type hierarchy we traversed - or more important, if they were "hidden"/native types). As an example, we'd get a DisplayListCanvas (a subclass of Canvas) in a subclass of View's onDraw method. That type isn't in the android.jar and we have no means of trying to get it's details without the android source code. the method declares the param type as simply Canvas. As a hedge against this, when we wrap arguments or return types, we hold the object and it's specific subclass on the Java side, but report as and wrap with the declared type. As a result, that means we now need some way to be able to explicitly cast down to subclasses if we know the value is a more specific subclass (say on View.getLayoutParams).

Comments

  1. Christopher Williams 2015-11-12

    https://github.com/appcelerator/hyperloop-android-module/pull/11

JSON Source