[android-developers] method setDirty() for View?

2011-06-07 Thread wboe
Hi, For a custom ViewGroup class I need something to mark a child view as to be redrawn. In the 2006 source code View.java the statement was: child.mPrivateFlags |= View.DRAWN. Maybe now some method e.g. named setDirty() must be used? Can somebody from the android team please provide any

Re: [android-developers] method setDirty() for View?

2011-06-07 Thread Romain Guy
That's what invalidate() is for :) On Tue, Jun 7, 2011 at 12:16 AM, wboe w.bo...@chello.nl wrote: Hi, For a custom ViewGroup class I need something to mark a child view as to be redrawn. In the 2006 source code View.java the statement was: child.mPrivateFlags |= View.DRAWN. Maybe now some

Re: [android-developers] method setDirty() for View?

2011-06-07 Thread wboe
Hi Romain, Using invalidate() is the trivial View method that I wanted to circumvent, because it will adress its parent, which then will scan all of its children, and redraw the ones that are dirty. If you have a lot of children, and your app is an audio program that must not be interrupted,

Re: [android-developers] method setDirty() for View?

2011-06-07 Thread Romain Guy
Using invalidate() is the trivial View method that I wanted to circumvent, because it will adress its parent, which then will scan all of its children, and redraw the ones that are dirty. If you have a lot of children, and your app is an audio program that must not be interrupted, then you

Re: [android-developers] method setDirty() for View?

2011-06-07 Thread wboe
Hi Romain, Thanks for the fast response. Using invalidate() is the trivial View method that I wanted to circumvent, because it will adress its parent, which then will scan all of its children, and redraw the ones that are dirty. If you have a lot of children, and your app is an audio

Re: [android-developers] method setDirty() for View?

2011-06-07 Thread Romain Guy
That's exactly what I was trying to do. The audio part can't be optimized anymore because it is native, so I tried to optimize the graphical part. What I mean is that if you have so many views that it's negatively impacting your application, you should try to reduce the number of views. Dare

Re: [android-developers] method setDirty() for View?

2011-06-07 Thread wboe
Hi Romain, Dare I disagree? I am using home-made widgets and I monitor when they are redrawn. I found out that they were redrawn often, also when not needed. So I used a ViewGroup derived from AbsoluteLayout, stripped as much as possible. The superfluous redrawing now happens less

Re: [android-developers] method setDirty() for View?

2011-06-07 Thread Romain Guy
Maybe the last sentence should be That's just not how the UI toolkit is supposed to work? You made a simple assumption based on your application. There is nothing in the UI toolkit that does what you describe. There is not even a notion of not enough time to redraw some views. The only thing

Re: [android-developers] method setDirty() for View?

2011-06-07 Thread Romain Guy
Note also that for the framework, a visible view is simply a view that intersects with the clipping rectangle. The clipping rectangle is based on the dirty region used by the last series of invalidate calls. This means that if a view is redrawn, an invalidate with a dirty rectangle intersecting

Re: [android-developers] method setDirty() for View?

2011-06-07 Thread wboe
Hi Romain, Actually I tried everything to find out the cause of the superfluous redraws. I had an AbsoluteLayout with about 20 children, and often, after an invalidate of one child, all visible View's were redrawn. Then I stripped the AbsoluteLayout, and there were less redraws. Then I