OSDN Git Service

b/2530580 Added check for first event
authorErik <roboerik@android.com>
Fri, 19 Mar 2010 21:10:22 +0000 (14:10 -0700)
committerErik <roboerik@android.com>
Fri, 19 Mar 2010 21:10:22 +0000 (14:10 -0700)
Now edit event will only give the option to modify this and all future
events if it is not the first event in a recurrence. The first event
can only see modify this instance and modify all events now.

Change-Id: I61709ae701ce1dfc6e637f8d9d30a1ef001d157c

src/com/android/calendar/EditEvent.java

index 9657224..56e7208 100644 (file)
@@ -990,13 +990,28 @@ public class EditEvent extends Activity implements View.OnClickListener,
                 int itemIndex = 0;
                 CharSequence[] items;
                 if (mSyncId == null) {
-                    items = new CharSequence[2];
+                    if(isFirstEventInSeries()) {
+                        // Still display the option so the user knows all events are changing
+                        items = new CharSequence[1];
+                    } else {
+                        items = new CharSequence[2];
+                    }
                 } else {
-                    items = new CharSequence[3];
+                    if(isFirstEventInSeries()) {
+                        items = new CharSequence[2];
+                    } else {
+                        items = new CharSequence[3];
+                    }
                     items[itemIndex++] = getText(R.string.modify_event);
                 }
                 items[itemIndex++] = getText(R.string.modify_all);
-                items[itemIndex++] = getText(R.string.modify_all_following);
+
+                // Do one more check to make sure this remains at the end of the list
+                if(!isFirstEventInSeries()) {
+                    // TODO Find out why modify all following causes a dup of the first event if
+                    // it's operating on the first event.
+                    items[itemIndex++] = getText(R.string.modify_all_following);
+                }
 
                 // Display the modification dialog.
                 new AlertDialog.Builder(this)