OSDN Git Service

auto import from //branches/cupcake/...@130745
authorThe Android Open Source Project <initial-contribution@android.com>
Tue, 10 Feb 2009 23:44:04 +0000 (15:44 -0800)
committerThe Android Open Source Project <initial-contribution@android.com>
Tue, 10 Feb 2009 23:44:04 +0000 (15:44 -0800)
67 files changed:
AndroidManifest.xml
res/drawable-land/bg_calendar.9.png [new file with mode: 0644]
res/drawable/bg_cal_card.9.png [new file with mode: 0644]
res/drawable/bg_calendar.9.png [new file with mode: 0644]
res/drawable/box_color_white.9.png
res/drawable/ic_recurring_white.png [new file with mode: 0644]
res/drawable/ic_reminder_bell.png [new file with mode: 0644]
res/drawable/strip_cal.9.png [new file with mode: 0644]
res/drawable/top_color_strip.9.png [new file with mode: 0644]
res/drawable/white_list_rule_cal.9.png [new file with mode: 0644]
res/layout-land/gadget_item.xml [new file with mode: 0644]
res/layout/agenda_day.xml
res/layout/agenda_item.xml
res/layout/bubble_event.xml
res/layout/day_activity.xml
res/layout/edit_event.xml
res/layout/event_info_activity.xml
res/layout/gadget_item.xml [new file with mode: 0644]
res/layout/month_activity.xml
res/layout/week_activity.xml
res/values-cs/arrays.xml
res/values-cs/strings.xml
res/values-de/arrays.xml
res/values-de/strings.xml
res/values-es/arrays.xml
res/values-es/strings.xml
res/values-fr/arrays.xml
res/values-fr/strings.xml
res/values-it/arrays.xml
res/values-it/strings.xml
res/values-ja/arrays.xml
res/values-ja/strings.xml
res/values-ko/arrays.xml [new file with mode: 0644]
res/values-ko/strings.xml [new file with mode: 0644]
res/values-nb/arrays.xml [new file with mode: 0644]
res/values-nb/strings.xml [new file with mode: 0644]
res/values-nl/arrays.xml
res/values-nl/strings.xml
res/values-pl/arrays.xml
res/values-pl/strings.xml
res/values-ru/arrays.xml
res/values-ru/strings.xml
res/values-zh-rCN/arrays.xml
res/values-zh-rCN/strings.xml
res/values-zh-rTW/arrays.xml
res/values-zh-rTW/strings.xml
res/values/arrays.xml
res/values/colors.xml
res/values/strings.xml
res/values/styles.xml
res/xml/gadget_info.xml [new file with mode: 0644]
src/com/android/calendar/AgendaActivity.java
src/com/android/calendar/AgendaAdapter.java
src/com/android/calendar/AlertAdapter.java
src/com/android/calendar/AlertReceiver.java
src/com/android/calendar/CalendarActivity.java
src/com/android/calendar/CalendarGadgetProvider.java [new file with mode: 0644]
src/com/android/calendar/CalendarView.java
src/com/android/calendar/DateSpinner.java [deleted file]
src/com/android/calendar/DeleteEventHelper.java
src/com/android/calendar/EditEvent.java
src/com/android/calendar/EditResponseHelper.java [new file with mode: 0644]
src/com/android/calendar/EventInfoActivity.java
src/com/android/calendar/LaunchActivity.java
src/com/android/calendar/MonthView.java
src/com/android/calendar/SelectCalendarsActivity.java
src/com/android/calendar/Utils.java

index 2a260d8..707d8ac 100644 (file)
@@ -35,7 +35,8 @@
              (android.test) library. -->
         <uses-library android:name="android.test.runner" />
 
-        <activity android:name="LaunchActivity">
+        <activity android:name="LaunchActivity"
+            android:theme="@android:style/Theme.Light">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.DEFAULT" />
         </activity>
 
         <activity android:name="MonthActivity" android:label="@string/month_view"
-            android:theme="@android:style/Theme.NoTitleBar" />
+            android:theme="@android:style/Theme.Light.NoTitleBar" />
         <activity android:name="WeekActivity" android:label="@string/week_view"
-            android:theme="@android:style/Theme.NoTitleBar" />
+            android:theme="@android:style/Theme.Light.NoTitleBar" />
         <activity android:name="DayActivity" android:label="@string/day_view"
-            android:theme="@android:style/Theme.NoTitleBar" />
-        <activity android:name="AgendaActivity" android:label="@string/agenda_view" />
+            android:theme="@android:style/Theme.Light.NoTitleBar" />
+        <activity android:name="AgendaActivity" android:label="@string/agenda_view" 
+            android:theme="@android:style/Theme.Light.NoTitleBar" />
         
         <activity android:name="EditEvent" android:label="@string/event_edit_title"
+            android:theme="@android:style/Theme.Light"
             android:configChanges="orientation|keyboardHidden">
             
             <intent-filter>
@@ -62,6 +65,7 @@
         </activity>
         
         <activity android:name="EventInfoActivity" android:label="@string/event_info_title"
+               android:theme="@android:style/Theme.Light"
             android:configChanges="orientation|keyboardHidden">
             
             <intent-filter>
                  <category android:name="android.intent.category.UNIT_TEST" />
             </intent-filter>
         </activity>
+
+        <receiver android:name="CalendarGadgetProvider">
+            <intent-filter>
+                <action android:name="android.gadget.action.GADGET_UPDATE" />
+                <action android:name="com.android.providers.calendar.EVENTS_CHANGED" />
+            </intent-filter>
+            <meta-data android:name="android.gadget.provider" android:resource="@xml/gadget_info" />
+        </receiver>
     </application>
 </manifest>
 
diff --git a/res/drawable-land/bg_calendar.9.png b/res/drawable-land/bg_calendar.9.png
new file mode 100644 (file)
index 0000000..61607ce
Binary files /dev/null and b/res/drawable-land/bg_calendar.9.png differ
diff --git a/res/drawable/bg_cal_card.9.png b/res/drawable/bg_cal_card.9.png
new file mode 100644 (file)
index 0000000..af7ec44
Binary files /dev/null and b/res/drawable/bg_cal_card.9.png differ
diff --git a/res/drawable/bg_calendar.9.png b/res/drawable/bg_calendar.9.png
new file mode 100644 (file)
index 0000000..61607ce
Binary files /dev/null and b/res/drawable/bg_calendar.9.png differ
index aaaa381..c4b41fb 100644 (file)
Binary files a/res/drawable/box_color_white.9.png and b/res/drawable/box_color_white.9.png differ
diff --git a/res/drawable/ic_recurring_white.png b/res/drawable/ic_recurring_white.png
new file mode 100644 (file)
index 0000000..758ec19
Binary files /dev/null and b/res/drawable/ic_recurring_white.png differ
diff --git a/res/drawable/ic_reminder_bell.png b/res/drawable/ic_reminder_bell.png
new file mode 100644 (file)
index 0000000..a4e01f8
Binary files /dev/null and b/res/drawable/ic_reminder_bell.png differ
diff --git a/res/drawable/strip_cal.9.png b/res/drawable/strip_cal.9.png
new file mode 100644 (file)
index 0000000..4a8d540
Binary files /dev/null and b/res/drawable/strip_cal.9.png differ
diff --git a/res/drawable/top_color_strip.9.png b/res/drawable/top_color_strip.9.png
new file mode 100644 (file)
index 0000000..d1353df
Binary files /dev/null and b/res/drawable/top_color_strip.9.png differ
diff --git a/res/drawable/white_list_rule_cal.9.png b/res/drawable/white_list_rule_cal.9.png
new file mode 100644 (file)
index 0000000..0b175a3
Binary files /dev/null and b/res/drawable/white_list_rule_cal.9.png differ
diff --git a/res/layout-land/gadget_item.xml b/res/layout-land/gadget_item.xml
new file mode 100644 (file)
index 0000000..541b01a
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/gadget"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:background="@drawable/bg_calendar"
+    android:paddingBottom="9px"
+    android:gravity="center"
+    >
+
+    <LinearLayout
+        android:id="@+id/vertical_stripe"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:background="@drawable/top_color_strip"
+        android:gravity="center_vertical"
+        >
+
+        <TextView
+            android:id="@+id/when"
+            android:layout_width="0dip"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:paddingRight="3dip"
+            android:textStyle="bold"
+            android:textSize="11px"
+            android:textColor="@color/gadget_when"
+            android:singleLine="true"
+            />
+
+        <TextView
+            android:id="@+id/reminder"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:drawableLeft="@drawable/ic_reminder_bell"
+            android:drawablePadding="3dip"
+            android:textSize="11px"
+            android:textColor="@color/gadget_when"
+            android:singleLine="true"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:paddingLeft="7px"
+        android:paddingTop="1px"
+        android:paddingRight="7px"
+        android:orientation="horizontal"
+        android:gravity="center_vertical"
+        >
+
+        <TextView
+            android:id="@+id/title"
+            android:layout_width="0dip"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:paddingRight="3dip"
+            android:textStyle="bold"
+            android:textSize="16px"
+            android:textColor="@color/gadget_title"
+            android:singleLine="true"
+            />
+
+        <FrameLayout
+            android:id="@+id/repeat"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:background="@drawable/ic_recurring_white"
+            />
+
+    </LinearLayout>
+
+</LinearLayout>
index 0a50ebc..faee4a6 100644 (file)
      limitations under the License.
 -->
 
+    
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
+    android:orientation="horizontal"
     android:layout_height="wrap_content"
     android:layout_width="fill_parent"
+    android:background="@android:color/darker_gray"
+    android:padding="4dip"
     >
-    
-    <View android:layout_height="1dip"
-        android:layout_width="fill_parent"
-        android:layout_marginTop="5dip"
-        android:background="@android:drawable/divider_horizontal_dark"
+    <TextView android:id="@+id/date"
+        android:layout_height="wrap_content"
+        android:layout_width="wrap_content"
+        android:textStyle="bold"
+        android:textColor="?android:attr/textColorPrimary"
         />
-        
-    <LinearLayout
-        android:orientation="horizontal"
+    <TextView android:id="@+id/day_of_week"
         android:layout_height="wrap_content"
-        android:layout_width="fill_parent"
-        android:background="@android:color/darker_gray"
-        android:paddingLeft="4dip"
-        >
-        <TextView android:id="@+id/date"
-            android:layout_height="wrap_content"
-            android:layout_width="wrap_content"
-            android:textStyle="bold"
-            android:textColor="?android:attr/textColorPrimary"
-            />
-        <TextView android:id="@+id/day_of_week"
-            android:layout_height="wrap_content"
-            android:layout_width="wrap_content"
-            android:layout_marginLeft="5dip"
-            android:textColor="?android:attr/textColorPrimary"
-            />
-    </LinearLayout>
-    
-    <View android:layout_height="1dip"
-        android:layout_width="fill_parent"
-        android:background="@android:drawable/divider_horizontal_dark"
-        android:layout_marginBottom="5dip"
+        android:layout_width="wrap_content"
+        android:layout_marginLeft="5dip"
+        android:textColor="?android:attr/textColorPrimary"
         />
-        
 </LinearLayout>
+    
index 1e9bbb1..e700328 100644 (file)
      limitations under the License.
 -->
 
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="horizontal"
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@android:id/content"
     android:layout_height="wrap_content"
-    android:layout_width="fill_parent"
-    android:paddingLeft="1dip"
-    android:background="@drawable/box_appointment"
-    android:layout_marginTop="2dip"
-    android:layout_marginBottom="2dip"
-    android:layout_marginLeft="3dip"
-    android:layout_marginRight="3dip"
-    >
+    android:layout_width="fill_parent">
     
-    <ImageView android:id="@+id/vertical_stripe"
-        android:layout_width="wrap_content"
-        android:layout_height="fill_parent"
-        android:layout_marginTop="2dip"
-        android:layout_marginBottom="2dip"
-        android:layout_marginRight="5dip"
-        android:background="@drawable/box_color_white" />
-        
-    <LinearLayout
-        android:orientation="vertical"
-        android:layout_height="wrap_content"
-        android:layout_width="fill_parent"
-        android:layout_weight="1">
-        
-        <TextView android:id="@+id/title"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:textStyle="bold"
-            android:textColor="@android:color/black"
-            style="?android:attr/textAppearanceMediumInverse"
-        />
-        
-        <LinearLayout
-            android:orientation="horizontal"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content">
-            
-            <LinearLayout
-                android:orientation="horizontal"
-                android:layout_width="0dip"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:gravity="center_vertical">
-                <TextView android:id="@+id/when"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:textStyle="bold"
-                    android:textColor="@android:color/black"
-                    style="?android:attr/textAppearanceSmallInverse"
-                />
-                
-                <ImageView android:id="@+id/repeat_icon"
-                    android:layout_width="wrap_content"
-                    android:layout_height="fill_parent"
-                    android:layout_marginLeft="5dip"
-                    android:src="@drawable/ic_repeat_dark"
-                    android:focusable="false"
-                    android:clickable="false"
-                />
-            </LinearLayout>
-            
-            <LinearLayout android:id="@+id/reminders_container"
-                android:orientation="vertical"
-                android:layout_height="wrap_content"
-                android:layout_width="wrap_content"
-            />
-        </LinearLayout>
-        
-        <TextView android:id="@+id/where"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:textStyle="bold"
-            android:textColor="@android:color/black"
-            style="?android:attr/textAppearanceSmallInverse"
-        />
-    </LinearLayout>
-</LinearLayout>
+       <LinearLayout
+           android:orientation="horizontal"
+           android:layout_height="wrap_content"
+           android:layout_width="fill_parent"
+           >
+           
+           <View android:id="@+id/vertical_stripe"
+               android:layout_width="10dip"
+               android:layout_height="fill_parent"
+               android:layout_marginRight="5dip" />
+               
+           <LinearLayout
+               android:orientation="vertical"
+               android:layout_height="wrap_content"
+               android:layout_width="fill_parent"
+               android:layout_weight="1">
+               
+               <TextView android:id="@+id/title"
+                   android:layout_width="fill_parent"
+                   android:layout_height="wrap_content"
+                   android:textStyle="bold"
+                   android:textColor="@android:color/black"
+                   style="?android:attr/textAppearanceMediumInverse"
+               />
+               
+               <TextView android:id="@+id/when"
+                   android:layout_width="wrap_content"
+                   android:layout_height="wrap_content"
+                   android:textStyle="bold"
+                   android:textColor="@android:color/black"
+                   style="?android:attr/textAppearanceSmallInverse"
+               />
+                       
+               <TextView android:id="@+id/where"
+                   android:layout_width="fill_parent"
+                   android:layout_height="wrap_content"
+                   android:textStyle="bold"
+                   android:textColor="@android:color/black"
+                   style="?android:attr/textAppearanceSmallInverse"
+               />
+           </LinearLayout>
+       </LinearLayout>
+</FrameLayout>
\ No newline at end of file
index 71d9e7f..9f988e3 100644 (file)
@@ -18,6 +18,7 @@
     android:id="@+id/bubble_layout"
     android:orientation="vertical"
     android:paddingTop="5dip"
+    android:paddingBottom="5dip"
     android:paddingLeft="10dip"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content">
index aeadd56..93b3ce1 100644 (file)
             android:layout_height="wrap_content" />
     </RelativeLayout>
 
-    <View
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="@android:drawable/divider_horizontal_dark" />
-
     <ViewSwitcher android:id="@+id/switcher"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent" />
index 5d222f4..68f2001 100644 (file)
                 android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
                 android:hint="@string/hint_description"
-                android:capitalize="sentences"
-                android:maxLines="4"/>
+                android:capitalize="sentences"/>
         </LinearLayout>
 
         <!-- CALENDARS -->
         </LinearLayout>
         
         <!-- BUTTONS -->
-        <View
-            android:layout_width="fill_parent"
-            android:layout_height="1dip"
-            android:background="@android:drawable/divider_horizontal_dark"
-        />
-        
         <LinearLayout
             android:orientation="horizontal"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:paddingTop="5dip"
-            android:baselineAligned="false">
+            android:paddingLeft="4dip"
+            android:paddingRight="4dip"
+            android:paddingBottom="1dip"   
+            android:background="@android:drawable/bottom_bar" >
             
             <Button android:id="@+id/save"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
+                android:layout_width="0dip"
+                android:layout_height="fill_parent"
                 android:layout_weight="1"
                 android:text="@string/save_label"
             />
             
             <Button android:id="@+id/discard"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
+                android:layout_width="0dip"
+                android:layout_height="fill_parent"
                 android:layout_weight="1"
                 android:text="@string/discard_label"
             />
             
             <Button android:id="@+id/delete"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
+                android:layout_width="0dip"
+                android:layout_height="fill_parent"
                 android:layout_weight="1"
                 android:text="@string/delete_label"
             />
index ebdcfc2..a6fbe2d 100644 (file)
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
+    
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
-    android:layout_height="fill_parent">
+    android:layout_height="fill_parent"
+    android:layout_weight="1.0" >
     
-    <ScrollView
+    <LinearLayout 
+        android:orientation="vertical"
         android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
-        android:layout_weight="1.0" >
-        
+        android:layout_height="wrap_content"
+        android:padding="8dip"
+        android:layout_alignParentTop="true" >
+
+    
         <LinearLayout android:id="@+id/event"
+               android:background="@drawable/bg_cal_card"
             android:orientation="vertical"
-            android:layout_width="fill_parent"
             android:layout_height="wrap_content"
-            android:layout_alignParentTop="true" >
+            android:layout_width="fill_parent"
+            android:layout_weight="1">
 
-            <LinearLayout
-                android:orientation="horizontal"
-                android:layout_height="wrap_content"
+                       
+                       <View android:id="@+id/strip"
+                           android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:background="@drawable/strip_cal"
+                       />
+                
+            <!-- WHAT -->
+            <TextView android:id="@+id/title"
                 android:layout_width="fill_parent"
-                android:paddingLeft="1dip"
-                android:background="@drawable/box_appointment"
-                android:layout_marginTop="2dip"
-                android:layout_marginBottom="2dip"
-                android:layout_marginLeft="3dip"
-                android:layout_marginRight="3dip"
-                >
+                android:layout_height="wrap_content"
+                android:autoLink="all"
+                android:textStyle="bold"
+                android:padding="8dip"
+                style="?android:attr/textAppearanceMedium"
+            />
+            
+                       <View android:id="@+id/divider"
+                           android:layout_width="fill_parent"
+                           android:layout_height="wrap_content"
+                           android:layout_marginLeft="8dip"
+                android:layout_marginRight="8dip"
+                           android:background="@android:drawable/divider_horizontal_dark"
+                       />
+
+            <!-- WHEN -->
+            <TextView android:id="@+id/when"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:paddingTop="5dip"
+                android:paddingLeft="8dip"
+                android:paddingRight="8dip"
+                android:textStyle="bold"
+                style="?android:attr/textAppearanceSmall"
+            />
     
-                <ImageView android:id="@+id/vertical_stripe"
-                    android:layout_width="wrap_content"
-                    android:layout_height="fill_parent"
-                    android:layout_marginTop="2dip"
-                    android:layout_marginBottom="2dip"
-                    android:layout_marginRight="5dip"
-                    android:background="@drawable/box_color_white" />
+            <!-- TIMEZONE -->
+            <LinearLayout android:id="@+id/timezone_container"
+                android:orientation="horizontal"
+                android:paddingTop="5dip"
+                android:paddingLeft="8dip"
+                android:paddingRight="8dip"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content">
         
-                <LinearLayout
-                    android:orientation="vertical"
+                <TextView android:id="@+id/timezone_label"
+                    android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_width="fill_parent"
-                    android:layout_weight="1">
-        
-                    <!-- WHAT -->
-                    <TextView android:id="@+id/title"
-                        android:layout_width="fill_parent"
-                        android:layout_height="wrap_content"
-                        android:autoLink="all"
-                        android:textStyle="bold"
-                        style="?android:attr/textAppearanceMediumInverse"
-                    />
+                    android:layout_marginRight="5dip"
+                    android:text="@string/view_event_timezone_label"
+                    style="?android:attr/textAppearanceSmall"
+                />
 
-                    <!-- WHEN -->
-                    <TextView android:id="@+id/when"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="5dip"
-                        android:textStyle="bold"
-                        style="?android:attr/textAppearanceSmallInverse"
-                    />
-            
-                    <!-- TIMEZONE -->
-                    <LinearLayout android:id="@+id/timezone_container"
-                        android:orientation="horizontal"
-                        android:layout_width="fill_parent"
-                        android:layout_height="wrap_content">
-                
-                        <TextView android:id="@+id/timezone_label"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_marginRight="5dip"
-                            android:text="@string/view_event_timezone_label"
-                            style="?android:attr/textAppearanceSmallInverse"
-                        />
-        
-                        <TextView android:id="@+id/timezone"
-                            android:layout_width="fill_parent"
-                            android:layout_height="wrap_content"
-                            android:textStyle="bold"
-                            style="?android:attr/textAppearanceSmallInverse"
-                        />
-                    </LinearLayout>
-                
-                    <!-- REPEATS -->
-                    <LinearLayout android:id="@+id/repeat_container"
-                        android:orientation="horizontal"
-                        android:layout_width="fill_parent"
-                        android:layout_height="wrap_content">
-                    
-                        <ImageView android:id="@+id/repeat_icon"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_gravity="center"
-                            android:src="@drawable/ic_repeat_dark"
-                            android:focusable="false"
-                            android:clickable="false"
-                        />
-            
-                        <TextView android:id="@+id/repeat"
-                            android:layout_width="fill_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_marginLeft="3dip"
-                            style="?android:attr/textAppearanceSmallInverse"
-                        />
-                    </LinearLayout>
-        
-                    <!-- WHERE -->
-                    <TextView android:id="@+id/where"
-                        android:layout_width="fill_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="5dip"
-                        android:autoLink="all"
-                        android:textStyle="bold"
-                        style="?android:attr/textAppearanceSmallInverse"
-                    />
-        
-                    <!-- DESCRIPTION -->
-                    <TextView android:id="@+id/description"
-                        android:layout_width="fill_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="5dip"
-                        android:autoLink="all"
-                        style="?android:attr/textAppearanceSmallInverse"
-                    />
-            
-                    <!-- CALENDAR -->
-                    <LinearLayout android:id="@+id/calendar_container"
-                        android:orientation="horizontal"
-                        android:layout_width="fill_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="5dip"
-                    >
-                
-                        <TextView android:id="@+id/calendar_label"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_marginRight="5dip"
-                            android:text="@string/view_event_calendar_label"
-                            style="?android:attr/textAppearanceSmallInverse"
-                        />
-        
-                        <TextView android:id="@+id/calendar"
-                            android:layout_width="fill_parent"
-                            android:layout_height="wrap_content"
-                            android:textStyle="bold"
-                            style="?android:attr/textAppearanceSmallInverse"
-                        />
-                    </LinearLayout>
-                </LinearLayout>
+                <TextView android:id="@+id/timezone"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:textStyle="bold"
+                    style="?android:attr/textAppearanceSmall"
+                />
             </LinearLayout>
-            
-            <!-- REMINDERS -->
-            <LinearLayout android:id="@+id/reminders_container"
-                android:orientation="vertical"
+        
+            <!-- REPEATS -->
+            <LinearLayout android:id="@+id/repeat_container"
+                android:orientation="horizontal"
+                android:paddingLeft="8dip"
+                android:paddingRight="8dip"
                 android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:paddingLeft="5dip"
-                android:paddingRight="5dip"
-                android:paddingTop="5dip"
-                android:paddingBottom="1dip">
+                android:layout_height="wrap_content">
             
-                <TextView android:id="@+id/reminders_label"
+                <ImageView android:id="@+id/repeat_icon"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="@string/reminders_label"
-                    style="?android:attr/textAppearanceMedium"/>
-            
-                <LinearLayout android:id="@+id/reminder_items_container"
-                    android:orientation="vertical"
+                    android:layout_gravity="center"
+                    android:src="@drawable/ic_repeat_dark"
+                    android:focusable="false"
+                    android:clickable="false"
+                />
+    
+                <TextView android:id="@+id/repeat"
                     android:layout_width="fill_parent"
-                    android:layout_height="wrap_content">
-                </LinearLayout>
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="3dip"
+                    style="?android:attr/textAppearanceSmall"
+                />
             </LinearLayout>
-            
-            <!-- RESPONSE -->
-            <LinearLayout android:id="@+id/response_container"
-                android:orientation="vertical"
+
+            <!-- WHERE -->
+            <TextView android:id="@+id/where"
                 android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
-                android:paddingLeft="5dip"
-                android:paddingRight="5dip"
-                android:paddingTop="5dip"
-                android:paddingBottom="1dip">
-            
-                <TextView android:id="@+id/response_label"
+                android:paddingLeft="8dip"
+                android:paddingRight="8dip"
+                android:autoLink="all"
+                android:textStyle="bold"
+                style="?android:attr/textAppearanceSmall"
+            />
+
+            <!-- DESCRIPTION -->
+            <TextView android:id="@+id/description"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:paddingLeft="8dip"
+                android:paddingRight="8dip"
+                android:autoLink="all"
+                style="?android:attr/textAppearanceSmall"
+            />
+    
+            <!-- CALENDAR -->
+            <LinearLayout android:id="@+id/calendar_container"
+                android:orientation="horizontal"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:paddingLeft="8dip"
+                android:paddingRight="8dip"
+                android:paddingBottom="5dip"
+            >
+        
+                <TextView android:id="@+id/calendar_label"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="@string/view_event_response_label"
-                    style="?android:attr/textAppearanceMedium"/>
-            
-                <Spinner android:id="@+id/response_value"
+                    android:layout_marginRight="5dip"
+                    android:text="@string/view_event_calendar_label"
+                    style="?android:attr/textAppearanceSmall"
+                />
+
+                <TextView android:id="@+id/calendar"
                     android:layout_width="fill_parent"
                     android:layout_height="wrap_content"
-                    android:entries="@array/response_labels1"/>
+                    android:textStyle="bold"
+                    style="?android:attr/textAppearanceSmall"
+                />
             </LinearLayout>
         </LinearLayout>
-    </ScrollView>
-</LinearLayout>
+        
+        <!-- REMINDERS -->
+        <LinearLayout android:id="@+id/reminders_container"
+            android:orientation="vertical"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:paddingTop="5dip"
+            android:paddingBottom="1dip">
+        
+            <TextView android:id="@+id/reminders_label"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/reminders_label"
+                style="?android:attr/textAppearanceMedium"/>
+        
+            <LinearLayout android:id="@+id/reminder_items_container"
+                android:orientation="vertical"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content">
+            </LinearLayout>
+        </LinearLayout>
+        
+        <!-- RESPONSE -->
+        <LinearLayout android:id="@+id/response_container"
+            android:orientation="vertical"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:paddingTop="5dip"
+            android:paddingBottom="1dip">
+        
+            <TextView android:id="@+id/response_label"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/view_event_response_label"
+                style="?android:attr/textAppearanceMedium"/>
+        
+            <Spinner android:id="@+id/response_value"
+                android:prompt="@string/view_event_response_label"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:entries="@array/response_labels1"/>
+        </LinearLayout>
+    </LinearLayout>
+</ScrollView>
diff --git a/res/layout/gadget_item.xml b/res/layout/gadget_item.xml
new file mode 100644 (file)
index 0000000..78eb4fb
--- /dev/null
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/gadget"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:background="@drawable/bg_calendar"
+    android:paddingBottom="9px"
+    android:gravity="center"
+    >
+
+    <LinearLayout
+        android:id="@+id/vertical_stripe"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:background="@drawable/top_color_strip"
+        android:gravity="center_vertical"
+        >
+
+        <TextView
+            android:id="@+id/when"
+            android:layout_width="0dip"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:paddingRight="3dip"
+            android:textStyle="bold"
+            android:textSize="11px"
+            android:textColor="@color/gadget_when"
+            android:singleLine="true"
+            />
+
+        <TextView
+            android:id="@+id/reminder"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:drawableLeft="@drawable/ic_reminder_bell"
+            android:drawablePadding="3dip"
+            android:textSize="11px"
+            android:textColor="@color/gadget_when"
+            android:singleLine="true"
+            />
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:paddingLeft="7px"
+        android:paddingTop="1px"
+        android:paddingRight="7px"
+        android:orientation="horizontal"
+        android:gravity="center_vertical"
+        >
+
+        <TextView
+            android:id="@+id/title"
+            android:layout_width="0dip"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:paddingRight="3dip"
+            android:textStyle="bold"
+            android:textSize="16px"
+            android:textColor="@color/gadget_title"
+            android:singleLine="true"
+            />
+
+        <FrameLayout
+            android:id="@+id/repeat"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:background="@drawable/ic_recurring_white"
+            />
+
+    </LinearLayout>
+
+    <ImageView
+        android:id="@+id/divider"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="7px"
+        android:layout_marginRight="7px"
+        android:layout_marginTop="2px"
+        android:layout_marginBottom="2px"
+        android:background="@drawable/white_list_rule_cal"
+        />
+
+    <TextView
+        android:id="@+id/where"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:paddingLeft="7px"
+        android:paddingRight="7px"
+        android:textStyle="bold"
+        android:textSize="12px"
+        android:textColor="@color/gadget_where"
+        android:singleLine="true"
+        />
+
+    <LinearLayout
+        android:id="@+id/calendar_container"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:paddingLeft="7px"
+        android:paddingRight="7px"
+        android:orientation="horizontal"
+        >
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:paddingRight="5dip"
+            android:textSize="12px"
+            android:textStyle="bold"
+            android:textColor="@color/gadget_calendar"
+            android:text="@string/gadget_calendar"
+            android:singleLine="true"
+            />
+
+        <TextView
+            android:id="@+id/calendar"
+            android:layout_width="0dip"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:textSize="12px"
+            android:textColor="@color/gadget_calendar"
+            android:singleLine="true"
+            />
+
+    </LinearLayout>
+
+</LinearLayout>
index f2fd961..fe9c651 100644 (file)
             android:layout_height="wrap_content" />
     </RelativeLayout>
 
-    <View
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="@android:drawable/divider_horizontal_dark" />
-
     <LinearLayout android:id="@+id/day_names"
         android:orientation="horizontal"
         android:background="@color/daynames_background"
index aeadd56..93b3ce1 100644 (file)
             android:layout_height="wrap_content" />
     </RelativeLayout>
 
-    <View
-        android:layout_width="fill_parent"
-        android:layout_height="1dip"
-        android:background="@android:drawable/divider_horizontal_dark" />
-
     <ViewSwitcher android:id="@+id/switcher"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent" />
index 4cd52a3..9d1c7de 100644 (file)
     <item>"Tato a budoucí události"</item>
     <item>"Všechny události"</item>
   </string-array>
+    <!-- no translation found for change_response_labels:0 (2012815396992847028) -->
+    <!-- no translation found for change_response_labels:1 (140670561403965380) -->
 </resources>
index e4ca3b0..9e46c8e 100644 (file)
     <item quantity="one">"1 den"</item>
     <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> dnů"</item>
   </plurals>
-    <!-- no translation found for show_agenda_view (7971854300981408347) -->
-    <skip />
-    <!-- no translation found for show_day_view (5782512782605466016) -->
-    <skip />
+    <string name="show_agenda_view">"Zobrazit agendu"</string>
+    <string name="show_day_view">"Zobrazit den"</string>
     <string name="agenda_view">"Agenda"</string>
     <string name="day_view">"Den"</string>
     <string name="week_view">"Týden"</string>
     <string name="modify_all_following">"Změnit tuto událost a všechny budoucí"</string>
     <string name="delete_this_event_title">"Tato událost bude odstraněna."</string>
     <string name="delete_title">"Smazat"</string>
+    <!-- no translation found for change_response_title (7704714776070974984) -->
+    <skip />
     <string name="preferences_title">"Nastavení"</string>
     <string name="preferences_general_title">"Nastavení zobrazení kalendáře"</string>
     <string name="preferences_alerts_title">"Nastavení připomenutí"</string>
     <string name="preferences_default_reminder_title">"Nastavit výchozí připomenutí"</string>
     <string name="preferences_default_reminder_dialog">"Výchozí čas připomenutí"</string>
     <string name="preferences_default_reminder_default">"10"</string>
+    <!-- no translation found for gadget_calendar (6529838309554174909) -->
+    <skip />
+    <!-- no translation found for gadget_now_event (2227001785989034221) -->
+    <skip />
+    <!-- no translation found for gadget_next_event (6212660541888750636) -->
+    <skip />
+    <!-- no translation found for gadget_later_event (8082518131045578444) -->
+    <skip />
+    <!-- no translation found for gadget_more_events:one (1813062802420615657) -->
+    <!-- no translation found for gadget_more_events:other (7993512762778431065) -->
+    <!-- no translation found for gadget_no_events (5209110911088302855) -->
+    <skip />
 </resources>
index c3233ff..b70e871 100644 (file)
     <item>"Dieser und zukünftige Termine"</item>
     <item>"Alle Termine"</item>
   </string-array>
+    <!-- no translation found for change_response_labels:0 (2012815396992847028) -->
+    <!-- no translation found for change_response_labels:1 (140670561403965380) -->
 </resources>
index 908c15d..c312604 100644 (file)
     <item quantity="one">"1 Tag"</item>
     <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> Tag(e)"</item>
   </plurals>
-    <!-- no translation found for show_agenda_view (7971854300981408347) -->
-    <skip />
-    <!-- no translation found for show_day_view (5782512782605466016) -->
-    <skip />
+    <string name="show_agenda_view">"Terminübersicht anzeigen"</string>
+    <string name="show_day_view">"Tag anzeigen"</string>
     <string name="agenda_view">"Terminübersicht"</string>
     <string name="day_view">"Tag"</string>
     <string name="week_view">"Woche"</string>
     <string name="modify_all_following">"Diesen und alle zukünftigen Termine ändern"</string>
     <string name="delete_this_event_title">"Dieser Termin wird gelöscht."</string>
     <string name="delete_title">"Löschen"</string>
+    <!-- no translation found for change_response_title (7704714776070974984) -->
+    <skip />
     <string name="preferences_title">"Einstellungen"</string>
     <string name="preferences_general_title">"Einstellung für Kalenderansicht"</string>
     <string name="preferences_alerts_title">"Erinnerungseinstellungen"</string>
     <string name="preferences_default_reminder_title">"Standarderinnerung festlegen"</string>
     <string name="preferences_default_reminder_dialog">"Standard-Erinnerungszeit"</string>
     <string name="preferences_default_reminder_default">"10"</string>
+    <!-- no translation found for gadget_calendar (6529838309554174909) -->
+    <skip />
+    <!-- no translation found for gadget_now_event (2227001785989034221) -->
+    <skip />
+    <!-- no translation found for gadget_next_event (6212660541888750636) -->
+    <skip />
+    <!-- no translation found for gadget_later_event (8082518131045578444) -->
+    <skip />
+    <!-- no translation found for gadget_more_events:one (1813062802420615657) -->
+    <!-- no translation found for gadget_more_events:other (7993512762778431065) -->
+    <!-- no translation found for gadget_no_events (5209110911088302855) -->
+    <skip />
 </resources>
index 8918eb5..c38a447 100644 (file)
     <item>"Éste y otros eventos posteriores"</item>
     <item>"Todos los eventos"</item>
   </string-array>
+    <!-- no translation found for change_response_labels:0 (2012815396992847028) -->
+    <!-- no translation found for change_response_labels:1 (140670561403965380) -->
 </resources>
index d9aafb8..9860327 100644 (file)
     <item quantity="one">"1 día"</item>
     <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> días"</item>
   </plurals>
-    <!-- no translation found for show_agenda_view (7971854300981408347) -->
-    <skip />
-    <!-- no translation found for show_day_view (5782512782605466016) -->
-    <skip />
+    <string name="show_agenda_view">"Mostrar agenda"</string>
+    <string name="show_day_view">"Mostrar día"</string>
     <string name="agenda_view">"Agenda"</string>
     <string name="day_view">"Día"</string>
     <string name="week_view">"Semana"</string>
     <string name="modify_all_following">"Cambiar éste y todos los eventos futuros"</string>
     <string name="delete_this_event_title">"Este evento se suprimirá."</string>
     <string name="delete_title">"Eliminar"</string>
+    <!-- no translation found for change_response_title (7704714776070974984) -->
+    <skip />
     <string name="preferences_title">"Configuración"</string>
     <string name="preferences_general_title">"Configuración de la vista de calendario"</string>
     <string name="preferences_alerts_title">"Configuración de los recordatorios"</string>
     <string name="preferences_default_reminder_title">"Configurar recordatorio predeterminado"</string>
     <string name="preferences_default_reminder_dialog">"Duración predeterminada del recordatorio"</string>
     <string name="preferences_default_reminder_default">"10"</string>
+    <!-- no translation found for gadget_calendar (6529838309554174909) -->
+    <skip />
+    <!-- no translation found for gadget_now_event (2227001785989034221) -->
+    <skip />
+    <!-- no translation found for gadget_next_event (6212660541888750636) -->
+    <skip />
+    <!-- no translation found for gadget_later_event (8082518131045578444) -->
+    <skip />
+    <!-- no translation found for gadget_more_events:one (1813062802420615657) -->
+    <!-- no translation found for gadget_more_events:other (7993512762778431065) -->
+    <!-- no translation found for gadget_no_events (5209110911088302855) -->
+    <skip />
 </resources>
index ee08072..3e27aed 100644 (file)
     <item>"Cet événement et les suivants"</item>
     <item>"Tous les événements"</item>
   </string-array>
+    <!-- no translation found for change_response_labels:0 (2012815396992847028) -->
+    <!-- no translation found for change_response_labels:1 (140670561403965380) -->
 </resources>
index 782f995..9f86201 100644 (file)
     <item quantity="one">"1 jour"</item>
     <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> jours"</item>
   </plurals>
-    <!-- no translation found for show_agenda_view (7971854300981408347) -->
-    <skip />
-    <!-- no translation found for show_day_view (5782512782605466016) -->
-    <skip />
+    <string name="show_agenda_view">"Afficher le planning"</string>
+    <string name="show_day_view">"Afficher le jour"</string>
     <string name="agenda_view">"Agenda"</string>
     <string name="day_view">"Jour"</string>
     <string name="week_view">"Semaine"</string>
     <string name="modify_all_following">"Modifier cet événement et tous les suivants."</string>
     <string name="delete_this_event_title">"Cet événement va être supprimé."</string>
     <string name="delete_title">"Supprimer"</string>
+    <!-- no translation found for change_response_title (7704714776070974984) -->
+    <skip />
     <string name="preferences_title">"Paramètres"</string>
     <string name="preferences_general_title">"Paramètre d\'affichage de l\'agenda"</string>
     <string name="preferences_alerts_title">"Paramètres de rappel"</string>
     <string name="preferences_default_reminder_title">"Définir le rappel par défaut"</string>
     <string name="preferences_default_reminder_dialog">"Intervalle de rappel par défaut"</string>
     <string name="preferences_default_reminder_default">"10"</string>
+    <!-- no translation found for gadget_calendar (6529838309554174909) -->
+    <skip />
+    <!-- no translation found for gadget_now_event (2227001785989034221) -->
+    <skip />
+    <!-- no translation found for gadget_next_event (6212660541888750636) -->
+    <skip />
+    <!-- no translation found for gadget_later_event (8082518131045578444) -->
+    <skip />
+    <!-- no translation found for gadget_more_events:one (1813062802420615657) -->
+    <!-- no translation found for gadget_more_events:other (7993512762778431065) -->
+    <!-- no translation found for gadget_no_events (5209110911088302855) -->
+    <skip />
 </resources>
index 68b8a9e..b6b54f5 100644 (file)
     <item>"Questo e gli eventi futuri"</item>
     <item>"Tutti gli eventi"</item>
   </string-array>
+    <!-- no translation found for change_response_labels:0 (2012815396992847028) -->
+    <!-- no translation found for change_response_labels:1 (140670561403965380) -->
 </resources>
index 4bdc622..a9999d2 100644 (file)
     <item quantity="one">"1 giorno"</item>
     <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> giorni"</item>
   </plurals>
-    <!-- no translation found for show_agenda_view (7971854300981408347) -->
-    <skip />
-    <!-- no translation found for show_day_view (5782512782605466016) -->
-    <skip />
+    <string name="show_agenda_view">"Mostra agenda"</string>
+    <string name="show_day_view">"Mostra giorno"</string>
     <string name="agenda_view">"Agenda"</string>
     <string name="day_view">"Giorno"</string>
     <string name="week_view">"Settimana"</string>
     <string name="modify_all_following">"Modifica questo e tutti gli eventi futuri."</string>
     <string name="delete_this_event_title">"L\'evento verrà eliminato."</string>
     <string name="delete_title">"Elimina"</string>
+    <!-- no translation found for change_response_title (7704714776070974984) -->
+    <skip />
     <string name="preferences_title">"Impostazioni"</string>
     <string name="preferences_general_title">"Impostazione visualizzazione calendario"</string>
     <string name="preferences_alerts_title">"Impostazioni promemoria"</string>
     <string name="preferences_default_reminder_title">"Imposta promemoria predefinito"</string>
     <string name="preferences_default_reminder_dialog">"Orario promemoria predefinito"</string>
     <string name="preferences_default_reminder_default">"10"</string>
+    <!-- no translation found for gadget_calendar (6529838309554174909) -->
+    <skip />
+    <!-- no translation found for gadget_now_event (2227001785989034221) -->
+    <skip />
+    <!-- no translation found for gadget_next_event (6212660541888750636) -->
+    <skip />
+    <!-- no translation found for gadget_later_event (8082518131045578444) -->
+    <skip />
+    <!-- no translation found for gadget_more_events:one (1813062802420615657) -->
+    <!-- no translation found for gadget_more_events:other (7993512762778431065) -->
+    <!-- no translation found for gadget_no_events (5209110911088302855) -->
+    <skip />
 </resources>
index 079b0f1..0924ebf 100644 (file)
     <item>"これ以降の予定"</item>
     <item>"すべての予定"</item>
   </string-array>
+    <!-- no translation found for change_response_labels:0 (2012815396992847028) -->
+    <!-- no translation found for change_response_labels:1 (140670561403965380) -->
 </resources>
index aedf952..9ae4f17 100644 (file)
     <item quantity="one">"1日"</item>
     <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g>日"</item>
   </plurals>
-    <!-- no translation found for show_agenda_view (7971854300981408347) -->
-    <skip />
-    <!-- no translation found for show_day_view (5782512782605466016) -->
-    <skip />
+    <string name="show_agenda_view">"予定リストを表示"</string>
+    <string name="show_day_view">"日付を表示"</string>
     <string name="agenda_view">"予定リスト"</string>
     <string name="day_view">"日"</string>
     <string name="week_view">"週"</string>
     <string name="modify_all_following">"これ以降の予定すべてを削除します。"</string>
     <string name="delete_this_event_title">"この予定を削除します。"</string>
     <string name="delete_title">"削除"</string>
+    <!-- no translation found for change_response_title (7704714776070974984) -->
+    <skip />
     <string name="preferences_title">"設定"</string>
     <string name="preferences_general_title">"カレンダーの表示の設定"</string>
     <string name="preferences_alerts_title">"通知の設定"</string>
     <string name="preferences_default_reminder_title">"デフォルトの通知を設定"</string>
     <string name="preferences_default_reminder_dialog">"デフォルトの通知時間"</string>
     <string name="preferences_default_reminder_default">"10"</string>
+    <!-- no translation found for gadget_calendar (6529838309554174909) -->
+    <skip />
+    <!-- no translation found for gadget_now_event (2227001785989034221) -->
+    <skip />
+    <!-- no translation found for gadget_next_event (6212660541888750636) -->
+    <skip />
+    <!-- no translation found for gadget_later_event (8082518131045578444) -->
+    <skip />
+    <!-- no translation found for gadget_more_events:one (1813062802420615657) -->
+    <!-- no translation found for gadget_more_events:other (7993512762778431065) -->
+    <!-- no translation found for gadget_no_events (5209110911088302855) -->
+    <skip />
 </resources>
diff --git a/res/values-ko/arrays.xml b/res/values-ko/arrays.xml
new file mode 100644 (file)
index 0000000..c959314
--- /dev/null
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+  <string-array name="reminder_minutes_labels">
+    <item>"5분"</item>
+    <item>"10분"</item>
+    <item>"15분"</item>
+    <item>"20분"</item>
+    <item>"25분"</item>
+    <item>"30분"</item>
+    <item>"45분"</item>
+    <item>"1시간"</item>
+    <item>"2시간"</item>
+    <item>"3시간"</item>
+    <item>"12시간"</item>
+    <item>"24시간"</item>
+    <item>"2일"</item>
+    <item>"1주"</item>
+  </string-array>
+  <string-array name="reminder_minutes_values">
+    <item>"5"</item>
+    <item>"10"</item>
+    <item>"15"</item>
+    <item>"20"</item>
+    <item>"25"</item>
+    <item>"30"</item>
+    <item>"45"</item>
+    <item>"60"</item>
+    <item>"120"</item>
+    <item>"180"</item>
+    <item>"720"</item>
+    <item>"1440"</item>
+    <item>"2880"</item>
+    <item>"10080"</item>
+  </string-array>
+  <string-array name="preferences_default_reminder_labels">
+    <item>"없음"</item>
+    <item>"5분"</item>
+    <item>"10분"</item>
+    <item>"15분"</item>
+    <item>"20분"</item>
+    <item>"25분"</item>
+    <item>"30분"</item>
+    <item>"45분"</item>
+    <item>"1시간"</item>
+    <item>"2시간"</item>
+    <item>"3시간"</item>
+    <item>"12시간"</item>
+    <item>"24시간"</item>
+    <item>"2일"</item>
+    <item>"1주"</item>
+  </string-array>
+  <string-array name="preferences_default_reminder_values">
+    <item>"0"</item>
+    <item>"5"</item>
+    <item>"10"</item>
+    <item>"15"</item>
+    <item>"20"</item>
+    <item>"25"</item>
+    <item>"30"</item>
+    <item>"45"</item>
+    <item>"60"</item>
+    <item>"120"</item>
+    <item>"180"</item>
+    <item>"720"</item>
+    <item>"1440"</item>
+    <item>"2880"</item>
+    <item>"10080"</item>
+  </string-array>
+  <string-array name="preferences_alert_type_labels">
+    <item>"알림"</item>
+    <item>"상태 표시줄 알림"</item>
+    <item>"해제"</item>
+  </string-array>
+  <string-array name="preferences_alert_type_values">
+    <item>"0"</item>
+    <item>"1"</item>
+    <item>"2"</item>
+  </string-array>
+  <string-array name="availability">
+    <item>"다른 용무 중"</item>
+    <item>"대화가능"</item>
+  </string-array>
+  <string-array name="visibility">
+    <item>"기본값"</item>
+    <item>"비공개"</item>
+    <item>"공개"</item>
+  </string-array>
+  <string-array name="day_labels">
+    <item>"일요일"</item>
+    <item>"월요일"</item>
+    <item>"화요일"</item>
+    <item>"수요일"</item>
+    <item>"목요일"</item>
+    <item>"금요일"</item>
+    <item>"토요일"</item>
+  </string-array>
+  <string-array name="ordinal_labels">
+    <item>"첫 번째"</item>
+    <item>"두 번째"</item>
+    <item>"3번째"</item>
+    <item>"4번째"</item>
+    <item>"마지막"</item>
+  </string-array>
+  <string-array name="response_labels1">
+    <item>"(응답 없음)"</item>
+    <item>"예"</item>
+    <item>"미정"</item>
+    <item>"아니요"</item>
+  </string-array>
+  <string-array name="response_labels2">
+    <item>"예"</item>
+    <item>"미정"</item>
+    <item>"아니요"</item>
+  </string-array>
+  <string-array name="delete_repeating_labels">
+    <item>"해당 이벤트만"</item>
+    <item>"현재 일정 및 향후 일정"</item>
+    <item>"모든 일정"</item>
+  </string-array>
+  <string-array name="delete_repeating_labels_no_selected">
+    <item>"현재 및 향후 일정"</item>
+    <item>"모든 일정"</item>
+  </string-array>
+    <!-- no translation found for change_response_labels:0 (2012815396992847028) -->
+    <!-- no translation found for change_response_labels:1 (140670561403965380) -->
+</resources>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
new file mode 100644 (file)
index 0000000..854ab87
--- /dev/null
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_label">"캘린더"</string>
+    <string name="calendar_plug"><font fgcolor="#ffffffff">"Google 캘린더에 오신 것을 환영합니다."</font>" "\n"일정 예약을 보다 간편하고 효율적이며 쉽게 사용할 수 있도록 만들어진 Google의 일정 관리 서비스입니다."</string>
+    <string name="what_label">"내용"</string>
+    <string name="when_label">"일자"</string>
+    <string name="where_label">"위치"</string>
+    <string name="repeats_label">"반복"</string>
+    <string name="no_title_label">"(제목 없음)"</string>
+  <plurals name="Nminutes">
+    <item quantity="one">"1분"</item>
+    <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g>분"</item>
+  </plurals>
+  <plurals name="Nmins">
+    <item quantity="one">"1분"</item>
+    <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g>분"</item>
+  </plurals>
+  <plurals name="Nhours">
+    <item quantity="one">"1시간"</item>
+    <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g>시간"</item>
+  </plurals>
+  <plurals name="Ndays">
+    <item quantity="one">"1일"</item>
+    <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g>일"</item>
+  </plurals>
+    <string name="show_agenda_view">"일정 표시"</string>
+    <string name="show_day_view">"하루 일정 표시"</string>
+    <string name="agenda_view">"일정목록"</string>
+    <string name="day_view">"일"</string>
+    <string name="week_view">"주"</string>
+    <string name="month_view">"월"</string>
+    <string name="event_view">"일정 보기"</string>
+    <string name="event_create">"새 일정"</string>
+    <string name="event_edit">"일정 수정"</string>
+    <string name="event_delete">"일정 삭제"</string>
+    <string name="goto_today">"오늘"</string>
+    <string name="menu_select_calendars">"내 캘린더"</string>
+    <string name="menu_preferences">"설정"</string>
+    <string name="plus_N_more">"(<xliff:g id="MORE_COUNT">%d</xliff:g>개 추가 표시)"</string>
+    <string name="calendars_title">"내 캘린더"</string>
+    <string name="add_calendars">"캘린더 추가"</string>
+    <string name="remove_calendars">"캘린더 삭제"</string>
+    <string name="event_edit_title">"일정 세부정보"</string>
+    <string name="hint_what">"일정 이름"</string>
+    <string name="hint_where">"일정 위치"</string>
+    <string name="hint_description">"일정 설명"</string>
+    <string name="creating_event">"일정을 만드는 중..."</string>
+    <string name="saving_event">"일정 저장 중..."</string>
+    <string name="loading_calendars_title">"캘린더 로드 중"</string>
+    <string name="loading_calendars_message">"캘린더 로드 중..."</string>
+    <string name="alert_when_label">"일자:"</string>
+    <string name="alert_where_label">"위치:"</string>
+    <string name="alert_missed_events_single">"(<xliff:g id="REMINDER_COUNT">%s</xliff:g>개 이상의 알림)"</string>
+    <string name="alert_missed_events_multiple">"(<xliff:g id="REMINDER_COUNT">%s</xliff:g>개 이상의 알림)"</string>
+    <string name="event_info_title">"일정 보기"</string>
+    <string name="event_info_title_invite">"회의 초대장"</string>
+    <string name="add_new_reminder">"알림 추가"</string>
+    <string name="edit_event_to_label">"종료일:"</string>
+    <string name="edit_event_from_label">"시작일:"</string>
+    <string name="edit_event_all_day_label">"종일"</string>
+    <string name="edit_event_calendar_label">"캘린더"</string>
+    <string name="edit_event_show_extra_options">"추가 옵션 표시"</string>
+    <string name="edit_event_hide_extra_options">"추가 옵션 숨기기"</string>
+    <string name="description_label">"설명"</string>
+    <string name="presence_label">"상태"</string>
+    <string name="privacy_label">"비공개"</string>
+    <string name="reminders_label">"알림"</string>
+    <string name="no_syncable_calendars">"캘린더 없음"</string>
+    <string name="no_calendars_found">"캘린더가 없습니다."</string>
+    <string name="view_event_calendar_label">"캘린더"</string>
+    <string name="view_event_timezone_label">"현지 시간대"</string>
+    <string name="view_event_response_label">"참석 여부"</string>
+    <string name="agenda_today">"오늘"</string>
+    <string name="num_events">"일정 수"</string>
+    <string name="edit_event_label">"일정 수정"</string>
+    <string name="delete_label">"삭제"</string>
+    <string name="delete_event_label">"일정 삭제"</string>
+    <string name="save_label">"저장"</string>
+    <string name="discard_label">"변경사항 취소"</string>
+    <string name="import_label">"가져오기"</string>
+    <string name="snooze_all_label">"모든 알림 일시중지"</string>
+    <string name="dismiss_all_label">"모두 해제"</string>
+    <string name="does_not_repeat">"일회성 일정"</string>
+    <string name="daily">"매일"</string>
+    <string name="every_weekday">"주중 매일(월-금)"</string>
+    <string name="weekly">"매주(<xliff:g id="DAYS_OF_WEEK">%s</xliff:g>마다)"</string>
+    <string name="monthly_on_day_count">"매월(<xliff:g id="ORDINAL_NUMBER">%1$s</xliff:g> <xliff:g id="DAY_OF_WEEK">%2$s</xliff:g>마다)"</string>
+    <string name="monthly_on_day">"매월(<xliff:g id="DAY_OF_MONTH">%s</xliff:g>일)"</string>
+    <string name="yearly">"매년(<xliff:g id="DATES">%s</xliff:g>일"</string>
+    <string name="custom">"사용자설정...(휴대전화에서는 불가능)"</string>
+    <string name="modify_event">"해당 일정만 변경합니다."</string>
+    <string name="modify_all">"반복되는 모든 일정을 변경합니다."</string>
+    <string name="modify_all_following">"현재 일정 및 모든 향후 일정을 변경합니다."</string>
+    <string name="delete_this_event_title">"일정이 삭제됩니다."</string>
+    <string name="delete_title">"삭제"</string>
+    <!-- no translation found for change_response_title (7704714776070974984) -->
+    <skip />
+    <string name="preferences_title">"설정"</string>
+    <string name="preferences_general_title">"캘린더 보기 설정"</string>
+    <string name="preferences_alerts_title">"알림 설정"</string>
+    <string name="preferences_hide_declined_title">"거절한 일정 숨기기"</string>
+    <string name="preferences_alerts_type_title">"알리미 및 알림 설정"</string>
+    <string name="preferences_alerts_type_dialog">"알리미 및 알림"</string>
+    <string name="preferences_alerts_vibrate_title">"진동"</string>
+    <string name="preferences_alerts_ringtone_title">"벨소리 선택"</string>
+    <string name="preferences_default_reminder_title">"기본 알림 설정"</string>
+    <string name="preferences_default_reminder_dialog">"기본 알림 시간"</string>
+    <string name="preferences_default_reminder_default">"10"</string>
+    <!-- no translation found for gadget_calendar (6529838309554174909) -->
+    <skip />
+    <!-- no translation found for gadget_now_event (2227001785989034221) -->
+    <skip />
+    <!-- no translation found for gadget_next_event (6212660541888750636) -->
+    <skip />
+    <!-- no translation found for gadget_later_event (8082518131045578444) -->
+    <skip />
+    <!-- no translation found for gadget_more_events:one (1813062802420615657) -->
+    <!-- no translation found for gadget_more_events:other (7993512762778431065) -->
+    <!-- no translation found for gadget_no_events (5209110911088302855) -->
+    <skip />
+</resources>
diff --git a/res/values-nb/arrays.xml b/res/values-nb/arrays.xml
new file mode 100644 (file)
index 0000000..0155043
--- /dev/null
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+  <string-array name="reminder_minutes_labels">
+    <item>"5 minutter"</item>
+    <item>"10 minutter"</item>
+    <item>"15 minutter"</item>
+    <item>"20 minutter"</item>
+    <item>"25 minutter"</item>
+    <item>"30 minutter"</item>
+    <item>"45 minutter"</item>
+    <item>"1 time"</item>
+    <item>"2 timer"</item>
+    <item>"3 timer"</item>
+    <item>"12 timer"</item>
+    <item>"24 timer"</item>
+    <item>"2 dager"</item>
+    <item>"1 uke"</item>
+  </string-array>
+  <string-array name="reminder_minutes_values">
+    <item>"5"</item>
+    <item>"10"</item>
+    <item>"15"</item>
+    <item>"20"</item>
+    <item>"25"</item>
+    <item>"30"</item>
+    <item>"45"</item>
+    <item>"60"</item>
+    <item>"120"</item>
+    <item>"180"</item>
+    <item>"720"</item>
+    <item>"1440"</item>
+    <item>"2880"</item>
+    <item>"10080"</item>
+  </string-array>
+  <string-array name="preferences_default_reminder_labels">
+    <item>"Ingen"</item>
+    <item>"5 minutter"</item>
+    <item>"10 minutter"</item>
+    <item>"15 minutter"</item>
+    <item>"20 minutter"</item>
+    <item>"25 minutter"</item>
+    <item>"30 minutter"</item>
+    <item>"45 minutter"</item>
+    <item>"1 time"</item>
+    <item>"2 timer"</item>
+    <item>"3 timer"</item>
+    <item>"12 timer"</item>
+    <item>"24 timer"</item>
+    <item>"2 dager"</item>
+    <item>"1 uke"</item>
+  </string-array>
+  <string-array name="preferences_default_reminder_values">
+    <item>"0"</item>
+    <item>"5"</item>
+    <item>"10"</item>
+    <item>"15"</item>
+    <item>"20"</item>
+    <item>"25"</item>
+    <item>"30"</item>
+    <item>"45"</item>
+    <item>"60"</item>
+    <item>"120"</item>
+    <item>"180"</item>
+    <item>"720"</item>
+    <item>"1440"</item>
+    <item>"2880"</item>
+    <item>"10080"</item>
+  </string-array>
+  <string-array name="preferences_alert_type_labels">
+    <item>"Advarsel"</item>
+    <item>"Varsling i statusfeltet"</item>
+    <item>"Av"</item>
+  </string-array>
+  <string-array name="preferences_alert_type_values">
+    <item>"0"</item>
+    <item>"1"</item>
+    <item>"2"</item>
+  </string-array>
+  <string-array name="availability">
+    <item>"Opptatt"</item>
+    <item>"Tilgjengelig"</item>
+  </string-array>
+  <string-array name="visibility">
+    <item>"Standard"</item>
+    <item>"Privat"</item>
+    <item>"Offentlig"</item>
+  </string-array>
+  <string-array name="day_labels">
+    <item>"søndag"</item>
+    <item>"mandag"</item>
+    <item>"tirsdag"</item>
+    <item>"onsdag"</item>
+    <item>"torsdag"</item>
+    <item>"fredag"</item>
+    <item>"lørdag"</item>
+  </string-array>
+  <string-array name="ordinal_labels">
+    <item>"første"</item>
+    <item>"andre"</item>
+    <item>"tredje"</item>
+    <item>"fjerde"</item>
+    <item>"siste"</item>
+  </string-array>
+  <string-array name="response_labels1">
+    <item>"(Ikke svart)"</item>
+    <item>"Ja"</item>
+    <item>"Kanskje"</item>
+    <item>"Nei"</item>
+  </string-array>
+  <string-array name="response_labels2">
+    <item>"Ja"</item>
+    <item>"Kanskje"</item>
+    <item>"Nei"</item>
+  </string-array>
+  <string-array name="delete_repeating_labels">
+    <item>"Bare denne hendelsen"</item>
+    <item>"Denne og framtidige hendelser"</item>
+    <item>"Alle hendelser"</item>
+  </string-array>
+  <string-array name="delete_repeating_labels_no_selected">
+    <item>"Denne og framtidige hendelser"</item>
+    <item>"Alle hendelser"</item>
+  </string-array>
+    <!-- no translation found for change_response_labels:0 (2012815396992847028) -->
+    <!-- no translation found for change_response_labels:1 (140670561403965380) -->
+</resources>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
new file mode 100644 (file)
index 0000000..f5a1ab7
--- /dev/null
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_label">"Kalender"</string>
+    <string name="calendar_plug"><font fgcolor="#ffffffff">"Velkommen til Google-kalenderen!"</font>" "\n"En Google-løsning for å vedlikeholde timeplanen din, bygget på ideen om at å planlegge ting skal være intuitivt, effektivt og tilgjengelig."</string>
+    <string name="what_label">"Hva"</string>
+    <string name="when_label">"Når"</string>
+    <string name="where_label">"Hvor"</string>
+    <string name="repeats_label">"Gjentas"</string>
+    <string name="no_title_label">"(Mangler emne)"</string>
+  <plurals name="Nminutes">
+    <item quantity="one">"Et minutt"</item>
+    <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> minutter"</item>
+  </plurals>
+  <plurals name="Nmins">
+    <item quantity="one">"1 min"</item>
+    <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> min"</item>
+  </plurals>
+  <plurals name="Nhours">
+    <item quantity="one">"En time"</item>
+    <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> timer"</item>
+  </plurals>
+  <plurals name="Ndays">
+    <item quantity="one">"En dag"</item>
+    <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> dager"</item>
+  </plurals>
+    <!-- no translation found for show_agenda_view (7971854300981408347) -->
+    <skip />
+    <!-- no translation found for show_day_view (5782512782605466016) -->
+    <skip />
+    <string name="agenda_view">"Agenda"</string>
+    <string name="day_view">"Dag"</string>
+    <string name="week_view">"Uke"</string>
+    <string name="month_view">"Måned"</string>
+    <string name="event_view">"Vis hendelse"</string>
+    <string name="event_create">"Ny hendelse"</string>
+    <string name="event_edit">"Rediger hendelse"</string>
+    <string name="event_delete">"Slett hendelse"</string>
+    <string name="goto_today">"I dag"</string>
+    <string name="menu_select_calendars">"Mine kalendre"</string>
+    <string name="menu_preferences">"Innstillinger"</string>
+    <string name="plus_N_more">"(samt <xliff:g id="MORE_COUNT">%d</xliff:g> til …)"</string>
+    <string name="calendars_title">"Mine kalendre"</string>
+    <string name="add_calendars">"Legg til kalendre"</string>
+    <string name="remove_calendars">"Fjern kalendre"</string>
+    <string name="event_edit_title">"Hendelsesdetaljer"</string>
+    <string name="hint_what">"Navn på hendelse"</string>
+    <string name="hint_where">"Sted"</string>
+    <string name="hint_description">"Beskrivelse av hendelsen"</string>
+    <string name="creating_event">"Lager hendelse…"</string>
+    <string name="saving_event">"Lagrer hendelse…"</string>
+    <string name="loading_calendars_title">"Laster kalendre"</string>
+    <string name="loading_calendars_message">"Laster kalendre…"</string>
+    <string name="alert_when_label">"Hva:"</string>
+    <string name="alert_where_label">"Hvor:"</string>
+    <!-- no translation found for alert_missed_events_single (8042891195314876684) -->
+    <skip />
+    <string name="alert_missed_events_multiple">"(<xliff:g id="REMINDER_COUNT">%s</xliff:g> hendelser til)"</string>
+    <string name="event_info_title">"Vis hendelse"</string>
+    <string name="event_info_title_invite">"Møteinvitasjon"</string>
+    <string name="add_new_reminder">"Legg til påminnelse"</string>
+    <string name="edit_event_to_label">"Til"</string>
+    <string name="edit_event_from_label">"Fra"</string>
+    <string name="edit_event_all_day_label">"Hele dagen"</string>
+    <string name="edit_event_calendar_label">"Kalender"</string>
+    <string name="edit_event_show_extra_options">"Vis ekstra valg"</string>
+    <string name="edit_event_hide_extra_options">"Skjul ekstra valg"</string>
+    <string name="description_label">"Beskrivelse"</string>
+    <string name="presence_label">"Vis meg som"</string>
+    <string name="privacy_label">"Personvern"</string>
+    <string name="reminders_label">"Påminnelser"</string>
+    <string name="no_syncable_calendars">"Ingen kalendre"</string>
+    <string name="no_calendars_found">"Du har ingen kalendre."</string>
+    <string name="view_event_calendar_label">"Kalender"</string>
+    <string name="view_event_timezone_label">"Lokal tidssone"</string>
+    <string name="view_event_response_label">"Kommer du?"</string>
+    <string name="agenda_today">"I dag"</string>
+    <string name="num_events">"Ant. hendelser"</string>
+    <string name="edit_event_label">"Rediger hendelse"</string>
+    <string name="delete_label">"Slett"</string>
+    <string name="delete_event_label">"Slett hendelse"</string>
+    <string name="save_label">"Lagre"</string>
+    <string name="discard_label">"Forkast hendelse"</string>
+    <string name="import_label">"Importer"</string>
+    <string name="snooze_all_label">"Slumre alle"</string>
+    <string name="dismiss_all_label">"Skjul alle"</string>
+    <string name="does_not_repeat">"Engangshendelse"</string>
+    <string name="daily">"Daglig"</string>
+    <string name="every_weekday">"Hverdager (man–fre)"</string>
+    <string name="weekly">"Ukentlig (hver <xliff:g id="DAYS_OF_WEEK">%s</xliff:g>)"</string>
+    <string name="monthly_on_day_count">"Hver måned (hver <xliff:g id="ORDINAL_NUMBER">%1$s</xliff:g> <xliff:g id="DAY_OF_WEEK">%2$s</xliff:g>)"</string>
+    <string name="monthly_on_day">"Hver måned (den <xliff:g id="DAY_OF_MONTH">%s</xliff:g>.)"</string>
+    <string name="yearly">"Hvert år (<xliff:g id="DATES">%s</xliff:g>)"</string>
+    <string name="custom">"Egendefinert… (kan ikke settes på telefonen)"</string>
+    <string name="modify_event">"Endre bare denne hendelsen."</string>
+    <string name="modify_all">"Endre alle hendelser i denne serien."</string>
+    <string name="modify_all_following">"Endre denne og alle framtidige hendelser."</string>
+    <string name="delete_this_event_title">"Denne hendelsen vil bli slettet."</string>
+    <string name="delete_title">"Slett"</string>
+    <!-- no translation found for change_response_title (7704714776070974984) -->
+    <skip />
+    <string name="preferences_title">"Innstillinger"</string>
+    <string name="preferences_general_title">"Kalender visningsinnstilling"</string>
+    <string name="preferences_alerts_title">"Innstillinger for påminnelser"</string>
+    <string name="preferences_hide_declined_title">"Skjul avslåtte hendelser"</string>
+    <string name="preferences_alerts_type_title">"Sett varsling og påminnelser"</string>
+    <string name="preferences_alerts_type_dialog">"Varsling og påminnelser"</string>
+    <string name="preferences_alerts_vibrate_title">"Vibrer"</string>
+    <string name="preferences_alerts_ringtone_title">"Velg ringetone"</string>
+    <string name="preferences_default_reminder_title">"Sett standard påminnelse"</string>
+    <string name="preferences_default_reminder_dialog">"Standard påminnelsestid"</string>
+    <string name="preferences_default_reminder_default">"10"</string>
+    <!-- no translation found for gadget_calendar (6529838309554174909) -->
+    <skip />
+    <!-- no translation found for gadget_now_event (2227001785989034221) -->
+    <skip />
+    <!-- no translation found for gadget_next_event (6212660541888750636) -->
+    <skip />
+    <!-- no translation found for gadget_later_event (8082518131045578444) -->
+    <skip />
+    <!-- no translation found for gadget_more_events:one (1813062802420615657) -->
+    <!-- no translation found for gadget_more_events:other (7993512762778431065) -->
+    <!-- no translation found for gadget_no_events (5209110911088302855) -->
+    <skip />
+</resources>
index da30bd0..238e067 100644 (file)
     <item>"Deze en toekomstige afspraken"</item>
     <item>"Alle afspraken"</item>
   </string-array>
+    <!-- no translation found for change_response_labels:0 (2012815396992847028) -->
+    <!-- no translation found for change_response_labels:1 (140670561403965380) -->
 </resources>
index e32ed04..3270db6 100644 (file)
     <item quantity="one">"1 dag"</item>
     <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> dagen"</item>
   </plurals>
-    <!-- no translation found for show_agenda_view (7971854300981408347) -->
-    <skip />
-    <!-- no translation found for show_day_view (5782512782605466016) -->
-    <skip />
+    <string name="show_agenda_view">"Geef agenda weer"</string>
+    <string name="show_day_view">"Geef dag weer"</string>
     <string name="agenda_view">"Agenda"</string>
     <string name="day_view">"Dag"</string>
     <string name="week_view">"Week"</string>
     <string name="modify_all_following">"Deze en alle toekomstige afspraken wijzigen."</string>
     <string name="delete_this_event_title">"Deze afspraak wordt verwijderd."</string>
     <string name="delete_title">"Verwijderen"</string>
+    <!-- no translation found for change_response_title (7704714776070974984) -->
+    <skip />
     <string name="preferences_title">"Instellingen"</string>
     <string name="preferences_general_title">"Instelling agendaweergave"</string>
     <string name="preferences_alerts_title">"Instellingen voor herinneringen"</string>
     <string name="preferences_default_reminder_title">"Standaardherinnering instellen"</string>
     <string name="preferences_default_reminder_dialog">"Standaard herinneringstijd"</string>
     <string name="preferences_default_reminder_default">"10"</string>
+    <!-- no translation found for gadget_calendar (6529838309554174909) -->
+    <skip />
+    <!-- no translation found for gadget_now_event (2227001785989034221) -->
+    <skip />
+    <!-- no translation found for gadget_next_event (6212660541888750636) -->
+    <skip />
+    <!-- no translation found for gadget_later_event (8082518131045578444) -->
+    <skip />
+    <!-- no translation found for gadget_more_events:one (1813062802420615657) -->
+    <!-- no translation found for gadget_more_events:other (7993512762778431065) -->
+    <!-- no translation found for gadget_no_events (5209110911088302855) -->
+    <skip />
 </resources>
index bbca539..62a7d56 100644 (file)
     <item>"To i przyszłe wydarzenia"</item>
     <item>"Wszystkie wydarzenia"</item>
   </string-array>
+    <!-- no translation found for change_response_labels:0 (2012815396992847028) -->
+    <!-- no translation found for change_response_labels:1 (140670561403965380) -->
 </resources>
index 61253eb..424038a 100644 (file)
     <item quantity="one">"1 dzień"</item>
     <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> dni"</item>
   </plurals>
-    <!-- no translation found for show_agenda_view (7971854300981408347) -->
-    <skip />
-    <!-- no translation found for show_day_view (5782512782605466016) -->
-    <skip />
+    <string name="show_agenda_view">"Pokaż plan dnia"</string>
+    <string name="show_day_view">"Pokaż dzień"</string>
     <string name="agenda_view">"Plan dnia"</string>
     <string name="day_view">"Dzień"</string>
     <string name="week_view">"Tydzień"</string>
     <string name="modify_all_following">"Zmień to i wszystkie przyszłe wydarzenia."</string>
     <string name="delete_this_event_title">"To wydarzenie zostanie usunięte."</string>
     <string name="delete_title">"Usuń"</string>
+    <!-- no translation found for change_response_title (7704714776070974984) -->
+    <skip />
     <string name="preferences_title">"Ustawienia"</string>
     <string name="preferences_general_title">"Ustawienie widoku kalendarza"</string>
     <string name="preferences_alerts_title">"Ustawienia przypomnień"</string>
     <string name="preferences_default_reminder_title">"Ustaw domyślne przypomnienie"</string>
     <string name="preferences_default_reminder_dialog">"Domyślna godzina przypomnienia"</string>
     <string name="preferences_default_reminder_default">"10"</string>
+    <!-- no translation found for gadget_calendar (6529838309554174909) -->
+    <skip />
+    <!-- no translation found for gadget_now_event (2227001785989034221) -->
+    <skip />
+    <!-- no translation found for gadget_next_event (6212660541888750636) -->
+    <skip />
+    <!-- no translation found for gadget_later_event (8082518131045578444) -->
+    <skip />
+    <!-- no translation found for gadget_more_events:one (1813062802420615657) -->
+    <!-- no translation found for gadget_more_events:other (7993512762778431065) -->
+    <!-- no translation found for gadget_no_events (5209110911088302855) -->
+    <skip />
 </resources>
index 8768ae0..857c8e5 100644 (file)
     <item>"Это и будущие мероприятия"</item>
     <item>"Все мероприятия"</item>
   </string-array>
+    <!-- no translation found for change_response_labels:0 (2012815396992847028) -->
+    <!-- no translation found for change_response_labels:1 (140670561403965380) -->
 </resources>
index c0e85d6..ab7acbc 100644 (file)
     <item quantity="one">"1 день"</item>
     <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> дн."</item>
   </plurals>
-    <!-- no translation found for show_agenda_view (7971854300981408347) -->
-    <skip />
-    <!-- no translation found for show_day_view (5782512782605466016) -->
-    <skip />
+    <string name="show_agenda_view">"Показать в режиме просмотра повестки дня"</string>
+    <string name="show_day_view">"Показать в режиме просмотра дня"</string>
     <string name="agenda_view">"Повестка дня"</string>
     <string name="day_view">"День"</string>
     <string name="week_view">"Неделя"</string>
     <string name="modify_all_following">"Изменить это и все будущие мероприятия"</string>
     <string name="delete_this_event_title">"Это мероприятие будет удалено."</string>
     <string name="delete_title">"Удалить"</string>
+    <!-- no translation found for change_response_title (7704714776070974984) -->
+    <skip />
     <string name="preferences_title">"Настройки"</string>
     <string name="preferences_general_title">"Настройка режимов просмотра календаря"</string>
     <string name="preferences_alerts_title">"Настройки напоминания"</string>
     <string name="preferences_default_reminder_title">"Установить напоминание по умолчанию"</string>
     <string name="preferences_default_reminder_dialog">"Время напоминания по умолчанию"</string>
     <string name="preferences_default_reminder_default">"10"</string>
+    <!-- no translation found for gadget_calendar (6529838309554174909) -->
+    <skip />
+    <!-- no translation found for gadget_now_event (2227001785989034221) -->
+    <skip />
+    <!-- no translation found for gadget_next_event (6212660541888750636) -->
+    <skip />
+    <!-- no translation found for gadget_later_event (8082518131045578444) -->
+    <skip />
+    <!-- no translation found for gadget_more_events:one (1813062802420615657) -->
+    <!-- no translation found for gadget_more_events:other (7993512762778431065) -->
+    <!-- no translation found for gadget_no_events (5209110911088302855) -->
+    <skip />
 </resources>
index 7fe3dcb..bb24407 100644 (file)
     <item>"此活动和将来的活动"</item>
     <item>"所有活动"</item>
   </string-array>
+    <!-- no translation found for change_response_labels:0 (2012815396992847028) -->
+    <!-- no translation found for change_response_labels:1 (140670561403965380) -->
 </resources>
index 5e1f1ab..46ed3e2 100644 (file)
     <item quantity="one">"1 天"</item>
     <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> 天"</item>
   </plurals>
-    <!-- no translation found for show_agenda_view (7971854300981408347) -->
-    <skip />
-    <!-- no translation found for show_day_view (5782512782605466016) -->
-    <skip />
+    <string name="show_agenda_view">"显示日程"</string>
+    <string name="show_day_view">"显示日期"</string>
     <string name="agenda_view">"日程"</string>
     <string name="day_view">"天"</string>
     <string name="week_view">"周"</string>
     <string name="modify_all_following">"更改此活动和将来的所有活动。"</string>
     <string name="delete_this_event_title">"系统将删除此活动。"</string>
     <string name="delete_title">"删除"</string>
+    <!-- no translation found for change_response_title (7704714776070974984) -->
+    <skip />
     <string name="preferences_title">"设置"</string>
     <string name="preferences_general_title">"日历视图设置"</string>
     <string name="preferences_alerts_title">"提醒设置"</string>
     <string name="preferences_default_reminder_title">"设置默认提醒"</string>
     <string name="preferences_default_reminder_dialog">"默认提醒时间"</string>
     <string name="preferences_default_reminder_default">"10"</string>
+    <!-- no translation found for gadget_calendar (6529838309554174909) -->
+    <skip />
+    <!-- no translation found for gadget_now_event (2227001785989034221) -->
+    <skip />
+    <!-- no translation found for gadget_next_event (6212660541888750636) -->
+    <skip />
+    <!-- no translation found for gadget_later_event (8082518131045578444) -->
+    <skip />
+    <!-- no translation found for gadget_more_events:one (1813062802420615657) -->
+    <!-- no translation found for gadget_more_events:other (7993512762778431065) -->
+    <!-- no translation found for gadget_no_events (5209110911088302855) -->
+    <skip />
 </resources>
index 5a959fe..c6a2646 100644 (file)
     <item>"此活動及未來活動"</item>
     <item>"所有活動"</item>
   </string-array>
+    <!-- no translation found for change_response_labels:0 (2012815396992847028) -->
+    <!-- no translation found for change_response_labels:1 (140670561403965380) -->
 </resources>
index 41ae78b..4cd57a2 100644 (file)
     <item quantity="one">"1 天"</item>
     <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> 天"</item>
   </plurals>
-    <!-- no translation found for show_agenda_view (7971854300981408347) -->
-    <skip />
-    <!-- no translation found for show_day_view (5782512782605466016) -->
-    <skip />
+    <string name="show_agenda_view">"顯示待辦事項"</string>
+    <string name="show_day_view">"顯示天"</string>
     <string name="agenda_view">"待辦事項"</string>
     <string name="day_view">"日"</string>
     <string name="week_view">"週"</string>
     <string name="modify_all_following">"變更此活動及所有未來活動。"</string>
     <string name="delete_this_event_title">"系統會刪除此活動。"</string>
     <string name="delete_title">"刪除"</string>
+    <!-- no translation found for change_response_title (7704714776070974984) -->
+    <skip />
     <string name="preferences_title">"設定"</string>
     <string name="preferences_general_title">"日曆檢視設定"</string>
     <string name="preferences_alerts_title">"提醒設定"</string>
     <string name="preferences_default_reminder_title">"設定預設提醒"</string>
     <string name="preferences_default_reminder_dialog">"預設提醒時間"</string>
     <string name="preferences_default_reminder_default">"10"</string>
+    <!-- no translation found for gadget_calendar (6529838309554174909) -->
+    <skip />
+    <!-- no translation found for gadget_now_event (2227001785989034221) -->
+    <skip />
+    <!-- no translation found for gadget_next_event (6212660541888750636) -->
+    <skip />
+    <!-- no translation found for gadget_later_event (8082518131045578444) -->
+    <skip />
+    <!-- no translation found for gadget_more_events:one (1813062802420615657) -->
+    <!-- no translation found for gadget_more_events:other (7993512762778431065) -->
+    <!-- no translation found for gadget_no_events (5209110911088302855) -->
+    <skip />
 </resources>
index ee8cf99..ccdfe78 100644 (file)
     </string-array>
 
     <!-- The corresponding indices are defined in DeleteEventHelper.java -->
+    <skip />
     <string-array name="delete_repeating_labels">
         <item>Only this event</item>
         <item>This &amp; future events</item>
          code where you can't delete one instance of a repeating event that
          was created on the phone until that event has been synced to the server.
      -->
+    <skip />
     <string-array name="delete_repeating_labels_no_selected">
         <item>This &amp; future events</item>
         <item>All events</item>
     </string-array>
+
+    <!-- The corresponding array indices are defined in EventInfoActivity.java -->
+    <skip />
+    <!-- The list of choices displayed in a dialog box when the user wants to
+    respond to an invitation that repeats. -->
+    <string-array name="change_response_labels">
+        <!-- The choice for responding to only one instance of a repeating event -->
+        <item>Only this instance</item>
+        <!-- The choice for responding to all instances of a repeating event -->
+        <item>All events in the series</item>
+    </string-array>
 </resources>
index f2c9fb0..b72c07f 100644 (file)
 <resources>
     <color name="event_background">#ffc3d9ff</color>
     <color name="panel_text_foreground">#ffffffff</color>
-    <color name="daynames_background">#ff1c1c1c</color>
-    <color name="calendar_all_day_event_color">#ffffffff</color>
-    <color name="calendar_event_text_color">#ff000000</color>
+    <color name="daynames_background">#ffc3d9ff</color>
+    <color name="daynames_text_color">#ff112abb</color>
+    <color name="calendar_event_selected_text_color">#ff000000</color>
+    <color name="calendar_event_text_color">#ffffffff</color>
 
-    <color name="calendar_all_day_background">#ff5a5a5a</color>
-    <color name="week_weekend">@android:color/white</color>
-    <color name="calendar_hour_label">@android:color/white</color>
-    <color name="calendar_ampm_label">#ffbebebe</color>
-    <color name="calendar_hour_background">#ff393939</color>
-    <color name="calendar_hour_selected">#ff808080</color>
-    <color name="calendar_date_banner_background">#ff424242</color>
-    <color name="calendar_date_selected">#ff808080</color>
-    <color name="calendar_date_banner_text_color">@android:color/white</color>
-    <color name="calendar_grid_area_background">#ff202020</color>
-    <color name="calendar_grid_area_selected">#ff505050</color>
-    <color name="calendar_grid_line_horizontal_color">#ff5a5a5a</color>
+    <color name="calendar_all_day_background">#ffe8eef7</color>
+    <color name="week_weekend">#ff446688</color>
+    <color name="calendar_hour_label">#ff446688</color>
+    <color name="calendar_ampm_label">#ff446688</color>
+    <color name="calendar_hour_background">#ffe8eef7</color>
+    <color name="calendar_hour_selected">#ffB0B0B0</color>
+    <color name="calendar_date_banner_background">#ffc3d9ff</color>
+    <color name="calendar_date_selected">#ffB0B0B0</color>
+    <color name="calendar_date_banner_text_color">#ff446688</color>
+    <color name="calendar_grid_area_background">#ffffffff</color>
+    <color name="calendar_grid_area_selected">#ffffffcc</color>
+    <color name="calendar_grid_line_horizontal_color">#ffdddddd</color>
     <color name="calendar_grid_line_vertical_color">#ff5a5a5a</color>
     <color name="calendar_grid_line_highlight_color">#ff707070</color>
     <color name="selection">#ffffaa00</color>
-    
+    <color name="pressed">#fffab400</color>
+        
     <color name="month_day_number">#ff404040</color>
     <color name="month_today_number">#ffffffff</color>
     <color name="month_other_month">#ff595959</color>
     <color name="month_week_banner">#20595959</color>
 
     <color name="event_center">#ff6bd697</color>
+
+    <color name="gadget_when">#ffffffff</color>
+    <color name="gadget_reminder">#ffffffff</color>
+    <color name="gadget_title">#ff000000</color>
+    <color name="gadget_where">#ff000000</color>
+    <color name="gadget_calendar">#ff000000</color>
+
+    <color name="gadget_no_events">#bb000000</color>
+    
+    <drawable name="agenda_item_declined">#88ffffff</drawable>
 </resources>
 
index dcbda28..2850097 100644 (file)
     <!-- This is the title of a popup dialog that asks for confirmation before
          deleting an event. -->
     <string name="delete_title">Delete</string>
+    <!-- This is the title of a popup dialog that asks for confirmation before
+         changing the response to an invitation. -->
+    <string name="change_response_title">Change response</string>
 
     <!-- This is the title of the screen for setting user preferences. -->
     <string name="preferences_title">"Settings"</string>
     <string name="preferences_default_reminder_dialog">Default reminder time</string>
     <!-- Default value for the number of reminder minutes -->
     <string name="preferences_default_reminder_default">10</string>
+
+    <!-- Bold prefix for gadget that identifies the calendar display name -->
+    <string name="gadget_calendar">Calendar:</string>
+
+    <!-- Prefix for date/time of currently happening event in gadget -->
+    <string name="gadget_now_event">Now: <xliff:g id="time_date">%s</xliff:g></string>
+    <!-- Prefix for date/time of next upcoming event in gadget -->
+    <string name="gadget_next_event">Next: <xliff:g id="time_date">%s</xliff:g></string>
+    <!-- Prefix for date/time of later upcoming event in gadget -->
+    <string name="gadget_later_event">Later: <xliff:g id="time_date">%s</xliff:g></string>
+
+    <!-- Shown in gadget when additional events are available for display, but no room remaining -->
+    <plurals name="gadget_more_events">
+        <!-- additional events message for 1 event -->
+        <item quantity="one">1 more event</item>
+        <!-- additional events message for multiple events -->
+        <item quantity="other"><xliff:g id="number">%d</xliff:g> more events</item>
+    </plurals>
+
+    <!-- Caption to show on gadget when there are no upcoming calendar events -->
+    <string name="gadget_no_events">No upcoming calendar events</string>
+
 </resources>
index 64dfb61..bcc04c2 100644 (file)
@@ -39,7 +39,7 @@
     <style name="TextAppearance.MonthView_DayLabel">
         <item name="android:textSize">14sp</item>
         <item name="android:textStyle">bold</item>
-        <item name="android:textColor">@android:color/white</item>
+        <item name="android:textColor">@color/daynames_text_color</item>
     </style>
     
     <style name="TextAppearance.AgendaView_ValueLabel">
diff --git a/res/xml/gadget_info.xml b/res/xml/gadget_info.xml
new file mode 100644 (file)
index 0000000..e5720c9
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<gadget-provider xmlns:android="http://schemas.android.com/apk/res/android"
+    android:minWidth="300px"
+    android:minHeight="30px"
+    android:updatePeriodMillis="0"
+    android:initialLayout="@layout/gadget_item"
+    >
+</gadget-provider>
index f35c238..fd159e6 100644 (file)
@@ -51,7 +51,7 @@ public class AgendaActivity extends Activity implements ViewSwitcher.ViewFactory
 
     protected static final String BUNDLE_KEY_RESTORE_TIME = "key_restore_time";
 
-    private static final String[] PROJECTION = new String[] {
+    static final String[] PROJECTION = new String[] {
         Instances._ID,                  // 0
         Instances.TITLE,                // 1
         Instances.EVENT_LOCATION,       // 2
@@ -125,8 +125,6 @@ public class AgendaActivity extends Activity implements ViewSwitcher.ViewFactory
 
         public AgendaListView(Context context) {
             super(context, null);
-            setDivider(null);
-            setSelector(android.R.color.transparent);
             setOnItemClickListener(mOnItemClickListener);
             setChoiceMode(ListView.CHOICE_MODE_SINGLE);
             mAdapter = new AgendaAdapter(AgendaActivity.this, R.layout.agenda_item);
index 07a6bc7..6aac218 100644 (file)
 
 package com.android.calendar;
 
-import android.content.ContentResolver;
 import android.content.Context;
 import android.content.res.Resources;
 import android.database.Cursor;
-import android.graphics.PorterDuff;
-import android.net.Uri;
 import android.provider.Calendar.Attendees;
 import android.provider.Calendar.Reminders;
 import android.text.format.DateFormat;
 import android.text.format.DateUtils;
-import android.view.LayoutInflater;
 import android.view.View;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
+import android.widget.FrameLayout;
 import android.widget.ResourceCursorAdapter;
 import android.widget.TextView;
 
@@ -37,12 +32,12 @@ import java.util.ArrayList;
 
 public class AgendaAdapter extends ResourceCursorAdapter {
     
-    private static final String[] REMINDERS_PROJECTION = new String[] {
+    static final String[] REMINDERS_PROJECTION = new String[] {
         Reminders._ID,      // 0
         Reminders.MINUTES,  // 1
     };
-    private static final int REMINDERS_INDEX_MINUTES = 1;
-    private static final String REMINDERS_WHERE = Reminders.EVENT_ID + "=%d AND (" + 
+    static final int REMINDERS_INDEX_MINUTES = 1;
+    static final String REMINDERS_WHERE = Reminders.EVENT_ID + "=%d AND (" + 
             Reminders.METHOD + "=" + Reminders.METHOD_ALERT + " OR " + Reminders.METHOD + "=" +
             Reminders.METHOD_DEFAULT + ")";
     
@@ -57,16 +52,16 @@ public class AgendaAdapter extends ResourceCursorAdapter {
     
     @Override
     public void bindView(View view, Context context, Cursor cursor) {
-        ImageView stripe = (ImageView) view.findViewById(R.id.vertical_stripe);
-        int color = cursor.getInt(AgendaActivity.INDEX_COLOR) & 0xbbffffff;
-        stripe.getBackground().setColorFilter(color, PorterDuff.Mode.SRC_IN);
-        
-        // Fade visible boxes if event was declined.
+        // Fade text if event was declined.
         int selfAttendeeStatus = cursor.getInt(AgendaActivity.INDEX_SELF_ATTENDEE_STATUS);
         boolean declined = (selfAttendeeStatus == Attendees.ATTENDEE_STATUS_DECLINED);
-        int targetAlpha = declined ? 128 : 255;
+        
+        View stripe = view.findViewById(R.id.vertical_stripe);
+        int color = cursor.getInt(AgendaActivity.INDEX_COLOR);
+        ((FrameLayout) view).setForeground(declined ? 
+                mResources.getDrawable(R.drawable.agenda_item_declined) : null);
 
-        view.getBackground().setAlpha(targetAlpha);
+        stripe.setBackgroundColor(color);
         
         // What
         TextView title = (TextView) view.findViewById(R.id.title);
@@ -75,6 +70,7 @@ public class AgendaAdapter extends ResourceCursorAdapter {
             titleString = mResources.getString(R.string.no_title_label);
         }
         title.setText(titleString);
+        title.setTextColor(color);
         
         // When
         TextView when = (TextView) view.findViewById(R.id.when);
@@ -94,6 +90,16 @@ public class AgendaAdapter extends ResourceCursorAdapter {
         whenString = DateUtils.formatDateRange(context, begin, end, flags);
         when.setText(whenString);
         
+        String rrule = cursor.getString(AgendaActivity.INDEX_RRULE);
+        if (rrule != null) {
+            when.setCompoundDrawablesWithIntrinsicBounds(null, null, 
+                    context.getResources().getDrawable(R.drawable.ic_repeat_dark), null);
+            when.setCompoundDrawablePadding(5);
+        } else {
+            when.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
+        }
+        
+        /*
         // Repeating info
         View repeatContainer = view.findViewById(R.id.repeat_icon);
         String rrule = cursor.getString(AgendaActivity.INDEX_RRULE);
@@ -102,12 +108,15 @@ public class AgendaAdapter extends ResourceCursorAdapter {
         } else {
             repeatContainer.setVisibility(View.GONE);
         }
+        */
         
+        /*
         // Reminder
         boolean hasAlarm = cursor.getInt(AgendaActivity.INDEX_HAS_ALARM) != 0;
         if (hasAlarm) {
             updateReminder(view, context, begin, cursor.getLong(AgendaActivity.INDEX_EVENT_ID));
         }
+        */
         
         // Where
         TextView where = (TextView) view.findViewById(R.id.where);
@@ -120,6 +129,7 @@ public class AgendaAdapter extends ResourceCursorAdapter {
         }
     }
 
+    /*
     public static void updateReminder(View view, Context context, long begin, long eventId) {
         ContentResolver cr = context.getContentResolver();
         Uri uri = Reminders.CONTENT_URI;
@@ -143,5 +153,6 @@ public class AgendaAdapter extends ResourceCursorAdapter {
         }
         remindersCursor.close();
     }
+    */
 }
 
index 0f0a49e..b182ccd 100644 (file)
@@ -49,13 +49,15 @@ public class AlertAdapter extends ResourceCursorAdapter {
         } else {
             repeatContainer.setVisibility(View.GONE);
         }
-                
+        
+        /*
         // Reminder
         boolean hasAlarm = cursor.getInt(AlertActivity.INDEX_HAS_ALARM) != 0;
         if (hasAlarm) {
             AgendaAdapter.updateReminder(view, context, cursor.getLong(AlertActivity.INDEX_BEGIN),
                     cursor.getLong(AlertActivity.INDEX_EVENT_ID));
         }
+        */
         
         String eventName = cursor.getString(AlertActivity.INDEX_TITLE);
         String location = cursor.getString(AlertActivity.INDEX_EVENT_LOCATION);
index 6044365..20f065c 100644 (file)
@@ -25,10 +25,12 @@ import android.content.ContentResolver;
 import android.content.ContentValues;
 import android.content.Context;
 import android.content.Intent;
+import android.content.SharedPreferences;
 import android.content.res.Resources;
 import android.database.Cursor;
 import android.net.Uri;
 import android.os.PowerManager;
+import android.preference.PreferenceManager;
 import android.provider.Calendar.CalendarAlerts;
 
 /**
@@ -166,7 +168,15 @@ public class AlertReceiver extends BroadcastReceiver {
             nm.cancel(AlertActivity.NOTIFICATION_ID);
             return;
         }
-        
+
+        // Check the settings to see if alerts are disabled
+        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+        String reminderType = prefs.getString(CalendarPreferenceActivity.KEY_ALERTS_TYPE,
+                CalendarPreferenceActivity.ALERT_TYPE_STATUS_BAR);
+        if (reminderType.equals(CalendarPreferenceActivity.ALERT_TYPE_OFF)) {
+            return;
+        }
+
         String title = alertCursor.getString(ALERT_INDEX_TITLE);
         String location = alertCursor.getString(ALERT_INDEX_EVENT_LOCATION);
         
index c02c0a3..639d59c 100644 (file)
@@ -111,7 +111,7 @@ public class CalendarActivity extends Activity implements Navigator {
         mInAnimationBackward = AnimationUtils.loadAnimation(this, R.anim.slide_right_in);
         mOutAnimationBackward = AnimationUtils.loadAnimation(this, R.anim.slide_right_out);
 
-        mGestureDetector = new GestureDetector(new CalendarGestureListener());
+        mGestureDetector = new GestureDetector(this, new CalendarGestureListener());
         mEventLoader = new EventLoader(this);
     }
 
diff --git a/src/com/android/calendar/CalendarGadgetProvider.java b/src/com/android/calendar/CalendarGadgetProvider.java
new file mode 100644 (file)
index 0000000..86213fe
--- /dev/null
@@ -0,0 +1,460 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.calendar;
+
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.content.BroadcastReceiver;
+import android.content.ComponentName;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.res.Resources;
+import android.database.Cursor;
+import android.gadget.GadgetManager;
+import android.graphics.PorterDuff;
+import android.net.Uri;
+import android.provider.Calendar;
+import android.provider.Calendar.Attendees;
+import android.provider.Calendar.Calendars;
+import android.provider.Calendar.EventsColumns;
+import android.provider.Calendar.Instances;
+import android.provider.Calendar.Reminders;
+import android.text.format.DateFormat;
+import android.text.format.DateUtils;
+import android.util.Config;
+import android.util.Log;
+import android.view.View;
+import android.widget.RemoteViews;
+
+import java.util.Arrays;
+
+/**
+ * Simple gadget to show next upcoming calendar event.
+ */
+public class CalendarGadgetProvider extends BroadcastReceiver {
+    static final String TAG = "CalendarGadgetProvider";
+    // TODO: turn off this debugging
+    static final boolean LOGD = Config.LOGD || true;
+
+    static final String[] UPDATE_PROJECTION = new String[] {
+        Instances.ALL_DAY,
+        Instances.BEGIN,
+        Instances.END
+    };
+
+    static final String EVENT_SORT_ORDER = "begin ASC, title ASC";
+
+    static final String[] EVENT_PROJECTION = new String[] {
+        Instances.ALL_DAY,
+        Instances.BEGIN,
+        Instances.END,
+        Instances.COLOR,
+        Instances.TITLE,
+        Instances.RRULE,
+        Instances.HAS_ALARM,
+        Instances.EVENT_LOCATION,
+        Instances.CALENDAR_ID,
+        Instances.EVENT_ID,
+    };
+
+    static final int INDEX_ALL_DAY = 0;
+    static final int INDEX_BEGIN = 1;
+    static final int INDEX_END = 2;
+    static final int INDEX_COLOR = 3;
+    static final int INDEX_TITLE = 4;
+    static final int INDEX_RRULE = 5;
+    static final int INDEX_HAS_ALARM = 6;
+    static final int INDEX_EVENT_LOCATION = 7;
+    static final int INDEX_CALENDAR_ID = 8;
+    static final int INDEX_EVENT_ID = 9;
+    
+    static final long SHORT_DURATION = DateUtils.DAY_IN_MILLIS;
+    static final long LONG_DURATION = DateUtils.WEEK_IN_MILLIS;
+    
+    static final long UPDATE_DELAY_TRIGGER_DURATION = DateUtils.MINUTE_IN_MILLIS * 30;
+    static final long UPDATE_DELAY_DURATION = DateUtils.MINUTE_IN_MILLIS * 5;
+
+    public void onReceive(Context context, Intent intent) {
+        String action = intent.getAction();
+        
+        if (GadgetManager.GADGET_ENABLED_ACTION.equals(action)) {
+            if (LOGD) Log.d(TAG, "ENABLED");
+        } else if (GadgetManager.GADGET_DISABLED_ACTION.equals(action)) {
+            if (LOGD) Log.d(TAG, "DISABLED");
+            // TODO: remove all alarmmanager subscriptions?
+        } else if (GadgetManager.GADGET_UPDATE_ACTION.equals(action)) {
+            if (LOGD) Log.d(TAG, "UPDATE");
+
+            // Update specific gadgets
+            int[] gadgetIds = intent.getIntArrayExtra(GadgetManager.EXTRA_GADGET_IDS);
+            performUpdate(context, gadgetIds);
+            
+//        } else if (Calendar.ACTION_EVENTS_CHANGED.equals(action)) {
+//            if (LOGD) Log.d(TAG, "ACTION_EVENTS_CHANGED");
+//            
+//            // Force update of all gadgets when a calendar changes
+//            performUpdate(context, null);
+        }
+        
+        // TODO: handle configuration step for picking calendars from the user?
+        // TODO: backend database to store selected calendars?
+        
+    }
+    
+    /**
+     * Process and push out an update for the given gadgetIds.
+     */
+    static void performUpdate(Context context, int[] gadgetIds) {
+        // TODO: get list of all alive gadgetids to make sure we update all active
+        // TODO: lookup calendarQuery in our backend database
+        
+        ContentResolver resolver = context.getContentResolver();
+        
+        // We're interested in selected calendars that have un-declined events
+        String calendarQuery = String.format("%s=1 AND %s!=%d", Calendars.SELECTED,
+                Instances.SELF_ATTENDEE_STATUS, Attendees.ATTENDEE_STATUS_DECLINED);
+        
+        Cursor cursor = null;
+        RemoteViews views = null;
+
+        try {
+            // Try searching for events in next day, if nothing found then expand
+            // search to upcoming week.
+            cursor = getUpcomingInstancesCursor(resolver, SHORT_DURATION, calendarQuery);
+            
+            if (cursor == null || cursor.getCount() == 0) {
+                if (cursor != null) {
+                    cursor.close();
+                }
+                if (LOGD) Log.d(TAG, "having to look into LONG_DURATION");
+                cursor = getUpcomingInstancesCursor(resolver, LONG_DURATION, calendarQuery);
+            }
+            
+            // TODO: iterate across several events if showing more than one event in gadget
+            if (cursor != null && cursor.moveToFirst()) {
+                views = getGadgetUpdate(context, cursor);
+            } else {
+                views = getGadgetUpdateError(context);
+            }
+        } finally {
+            // Close the cursor we used, if still valid
+            if (cursor != null) {
+                cursor.close();
+            }
+        }
+        
+        GadgetManager gm = GadgetManager.getInstance(context);
+        if (gadgetIds != null) {
+            gm.updateGadget(gadgetIds, views);
+        } else {
+            ComponentName thisGadget = new ComponentName(context, CalendarGadgetProvider.class);
+            gm.updateGadget(thisGadget, views);
+        }
+
+        // Schedule an alarm to wake ourselves up for the next update.  We also cancel
+        // all existing wake-ups because PendingIntents don't match against extras.
+        
+        Intent updateIntent = new Intent(GadgetManager.GADGET_UPDATE_ACTION);
+        PendingIntent pendingUpdate = PendingIntent.getBroadcast(context,
+                0 /* no requestCode */, updateIntent, 0 /* no flags */);
+
+        // Figure out next time we need to update, and force to at least one minute
+        long triggerTime = calculateUpdateTime(context, calendarQuery);
+        long worstCase = System.currentTimeMillis() + DateUtils.MINUTE_IN_MILLIS;
+        if (triggerTime < worstCase) {
+            triggerTime = worstCase;
+        }
+        
+        AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
+        am.cancel(pendingUpdate);
+        am.set(AlarmManager.RTC, triggerTime, pendingUpdate);
+
+        if (LOGD) {
+            long seconds = (triggerTime - System.currentTimeMillis()) /
+                    DateUtils.SECOND_IN_MILLIS;
+            Log.d(TAG, String.format("Scheduled next update at %d (%d seconds from now)",
+                    triggerTime, seconds));
+        }
+        
+    }
+    
+    /**
+     * Figure out the best time to push gadget updates. If the event is longer
+     * than 30 minutes, we should wait until 5 minutes after it starts to
+     * replace it with next event. Otherwise we replace at start time.
+     * <p>
+     * Absolute worst case is that we don't have an upcoming event in the next
+     * week, so we should wait an entire day before the next push.
+     */
+    static long calculateUpdateTime(Context context, String calendarQuery) {
+        ContentResolver resolver = context.getContentResolver();
+        long result = System.currentTimeMillis() + DateUtils.DAY_IN_MILLIS;
+
+        Cursor cursor = null;
+        try {
+            long start = System.currentTimeMillis();
+            long end = start + LONG_DURATION;
+            
+            Uri uri = Uri.withAppendedPath(Instances.CONTENT_URI,
+                    String.format("%d/%d", start, end));
+
+            // Make sure we only look at events *starting* after now
+            String selection = String.format("(%s) AND %s > %d",
+                    calendarQuery, Instances.BEGIN, start);
+            
+            cursor = resolver.query(uri, UPDATE_PROJECTION, selection, null,
+                    EVENT_SORT_ORDER);
+            
+            if (cursor != null && cursor.moveToFirst()) {
+                boolean allDay = cursor.getInt(INDEX_ALL_DAY) != 0;
+                start = cursor.getLong(INDEX_BEGIN);
+                end = cursor.getLong(INDEX_END);
+                
+                // If event is longer than our trigger, avoid pushing an update
+                // for next event until a few minutes after it starts.  (Otherwise
+                // just push the update right as the event starts.)
+                long length = end - start;
+                if (length >= UPDATE_DELAY_TRIGGER_DURATION) {
+                    result = start + UPDATE_DELAY_DURATION;
+                } else {
+                    result = start;
+                }
+            }
+        } finally {
+            if (cursor != null) {
+                cursor.close();
+            }
+        }
+        
+        return result;
+    }
+    
+    /**
+     * Build a set of {@link RemoteViews} that describes how to update any
+     * gadget for a specific event instance. This assumes the incoming cursor on
+     * a valid row from {@link Instances#CONTENT_URI}.
+     */
+    static RemoteViews getGadgetUpdate(Context context, Cursor cursor) {
+        ContentResolver resolver = context.getContentResolver();
+        
+        RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.gadget_item);
+        
+        // Clicking on gadget launches the agenda view in Calendar
+        Intent agendaIntent = new Intent(context, AgendaActivity.class);
+        PendingIntent pendingIntent = PendingIntent.getActivity(context, 0 /* no requestCode */,
+                agendaIntent, 0 /* no flags */);
+        
+        views.setOnClickPendingIntent(R.id.gadget, pendingIntent);
+        
+        views.setViewVisibility(R.id.vertical_stripe, View.VISIBLE);
+        views.setViewVisibility(R.id.divider, View.VISIBLE);
+        
+        // Color stripe
+        int colorFilter = cursor.getInt(INDEX_COLOR);
+        views.setDrawableParameters(R.id.vertical_stripe, true, -1, colorFilter,
+                PorterDuff.Mode.SRC_IN, -1);
+        views.setTextColor(R.id.title, colorFilter);
+        views.setDrawableParameters(R.id.repeat, true, -1, colorFilter,
+                PorterDuff.Mode.SRC_IN, -1);
+        views.setDrawableParameters(R.id.divider, true, -1, colorFilter,
+                PorterDuff.Mode.SRC_IN, -1);
+
+        // What
+        String titleString = cursor.getString(INDEX_TITLE);
+        if (titleString == null || titleString.length() == 0) {
+            titleString = context.getString(R.string.no_title_label);
+        }
+        views.setTextViewText(R.id.title, titleString);
+        
+        // When
+        long start = cursor.getLong(INDEX_BEGIN);
+        long end = cursor.getLong(INDEX_END);
+        boolean allDay = cursor.getInt(INDEX_ALL_DAY) != 0;
+        
+        if (LOGD) {
+            long offset = start - System.currentTimeMillis();
+            Log.d(TAG, "found event offset=" + offset);
+        }
+        
+        int flags;
+        String whenString;
+        if (allDay) {
+            flags = DateUtils.FORMAT_UTC | DateUtils.FORMAT_SHOW_WEEKDAY |
+                    DateUtils.FORMAT_SHOW_DATE;
+        } else {
+            flags = DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE;
+        }
+        if (DateFormat.is24HourFormat(context)) {
+            flags |= DateUtils.FORMAT_24HOUR;
+        }
+        whenString = DateUtils.formatDateRange(context, start, end, flags);
+        whenString = context.getString(R.string.gadget_next_event, whenString);
+        views.setTextViewText(R.id.when, whenString);
+
+        // Repeating info
+        String rrule = cursor.getString(INDEX_RRULE);
+        if (rrule != null) {
+            views.setViewVisibility(R.id.repeat, View.VISIBLE);
+        } else {
+            views.setViewVisibility(R.id.repeat, View.GONE);
+        }
+        
+        // Reminder
+        boolean hasAlarm = cursor.getInt(INDEX_HAS_ALARM) != 0;
+        if (hasAlarm) {
+            long eventId = cursor.getLong(INDEX_EVENT_ID);
+            int alarmMinutes = getAlarmMinutes(resolver, eventId);
+            
+            if (alarmMinutes != -1) {
+                views.setViewVisibility(R.id.reminder, View.VISIBLE);
+                views.setTextViewText(R.id.reminder, String.valueOf(alarmMinutes));
+            } else {
+                views.setViewVisibility(R.id.reminder, View.GONE);
+            }
+        } else {
+            views.setViewVisibility(R.id.reminder, View.GONE);
+        }
+        
+        // Where
+        String whereString = cursor.getString(INDEX_EVENT_LOCATION);
+        if (whereString != null && whereString.length() > 0) {
+            views.setViewVisibility(R.id.where, View.VISIBLE);
+            views.setTextViewText(R.id.where, whereString);
+        } else {
+            views.setViewVisibility(R.id.where, View.GONE);
+        }
+        
+        // Calendar
+        long calendarId = cursor.getLong(INDEX_CALENDAR_ID);
+        String displayName = getCalendarDisplayName(resolver, calendarId);
+        if (displayName != null && displayName.length() > 0) {
+            views.setViewVisibility(R.id.calendar_container, View.VISIBLE);
+            views.setTextViewText(R.id.calendar, displayName);
+        } else {
+            views.setViewVisibility(R.id.calendar_container, View.GONE);
+        }
+        
+        return views;
+    }
+    
+    /**
+     * Build a set of {@link RemoteViews} that describes an error state.
+     */
+    static RemoteViews getGadgetUpdateError(Context context) {
+        RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.gadget_item);
+
+        Resources res = context.getResources();
+        views.setTextViewText(R.id.title, res.getText(R.string.gadget_no_events));
+        views.setTextColor(R.id.title, res.getColor(R.color.gadget_no_events));
+        
+        views.setViewVisibility(R.id.vertical_stripe, View.GONE);
+        views.setViewVisibility(R.id.repeat, View.GONE);
+        views.setViewVisibility(R.id.divider, View.GONE);
+        views.setViewVisibility(R.id.where, View.GONE);
+        views.setViewVisibility(R.id.calendar_container, View.GONE);
+        
+        // Clicking on gadget launches the agenda view in Calendar
+        Intent agendaIntent = new Intent(context, AgendaActivity.class);
+        PendingIntent pendingIntent = PendingIntent.getActivity(context, 0 /* no requestCode */,
+                agendaIntent, 0 /* no flags */);
+        
+        views.setOnClickPendingIntent(R.id.gadget, pendingIntent);
+
+        return views;
+    }
+    
+    /**
+     * Query across all calendars for upcoming event instances from now until
+     * some time in the future.
+     * 
+     * @param searchDuration Distance into the future to look for event
+     *            instances in milliseconds.
+     * @param calendarQuery SQL string to apply against the event selection
+     *            clause so we can filter a specific subset of calendars. A good
+     *            field for filtering is _sync_id in the Calendar table, if
+     *            present.
+     */
+    static Cursor getUpcomingInstancesCursor(ContentResolver resolver, long searchDuration,
+            String calendarQuery) {
+        // Search for events from now until some time in the future
+        long start = System.currentTimeMillis();
+        long end = start + searchDuration;
+        
+        Uri uri = Uri.withAppendedPath(Instances.CONTENT_URI,
+                String.format("%d/%d", start, end));
+
+        // Make sure we only look at events *starting* after now
+        String selection = String.format("(%s) AND %s > %d",
+                calendarQuery, Instances.BEGIN, start);
+
+        return resolver.query(uri, EVENT_PROJECTION, selection, null,
+                EVENT_SORT_ORDER);
+    }
+    
+    /**
+     * Pull the display name of a specific {@link EventsColumns#CALENDAR_ID}.
+     */
+    static String getCalendarDisplayName(ContentResolver resolver, long calendarId) {
+        Cursor cursor = null;
+        String result = null;
+        
+        try {
+            cursor = resolver.query(Calendars.CONTENT_URI,
+                    EventInfoActivity.CALENDARS_PROJECTION,
+                    String.format(EventInfoActivity.CALENDARS_WHERE, calendarId),
+                    null, null);
+
+            if (cursor != null && cursor.moveToFirst()) {
+                result = cursor.getString(EventInfoActivity.CALENDARS_INDEX_DISPLAY_NAME);
+            }
+        } finally {
+            if (cursor != null) {
+                cursor.close();
+            }
+        }
+        
+        return result;
+    }
+    
+    /**
+     * Pull the alarm reminder, in minutes, for a specific event.
+     */
+    static int getAlarmMinutes(ContentResolver resolver, long eventId) {
+        Cursor cursor = null;
+        int result = -1;
+        
+        try {
+            cursor = resolver.query(Reminders.CONTENT_URI,
+                    AgendaAdapter.REMINDERS_PROJECTION,
+                    String.format(AgendaAdapter.REMINDERS_WHERE, eventId),
+                    null, null);
+            
+            if (cursor != null && cursor.moveToFirst()) {
+                result = cursor.getInt(AgendaAdapter.REMINDERS_INDEX_MINUTES);
+            }
+        } finally {
+            if (cursor != null) {
+                cursor.close();
+            }
+        }
+        
+        return result;
+    }
+    
+}
+
index 747bd3b..e664ae6 100644 (file)
@@ -145,7 +145,7 @@ public class CalendarView extends View
     private Rect mSrcRect = new Rect();
     private Rect mDestRect = new Rect();
     private Paint mPaint = new Paint();
-    private Paint mEventPaint = new Paint();
+    private Paint mEventTextPaint = new Paint();
     private Paint mSelectionPaint = new Paint();
     private Path mPath = new Path();
 
@@ -154,7 +154,7 @@ public class CalendarView extends View
 
     private PopupWindow mPopup;
     private View mPopupView;
-    private static final int POPUP_HEIGHT = 62;
+    private static final int POPUP_HEIGHT = 67;
 
     // The number of milliseconds to show the popup window
     private static final int POPUP_DISMISS_DELAY = 3000;
@@ -200,11 +200,10 @@ public class CalendarView extends View
     private static final int MAX_EVENT_TEXT_LEN = 500;
     private static final float MIN_EVENT_HEIGHT = 15.0F;  // in pixels
 
-    private static final float CALENDAR_COLOR_WIDTH = 8.0F;
-    private static final float CALENDAR_COLOR_HEIGHT_OFFSET = 6.0F;
-
     private static int mSelectionColor;
-    private static int mAllDayEventColor;
+    private static int mPressedColor;
+    private static int mSelectedEventTextColor;
+    private static int mEventTextColor;
 
     private int mViewStartX;
     private int mViewStartY;
@@ -322,12 +321,13 @@ public class CalendarView extends View
         }
 
         mSelectionColor = mResources.getColor(R.color.selection);
-        mAllDayEventColor = mResources.getColor(R.color.calendar_all_day_event_color);
-        int eventTextColor = mResources.getColor(R.color.calendar_event_text_color);
-        mEventPaint.setColor(eventTextColor);
-        mEventPaint.setTextSize(EVENT_TEXT_FONT_SIZE);
-        mEventPaint.setTextAlign(Paint.Align.LEFT);
-        mEventPaint.setAntiAlias(true);
+        mPressedColor = mResources.getColor(R.color.pressed);
+        mSelectedEventTextColor = mResources.getColor(R.color.calendar_event_selected_text_color);
+        mEventTextColor = mResources.getColor(R.color.calendar_event_text_color);
+        mEventTextPaint.setColor(mEventTextColor);
+        mEventTextPaint.setTextSize(EVENT_TEXT_FONT_SIZE);
+        mEventTextPaint.setTextAlign(Paint.Align.LEFT);
+        mEventTextPaint.setAntiAlias(true);
 
         int gridLineColor = mResources.getColor(R.color.calendar_grid_line_highlight_color);
         Paint p = mSelectionPaint;
@@ -1504,7 +1504,7 @@ public class CalendarView extends View
             Rect r, Canvas canvas, Paint p) {
         p.setTextSize(NORMAL_FONT_SIZE);
         p.setTextAlign(Paint.Align.LEFT);
-        Paint eventPaint = mEventPaint;
+        Paint eventTextPaint = mEventTextPaint;
 
         // Draw the background for the all-day events area
         r.top = mBannerPlusMargin;
@@ -1573,8 +1573,8 @@ public class CalendarView extends View
             // Multiply the height by 0.9 to leave a little gap between events
             event.bottom = event.top + height * 0.9f;
 
-            RectF rf = drawAllDayEventRect(event, canvas, p);
-            drawEventText(event, rf, canvas, eventPaint, ALL_DAY_TEXT_TOP_MARGIN);
+            RectF rf = drawAllDayEventRect(event, canvas, p, eventTextPaint);
+            drawEventText(event, rf, canvas, eventTextPaint, ALL_DAY_TEXT_TOP_MARGIN);
 
             // Check if this all-day event intersects the selected day
             if (mSelectionAllDay && mComputeSelectedEvents) {
@@ -1590,8 +1590,8 @@ public class CalendarView extends View
             computeAllDayNeighbors();
             if (mSelectedEvent != null) {
                 Event event = mSelectedEvent;
-                RectF rf = drawAllDayEventRect(event, canvas, p);
-                drawEventText(event, rf, canvas, eventPaint, ALL_DAY_TEXT_TOP_MARGIN);
+                RectF rf = drawAllDayEventRect(event, canvas, p, eventTextPaint);
+                drawEventText(event, rf, canvas, eventTextPaint, ALL_DAY_TEXT_TOP_MARGIN);
             }
 
             // Draw the highlight on the selected all-day area
@@ -1673,15 +1673,17 @@ public class CalendarView extends View
         }
     }
 
-    RectF drawAllDayEventRect(Event event, Canvas canvas, Paint p) {
+    RectF drawAllDayEventRect(Event event, Canvas canvas, Paint p, Paint eventTextPaint) {
         // If this event is selected, then use the selection color
         if (mSelectedEvent == event) {
             // Also, remember the last selected event that we drew
             mPrevSelectedEvent = event;
             p.setColor(mSelectionColor);
+            eventTextPaint.setColor(mSelectedEventTextColor);
         } else {
             // Use the normal color for all-day events
-            p.setColor(mAllDayEventColor);
+            p.setColor(event.color);
+            eventTextPaint.setColor(mEventTextColor);
         }
 
         RectF rf = mRectF;
@@ -1691,30 +1693,13 @@ public class CalendarView extends View
         rf.right = event.right;
         canvas.drawRoundRect(rf, SMALL_ROUND_RADIUS, SMALL_ROUND_RADIUS, p);
 
-        // Draw the calendar color inset rectangle
-        p.setColor(event.color);
-
-        // Save the outer rectangle coordinates so that we can restore them
-        float right = rf.right;
-        float top = rf.top;
-        float bottom = rf.bottom;
-
-        rf.right = rf.left + CALENDAR_COLOR_WIDTH;
-        float eventHeight = rf.bottom - rf.top;
-        rf.top += 0.05f * eventHeight;
-        rf.bottom -= 0.05f * eventHeight;
-        canvas.drawRoundRect(rf, SMALL_ROUND_RADIUS, SMALL_ROUND_RADIUS, p);
-
-        // Change the rf coordinates to be the area suitable for text.
-        rf.left = rf.right;
-        rf.right = right;
-        rf.top = top;
-        rf.bottom = bottom;
+        rf.left += 2;
+        rf.right -= 2;
         return rf;
     }
 
     private void drawEvents(int date, int left, int top, Canvas canvas, Paint p) {
-        Paint eventPaint = mEventPaint;
+        Paint eventTextPaint = mEventTextPaint;
         int cellWidth = mCellWidth;
         int cellHeight = mCellHeight;
 
@@ -1740,16 +1725,16 @@ public class CalendarView extends View
                 mSelectedEvents.add(event);
             }
 
-            RectF rf = drawEventRect(event, canvas, p);
-            drawEventText(event, rf, canvas, eventPaint, NORMAL_TEXT_TOP_MARGIN);
+            RectF rf = drawEventRect(event, canvas, p, eventTextPaint);
+            drawEventText(event, rf, canvas, eventTextPaint, NORMAL_TEXT_TOP_MARGIN);
         }
 
         if (date == mSelectionDay && !mSelectionAllDay && isFocused()
                 && mSelectionMode != SELECTION_HIDDEN) {
             computeNeighbors();
             if (mSelectedEvent != null) {
-                RectF rf = drawEventRect(mSelectedEvent, canvas, p);
-                drawEventText(mSelectedEvent, rf, canvas, eventPaint, NORMAL_TEXT_TOP_MARGIN);
+                RectF rf = drawEventRect(mSelectedEvent, canvas, p, eventTextPaint);
+                drawEventText(mSelectedEvent, rf, canvas, eventTextPaint, NORMAL_TEXT_TOP_MARGIN);
             }
         }
     }
@@ -2042,85 +2027,61 @@ public class CalendarView extends View
     }
 
 
-    private RectF drawEventRect(Event event, Canvas canvas, Paint p) {
-        Drawable box = mBoxNormal;
+    private RectF drawEventRect(Event event, Canvas canvas, Paint p, Paint eventTextPaint) {
 
+        int color = event.color;
+        
+        // Fade visible boxes if event was declined.
+        boolean declined = (event.selfAttendeeStatus == Attendees.ATTENDEE_STATUS_DECLINED);
+        if (declined) {
+            int alpha = color & 0xff000000;
+            color &= 0x00ffffff;
+            int red = (color & 0x00ff0000) >> 16;
+            int green = (color & 0x0000ff00) >> 8;
+            int blue = (color & 0x0000ff);
+            color = ((red >> 1) << 16) | ((green >> 1) << 8) | (blue >> 1);
+            color += 0x7F7F7F + alpha;
+        }
+        
         // If this event is selected, then use the selection color
         if (mSelectedEvent == event) {
             if (mSelectionMode == SELECTION_PRESSED) {
                 // Also, remember the last selected event that we drew
                 mPrevSelectedEvent = event;
-                box = mBoxPressed;
+                // box = mBoxPressed;
+                p.setColor(mPressedColor); // FIXME:pressed
+                eventTextPaint.setColor(this.mSelectedEventTextColor);
             } else if (mSelectionMode == SELECTION_SELECTED) {
                 // Also, remember the last selected event that we drew
                 mPrevSelectedEvent = event;
-                box = mBoxSelected;
+                // box = mBoxSelected;
+                p.setColor(mSelectionColor);
+                eventTextPaint.setColor(this.mSelectedEventTextColor);
             } else if (mSelectionMode == SELECTION_LONGPRESS) {
-                box = mBoxLongPressed;
+                // box = mBoxLongPressed;
+                p.setColor(mPressedColor); // FIXME: longpressed (maybe -- this doesn't seem to work)
+                eventTextPaint.setColor(this.mSelectedEventTextColor);
+            } else {
+                p.setColor(color);
+                eventTextPaint.setColor(mEventTextColor);
             }
+        } else {
+            p.setColor(color);
+            eventTextPaint.setColor(mEventTextColor);
         }
 
-        // Fade visible boxes if event was declined.
-        boolean declined = (event.selfAttendeeStatus == Attendees.ATTENDEE_STATUS_DECLINED);
-        int targetAlpha = declined ? 128 : 255;
-
-        box.setAlpha(targetAlpha);
-        p.setAlpha(targetAlpha);
 
         RectF rf = mRectF;
         rf.top = event.top;
         rf.bottom = event.bottom;
         rf.left = event.left;
-        rf.right = event.right;
-        int boxTop = (int) event.top;
-        int boxBottom = (int) event.bottom;
-        int boxLeft = (int) event.left;
-        int boxRight = (int) event.right;
-
-        box.setBounds(boxLeft, boxTop, boxRight, boxBottom);
-        box.draw(canvas);
-
-        // Save the coordinates
-        float eventRight = rf.right;
-        float eventTop = rf.top;
-        float eventBottom = rf.bottom;
-
-        // Draw the calendar color as a small rectangle on top of the event
-        // rectangle.  Use a fixed size width unless it doesn't fit, in which
-        // case use 1/2 the width.  For the height, use a fixed offset from
-        // the top and bottom unless that would be too small, in which case,
-        // use a 5% offset for top and bottom.
-        float width = CALENDAR_COLOR_WIDTH;
-        float maxWidth = (rf.right - rf.left) / 2.0f;
-        if (width > maxWidth) {
-            width = maxWidth;
-        }
-
-        // The drawable has a 1-pixel border so we need to shift the
-        // inner colored rectangle by one pixel.  But we don't shift by 1
-        // if the rectangle is really small.
-        if (width >= 3) {
-            rf.left += 1;
-        }
-        float top = rf.top + CALENDAR_COLOR_HEIGHT_OFFSET;
-        float bottom = rf.bottom - CALENDAR_COLOR_HEIGHT_OFFSET;
-        float height = bottom - top;
-        if (height < MIN_EVENT_HEIGHT) {
-            float eventHeight = rf.bottom - rf.top;
-            top = rf.top + 0.2f * eventHeight;
-            bottom = rf.bottom - 0.2f * eventHeight;
-        }
-        rf.right = rf.left + width;
-        rf.top = top;
-        rf.bottom = bottom;
-        p.setColor(event.color);
-        canvas.drawRoundRect(rf, SMALL_ROUND_RADIUS, SMALL_ROUND_RADIUS, p);
+        rf.right = event.right - 1;
 
-        // Set the rectangle for the event text.
-        rf.left = rf.right;
-        rf.right = eventRight;
-        rf.top = eventTop;
-        rf.bottom = eventBottom;
+        canvas.drawRoundRect(rf, SMALL_ROUND_RADIUS, SMALL_ROUND_RADIUS, p);
+        
+        rf.left += 2;
+        rf.right -= 2;
+        
         return rf;
     }
 
diff --git a/src/com/android/calendar/DateSpinner.java b/src/com/android/calendar/DateSpinner.java
deleted file mode 100644 (file)
index d0e757b..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.calendar;
-
-import android.app.DatePickerDialog;
-import android.app.DatePickerDialog.OnDateSetListener;
-import android.content.Context;
-import android.text.format.Time;
-import android.util.AttributeSet;
-import android.view.KeyEvent;
-import android.view.View;
-import android.widget.AdapterView;
-import android.widget.ArrayAdapter;
-import android.widget.DatePicker;
-import android.widget.Spinner;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-
-/**
- * The DateSpinner class is a {@link Spinner} widget that pops up a
- * {@link DatePickerDialog} when clicked (instead of the usual menu of
- * options for the Spinner).  This class also provides a callback
- * {@link DateSpinner.OnDateChangedListener} when the date is changed
- * either through the Spinner or through the DatePickerDialog.
- */
-public class DateSpinner extends Spinner {
-
-    /**
-     * The listener interface for providing a callback when the date is
-     * changed by the user.
-     */
-    public interface OnDateChangedListener {
-        /**
-         * This method is called when the user changes the date through
-         * the Spinner or the DatePickerDialog.
-         * 
-         * @param dateSpinner the DateSpinner object that changed
-         * @param millis the date in UTC milliseconds
-         */
-        public void dateChanged(DateSpinner dateSpinner, long millis);
-    }
-
-    private Context mContext;
-    
-    // mTime and mMillis must be kept in sync
-    private Time mTime = new Time();
-    private long mMillis;
-    private int mWeekStartDay = Calendar.SUNDAY;
-    private OnDateChangedListener mOnDateChangedListener;
-    
-    // The default number of spinner choices is 2 weeks worth of days
-    // surrounding the given date.
-    private static final int NUM_SPINNER_CHOICES = 15;
-    
-    // The array of spinner choices, in UTC milliseconds.
-    private long[] mSpinnerMillis;
-    
-    // The minimum millisecond spinner value.  The DateSpinner can automatically
-    // generate an array of spinner choices for the dates.  This variable
-    // prevents the spinner choices from being less than this date (specified
-    // in UTC milliseconds).
-    private long mMinimumMillis;
-    
-    // The number of spinner choices.  This may be set by the user of this
-    // widget.
-    private int mNumSpinnerChoices;
-    
-    public DateSpinner(Context context) {
-        super(context);
-        mContext = context;
-    }
-
-    public DateSpinner(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        mContext = context;
-    }
-
-    public DateSpinner(Context context,
-                  AttributeSet attrs,
-                  int defStyle) {
-        super(context, attrs, defStyle);
-        mContext = context;
-    }
-    
-    private OnDateSetListener mDateSetListener = new OnDateSetListener() {
-        // This is called by the DatePickerDialog when the user sets the date.
-        public void onDateSet(DatePicker view, int year, int month, int day) {
-            mTime.year = year;
-            mTime.month = month;
-            mTime.monthDay = day;
-            mMillis = mTime.normalize(true /* ignore isDst */);
-            createSpinnerElements();
-            if (mOnDateChangedListener != null) {
-                mOnDateChangedListener.dateChanged(DateSpinner.this, mMillis);
-            }
-        }
-    };
-    
-    private OnItemSelectedListener mItemSelectedListener = new OnItemSelectedListener() {
-        // This is called when the user changes the selection in the Spinner.
-        public void onItemSelected(AdapterView parent, View v, int position, long id) {
-            long millis = mSpinnerMillis[position];
-            if (millis == mMillis) {
-                return;
-            }
-            mMillis = millis;
-            mTime.set(millis);
-            if (mOnDateChangedListener != null) {
-                mOnDateChangedListener.dateChanged(DateSpinner.this, millis);
-            }
-        }
-    
-        public void onNothingSelected(AdapterView parent) {
-        }
-    };
-
-    @Override
-    public boolean onKeyDown(int keyCode, KeyEvent event) {
-        switch (keyCode) {
-        case KeyEvent.KEYCODE_DPAD_CENTER:
-        case KeyEvent.KEYCODE_ENTER:
-            new DatePickerDialog(mContext, mDateSetListener, mTime.year,
-                    mTime.month, mTime.monthDay).show();
-            return true;
-        }
-        return super.onKeyDown(keyCode, event);
-    }
-
-    public void setMillis(long millis) {
-        mTime.set(millis);
-        mMillis = millis;
-        createSpinnerElements();
-    }
-    
-    public long getMillis() {
-        return mMillis;
-    }
-    
-    private void createSpinnerElements() {
-        // Create spinner elements for a week preceding this date plus a
-        // week following this date.
-        Time time = new Time();
-        time.set(mTime);
-        long millis = time.toMillis(false /* use isDst */);
-        long selectedDay = Time.getJulianDay(millis, time.gmtoff);
-        int numSpinnerChoices = NUM_SPINNER_CHOICES;
-        if (mNumSpinnerChoices > 0) {
-            numSpinnerChoices = mNumSpinnerChoices;
-        }
-        time.monthDay -= numSpinnerChoices / 2;
-        millis = time.normalize(true /* ignore isDst */);
-        if (millis < mMinimumMillis) {
-            long days = (mMinimumMillis - millis) / CalendarView.MILLIS_PER_DAY;
-            millis = mMinimumMillis;
-            time.set(millis);
-        }
-
-        int selectedIndex = 0;
-        ArrayList<Long> millisList = new ArrayList<Long>();
-        for (int pos = 0; pos < numSpinnerChoices; ++pos) {
-            millis = time.normalize(true /* ignore isDst */);
-            int julianDay = Time.getJulianDay(millis, time.gmtoff);
-            if (julianDay == selectedDay) {
-                selectedIndex = pos;
-            }
-            millisList.add(millis);
-            time.monthDay += 1;
-        }
-
-        // Convert the ArrayList to a long[] array.
-        int len = millisList.size();
-        long[] spinnerMillis = new long[len];
-        for (int pos = 0; pos < len; pos++) {
-            spinnerMillis[pos] = millisList.get(pos);
-        }
-        
-        setSpinnerElements(spinnerMillis, selectedIndex);
-    }
-    
-    public void setSpinnerElements(long[] spinnerMillis, int selectedIndex) {
-        if (spinnerMillis == null || spinnerMillis.length == 0) {
-            return;
-        }
-        mSpinnerMillis = spinnerMillis;
-        long millis = spinnerMillis[selectedIndex];
-        mTime.set(millis);
-        mMillis = millis;
-        
-        Time time = new Time();
-        int len = spinnerMillis.length;
-        String[] choices = new String[len];
-        for (int pos = 0; pos < len; pos++) {
-            millis = spinnerMillis[pos];
-            time.set(millis);
-            choices[pos] = Utils.formatDayDate(time, true);
-        }
-        
-        ArrayAdapter<String> adapter = new ArrayAdapter<String>(mContext,
-                android.R.layout.simple_spinner_item, choices);
-        setAdapter(adapter);
-        setSelection(selectedIndex);
-        setOnItemSelectedListener(mItemSelectedListener);
-    }
-
-    public int getYear() {
-        return mTime.year;
-    }
-
-    public int getMonth() {
-        return mTime.month;
-    }
-
-    public int getMonthDay() {
-        return mTime.monthDay;
-    }
-    
-    /**
-     * Fills in the given {@link Time} object with the year, month, and
-     * monthDay from the DateSpinner.
-     * 
-     * @param time the given Time object, allocated by the caller
-     */
-    public void getDate(Time time) {
-        time.year = mTime.year;
-        time.month = mTime.month;
-        time.monthDay = mTime.monthDay;
-    }
-
-    public void setWeekStartDay(int weekStartDay) {
-        mWeekStartDay = weekStartDay;
-    }
-
-    public int getWeekStartDay() {
-        return mWeekStartDay;
-    }
-
-    public void setOnDateChangedListener(OnDateChangedListener onDateChangedListener) {
-        mOnDateChangedListener = onDateChangedListener;
-    }
-
-    public OnDateChangedListener getOnDateChangedListener() {
-        return mOnDateChangedListener;
-    }
-
-    public void setMinimum(long minimum) {
-        mMinimumMillis = minimum;
-    }
-
-    public long getMinimum() {
-        return mMinimumMillis;
-    }
-
-    public void setNumSpinnerChoices(int numSpinnerChoices) {
-        mNumSpinnerChoices = numSpinnerChoices;
-    }
-
-    public int getNumSpinnerChoices() {
-        return mNumSpinnerChoices;
-    }
-}
index 8141d20..90cd3ff 100644 (file)
@@ -28,6 +28,7 @@ import android.pim.EventRecurrence;
 import android.provider.Calendar;
 import android.provider.Calendar.Events;
 import android.text.format.Time;
+import android.widget.Button;
 
 /**
  * A helper class for deleting events.  If a normal event is selected for
@@ -74,6 +75,7 @@ public class DeleteEventHelper {
     static final int DELETE_ALL = 2;
     
     private int mWhichDelete;
+    private AlertDialog mAlertDialog;
 
     private static final String[] EVENT_PROJECTION = new String[] {
         Events._ID,
@@ -122,6 +124,11 @@ public class DeleteEventHelper {
             new DialogInterface.OnClickListener() {
         public void onClick(DialogInterface dialog, int button) {
             mWhichDelete = button;
+            
+            // Enable the "ok" button now that the user has selected which
+            // events in the series to delete.
+            Button ok = mAlertDialog.getButton(DialogInterface.BUTTON_POSITIVE);
+            ok.setEnabled(true);
         }
     };
 
@@ -220,13 +227,19 @@ public class DeleteEventHelper {
             if (mSyncId == null) {
                 labelsArrayId = R.array.delete_repeating_labels_no_selected;
             }
-            new AlertDialog.Builder(mParent)
+            AlertDialog dialog = new AlertDialog.Builder(mParent)
             .setTitle(R.string.delete_title)
             .setIcon(android.R.drawable.ic_dialog_alert)
             .setSingleChoiceItems(labelsArrayId, which, mDeleteListListener)
             .setPositiveButton(android.R.string.ok, mDeleteRepeatingDialogListener)
             .setNegativeButton(android.R.string.cancel, null)
             .show();
+            mAlertDialog = dialog;
+            
+            // Disable the "Ok" button until the user selects which events to
+            // delete.
+            Button ok = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
+            ok.setEnabled(false);
         }
     }
     
index fe70b4f..f020a7c 100644 (file)
@@ -1060,6 +1060,7 @@ public class EditEvent extends Activity implements View.OnClickListener,
         
         Spinner spinner = (Spinner) reminderItem.findViewById(R.id.reminder_value);
         Resources res = activity.getResources();
+        spinner.setPrompt(res.getString(R.string.reminders_label));
         int resource = android.R.layout.simple_spinner_item;
         ArrayAdapter<String> adapter = new ArrayAdapter<String>(activity, resource, labels);
         adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
@@ -1408,11 +1409,21 @@ public class EditEvent extends Activity implements View.OnClickListener,
         return reminderMinutes;
     }
 
-    static void saveReminders(ContentResolver cr, long eventId,
+    /**
+     * Saves the reminders, if they changed.  Returns true if the database
+     * was updated.
+     * 
+     * @param cr the ContentResolver
+     * @param eventId the id of the event whose reminders are being updated
+     * @param reminderMinutes the array of reminders set by the user
+     * @param originalMinutes the original array of reminders
+     * @return true if the database was updated
+     */
+    static boolean saveReminders(ContentResolver cr, long eventId,
             ArrayList<Integer> reminderMinutes, ArrayList<Integer> originalMinutes) {
         // If the reminders have not changed, then don't update the database
         if (reminderMinutes.equals(originalMinutes)) {
-            return;
+            return false;
         }
 
         // Delete all the existing reminders for this event
@@ -1437,6 +1448,7 @@ public class EditEvent extends Activity implements View.OnClickListener,
             values.put(Reminders.EVENT_ID, eventId);
             cr.insert(Reminders.CONTENT_URI, values);
         }
+        return true;
     }
 
     private void addRecurrenceRule(ContentValues values) {
diff --git a/src/com/android/calendar/EditResponseHelper.java b/src/com/android/calendar/EditResponseHelper.java
new file mode 100644 (file)
index 0000000..378ef45
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.calendar;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.widget.Button;
+
+/**
+ * A helper class for editing the response to an invitation when the invitation
+ * is a repeating event.
+ */
+public class EditResponseHelper implements DialogInterface.OnClickListener {
+    private final Activity mParent;
+    private int mWhichEvents = -1;
+    private AlertDialog mAlertDialog;
+
+    /**
+     * This callback is passed in to this object when this object is created
+     * and is invoked when the "Ok" button is selected.
+     */
+    private DialogInterface.OnClickListener mDialogListener;
+    
+    public EditResponseHelper(Activity parent) {
+        mParent = parent;
+    }
+    
+    public void setOnClickListener(DialogInterface.OnClickListener listener) {
+        mDialogListener = listener;
+    }
+    
+    public int getWhichEvents() {
+        return mWhichEvents;
+    }
+    
+    public void onClick(DialogInterface dialog, int which) {
+    }
+
+    /**
+     * This callback is used when a list item is selected
+     */
+    private DialogInterface.OnClickListener mListListener =
+            new DialogInterface.OnClickListener() {
+        public void onClick(DialogInterface dialog, int which) {
+            mWhichEvents = which;
+            
+            // Enable the "ok" button now that the user has selected which
+            // events in the series to delete.
+            Button ok = mAlertDialog.getButton(DialogInterface.BUTTON_POSITIVE);
+            ok.setEnabled(true);
+        }
+    };
+    
+    public void showDialog(int whichEvents) {
+        // We need to have a non-null listener, otherwise we get null when
+        // we try to fetch the "Ok" button.
+        if (mDialogListener == null) {
+            mDialogListener = this;
+        }
+        AlertDialog dialog = new AlertDialog.Builder(mParent)
+                .setTitle(R.string.change_response_title)
+                .setIcon(android.R.drawable.ic_dialog_alert)
+                .setSingleChoiceItems(R.array.change_response_labels, whichEvents,
+                        mListListener)
+                .setPositiveButton(android.R.string.ok, mDialogListener)
+                .setNegativeButton(android.R.string.cancel, null)
+                .show();
+        mAlertDialog = dialog;
+        
+        if (whichEvents == -1) {
+            // Disable the "Ok" button until the user selects which events to
+            // delete.
+            Button ok = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
+            ok.setEnabled(false);
+        }
+    }
+}
index ccde953..0b31b01 100644 (file)
@@ -16,6 +16,9 @@
 
 package com.android.calendar;
 
+import static android.provider.Calendar.EVENT_BEGIN_TIME;
+import static android.provider.Calendar.EVENT_END_TIME;
+
 import android.app.Activity;
 import android.content.ContentResolver;
 import android.content.ContentUris;
@@ -32,29 +35,38 @@ import android.preference.PreferenceManager;
 import android.provider.Calendar;
 import android.provider.Calendar.Attendees;
 import android.provider.Calendar.Calendars;
-import static android.provider.Calendar.EVENT_BEGIN_TIME;
-import static android.provider.Calendar.EVENT_END_TIME;
 import android.provider.Calendar.Events;
 import android.provider.Calendar.Reminders;
 import android.text.format.DateFormat;
 import android.text.format.DateUtils;
 import android.text.format.Time;
+import android.util.Log;
 import android.view.KeyEvent;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
+import android.widget.AdapterView;
 import android.widget.ArrayAdapter;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.Spinner;
 import android.widget.TextView;
+import android.widget.Toast;
 
 import java.util.ArrayList;
 import java.util.Arrays;
 
-public class EventInfoActivity extends Activity implements View.OnClickListener {
+public class EventInfoActivity extends Activity implements View.OnClickListener,
+        AdapterView.OnItemSelectedListener {
     private static final int MAX_REMINDERS = 5;
 
+    /**
+     * These are the corresponding indices into the array of strings
+     * "R.array.change_response_labels" in the resource file.
+     */
+    static final int UPDATE_SINGLE = 0;
+    static final int UPDATE_ALL = 1;
+
     private static final String[] EVENT_PROJECTION = new String[] {
         Events._ID,                  // 0  do not remove; used in DeleteEventHelper
         Events.TITLE,                // 1  do not remove; used in DeleteEventHelper
@@ -69,20 +81,19 @@ public class EventInfoActivity extends Activity implements View.OnClickListener
         Events.HAS_ALARM,            // 10
         Events.ACCESS_LEVEL,         // 11
         Events.COLOR,                // 12
-        Events.SELF_ATTENDEE_STATUS, // 13
     };
     private static final int EVENT_INDEX_ID = 0;
     private static final int EVENT_INDEX_TITLE = 1;
     private static final int EVENT_INDEX_RRULE = 2;
     private static final int EVENT_INDEX_ALL_DAY = 3;
     private static final int EVENT_INDEX_CALENDAR_ID = 4;
+    private static final int EVENT_INDEX_SYNC_ID = 6;
     private static final int EVENT_INDEX_EVENT_TIMEZONE = 7;
     private static final int EVENT_INDEX_DESCRIPTION = 8;
     private static final int EVENT_INDEX_EVENT_LOCATION = 9;
     private static final int EVENT_INDEX_HAS_ALARM = 10;
     private static final int EVENT_INDEX_ACCESS_LEVEL = 11;
     private static final int EVENT_INDEX_COLOR = 12;
-    private static final int EVENT_INDEX_SELF_ATTENDEE_STATUS = 13;
 
     private static final String[] ATTENDEES_PROJECTION = new String[] {
         Attendees._ID,                      // 0
@@ -94,12 +105,12 @@ public class EventInfoActivity extends Activity implements View.OnClickListener
     private static final int ATTENDEES_INDEX_STATUS = 2;
     private static final String ATTENDEES_WHERE = Attendees.EVENT_ID + "=%d";
 
-    private static final String[] CALENDARS_PROJECTION = new String[] {
+    static final String[] CALENDARS_PROJECTION = new String[] {
         Calendars._ID,          // 0
         Calendars.DISPLAY_NAME, // 1
     };
-    private static final int CALENDARS_INDEX_DISPLAY_NAME = 1;
-    private static final String CALENDARS_WHERE = Calendars._ID + "=%d";
+    static final int CALENDARS_INDEX_DISPLAY_NAME = 1;
+    static final String CALENDARS_WHERE = Calendars._ID + "=%d";
 
     private static final String[] REMINDERS_PROJECTION = new String[] {
         Reminders._ID,      // 0
@@ -146,9 +157,11 @@ public class EventInfoActivity extends Activity implements View.OnClickListener
     private int mDefaultReminderMinutes;
 
     private DeleteEventHelper mDeleteEventHelper;
+    private EditResponseHelper mEditResponseHelper;
 
     private int mResponseOffset;
     private int mOriginalAttendeeResponse;
+    private boolean mIsRepeating;
 
     // This is called when one of the "remove reminder" buttons is selected.
     public void onClick(View v) {
@@ -158,6 +171,34 @@ public class EventInfoActivity extends Activity implements View.OnClickListener
         mReminderItems.remove(reminderItem);
         updateRemindersVisibility();
     }
+    
+    public void onItemSelected(AdapterView parent, View v, int position, long id) {
+        // If they selected the "No response" option, then don't display the
+        // dialog asking which events to change.
+        if (id == 0 && mResponseOffset == 0) {
+            return;
+        }
+        
+        // If this is not a repeating event, then don't display the dialog
+        // asking which events to change.
+        if (!mIsRepeating) {
+            return;
+        }
+        
+        // If the selection is the same as the original, then don't display the
+        // dialog asking which events to change.
+        int index = findResponseIndexFor(mOriginalAttendeeResponse);
+        if (position == index + mResponseOffset) {
+            return;
+        }
+        
+        // This is a repeating event. We need to ask the user if they mean to
+        // change just this one instance or all instances.
+        mEditResponseHelper.showDialog(mEditResponseHelper.getWhichEvents());
+    }
+
+    public void onNothingSelected(AdapterView parent) {
+    }
 
     @Override
     protected void onCreate(Bundle icicle) {
@@ -249,6 +290,7 @@ public class EventInfoActivity extends Activity implements View.OnClickListener
         updateRemindersVisibility();
 
         mDeleteEventHelper = new DeleteEventHelper(this, true /* exit when done */);
+        mEditResponseHelper = new EditResponseHelper(this);
     }
 
     @Override
@@ -275,6 +317,8 @@ public class EventInfoActivity extends Activity implements View.OnClickListener
         mEventCursor.moveToFirst();
         mVisibility = mEventCursor.getInt(EVENT_INDEX_ACCESS_LEVEL);
         mEventId = mEventCursor.getInt(EVENT_INDEX_ID);
+        String rRule = mEventCursor.getString(EVENT_INDEX_RRULE);
+        mIsRepeating = (rRule != null);
         return false;
     }
 
@@ -295,11 +339,17 @@ public class EventInfoActivity extends Activity implements View.OnClickListener
     @Override
     public void onPause() {
         super.onPause();
+        if (!isFinishing()) {
+            return;
+        }
         ContentResolver cr = getContentResolver();
         ArrayList<Integer> reminderMinutes = EditEvent.reminderItemsToMinutes(mReminderItems,
                 mReminderValues);
-        EditEvent.saveReminders(cr, mEventId, reminderMinutes, mOriginalMinutes);
-        saveResponse(cr);
+        boolean changed = EditEvent.saveReminders(cr, mEventId, reminderMinutes, mOriginalMinutes);
+        changed |= saveResponse(cr);
+        if (changed) {
+            Toast.makeText(this, R.string.saving_event, Toast.LENGTH_SHORT).show();
+        }
     }
 
     @Override
@@ -391,35 +441,104 @@ public class EventInfoActivity extends Activity implements View.OnClickListener
         }
     }
 
-    private void saveResponse(ContentResolver cr) {
-        if (mAttendeesCursor == null) {
-            return;
+    /**
+     * Saves the response to an invitation if the user changed the response.
+     * Returns true if the database was updated.
+     * 
+     * @param cr the ContentResolver
+     * @return true if the database was changed
+     */
+    private boolean saveResponse(ContentResolver cr) {
+        if (mAttendeesCursor == null || mEventCursor == null) {
+            return false;
         }
         Spinner spinner = (Spinner) findViewById(R.id.response_value);
         int position = spinner.getSelectedItemPosition() - mResponseOffset;
         if (position <= 0) {
-            return;
+            return false;
         }
 
         int status = ATTENDEE_VALUES[position];
 
         // If the status has not changed, then don't update the database
         if (status == mOriginalAttendeeResponse) {
-            return;
+            return false;
+        }
+
+        long attendeeId = mAttendeesCursor.getInt(ATTENDEES_INDEX_ID);
+        if (!mIsRepeating) {
+            // This is a non-repeating event
+            updateResponse(cr, mEventId, attendeeId, status);
+            return true;
         }
 
+        // This is a repeating event
+        int whichEvents = mEditResponseHelper.getWhichEvents();
+        switch (whichEvents) {
+            case -1:
+                return false;
+            case UPDATE_SINGLE:
+                createExceptionResponse(cr, mEventId, attendeeId, status);
+                return true;
+            case UPDATE_ALL:
+                updateResponse(cr, mEventId, attendeeId, status);
+                return true;
+            default:
+                Log.e("Calendar", "Unexpected choice for updating invitation response");
+                break;
+        }
+        return false;
+    }
+    
+    private void updateResponse(ContentResolver cr, long eventId, long attendeeId, int status) {
         // Update the "selfAttendeeStatus" field for the event
         ContentValues values = new ContentValues();
 
         // Will need to add email when MULTIPLE_ATTENDEES_PER_EVENT supported.
         values.put(Attendees.ATTENDEE_STATUS, status);
-        values.put(Attendees.EVENT_ID, mEventId);
-
-        int attendeeId = mAttendeesCursor.getInt(ATTENDEES_INDEX_ID);
+        values.put(Attendees.EVENT_ID, eventId);
 
         Uri uri = ContentUris.withAppendedId(Attendees.CONTENT_URI, attendeeId);
         cr.update(uri, values, null /* where */, null /* selection args */);
     }
+    
+    private void createExceptionResponse(ContentResolver cr, long eventId,
+            long attendeeId, int status) {
+        // Fetch information about the repeating event.
+        Uri uri = ContentUris.withAppendedId(Events.CONTENT_URI, eventId);
+        Cursor cursor = cr.query(uri, EVENT_PROJECTION, null, null, null);
+        if (cursor == null) {
+            return;
+        }
+
+        try {
+            cursor.moveToFirst();
+            ContentValues values = new ContentValues();
+            
+            String title = cursor.getString(EVENT_INDEX_TITLE);
+            String timezone = cursor.getString(EVENT_INDEX_EVENT_TIMEZONE);
+            int calendarId = cursor.getInt(EVENT_INDEX_CALENDAR_ID);
+            boolean allDay = cursor.getInt(EVENT_INDEX_ALL_DAY) != 0;
+            String syncId = cursor.getString(EVENT_INDEX_SYNC_ID);
+            
+            values.put(Events.TITLE, title);
+            values.put(Events.EVENT_TIMEZONE, timezone);
+            values.put(Events.ALL_DAY, allDay ? 1 : 0);
+            values.put(Events.CALENDAR_ID, calendarId);
+            values.put(Events.DTSTART, mStartMillis);
+            values.put(Events.DTEND, mEndMillis);
+            values.put(Events.ORIGINAL_EVENT, syncId);
+            values.put(Events.ORIGINAL_INSTANCE_TIME, mStartMillis);
+            values.put(Events.ORIGINAL_ALL_DAY, allDay ? 1 : 0);
+            values.put(Events.STATUS, Events.STATUS_CONFIRMED);
+            values.put(Events.SELF_ATTENDEE_STATUS, status);
+            
+            // Create a recurrence exception
+            Uri newUri = cr.insert(Events.CONTENT_URI, values);
+        } finally {
+            cursor.close();
+        }
+    }
 
     private int findResponseIndexFor(int response) {
         int size = ATTENDEE_VALUES.length;
@@ -465,9 +584,15 @@ public class EventInfoActivity extends Activity implements View.OnClickListener
         String eventTimezone = mEventCursor.getString(EVENT_INDEX_EVENT_TIMEZONE);
         int color = mEventCursor.getInt(EVENT_INDEX_COLOR) & 0xbbffffff;
 
-        ImageView stripe = (ImageView) findViewById(R.id.vertical_stripe);
-        stripe.getBackground().setColorFilter(color, PorterDuff.Mode.SRC_IN);
+        View strip = (View) findViewById(R.id.strip);
+        strip.getBackground().setColorFilter(color, PorterDuff.Mode.SRC_IN);
 
+        TextView title = (TextView) findViewById(R.id.title);
+        title.setTextColor(color);
+        
+        View divider = (View) findViewById(R.id.divider);
+        divider.getBackground().setColorFilter(color, PorterDuff.Mode.SRC_IN);
+        
         // What
         if (eventName != null) {
             setTextCommon(R.id.title, eventName);
@@ -579,6 +704,7 @@ public class EventInfoActivity extends Activity implements View.OnClickListener
 
         int index = findResponseIndexFor(mOriginalAttendeeResponse);
         spinner.setSelection(index + mResponseOffset);
+        spinner.setOnItemSelectedListener(this);
     }
 
     private void setTextCommon(int id, CharSequence text) {
index 4622fa9..4dabc5c 100644 (file)
@@ -36,6 +36,11 @@ public class LaunchActivity extends Activity {
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         
+        // Our UI is not something intended for the user to see.  We just
+        // stick around until we can figure out what to do next based on
+        // the current state of the system.
+        setVisible(false);
+        
         // Only try looking for an account if this is the first launch.
         if (icicle == null) {
             // This will request a Gmail account and if none are present, it will
index 5a670a0..f6db3b8 100644 (file)
@@ -60,7 +60,7 @@ public class MonthView extends View implements View.OnCreateContextMenuListener
     private static final boolean PROFILE_LOAD_TIME = false;
     private static final boolean DEBUG_BUSYBITS = false;
 
-    private static final int WEEK_GAP = 1;
+    private static final int WEEK_GAP = 0;
     private static final int MONTH_DAY_GAP = 1;
     private static final float HOUR_GAP = 0.5f;
 
@@ -257,7 +257,7 @@ public class MonthView extends View implements View.OnCreateContextMenuListener
             ta.recycle();
         }
 
-        mGestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() {
+        mGestureDetector = new GestureDetector(getContext(), new GestureDetector.SimpleOnGestureListener() {
             @Override
             public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
                     float velocityY) {
@@ -546,6 +546,8 @@ public class MonthView extends View implements View.OnCreateContextMenuListener
                 }
             }
         }
+        
+        drawGrid(canvas, p);
     }
 
     @Override
@@ -614,6 +616,28 @@ public class MonthView extends View implements View.OnCreateContextMenuListener
     }
 
     /**
+     * Draw the grid lines for the calendar
+     * @param canvas The canvas to draw on.
+     * @param p The paint used for drawing.
+     */
+    private void drawGrid(Canvas canvas, Paint p) {
+        p.setColor(mMonthOtherMonthColor);
+        p.setAntiAlias(false);
+        
+        final int width = getMeasuredWidth();
+        final int height = getMeasuredHeight();
+        
+        for (int row = 0; row < 6; row++) {
+            int y = WEEK_GAP + row * (WEEK_GAP + mCellHeight) - 1;
+            canvas.drawLine(0, y, width, y, p);
+        }
+        for (int column = 1; column < 7; column++) {
+            int x = mBorder + column * (MONTH_DAY_GAP + mCellWidth) - 1;
+            canvas.drawLine(x, WEEK_GAP, x, height, p);
+        }
+    }
+    
+    /**
      * Draw a single box onto the canvas.
      * @param day The Julian day.
      * @param weekNum The week number.
@@ -673,25 +697,6 @@ public class MonthView extends View implements View.OnCreateContextMenuListener
             if (column != 0) {
                 r.left--;
             }
-
-            // Draw cell border
-            p.setColor(mMonthOtherMonthColor);
-            p.setAntiAlias(false);
-
-            if (row == 0) {
-                // Bottom line
-                canvas.drawLine(r.left, r.bottom, r.right, r.bottom, p);
-            }
-
-            // Top line
-            canvas.drawLine(r.left, r.top, r.right, r.top, p);
-
-            // Right line
-            canvas.drawLine(r.right, r.top, r.right, r.bottom, p);
-
-            if (firstDayOfNextmonth && column != 0) {
-                canvas.drawLine(r.left, r.top, r.left, r.bottom, p);
-            }
         } else if (drawSelection) {
             if (mSelectionMode == SELECTION_SELECTED) {
                 mBoxSelected.setBounds(r);
index becb847..0b00bbc 100644 (file)
@@ -78,6 +78,17 @@ public class SelectCalendarsActivity extends Activity implements ListView.OnItem
         startCalendarSync();
     }
     
+    @Override
+    public void onPause() {
+        super.onPause();
+        
+        // We might have changed selected calendars, so push gadget updates
+        
+        // TODO: remove this once we link up CalendarProvider and any gadgets to watch
+        // for updates to the Calendar table.
+        CalendarGadgetProvider.performUpdate(this, null);
+    }
+    
     public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
         CheckBox box = (CheckBox) view.findViewById(R.id.checkbox);
         box.toggle();
index 2ea2f37..53c584c 100644 (file)
@@ -19,6 +19,7 @@ package com.android.calendar;
 import static android.provider.Calendar.EVENT_BEGIN_TIME;
 import android.content.Context;
 import android.content.Intent;
+import android.content.res.Resources;
 import android.text.format.Time;
 import android.view.animation.AlphaAnimation;
 import android.widget.ViewFlipper;
@@ -32,7 +33,7 @@ public class Utils {
 
         context.startActivity(intent);
     }
-    
+
     public static final Time timeFromIntent(Intent intent) {
         Time time = new Time();
         time.set(timeFromIntentInMillis(intent));
@@ -66,38 +67,19 @@ public class Utils {
         v.setInAnimation(in);
         v.setOutAnimation(out);
     }
-    
-    /**
-     * Formats the given Time object so that it gives the day of the week
-     * and the date (for example, "Monday, September 3, 2007").  If the
-     * abbrev argument is true, then abbreviated names will be used (for
-     * example, "Mon, Sep 3, 2007").
-     * 
-     * @param time the time to format
-     * @param abbrev if true, use abbreviations for the weekday and month
-     * @return the string containing the weekday and the date 
-     */
-    public static String formatDayDate(Time time, boolean abbrev) {
-        String date;
-        if (abbrev) {
-            date = time.format("%a, %b %-d, %Y");
-        } else {
-            date = time.format("%A, %B %-d, %Y");
-        }
-        return date;
-    }
-    
+
     /**
      * Formats the given Time object so that it gives the month and year
      * (for example, "September 2007").
-     * 
+     *
      * @param time the time to format
-     * @return the string containing the weekday and the date 
+     * @return the string containing the weekday and the date
      */
     public static String formatMonthYear(Time time) {
-        return time.format("%B %Y");
+        Resources res = Resources.getSystem();
+        return time.format(res.getString(com.android.internal.R.string.month_year));
     }
-    
+
     // TODO: replace this with the correct i18n way to do this
     public static final String englishNthDay[] = {
         "", "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th",
@@ -105,14 +87,14 @@ public class Utils {
         "20th", "21st", "22nd", "23rd", "24th", "25th", "26th", "27th", "28th", "29th",
         "30th", "31st"
     };
-    
+
     public static String formatNth(int nth) {
         return "the " + englishNthDay[nth];
     }
-    
+
     /**
      * Sets the time to the beginning of the day (midnight) by clearing the
-     * hour, minute, and second fields.  
+     * hour, minute, and second fields.
      */
     static void setTimeToStartOfDay(Time time) {
         time.second = 0;