This is a feature request and a tip to devs in one.
This is a feature request and a tip to devs in one.
First the tip: this is how to push any view (in this example a videoview) to LL
LL.bindClass(“android.R”);
LL.bindClass(“android.widget.VideoView”);
var root=LL.getContext().getWindow().getDecorView().findViewById(R.id.content);
var view=new VideoView(LL.getContext());
view.setVideoPath(“/sdcard/Video/video.mp4”);
root.addView(view);
view.start();
setTimeout(clear,0);
function clear()
{
if(LL.isPaused())root.removeView(view);
else setTimeout(clear,0);
}
Now the Request:
Pierre Hébert I would like to see a view item, which is just a item to display a java view. Of course it should be possible to create it through script. This would make things a lot easier and the above stuff wouldn’t be needed.
]]>
< ![CDATA[
Be careful, the timeout set at 0 will use 100% of one CPU, it will drain your battery fast. Use some pause event instead.
I don’t want to add another type of item, but what I can do is add a function that returns the view for an item. For general purpose use a shortcut without icon nor text, it will act as an empty view because image and text views are only created when visible.
There are several views though: one is responsible for handling position and transformation, another one manages the box properties and a third one is the content itself (possibly made of another view hierarchy).
]]>
< ![CDATA[
That would be great. Maybe also a function to set the view(s)?
]]>
< ![CDATA[
If the “box” view can be retrieved through a getBoxView method then I think a setChild method should work, yes.
]]>