How android.view.View.invalidate(int l, int t, int r, int b) make only the dirty area redrawn?

by Romain Guy » Sat, 07 Mar 2009 12:12:48 GMT

Sponsored Links
 This just sets the clip bounds. You will receive an onDraw(Canvas)
call as usual and everything you draw outside of the clip bounds will
be ignored. You can do ahead-of-time skips if you know you are
performing intensive computations in onDraw() (which you should not be
doing anyway) but it's most often not worth it.

Romain Guy
Android framework engineer

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them


Other Threads

1. Any way to use getChildDrawingOrder? where do we set FLAG_USE_CHILD_DRAWING_ORDER?

I'm writing a custom widget in which I need to control the child
drawing order. My control extends AbsoluteLayout. I can see that
getChildDrawingOrder is overrideable. The following note is in the
javadocs for this method:

NOTE: In order for this method to be called, the

However, I can find no setter to allow me to set this flag. There are
setters for similar flags such as the add states for children, but
seemingly nothing for the child drawing order. GalleryView uses this
flag, but it does so by accessing mGroupFlags which is a protected and
hidden property of ViewGroup. What am I missing? Shouldn't this flag
be exposed in some way to allow widget developers to utilize it?

2. Button with both Text and Image


Is there a way to create Buttons that contain both an Image and Text
(image on top text below or image left and text right)? And how can
this be done within a xml layout file?

For example, the application 'Pkt Auctions eBay' (see Android Market)
has these type of buttons.

So far I have tried and googled all over and found nothing on the
matter. Help is much appreciated. Thanks in advance.


3. Would you like to let me know how to get SDK version in my application code?

4. Game Crashes unexpectedly :(

5. Changing Alert Dialog styles

6. ContentProvider not backed by SQLLite?

7. update questions