Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23358] Hyperloop Android: Support method calls that use reference parameters/explicitly assign to args

GitHub Issuen/a
TypeBug
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid, Hyperloop
Labelsn/a
ReporterChristopher Williams
AssigneeJan Vennemann
Created2016-05-10T23:47:29.000+0000
Updated2017-09-22T15:14:46.000+0000

Description

Some methods in Android use "reference" parameters where the method is expected to modify the arguments explicitly rather than return a return value. Specifically, methods like: - http://developer.android.com/reference/android/view/View.html#getLocationOnScreen(int[]) - http://developer.android.com/reference/android/view/View.html#getLocationInWindow(int[]) - http://developer.android.com/reference/android/view/View.html#dispatchNestedPreScroll(int,%20int,%20int[],%20int[]) - http://developer.android.com/reference/android/view/View.html#dispatchNestedScroll(int,%20int,%20int,%20int,%20int[]) Right now, I don't believe we properly support this sort of method. We'll need to find some way to be able to transform the passed in JS array's contents from the modifications made on the Java converted array. We may just have to special case these methods to return the modified contents rather than void and then hack the JS side. Note that this isn't possible for typical Java primitives, but _is_ possible for arrays.

Comments

  1. Christopher Williams 2016-05-11

    A note that getLocationOnScreen actually has a hidden no-arg version that returns the int[] in source and Hans did report being able to use that. So we sort of have a workaround for that. There is no such hidden variant of getLocationInWindow.

JSON Source