Merge korg/donut into korg/master
Jean-Baptiste Queru [Sun, 26 Jul 2009 00:48:03 +0000 (17:48 -0700)]
34 files changed:
res/layout/agenda_item.xml
res/layout/calendar_item.xml
res/layout/edit_event.xml
res/layout/edit_reminder_item.xml
res/layout/event_info_activity.xml
res/values-cs/arrays.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-ja/arrays.xml
res/values-ko/arrays.xml
res/values-nb/arrays.xml
res/values-nl/arrays.xml
res/values-pl/arrays.xml
res/values-pl/strings.xml
res/values-pt/arrays.xml [new file with mode: 0644]
res/values-pt/strings.xml [new file with mode: 0644]
res/values-ru/arrays.xml
res/values-zh-rCN/arrays.xml
res/values-zh-rTW/arrays.xml
res/values-zh-rTW/strings.xml
res/values/arrays.xml
res/values/strings.xml
src/com/android/calendar/AgendaAdapter.java
src/com/android/calendar/AgendaItemView.java [new file with mode: 0644]
src/com/android/calendar/CalendarView.java
src/com/android/calendar/EditEvent.java
src/com/android/calendar/EventInfoActivity.java
src/com/android/calendar/SelectCalendarsActivity.java
src/com/android/calendar/SelectCalendarsAdapter.java

index 5cae988..9541917 100644 (file)
      limitations under the License.
 -->
 
-
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<com.android.calendar.AgendaItemView
+    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:layout_width="fill_parent"
+    android:gravity="center_vertical"
+    android:minHeight="?android:attr/listPreferredItemHeight">
 
-    <LinearLayout
-        android:orientation="horizontal"
+    <TextView
+        android:id="@+id/title"
+        android:layout_width="fill_parent"
         android:layout_height="wrap_content"
+        android:layout_marginLeft="10dip"
+        android:ellipsize="end"
+        android:maxLines="2"
+        android:textStyle="bold"
+        android:textColor="?android:attr/textColorSecondary"
+        style="?android:attr/textAppearanceMediumInverse" />
+
+    <TextView
+        android:id="@+id/when"
         android:layout_width="fill_parent"
-        android:gravity="center_vertical"
-        android:minHeight="?android:attr/listPreferredItemHeight"
-        >
-
-        <View android:id="@+id/vertical_stripe"
-            android:layout_width="5dip"
-            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:ellipsize="end"
-                android:maxLines="2"
-                android:textStyle="bold"
-                android:textColor="?android:attr/textColorSecondary"
-                style="?android:attr/textAppearanceMediumInverse"
-            />
-
-            <TextView android:id="@+id/when"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:ellipsize="end"
-                android:maxLines="2"
-                android:textStyle="bold"
-                android:textColor="?android:attr/textColorSecondary"
-                style="?android:attr/textAppearanceSmallInverse"
-            />
-
-            <TextView android:id="@+id/where"
-                android:layout_width="fill_parent"
-                android:layout_height="wrap_content"
-                android:ellipsize="end"
-                android:maxLines="2"
-                android:textColor="?android:attr/textColorSecondary"
-                style="?android:attr/textAppearanceSmallInverse"
-            />
-        </LinearLayout>
-    </LinearLayout>
-</FrameLayout>
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/title"
+        android:layout_alignLeft="@+id/title"
+        android:ellipsize="end"
+        android:maxLines="2"
+        android:textStyle="bold"
+        android:textColor="?android:attr/textColorSecondary"
+        style="?android:attr/textAppearanceSmallInverse" />
+
+    <TextView
+        android:id="@+id/where"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/when"
+        android:layout_alignLeft="@+id/title"
+        android:layout_alignParentRight="true"
+        android:ellipsize="end"
+        android:maxLines="2"
+        android:textColor="?android:attr/textColorSecondary"
+        style="?android:attr/textAppearanceSmallInverse" />
+
+</com.android.calendar.AgendaItemView>
index 9d3ba39..200f249 100644 (file)
@@ -17,7 +17,8 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="horizontal"
     android:layout_width="fill_parent"
-    android:layout_height="?android:attr/listPreferredItemHeight"
+    android:layout_height="wrap_content"
+    android:minHeight="?android:attr/listPreferredItemHeight"
     android:gravity="center_vertical">
 
     <View android:id="@+id/color"
index eb5886e..352a4ed 100644 (file)
             android:layout_height="wrap_content"
             android:gravity="center_vertical|right"
             android:paddingBottom="5dip">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="2dip"
+                android:text="@string/add_new_reminder"/>
+
             <ImageButton android:id="@+id/reminder_add"
                 style="@style/PlusButton"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginRight="10dip"
+                android:layout_marginRight="7dip"
                 android:gravity="center_vertical|right"
             />
         </LinearLayout>
index 18e45e6..2857255 100644 (file)
         android:layout_height="wrap_content"
         android:layout_weight="1"
         android:layout_gravity="center_vertical"
+        android:layout_marginRight="2dip"
         android:entries="@array/reminder_minutes_labels"/>
 
     <ImageButton android:id="@+id/reminder_remove"
         style="@style/MinusButton"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginRight="2dip"
         android:gravity="center_vertical"
     />
 </LinearLayout>
index 3a85ac9..3992e80 100644 (file)
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:paddingLeft="8dip"
-            android:paddingRight="8dip"
+            android:paddingRight="7dip"
             android:paddingTop="5dip"
             android:paddingBottom="1dip">
         
         <LinearLayout
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
-            android:gravity="right"
+            android:gravity="center_vertical|right"
+            android:paddingRight="5dip"
             android:paddingBottom="5dip">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="7dip"
+                android:text="@string/add_new_reminder"/>
+
             <ImageButton android:id="@+id/reminder_add"
                 style="@style/PlusButton"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginRight="10dip"
+                android:layout_marginRight="2dip"
             />
         </LinearLayout>
     </LinearLayout>
index f7d5eb3..d3fcd45 100644 (file)
     <item>"Soukromá"</item>
     <item>"Veřejná"</item>
   </string-array>
-  <string-array name="day_labels">
-    <item>"neděle"</item>
-    <item>"pondělí"</item>
-    <item>"úterý"</item>
-    <item>"středa"</item>
-    <item>"čtvrtek"</item>
-    <item>"pátek"</item>
-    <item>"sobota"</item>
-  </string-array>
   <string-array name="ordinal_labels">
     <item>"1."</item>
     <item>"2."</item>
index aca448c..66485db 100644 (file)
     <item>"Privat"</item>
     <item>"Öffentlich"</item>
   </string-array>
-  <string-array name="day_labels">
-    <item>"Sonntag"</item>
-    <item>"Montag"</item>
-    <item>"Dienstag"</item>
-    <item>"Mittwoch"</item>
-    <item>"Donnerstag"</item>
-    <item>"Freitag"</item>
-    <item>"Samstag"</item>
-  </string-array>
   <string-array name="ordinal_labels">
-    <item>"1."</item>
-    <item>"2."</item>
-    <item>"3."</item>
-    <item>"4."</item>
+    <item>"ersten"</item>
+    <item>"zweiten"</item>
+    <item>"dritten"</item>
+    <item>"vierten"</item>
     <item>"letzten"</item>
   </string-array>
   <string-array name="response_labels1">
index ac13c12..4cc060c 100644 (file)
     <string name="preferences_alerts_type_dialog">"Benachrichtigungen und Hinweise"</string>
     <string name="preferences_alerts_vibrate_title">"Vibration"</string>
     <string name="preferences_alerts_ringtone_title">"Klingelton auswählen"</string>
-    <string name="preferences_default_reminder_title">"Standard-Erinnerungszeit"</string>
+    <string name="preferences_default_reminder_title">"Standarderinnerung"</string>
     <string name="preferences_default_reminder_dialog">"Standard-Erinnerungszeit"</string>
     <string name="preferences_default_reminder_default">"10"</string>
 </resources>
index 21ff75a..6b5bac1 100644 (file)
     <item>"Privado"</item>
     <item>"Público"</item>
   </string-array>
-  <string-array name="day_labels">
-    <item>"domingo"</item>
-    <item>"lunes"</item>
-    <item>"martes"</item>
-    <item>"miércoles"</item>
-    <item>"jueves"</item>
-    <item>"viernes"</item>
-    <item>"sábado"</item>
-  </string-array>
   <string-array name="ordinal_labels">
-    <item>"primer"</item>
+    <item>"primero"</item>
     <item>"segundo"</item>
-    <item>"tercer"</item>
+    <item>"tercero"</item>
     <item>"cuarto"</item>
     <item>"último"</item>
   </string-array>
index 8337068..e4a759d 100644 (file)
@@ -66,8 +66,8 @@
     <string name="alert_title">"Notificaciones de Calendar"</string>
     <string name="alert_when_label">"Cuándo:"</string>
     <string name="alert_where_label">"Dónde:"</string>
-    <string name="alert_missed_events_single">"(<xliff:g id="REMINDER_COUNT">%s</xliff:g> recordatorios más)"</string>
-    <string name="alert_missed_events_multiple">"(<xliff:g id="REMINDER_COUNT">%s</xliff:g> recordatorios más)"</string>
+    <string name="alert_missed_events_single">"(<xliff:g id="REMINDER_COUNT">%s</xliff:g> más recordatorios)"</string>
+    <string name="alert_missed_events_multiple">"(<xliff:g id="REMINDER_COUNT">%s</xliff:g> más recordatorios)"</string>
     <string name="event_info_title">"Ver evento"</string>
     <string name="event_info_title_invite">"Invitación a un evento"</string>
     <string name="add_new_reminder">"Añadir recordatorio"</string>
@@ -98,9 +98,9 @@
     <string name="dismiss_all_label">"Descartar todos"</string>
     <string name="does_not_repeat">"Evento único"</string>
     <string name="daily">"Cada día"</string>
-    <string name="every_weekday">"Cada día laborable (lunes-viernes)"</string>
+    <string name="every_weekday">"Cada día laboral (lunes-viernes)"</string>
     <string name="weekly">"Cada semana (todos los <xliff:g id="DAYS_OF_WEEK">%s</xliff:g>)"</string>
-    <string name="monthly_on_day_count">"Cada mes (cada <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_count">"Cada mes (todos los <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">"Cada mes (el día <xliff:g id="DAY_OF_MONTH">%s</xliff:g>)"</string>
     <string name="yearly">"Cada año (el <xliff:g id="DATES">%s</xliff:g>)"</string>
     <string name="custom">"Personalizado... (no se puede personalizar por teléfono)"</string>
     <string name="preferences_title">"Ajustes"</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_hide_declined_title">"Ocultar eventos rechaz."</string>
-    <string name="preferences_alerts_type_title">"Configurar alertas y notif."</string>
+    <string name="preferences_hide_declined_title">"Ocultar eventos rechazados"</string>
+    <string name="preferences_alerts_type_title">"Configurar notificaciones y alertas"</string>
     <string name="preferences_alerts_type_dialog">"Alertas y notificaciones"</string>
     <string name="preferences_alerts_vibrate_title">"Vibrar"</string>
     <string name="preferences_alerts_ringtone_title">"Seleccionar tono"</string>
-    <string name="preferences_default_reminder_title">"Recordatorio predeterminado"</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>
 </resources>
index afb9346..8c45031 100644 (file)
     <item>"Privé"</item>
     <item>"Public"</item>
   </string-array>
-  <string-array name="day_labels">
-    <item>"dimanche"</item>
-    <item>"lundi"</item>
-    <item>"mardi"</item>
-    <item>"mercredi"</item>
-    <item>"jeudi"</item>
-    <item>"vendredi"</item>
-    <item>"samedi"</item>
-  </string-array>
   <string-array name="ordinal_labels">
     <item>"1er"</item>
     <item>"2e"</item>
index 2ad1d00..d1f46e1 100644 (file)
@@ -15,7 +15,7 @@
 -->
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_label">"Agenda"</string>
+    <string name="app_label">"Google Agenda"</string>
     <string name="calendar_plug"><font fgcolor="#ffffffff">"Bienvenue dans Google Agenda !"</font>" "\n"La solution de Google pour gérer votre emploi du temps en planifiant vos événements de manière plus intuitive, efficace et directe."</string>
     <string name="what_label">"Objet"</string>
     <string name="when_label">"Date"</string>
@@ -27,8 +27,8 @@
     <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> minutes"</item>
   </plurals>
   <plurals name="Nmins">
-    <item quantity="one">"1 mn"</item>
-    <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> mn"</item>
+    <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">"1 heure"</item>
@@ -54,7 +54,7 @@
     <string name="plus_N_more">"(et <xliff:g id="MORE_COUNT">%d</xliff:g> autres…)"</string>
     <string name="calendars_title">"Mes agendas"</string>
     <string name="add_calendars">"Ajouter des agendas"</string>
-    <string name="remove_calendars">"Supprimer des agendas"</string>
+    <string name="remove_calendars">"Supprimer les agendas"</string>
     <string name="event_edit_title">"Détails sur l\'événement"</string>
     <string name="hint_what">"Nom de l\'événement"</string>
     <string name="hint_where">"Lieu de l\'événement"</string>
     <string name="delete_label">"Supprimer"</string>
     <string name="delete_event_label">"Supprimer l\'événement"</string>
     <string name="save_label">"Enregistrer"</string>
-    <string name="discard_label">"Annuler"</string>
+    <string name="discard_label">"Ignorer"</string>
     <string name="import_label">"Importer"</string>
     <string name="snooze_all_label">"Tout répéter"</string>
     <string name="dismiss_all_label">"Tout supprimer"</string>
     <string name="does_not_repeat">"Événement ponctuel"</string>
-    <string name="daily">"Quotidien"</string>
+    <string name="daily">"Ignorer"</string>
     <string name="every_weekday">"Les jours ouvrables (lun–ven)"</string>
     <string name="weekly">"Hebdomadaire (chaque <xliff:g id="DAYS_OF_WEEK">%s</xliff:g>)"</string>
     <string name="monthly_on_day_count">"Mensuel (chaque <xliff:g id="ORDINAL_NUMBER">%1$s</xliff:g> <xliff:g id="DAY_OF_WEEK">%2$s</xliff:g>)"</string>
     <string name="delete_title">"Supprimer"</string>
     <string name="change_response_title">"Modifier la réponse"</string>
     <string name="preferences_title">"Paramètres"</string>
-    <string name="preferences_general_title">"Paramètres d\'affichage de l\'agenda"</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_hide_declined_title">"Masquer évén. refusés"</string>
     <string name="preferences_alerts_type_title">"Alertes et notifications"</string>
     <string name="preferences_alerts_vibrate_title">"Vibreur"</string>
     <string name="preferences_alerts_ringtone_title">"Sélectionner la sonnerie"</string>
     <string name="preferences_default_reminder_title">"Définir le rappel par défaut"</string>
-    <string name="preferences_default_reminder_dialog">"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>
 </resources>
index ef167d7..66fd63a 100644 (file)
@@ -51,7 +51,7 @@
   <string-array name="preferences_alert_type_labels">
     <item>"Avviso"</item>
     <item>"Notifica barra di stato"</item>
-    <item>"Disattiva"</item>
+    <item>"Disativa"</item>
   </string-array>
   <string-array name="availability">
     <item>"Occupato"</item>
index e37a930..0300bcb 100644 (file)
     <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>"第1"</item>
     <item>"第2"</item>
index d7924ce..5fee8ef 100644 (file)
     <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>
index 97179c0..744aa5d 100644 (file)
     <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>
index fdb58dd..bcbcbd4 100644 (file)
     <item>"Privé"</item>
     <item>"Openbaar"</item>
   </string-array>
-  <string-array name="day_labels">
-    <item>"Zondag"</item>
-    <item>"Maandag"</item>
-    <item>"Dinsdag"</item>
-    <item>"Woensdag"</item>
-    <item>"Donderdag"</item>
-    <item>"Vrijdag"</item>
-    <item>"Zaterdag"</item>
-  </string-array>
   <string-array name="ordinal_labels">
     <item>"eerste"</item>
     <item>"tweede"</item>
index b0e278a..8cdc6a8 100644 (file)
     <item>"Prywatny"</item>
     <item>"Publiczny"</item>
   </string-array>
-  <string-array name="day_labels">
-    <item>"niedziela"</item>
-    <item>"poniedziałek"</item>
-    <item>"wtorek"</item>
-    <item>"środa"</item>
-    <item>"czwartek"</item>
-    <item>"piątek"</item>
-    <item>"sobota"</item>
-  </string-array>
   <string-array name="ordinal_labels">
     <item>"1."</item>
     <item>"2."</item>
index 86a02f0..57a154a 100644 (file)
@@ -51,7 +51,7 @@
     <string name="goto_today">"Dzisiaj"</string>
     <string name="menu_select_calendars">"Moje kalendarze"</string>
     <string name="menu_preferences">"Ustawienia"</string>
-    <string name="plus_N_more">"(i <xliff:g id="MORE_COUNT">%d</xliff:g> więcej…)"</string>
+    <string name="plus_N_more">"(i <xliff:g id="MORE_COUNT">%d</xliff:g> więcej …)"</string>
     <string name="calendars_title">"Moje kalendarze"</string>
     <string name="add_calendars">"Dodaj kalendarze"</string>
     <string name="remove_calendars">"Usuń kalendarze"</string>
     <string name="every_weekday">"Codziennie (pn-pt)"</string>
     <string name="weekly">"Co tydzień (<xliff:g id="DAYS_OF_WEEK">%s</xliff:g>)"</string>
     <string name="monthly_on_day_count">"Co miesiąc (co <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">"Co miesiąc (<xliff:g id="DAY_OF_MONTH">%s</xliff:g>. każdego miesiąca)"</string>
+    <string name="monthly_on_day">"Co miesiąc (<xliff:g id="DAY_OF_MONTH">%s</xliff:g> każdego miesiąca)"</string>
     <string name="yearly">"Co rok (<xliff:g id="DATES">%s</xliff:g>)"</string>
     <string name="custom">"Niestandardowo… (nie można dostosować na telefonie)"</string>
     <string name="modify_event">"Zmień tylko to wydarzenie."</string>
diff --git a/res/values-pt/arrays.xml b/res/values-pt/arrays.xml
new file mode 100644 (file)
index 0000000..162be60
--- /dev/null
@@ -0,0 +1,96 @@
+<?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 minutos"</item>
+    <item>"10 minutos"</item>
+    <item>"15 minutos"</item>
+    <item>"20 minutos"</item>
+    <item>"25 minutos"</item>
+    <item>"30 minutos"</item>
+    <item>"45 minutos"</item>
+    <item>"1 hora"</item>
+    <item>"2 horas"</item>
+    <item>"3 horas"</item>
+    <item>"12 horas"</item>
+    <item>"24 horas"</item>
+    <item>"2 dias"</item>
+    <item>"1 semana"</item>
+  </string-array>
+  <string-array name="preferences_default_reminder_labels">
+    <item>"Nenhuma"</item>
+    <item>"5 minutos"</item>
+    <item>"10 minutos"</item>
+    <item>"15 minutos"</item>
+    <item>"20 minutos"</item>
+    <item>"25 minutos"</item>
+    <item>"30 minutos"</item>
+    <item>"45 minutos"</item>
+    <item>"1 hora"</item>
+    <item>"2 horas"</item>
+    <item>"3 horas"</item>
+    <item>"12 horas"</item>
+    <item>"24 horas"</item>
+    <item>"2 dias"</item>
+    <item>"1 semana"</item>
+  </string-array>
+  <string-array name="preferences_alert_type_labels">
+    <item>"Alerta"</item>
+    <item>"Notificação da barra de status"</item>
+    <item>"Desativado"</item>
+  </string-array>
+  <string-array name="availability">
+    <item>"Ocupado(a)"</item>
+    <item>"Disponível"</item>
+  </string-array>
+  <string-array name="visibility">
+    <item>"Padrão"</item>
+    <item>"Privado"</item>
+    <item>"Público"</item>
+  </string-array>
+  <string-array name="ordinal_labels">
+    <item>"primeiro"</item>
+    <item>"segundo"</item>
+    <item>"terceiro"</item>
+    <item>"quarto"</item>
+    <item>"último"</item>
+  </string-array>
+  <string-array name="response_labels1">
+    <item>"(Nenhuma resposta)"</item>
+    <item>"Sim"</item>
+    <item>"Talvez"</item>
+    <item>"Não"</item>
+  </string-array>
+  <string-array name="response_labels2">
+    <item>"Sim"</item>
+    <item>"Talvez"</item>
+    <item>"Não"</item>
+  </string-array>
+  <string-array name="delete_repeating_labels">
+    <item>"Somente este evento"</item>
+    <item>"Este evento e eventos futuros"</item>
+    <item>"Todos os eventos"</item>
+  </string-array>
+  <string-array name="delete_repeating_labels_no_selected">
+    <item>"Este evento e eventos futuros"</item>
+    <item>"Todos os eventos"</item>
+  </string-array>
+  <string-array name="change_response_labels">
+    <item>"Somente nessa ocasião"</item>
+    <item>"Todos os eventos da série"</item>
+  </string-array>
+</resources>
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
new file mode 100644 (file)
index 0000000..6544ff4
--- /dev/null
@@ -0,0 +1,126 @@
+<?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">"Agenda"</string>
+    <string name="calendar_plug"><font fgcolor="#ffffffff">"Bem-vindo ao Google Agenda!"</font>" "\n" Uma abordagem do Google para organizar seus horários baseada na idéia de que eventos programados podem ser mais intuitivos, eficientes e acessíveis."</string>
+    <string name="what_label">"O que"</string>
+    <string name="when_label">"Quando"</string>
+    <string name="where_label">"Onde"</string>
+    <string name="repeats_label">"Repetições"</string>
+    <string name="no_title_label">"(Sem título)"</string>
+  <plurals name="Nminutes">
+    <item quantity="one">"1 minuto"</item>
+    <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> minutos"</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">"1 hora"</item>
+    <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> horas"</item>
+  </plurals>
+  <plurals name="Ndays">
+    <item quantity="one">"1 dia"</item>
+    <item quantity="other">"<xliff:g id="COUNT">%d</xliff:g> dias"</item>
+  </plurals>
+    <string name="show_agenda_view">"Mostrar compromissos"</string>
+    <string name="show_day_view">"Mostrar dia"</string>
+    <string name="agenda_view">"Compromissos"</string>
+    <string name="day_view">"Dia"</string>
+    <string name="week_view">"Semana"</string>
+    <string name="month_view">"Mês"</string>
+    <string name="event_view">"Visualizar evento"</string>
+    <string name="event_create">"Novo evento"</string>
+    <string name="event_edit">"Editar evento"</string>
+    <string name="event_delete">"Excluir evento"</string>
+    <string name="goto_today">"Hoje"</string>
+    <string name="menu_select_calendars">"Minhas agendas"</string>
+    <string name="menu_preferences">"Configurações"</string>
+    <string name="plus_N_more">"(mais <xliff:g id="MORE_COUNT">%d</xliff:g> a mais …)"</string>
+    <string name="calendars_title">"Minhas agendas"</string>
+    <string name="add_calendars">"Adicionar agendas"</string>
+    <string name="remove_calendars">"Remover agendas"</string>
+    <string name="event_edit_title">"Detalhes do evento"</string>
+    <string name="hint_what">"Nome do evento"</string>
+    <string name="hint_where">"Local do evento"</string>
+    <string name="hint_description">"Descrição do evento"</string>
+    <string name="creating_event">"Criando um evento…"</string>
+    <string name="saving_event">"Salvando evento…"</string>
+    <string name="loading_calendars_title">"Carregando as agendas"</string>
+    <string name="loading_calendars_message">"Carregando as agendas..."</string>
+    <string name="alert_title">"Notificações da agenda"</string>
+    <string name="alert_when_label">"Quando:"</string>
+    <string name="alert_where_label">"Onde:"</string>
+    <string name="alert_missed_events_single">"(Mais <xliff:g id="REMINDER_COUNT">%s</xliff:g> lembrete)"</string>
+    <string name="alert_missed_events_multiple">"(mais <xliff:g id="REMINDER_COUNT">%s</xliff:g> lembretes)"</string>
+    <string name="event_info_title">"Visualizar evento"</string>
+    <string name="event_info_title_invite">"Convite para reunião"</string>
+    <string name="add_new_reminder">"Adicionar lembrete"</string>
+    <string name="edit_event_to_label">"A"</string>
+    <string name="edit_event_from_label">"De"</string>
+    <string name="edit_event_all_day_label">"O dia todo"</string>
+    <string name="edit_event_calendar_label">"Agenda"</string>
+    <string name="edit_event_show_extra_options">"Mostrar opções extras"</string>
+    <string name="edit_event_hide_extra_options">"Ocultar opções extras"</string>
+    <string name="description_label">"Descrição"</string>
+    <string name="presence_label">"Presença"</string>
+    <string name="privacy_label">"Privacidade"</string>
+    <string name="reminders_label">"Lembretes"</string>
+    <string name="no_syncable_calendars">"Nenhuma agenda disponível"</string>
+    <string name="no_calendars_found">"Você não tem nenhuma agenda."</string>
+    <string name="view_event_calendar_label">"Agenda"</string>
+    <string name="view_event_timezone_label">"Localizar fuso horário"</string>
+    <string name="view_event_response_label">"Você participará?"</string>
+    <string name="agenda_today">"Hoje"</string>
+    <string name="num_events">"Núm. eventos"</string>
+    <string name="edit_event_label">"Editar evento"</string>
+    <string name="delete_label">"Excluir"</string>
+    <string name="delete_event_label">"Excluir evento"</string>
+    <!-- no translation found for save_label (2133599104834432589) -->
+    <skip />
+    <!-- no translation found for discard_label (4510607554910139220) -->
+    <skip />
+    <string name="import_label">"Importar"</string>
+    <string name="snooze_all_label">"Colocar todos em modo de espera"</string>
+    <string name="dismiss_all_label">"Encerrar tudo"</string>
+    <string name="does_not_repeat">"Evento único"</string>
+    <string name="daily">"Diariamente"</string>
+    <string name="every_weekday">"Todos os dias da semana (de segunda a sexta)"</string>
+    <string name="weekly">"Semanalmente (todo(a) <xliff:g id="DAYS_OF_WEEK">%s</xliff:g>)"</string>
+    <string name="monthly_on_day_count">"Mensalmente (todo <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">"Mensalmente (no dia <xliff:g id="DAY_OF_MONTH">%s</xliff:g>)"</string>
+    <string name="yearly">"Anualmente (em <xliff:g id="DATES">%s</xliff:g>)"</string>
+    <string name="custom">"Personalizado… (não é permitido personalizar no telefone)"</string>
+    <string name="modify_event">"Alterar somente este evento."</string>
+    <string name="modify_all">"Alterar todos os eventos da série."</string>
+    <string name="modify_all_following">"Altere este e todos os eventos futuros."</string>
+    <string name="delete_this_event_title">"Este evento será excluído."</string>
+    <string name="delete_title">"Excluir"</string>
+    <string name="change_response_title">"Alterar resposta"</string>
+    <string name="preferences_title">"Configurações"</string>
+    <string name="preferences_general_title">"Configuração de visualização da agenda"</string>
+    <string name="preferences_alerts_title">"Configurações dos lembretes"</string>
+    <string name="preferences_hide_declined_title">"Ocultar eventos recusados"</string>
+    <string name="preferences_alerts_type_title">"Definir alertas e notificações"</string>
+    <string name="preferences_alerts_type_dialog">"Alertas e notificações"</string>
+    <string name="preferences_alerts_vibrate_title">"Vibrar"</string>
+    <string name="preferences_alerts_ringtone_title">"Selecionar toque"</string>
+    <string name="preferences_default_reminder_title">"Definir lembrete padrão"</string>
+    <string name="preferences_default_reminder_dialog">"Momento padrão do lembrete"</string>
+    <string name="preferences_default_reminder_default">"10"</string>
+</resources>
index 23c2ae8..186925e 100644 (file)
     <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>
index 10d1c23..ef87f67 100644 (file)
     <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>
index 08e4230..eddbfa0 100644 (file)
     <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>
index e88cc1c..a71ce5d 100644 (file)
     <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_this_event_title">"刪除此活動?"</string>
     <string name="delete_title">"刪除"</string>
     <string name="change_response_title">"變更回應"</string>
     <string name="preferences_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_vibrate_title">"震動"</string>
     <string name="preferences_alerts_ringtone_title">"選取鈴聲"</string>
-    <string name="preferences_default_reminder_title">"設定預設提醒"</string>
+    <string name="preferences_default_reminder_title">"設定預設提醒時間"</string>
     <string name="preferences_default_reminder_dialog">"預設提醒時間"</string>
     <string name="preferences_default_reminder_default">"10"</string>
 </resources>
index 16a9cab..512a923 100644 (file)
         <item>Public</item>
     </string-array>
     
-    <!-- Order matters, and note that the preference for which day the week starts on is handled
-         elsewhere (and needn't be addressed here). -->
-    <string-array name="day_labels">
-        <item>Sunday</item>
-        <item>Monday</item>
-        <item>Tuesday</item>
-        <item>Wednesday</item>
-        <item>Thursday</item>
-        <item>Friday</item>
-        <item>Saturday</item>
-    </string-array>
-    
     <string-array name="ordinal_labels">
         <item>first</item>
         <item>second</item>
index 0e26905..e49015e 100644 (file)
     <!-- A menu item for deleting an event -->
     <string name="delete_event_label">"Delete event"</string>
     <!-- The button label for saving an event -->
-    <string name="save_label">Save</string>
+    <string name="save_label">Done</string>
     <!-- The button label for discarding changes to an event -->
-    <string name="discard_label">Discard changes</string>
+    <string name="discard_label">Revert</string>
     <!-- The button label for importing events from another source to the phone -->
     <string name="import_label">"Import"</string>
 
index 6aac218..1b93b7e 100644 (file)
@@ -20,60 +20,71 @@ import android.content.Context;
 import android.content.res.Resources;
 import android.database.Cursor;
 import android.provider.Calendar.Attendees;
-import android.provider.Calendar.Reminders;
 import android.text.format.DateFormat;
 import android.text.format.DateUtils;
 import android.view.View;
-import android.widget.FrameLayout;
 import android.widget.ResourceCursorAdapter;
 import android.widget.TextView;
 
-import java.util.ArrayList;
-
 public class AgendaAdapter extends ResourceCursorAdapter {
-    
-    static final String[] REMINDERS_PROJECTION = new String[] {
-        Reminders._ID,      // 0
-        Reminders.MINUTES,  // 1
-    };
-    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 + ")";
-    
+    static private String mNoTitleLabel; // todo update on locale change.
     private Resources mResources;
-    private static ArrayList<Integer> sReminderValues;
-    private static String[] sReminderLabels;
+    private int mDeclinedColor;
+
+    static class ViewHolder {
+        int overLayColor; // Used by AgendaItemView to gray out the entire item if so desired
+
+        /* Event */
+        TextView title;
+        TextView when;
+        TextView where;
+        int calendarColor; // Used by AgendaItemView to color the vertical stripe
+    }
 
     public AgendaAdapter(Context context, int resource) {
         super(context, resource, null);
         mResources = context.getResources();
+        mNoTitleLabel = mResources.getString(R.string.no_title_label);
+        mDeclinedColor = mResources.getColor(R.drawable.agenda_item_declined);
     }
-    
+
     @Override
     public void bindView(View view, Context context, Cursor cursor) {
+        ViewHolder holder = (ViewHolder) view.getTag();
+
+        if (holder == null) {
+            holder = new ViewHolder();
+            view.setTag(holder);
+            holder.title = (TextView) view.findViewById(R.id.title);
+            holder.when = (TextView) view.findViewById(R.id.when);
+            holder.where = (TextView) view.findViewById(R.id.where);
+        }
+
         // Fade text if event was declined.
         int selfAttendeeStatus = cursor.getInt(AgendaActivity.INDEX_SELF_ATTENDEE_STATUS);
-        boolean declined = (selfAttendeeStatus == Attendees.ATTENDEE_STATUS_DECLINED);
-        
-        View stripe = view.findViewById(R.id.vertical_stripe);
+        if (selfAttendeeStatus == Attendees.ATTENDEE_STATUS_DECLINED) {
+            holder.overLayColor = mDeclinedColor;
+        } else {
+            holder.overLayColor = 0;
+        }
+
+        TextView title = holder.title;
+        TextView when = holder.when;
+        TextView where = holder.where;
+
+        /* Calendar Color */
         int color = cursor.getInt(AgendaActivity.INDEX_COLOR);
-        ((FrameLayout) view).setForeground(declined ? 
-                mResources.getDrawable(R.drawable.agenda_item_declined) : null);
+        holder.calendarColor = color;
 
-        stripe.setBackgroundColor(color);
-        
         // What
-        TextView title = (TextView) view.findViewById(R.id.title);
         String titleString = cursor.getString(AgendaActivity.INDEX_TITLE);
         if (titleString == null || titleString.length() == 0) {
-            titleString = mResources.getString(R.string.no_title_label);
+            titleString = mNoTitleLabel;
         }
         title.setText(titleString);
         title.setTextColor(color);
-        
+
         // When
-        TextView when = (TextView) view.findViewById(R.id.when);
         long begin = cursor.getLong(AgendaActivity.INDEX_BEGIN);
         long end = cursor.getLong(AgendaActivity.INDEX_END);
         boolean allDay = cursor.getInt(AgendaActivity.INDEX_ALL_DAY) != 0;
@@ -89,16 +100,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, 
+            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);
@@ -109,7 +120,7 @@ public class AgendaAdapter extends ResourceCursorAdapter {
             repeatContainer.setVisibility(View.GONE);
         }
         */
-        
+
         /*
         // Reminder
         boolean hasAlarm = cursor.getInt(AgendaActivity.INDEX_HAS_ALARM) != 0;
@@ -117,9 +128,8 @@ public class AgendaAdapter extends ResourceCursorAdapter {
             updateReminder(view, context, begin, cursor.getLong(AgendaActivity.INDEX_EVENT_ID));
         }
         */
-        
+
         // Where
-        TextView where = (TextView) view.findViewById(R.id.where);
         String whereString = cursor.getString(AgendaActivity.INDEX_EVENT_LOCATION);
         if (whereString != null && whereString.length() > 0) {
             where.setVisibility(View.VISIBLE);
@@ -134,7 +144,7 @@ public class AgendaAdapter extends ResourceCursorAdapter {
         ContentResolver cr = context.getContentResolver();
         Uri uri = Reminders.CONTENT_URI;
         String where = String.format(REMINDERS_WHERE, eventId);
-        
+
         Cursor remindersCursor = cr.query(uri, REMINDERS_PROJECTION, where, null, null);
         if (remindersCursor != null) {
             LayoutInflater inflater =
diff --git a/src/com/android/calendar/AgendaItemView.java b/src/com/android/calendar/AgendaItemView.java
new file mode 100644 (file)
index 0000000..7419e1a
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * 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.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.util.AttributeSet;
+import android.widget.RelativeLayout;
+
+import com.android.calendar.AgendaAdapter.ViewHolder;
+
+/**
+ * A custom layout for each item in the Agenda list view.
+ */
+public class AgendaItemView extends RelativeLayout {
+    Paint mPaint = new Paint();
+
+    public AgendaItemView(Context context) {
+        super(context);
+    }
+
+    public AgendaItemView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    @Override
+    protected void dispatchDraw(Canvas canvas) {
+        super.dispatchDraw(canvas);
+        ViewHolder holder = (ViewHolder) getTag();
+        if (holder != null) {
+            /* Draw vertical color stripe */
+            mPaint.setColor(holder.calendarColor);
+            canvas.drawRect(0, 0, 5, getHeight(), mPaint);
+
+            /* Gray out item if the event was declined */
+            if (holder.overLayColor != 0) {
+                mPaint.setColor(holder.overLayColor);
+                canvas.drawRect(0, 0, getWidth(), getHeight(), mPaint);
+            }
+        }
+    }
+}
index 3eb799a..38185a1 100644 (file)
@@ -103,6 +103,13 @@ public class CalendarView extends View
 
     private ContinueScroll mContinueScroll = new ContinueScroll();
 
+    private class DayHeader{
+        int cell;
+        String dateString;
+    }
+
+    private DayHeader[] dayHeaders = new DayHeader[32];
+    
     // Make this visible within the package for more informative debugging
     Time mBaseDate;
 
@@ -203,6 +210,19 @@ public class CalendarView extends View
     private static int mPressedColor;
     private static int mSelectedEventTextColor;
     private static int mEventTextColor;
+    private static int mWeek_weekendColor;
+    private static int mCalendarDateBannerTextColor;
+    private static int mCalendarAllDayBackground;
+    private static int mCalendarAmPmLabel;
+    private static int mCalendarDateBannerBackground;
+    private static int mCalendarDateSelected;
+    private static int mCalendarGridAreaBackground;
+    private static int mCalendarGridAreaSelected;
+    private static int mCalendarGridLineHorizontalColor;
+    private static int mCalendarGridLineVerticalColor;
+    private static int mCalendarHourBackground;
+    private static int mCalendarHourLabel;
+    private static int mCalendarHourSelected;
 
     private int mViewStartX;
     private int mViewStartY;
@@ -318,6 +338,19 @@ public class CalendarView extends View
             mStartDay = Time.SUNDAY;
         }
 
+        mWeek_weekendColor = mResources.getColor(R.color.week_weekend);
+        mCalendarDateBannerTextColor = mResources.getColor(R.color.calendar_date_banner_text_color);
+        mCalendarAllDayBackground = mResources.getColor(R.color.calendar_all_day_background);
+        mCalendarAmPmLabel = mResources.getColor(R.color.calendar_ampm_label);
+        mCalendarDateBannerBackground = mResources.getColor(R.color.calendar_date_banner_background);
+        mCalendarDateSelected = mResources.getColor(R.color.calendar_date_selected);
+        mCalendarGridAreaBackground = mResources.getColor(R.color.calendar_grid_area_background);
+        mCalendarGridAreaSelected = mResources.getColor(R.color.calendar_grid_area_selected);
+        mCalendarGridLineHorizontalColor = mResources.getColor(R.color.calendar_grid_line_horizontal_color);
+        mCalendarGridLineVerticalColor = mResources.getColor(R.color.calendar_grid_line_vertical_color);
+        mCalendarHourBackground = mResources.getColor(R.color.calendar_hour_background);
+        mCalendarHourLabel = mResources.getColor(R.color.calendar_hour_label);
+        mCalendarHourSelected = mResources.getColor(R.color.calendar_hour_selected);
         mSelectionColor = mResources.getColor(R.color.selection);
         mPressedColor = mResources.getColor(R.color.pressed);
         mSelectedEventTextColor = mResources.getColor(R.color.calendar_event_selected_text_color);
@@ -1212,7 +1245,7 @@ public class CalendarView extends View
     // below the upper-left corner, above the hours and to the left of the
     // all-day area.
     private void drawUpperLeftCorner(Rect r, Canvas canvas, Paint p) {
-        p.setColor(mResources.getColor(R.color.calendar_hour_background));
+        p.setColor(mCalendarHourBackground);
         r.top = mBannerPlusMargin;
         r.bottom = r.top + mAllDayHeight + ALLDAY_TOP_MARGIN;
         r.left = 0;
@@ -1222,7 +1255,7 @@ public class CalendarView extends View
 
     private void drawDayHeaderLoop(Rect r, Canvas canvas, Paint p) {
         // Draw the horizontal day background banner
-        p.setColor(mResources.getColor(R.color.calendar_date_banner_background));
+        p.setColor(mCalendarDateBannerBackground);
         r.top = 0;
         r.bottom = mBannerPlusMargin;
         r.left = 0;
@@ -1232,14 +1265,14 @@ public class CalendarView extends View
         // Fill the extra space on the right side with the default background
         r.left = r.right;
         r.right = mViewWidth;
-        p.setColor(mResources.getColor(R.color.calendar_grid_area_background));
+        p.setColor(mCalendarGridAreaBackground);
         canvas.drawRect(r, p);
 
         // Draw a highlight on the selected day (if any), but only if we are
         // displaying more than one day.
         if (mSelectionMode != SELECTION_HIDDEN) {
             if (mNumDays > 1) {
-                p.setColor(mResources.getColor(R.color.calendar_date_selected));
+                p.setColor(mCalendarDateSelected);
                 r.top = 0;
                 r.bottom = mBannerPlusMargin;
                 int daynum = mSelectionDay - mFirstJulianDay;
@@ -1262,6 +1295,8 @@ public class CalendarView extends View
             dayNames = mDayStrs2Letter;
         }
 
+        p.setTypeface(mBold);
+        p.setAntiAlias(true);
         for (int day = 0; day < mNumDays; day++, cell++) {
             drawDayHeader(dayNames[day + mStartDay], day, cell, x, canvas, p);
             x += deltaX;
@@ -1269,7 +1304,7 @@ public class CalendarView extends View
     }
 
     private void drawAmPm(Canvas canvas, Paint p) {
-        p.setColor(mResources.getColor(R.color.calendar_ampm_label));
+        p.setColor(mCalendarAmPmLabel);
         p.setTextSize(AMPM_FONT_SIZE);
         p.setTypeface(mBold);
         p.setAntiAlias(true);
@@ -1310,7 +1345,7 @@ public class CalendarView extends View
 
     private void drawHours(Rect r, Canvas canvas, Paint p) {
         // Draw the background for the hour labels
-        p.setColor(mResources.getColor(R.color.calendar_hour_background));
+        p.setColor(mCalendarHourBackground);
         r.top = 0;
         r.bottom = 24 * (mCellHeight + HOUR_GAP) + HOUR_GAP;
         r.left = 0;
@@ -1320,12 +1355,12 @@ public class CalendarView extends View
         // Fill the bottom left corner with the default grid background
         r.top = r.bottom;
         r.bottom = mBitmapHeight;
-        p.setColor(mResources.getColor(R.color.calendar_grid_area_background));
+        p.setColor(mCalendarGridAreaBackground);
         canvas.drawRect(r, p);
 
         // Draw a highlight on the selected hour (if needed)
         if (mSelectionMode != SELECTION_HIDDEN && !mSelectionAllDay) {
-            p.setColor(mResources.getColor(R.color.calendar_hour_selected));
+            p.setColor(mCalendarHourSelected);
             r.top = mSelectionHour * (mCellHeight + HOUR_GAP);
             r.bottom = r.top + mCellHeight + 2 * HOUR_GAP;
             r.left = 0;
@@ -1333,7 +1368,7 @@ public class CalendarView extends View
             canvas.drawRect(r, p);
 
             // Also draw the highlight on the grid
-            p.setColor(mResources.getColor(R.color.calendar_grid_area_selected));
+            p.setColor(mCalendarGridAreaSelected);
             int daynum = mSelectionDay - mFirstJulianDay;
             r.left = mHoursWidth + daynum * (mCellWidth + DAY_GAP);
             r.right = r.left + mCellWidth;
@@ -1349,7 +1384,7 @@ public class CalendarView extends View
             saveSelectionPosition(r.left, r.top, r.right, r.bottom);
         }
 
-        p.setColor(mResources.getColor(R.color.calendar_hour_label));
+        p.setColor(mCalendarHourLabel);
         p.setTextSize(HOURS_FONT_SIZE);
         p.setTypeface(mBold);
         p.setTextAlign(Paint.Align.RIGHT);
@@ -1368,9 +1403,6 @@ public class CalendarView extends View
     private void drawDayHeader(String dateStr, int day, int cell, int x, Canvas canvas, Paint p) {
         float xCenter = x + mCellWidth / 2.0f;
 
-        p.setTypeface(mBold);
-        p.setAntiAlias(true);
-
         boolean isWeekend = false;
         if ((mStartDay == Time.SUNDAY && (day == 0 || day == 6))
                 || (mStartDay == Time.MONDAY && (day == 5 || day == 6))
@@ -1379,9 +1411,9 @@ public class CalendarView extends View
         }
 
         if (isWeekend) {
-            p.setColor(mResources.getColor(R.color.week_weekend));
+            p.setColor(mWeek_weekendColor);
         } else {
-            p.setColor(mResources.getColor(R.color.calendar_date_banner_text_color));
+            p.setColor(mCalendarDateBannerTextColor);
         }
 
         int dateNum = mFirstDate + day;
@@ -1397,8 +1429,17 @@ public class CalendarView extends View
             dateNumStr = String.valueOf(dateNum);
         }
 
-        dateStr = getResources().getString(R.string.weekday_day,
-                                           dateStr, dateNumStr);
+        DayHeader header = dayHeaders[day];
+        if (header == null || header.cell != cell) {
+            // The day header string is regenerated on every draw during drag and fling animation.
+            // Caching day header since formatting the string takes surprising long time.
+
+            dayHeaders[day] = new DayHeader();
+            dayHeaders[day].cell = cell;
+            dayHeaders[day].dateString = getResources().getString(
+                    R.string.weekday_day, dateStr, dateNumStr);
+        }
+        dateStr = dayHeaders[day].dateString;
 
         float y = mBannerPlusMargin - 7;
         canvas.drawText(dateStr, xCenter, y, p);
@@ -1408,7 +1449,7 @@ public class CalendarView extends View
         Paint.Style savedStyle = p.getStyle();
 
         // Clear the background
-        p.setColor(mResources.getColor(R.color.calendar_grid_area_background));
+        p.setColor(mCalendarGridAreaBackground);
         r.top = 0;
         r.bottom = mBitmapHeight;
         r.left = 0;
@@ -1416,7 +1457,7 @@ public class CalendarView extends View
         canvas.drawRect(r, p);
 
         // Draw the horizontal grid lines
-        p.setColor(mResources.getColor(R.color.calendar_grid_line_horizontal_color));
+        p.setColor(mCalendarGridLineHorizontalColor);
         p.setStyle(Style.STROKE);
         p.setStrokeWidth(0);
         p.setAntiAlias(false);
@@ -1430,7 +1471,7 @@ public class CalendarView extends View
         }
 
         // Draw the vertical grid lines
-        p.setColor(mResources.getColor(R.color.calendar_grid_line_vertical_color));
+        p.setColor(mCalendarGridLineVerticalColor);
         float startY = 0;
         float stopY = HOUR_GAP + 24 * (mCellHeight + HOUR_GAP);
         float deltaX = mCellWidth + DAY_GAP;
@@ -1518,17 +1559,17 @@ public class CalendarView extends View
         r.bottom = r.top + mAllDayHeight + ALLDAY_TOP_MARGIN;
         r.left = mHoursWidth;
         r.right = r.left + mNumDays * (mCellWidth + DAY_GAP);
-        p.setColor(mResources.getColor(R.color.calendar_all_day_background));
+        p.setColor(mCalendarAllDayBackground);
         canvas.drawRect(r, p);
 
         // Fill the extra space on the right side with the default background
         r.left = r.right;
         r.right = mViewWidth;
-        p.setColor(mResources.getColor(R.color.calendar_grid_area_background));
+        p.setColor(mCalendarGridAreaBackground);
         canvas.drawRect(r, p);
 
         // Draw the vertical grid lines
-        p.setColor(mResources.getColor(R.color.calendar_grid_line_vertical_color));
+        p.setColor(mCalendarGridLineVerticalColor);
         p.setStyle(Style.STROKE);
         p.setStrokeWidth(0);
         p.setAntiAlias(false);
index e1c5310..ce545fa 100644 (file)
@@ -959,7 +959,15 @@ public class EditEvent extends Activity implements View.OnClickListener,
         Resources r = getResources();
         int resource = android.R.layout.simple_spinner_item;
 
-        String[] days = r.getStringArray(R.array.day_labels);
+        String[] days = new String[] {
+            DateUtils.getDayOfWeekString(Calendar.SUNDAY, DateUtils.LENGTH_MEDIUM),
+            DateUtils.getDayOfWeekString(Calendar.MONDAY, DateUtils.LENGTH_MEDIUM),
+            DateUtils.getDayOfWeekString(Calendar.TUESDAY, DateUtils.LENGTH_MEDIUM),
+            DateUtils.getDayOfWeekString(Calendar.WEDNESDAY, DateUtils.LENGTH_MEDIUM),
+            DateUtils.getDayOfWeekString(Calendar.THURSDAY, DateUtils.LENGTH_MEDIUM),
+            DateUtils.getDayOfWeekString(Calendar.FRIDAY, DateUtils.LENGTH_MEDIUM),
+            DateUtils.getDayOfWeekString(Calendar.SATURDAY, DateUtils.LENGTH_MEDIUM),
+        };
         String[] ordinals = r.getStringArray(R.array.ordinal_labels);
 
         // Only display "Custom" in the spinner if the device does not support the
index 48702bc..551aca6 100644 (file)
@@ -39,6 +39,7 @@ import android.provider.Calendar.Reminders;
 import android.text.format.DateFormat;
 import android.text.format.DateUtils;
 import android.text.format.Time;
+import android.text.util.Linkify;
 import android.util.Log;
 import android.view.KeyEvent;
 import android.view.Menu;
@@ -54,6 +55,7 @@ import android.widget.Toast;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.regex.Pattern;
 
 public class EventInfoActivity extends Activity implements View.OnClickListener,
         AdapterView.OnItemSelectedListener {
@@ -162,6 +164,8 @@ public class EventInfoActivity extends Activity implements View.OnClickListener,
     private int mOriginalAttendeeResponse;
     private boolean mIsRepeating;
 
+    private Pattern mWildcardPattern = Pattern.compile("^.*$");
+
     // This is called when one of the "remove reminder" buttons is selected.
     public void onClick(View v) {
         LinearLayout reminderItem = (LinearLayout) v.getParent();
@@ -657,7 +661,12 @@ public class EventInfoActivity extends Activity implements View.OnClickListener,
         if (location == null || location.length() == 0) {
             setVisibilityCommon(R.id.where, View.GONE);
         } else {
-            setTextCommon(R.id.where, location);
+            TextView textView = (TextView) findViewById(R.id.where);
+            if (textView != null) {
+                    textView.setAutoLinkMask(0);
+                    textView.setText(location);
+                    Linkify.addLinks(textView, mWildcardPattern, "geo:0,0?q=");
+            }
         }
 
         // Description
index 44943eb..01037ab 100644 (file)
@@ -35,6 +35,7 @@ import android.view.View;
 import android.view.Window;
 import android.view.MenuItem.OnMenuItemClickListener;
 import android.widget.AdapterView;
+import android.widget.Button;
 import android.widget.CheckBox;
 import android.widget.ListView;
 
@@ -116,6 +117,8 @@ public class SelectCalendarsActivity extends Activity implements ListView.OnItem
         boolean[] mIsChecked;
         ContentResolver mContentResolver;
         boolean mRemove;
+        private int mCheckedCount;
+        private Button mOkButtonInAddDeleteCalendar;
         
         public ChangeCalendarAction(boolean remove) {
             mContentResolver = SelectCalendarsActivity.this.getContentResolver();
@@ -128,6 +131,13 @@ public class SelectCalendarsActivity extends Activity implements ListView.OnItem
          */
         public void onClick(DialogInterface dialog, int position, boolean isChecked) {
             mIsChecked[position] = isChecked;
+            if (isChecked) {
+                mCheckedCount++;
+            } else {
+                mCheckedCount--;
+            }
+
+            mOkButtonInAddDeleteCalendar.setEnabled(mCheckedCount > 0);
         }
 
         /*
@@ -136,7 +146,7 @@ public class SelectCalendarsActivity extends Activity implements ListView.OnItem
          */
         public void onClick(DialogInterface dialog, int which) {
             // If the user cancelled the dialog, then do nothing.
-            if (which == DialogInterface.BUTTON2) {
+            if (which == DialogInterface.BUTTON_NEGATIVE) {
                 return;
             }
             
@@ -179,6 +189,7 @@ public class SelectCalendarsActivity extends Activity implements ListView.OnItem
                 selection = Calendars.SYNC_EVENTS + "=0";
             }
             ContentResolver cr = getContentResolver();
+            // TODO this can cause ANRs http://b/1736511
             Cursor cursor = cr.query(Calendars.CONTENT_URI, PROJECTION,
                     selection, null /* selectionArgs */,
                     Calendars.DEFAULT_SORT_ORDER);
@@ -192,6 +203,7 @@ public class SelectCalendarsActivity extends Activity implements ListView.OnItem
             CharSequence[] calendarNames = new CharSequence[count];
             mCalendarIds = new long[count];
             mIsChecked = new boolean[count];
+            mCheckedCount = 0;
             try {
                 int pos = 0;
                 while (cursor.moveToNext()) {
@@ -203,10 +215,13 @@ public class SelectCalendarsActivity extends Activity implements ListView.OnItem
                 cursor.close();
             }
             
-            builder.setMultiChoiceItems(calendarNames, null, this)
+            AlertDialog dialog = builder.setMultiChoiceItems(calendarNames, null, this)
                 .setPositiveButton(android.R.string.ok, this)
-                .setNegativeButton(android.R.string.cancel, this)
-                .show();
+                .setNegativeButton(android.R.string.cancel, this).create();
+            dialog.show();
+            mOkButtonInAddDeleteCalendar = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
+            mOkButtonInAddDeleteCalendar.setEnabled(false);
+
             return true;
         }
     }
index fb50662..a3eab03 100644 (file)
@@ -49,11 +49,16 @@ public class SelectCalendarsAdapter extends CursorAdapter {
     private final LayoutInflater mInflater;
     private final ContentResolver mResolver;
     private final ContentValues mValues = new ContentValues();
+    private Boolean mIsChecked[] = null;
+    private static final Boolean CHECKED = true;
+    private static final Boolean UNCHECKED = false;
 
     private class CheckBoxListener implements CheckBox.OnCheckedChangeListener {
         private final long mCalendarId;
+        private final int mPosition;
 
-        private CheckBoxListener(long calendarId) {
+        private CheckBoxListener(long calendarId, int position) {
+            mPosition = position;
             mCalendarId = calendarId;
         }
         
@@ -63,13 +68,19 @@ public class SelectCalendarsAdapter extends CursorAdapter {
             int checked = isChecked ? 1 : 0;
             mValues.put(Calendars.SELECTED, checked);
             mResolver.update(uri, mValues, null, null);
+            mIsChecked[mPosition] = isChecked ? CHECKED : UNCHECKED;
         }
     }
 
+    private void updateIsCheckedArray(int cursorCount) {
+        mIsChecked = new Boolean[cursorCount];
+    }
+
     public SelectCalendarsAdapter(Context context, Cursor cursor) {
         super(context, cursor);
         mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
         mResolver = context.getContentResolver();
+        updateIsCheckedArray(cursor.getCount());
     }
 
     @Override
@@ -87,10 +98,25 @@ public class SelectCalendarsAdapter extends CursorAdapter {
         setText(view, R.id.calendar, cursor.getString(nameColumn));
         CheckBox box = (CheckBox) view.findViewById(R.id.checkbox);
         long id = cursor.getLong(idColumn);
-        boolean checked = cursor.getInt(selectedColumn) != 0;
+
+        // Update mIsChecked array is needed
+        int cursorCount = cursor.getCount();
+        if (cursorCount != mIsChecked.length) {
+            updateIsCheckedArray(cursorCount);
+        }
+
+        // If the value hasn't changed, read from cursor; otherwise, read from mIsChecked array.
+        boolean checked;
+        int position = cursor.getPosition();
+        if (mIsChecked[position] == null) {
+            checked = cursor.getInt(selectedColumn) != 0;
+        } else {
+            checked = (mIsChecked[position] == CHECKED);
+        }
+
         box.setOnCheckedChangeListener(null);
         box.setChecked(checked);
-        box.setOnCheckedChangeListener(new CheckBoxListener(id));
+        box.setOnCheckedChangeListener(new CheckBoxListener(id, position));
     }
 
     private static void setText(View view, int id, String text) {