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

by FBear » Sat, 07 Mar 2009 10:54:21 GMT


Sponsored Links
 android.view.View.invalidate(int l, int t, int r, int b) can mark the
the area defined by the rect (l,t,r,b) as needing to be drawn.
But how does View update only the dirty area specified by the rect?
Is it wise enough to redraw only the dirty area even if the onDraw is
customized to update the whole view?

I read some sources and searched in google developer group. No answer
to this question was found.

Would anybody please kindly explain that to me?

Thanks in advance.

FBear

--~--~---------~--~----~------------~-------~--~----~



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

by FBear » Sat, 07 Mar 2009 17:21:35 GMT


 Do you mean that onDraw(Canvas) will ignore the drawing call in it
when the affected area is not in the dirty area?
I can hardly believe it it so wise.
How about the drawing call which affected area overlaps with the dirty
area?




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


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

by FBear » Sat, 07 Mar 2009 22:17:08 GMT


 Thank you very much!



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. ExpandableListActivity onCreateContextMenu

Hi,

I'm a bit of an android beginner, so I'd like someone to confirm this 
for me before I post a bug report, but it seems that the 
onCreateContextMenu() method in ExpandableListActivity is never called 
when I override it in my ExpandableListActivity subclass. If I use 
getExpandableListView().setOnCreateContextMenuListener(myListener) to 
set the listener directly on the expandable list view, then the listener 
*is* called.

When I look in the source of ExpandableListActivity I see in the 
onContentChanged() method that it registers itself as a listener for 
onChildClick, onGroupExpand and onGroupCollapse. However it does not 
register itself for the context menu event listener:

   @Override
    public void onContentChanged() {
        super.onContentChanged();
        View emptyView = findViewById(com.android.internal.R.id.empty);
        mList = 
(ExpandableListView)findViewById(com.android.internal.R.id.list);
        if (mList == null) {
            throw new RuntimeException(
                    "Your content must have a ExpandableListView whose 
id attribute is " +
                    "'android.R.id.list'");
        }
        if (emptyView != null) {
            mList.setEmptyView(emptyView);
        }
        mList.setOnChildClickListener(this);
        mList.setOnGroupExpandListener(this);
        mList.setOnGroupCollapseListener(this);
       
        if (mFinishedStart) {
            setListAdapter(mAdapter);
        }
        mFinishedStart = true;
    }

Shouldn't it also have the line:

     mList.setOnCreateContextMenuListener(this);

in there?

Regards,
Sebastiaan


--~--~---------~--~----~------------~-------~--~----~

2. Can you make SlidingDrawer slide from top of screen without custom code?

I love the SlidingDrawer widget, but would love to be able to have it
slide down from the top of the screen (like the notification bar) vs.
just the bottom.   Is this possible, or am I looking at copying the
code to create a custom implementation

--~--~---------~--~----~------------~-------~--~----~

3. do we need to pay any licensing fee, if we release a WMA based Radio app?

4. How to do locale setting?

5. shoutcast aac/aacp player available at market com.leadapps.android.radio

6. first time android usage

7. ExpandableListView not expanding/collapsing when using a group View with a checkbox