I has my own View subclass that does Layout (I call it ViewGallery), my problem is that views that I draw manually wont appear at screen, here's it onDraw method.
@Override
protected void onDraw(Canvas canvas) {
for(Child child : visibleChilds){
canvas.save();
canvas.clipRect(child.bounds);
child.view.draw(canvas);
canvas.restore();
}
}
private List<Child> visibleChilds = new ArrayList<ViewGallery.Child>();
private static class Child {
private View view;
private Rect bounds;
public Child(View view, Rect rect) {
this.view = view;
bounds = rect;
}
}
As far as I know that should draw the inner view in the specified clipped Canvas.
Why the view is still empty?
Also I tried extends ViewGroup so I pass itself as parameter in a Adapter, but default ViewGroup.LayoutParams doesn't has left (or x) properties that I need to handle properly translation of views. But when subclassing it the onDraw never get called and childs still wont appear.