Pierre Hébert is it possible to subclass a FrameLayout somehow?
Pierre Hébert is it possible to subclass a FrameLayout somehow?
]]>
« guys , i made a side bar and put inside it 17 apps icons (Previous Post)
(Next Post) V12.5b7 beta »
< ![CDATA[
Not sure what you really mean, not sure if this really works.
But it’s a start 😛
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model
]]>
< ![CDATA[
Unfortunately this isn’t possible in the current script engine implementation… Lightning uses 1.7, subclassing classes with no default constructor is in 1.8 🙁
]]>
< ![CDATA[
I already tried prototypes. The problem is: I can’t modify FrameLayouts prototype, it doesn’t seem to have one. I can copy FrameLayouts methods to a new prototype, but this is no subclass of View anymore, and therefore can’t be passed to addView() calls.
]]>
< ![CDATA[
Yes, this is exactly the problem, this is not an instance of View. It would work with JavaScript only, but not with other Java components.
]]>
< ![CDATA[
And I can’t override methods like I did it with e.g. Listeners, it throws an error.
]]>
< ![CDATA[
Can’t we switch to 1.8 then?
]]>
< ![CDATA[
No unfortunately, I don’t remember why exactly but using 1.7 which was already old when I added scripting was not a choice but a constraint.
]]>
< ![CDATA[
I just saw that 1.7 received two updates in 2015 (previous one was 2012). It seems these new versions includes patches scheduled for 1.8. Maybe it is worth looking at these new versions.
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Download_Rhino
]]>
< ![CDATA[
Well there are several fixes regarding prototypes and constructors, so it might help.
]]>
< ![CDATA[
According to here https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Scripting_Java there should be a JavaAdapter. I can’t reach it through scripting though.
Pierre Hébert could you make it available?
]]>
< ![CDATA[
Lukas Morawietz this class is obfuscated 🙁 In the current 12.5.1 version it should be b.a.b.as
I will add it to the list of public classes so that it becomes clearly available.
]]>
< ![CDATA[
I’m not sure if this is the correct class, as it doesn’t seem to have the constructor which it should have. I’ll wait for the next release.
]]>
< ![CDATA[
This will be a beta. I initially wanted to publish it a few days before but I have work to do, maybe this week end.
]]>
< ![CDATA[
Beta published with JavaAdapter now visible, however didn’t tested the use of it. Since this class is heavily relying on reflection, I wonder whether other classes would need to be made public too. Please let me know how it works or not.
]]>
< ![CDATA[
I have already submitted my crashreport to you. I’ve found a post that said turning the optimization off might help here.
]]>
< ![CDATA[
It appears that rhino is generating java bytecode and tries to load it. The issue is that Android expects dex code, not java.
The optimization setting is already disabled: in fact it configures whether to produce native code from javascript, and cannot work on android for the same reason.
So at the moment I don’t see a solution except to implement a dex byte code factory 🙁
]]>
< ![CDATA[
Seems like the launcher of no limits has met its limit…
I’ve created an issue at rhinos github repository, but I don’t expect much from it.
]]>