[TIMOB-23358] Hyperloop Android: Support method calls that use reference parameters/explicitly assign to args
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android, Hyperloop |
Labels | n/a |
Reporter | Christopher Williams |
Assignee | Jan Vennemann |
Created | 2016-05-10T23:47:29.000+0000 |
Updated | 2017-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.
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.