OSDN Git Service

b/2500485 Made Agenda View update when there are no events found.
authorErik <roboerik@android.com>
Tue, 9 Mar 2010 23:21:28 +0000 (15:21 -0800)
committerErik <roboerik@android.com>
Wed, 10 Mar 2010 00:10:22 +0000 (16:10 -0800)
Agenda View was continuing to display removed events. Changed check for doing
update to also update if QUERY_TYPE_CLEAN is set. This forces it to update for
changes to the background data whether or not it returns any items.

Change-Id: I48fd4b32538c595e74dec13b6bd3ebce4cf280dc

src/com/android/calendar/AgendaActivity.java
src/com/android/calendar/AgendaWindowAdapter.java

index 0d86f07..c6cb8db 100644 (file)
@@ -81,7 +81,7 @@ public class AgendaActivity extends Activity implements Navigator {
     @Override
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
-        
+
         // Eliminate extra GCs during startup by setting the initial heap size to 4MB.
         // TODO: We should restore the old heap size once the activity reaches the idle state
         VMRuntime.getRuntime().setMinimumHeapSize(INITIAL_HEAP_SIZE);
index 9d4fb46..11c1d0d 100644 (file)
@@ -472,7 +472,7 @@ public class AgendaWindowAdapter extends BaseAdapter {
         if (DEBUGLOG) {
             Log.e(TAG, "refresh " + goToTime.toString() + (forced ? " forced" : " not forced"));
         }
-        
+
         int startDay = Time.getJulianDay(goToTime.toMillis(false), goToTime.gmtoff);
 
         if (!forced && isInRange(startDay, startDay)) {
@@ -678,7 +678,7 @@ public class AgendaWindowAdapter extends BaseAdapter {
 
             // Notify Listview of changes and update position
             int cursorSize = cursor.getCount();
-            if (cursorSize > 0 || mAdapterInfos.isEmpty()) {
+            if (cursorSize > 0 || mAdapterInfos.isEmpty() || data.queryType == QUERY_TYPE_CLEAN) {
                 final int listPositionOffset = processNewCursor(data, cursor);
                 if (data.goToTime == null) { // Typical Scrolling type query
                     notifyDataSetChanged();
@@ -692,9 +692,10 @@ public class AgendaWindowAdapter extends BaseAdapter {
                     if (newPosition >= 0) {
                         mAgendaListView.setSelection(newPosition + OFF_BY_ONE_BUG);
                     }
-                    if (DEBUGLOG)
+                    if (DEBUGLOG) {
                         Log.e(TAG, "Setting listview to " +
-                                       "findDayPositionNearestTime: " + (newPosition + OFF_BY_ONE_BUG));
+                                "findDayPositionNearestTime: " + (newPosition + OFF_BY_ONE_BUG));
+                    }
                 }
             } else {
                 cursor.close();