Merge "Do not smoothScrollBy(0)"
diff --git a/res/drawable-hdpi/ic_call_arrow.png b/res/drawable-hdpi/ic_call_arrow.png
new file mode 100644
index 0000000..14a33e3
--- /dev/null
+++ b/res/drawable-hdpi/ic_call_arrow.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_call_arrow.png b/res/drawable-mdpi/ic_call_arrow.png
new file mode 100644
index 0000000..169cf29
--- /dev/null
+++ b/res/drawable-mdpi/ic_call_arrow.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_call_arrow.png b/res/drawable-xhdpi/ic_call_arrow.png
new file mode 100644
index 0000000..6f13660
--- /dev/null
+++ b/res/drawable-xhdpi/ic_call_arrow.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_call_arrow.png b/res/drawable-xxhdpi/ic_call_arrow.png
new file mode 100644
index 0000000..0364ee0
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_call_arrow.png
Binary files differ
diff --git a/res/values-hy-rAM/strings.xml b/res/values-hy-rAM/strings.xml
index e3b54e1..399294e 100644
--- a/res/values-hy-rAM/strings.xml
+++ b/res/values-hy-rAM/strings.xml
@@ -16,8 +16,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- no translation found for people (1190841469952343354) -->
- <skip />
+ <string name="people" msgid="1190841469952343354">"Կոնտակտներ"</string>
<string name="contactsList" msgid="8661624236494819731">"Կոնտակտներ"</string>
<string name="shortcutContact" msgid="749243779392912958">"Կոնտակտ"</string>
<string name="shortcutDialContact" msgid="746622101599186779">"Ուղիղ համարհավաքում"</string>
@@ -65,8 +64,7 @@
<string name="readOnlyContactDeleteConfirmation" msgid="2137170726670196909">"Այս կոնտակտը պարունակում է տվյալներմի քանի հաշվիներից: Միայն ընթերցելի հաշիվներից տվյալները կթաքցվեն ձեր կոնտակների ցանկից, չեն ջնջվի:"</string>
<string name="multipleContactDeleteConfirmation" msgid="938900978442960800">"Այս կոնտակտը ջնջելիս տվյալները ևս մի քանի հաշիվներից կջնջվեն:"</string>
<string name="deleteConfirmation" msgid="811706994761610640">"Այս կոնտակտը կջնջվի:"</string>
- <!-- no translation found for menu_discard (6854657936970228164) -->
- <skip />
+ <string name="menu_discard" msgid="6854657936970228164">"Հրաժարվել փոփոխություններից"</string>
<string name="invalidContactMessage" msgid="8215051456181842274">"Կոնտակտը գոյություն չունի:"</string>
<string name="createContactShortcutSuccessful" msgid="7874133287558150877">"Կոնտակտի վիջեթը ավելացվեց Գլխավոր էկրանին:"</string>
<string name="pickerNewContactHeader" msgid="7750705279843568147">"Ստեղծել նոր կոնտակտ"</string>
@@ -214,8 +212,7 @@
<string name="local_profile_title" msgid="2021416826991393684">"Իմ տեղային պրոֆիլը"</string>
<string name="external_profile_title" msgid="8034998767621359438">"Իմ <xliff:g id="EXTERNAL_SOURCE">%1$s</xliff:g> պրոֆիլը"</string>
<string name="toast_displaying_all_contacts" msgid="2737388783898593875">"Ցուցադրվում են բոլոր կոնտակտները"</string>
- <!-- no translation found for no_account_prompt (6424883302325061025) -->
- <skip />
+ <string name="no_account_prompt" msgid="6424883302325061025">"Կոնտակտների հավելվածն ավելի լավ է աշխատում Google հաշվի հետ:\n\n• Մուտք գործեք ցանկացած վեբ դիտարկչով:\n• Պահուստավորեք ձեր կոնտակտներն ապահով ճանապարհով:"</string>
<string name="generic_no_account_prompt" msgid="7218827704367325460">"Պահեք ձեր կոնտակտները ապահով, նույնիսկ եթե կորցնեք ձեր հեռախոսը. համաժամեցրեք առցանց ծառայության հետ:"</string>
<string name="generic_no_account_prompt_title" msgid="753783911899054860">"Ավելացնել հաշիվ"</string>
<string name="contact_editor_prompt_zero_accounts" msgid="1785345895691886499">"Ձեր նոր կոնտակտը չի պահուստավորվի: Ավելացնե՞լ հաշիվ, որն առցանց է պահուստավորում կոնտակտները:"</string>
@@ -226,34 +223,19 @@
<string name="add_new_account" msgid="5748627740680940264">"Ավելացնել նոր հաշիվ"</string>
<string name="menu_export_database" msgid="2659719297530170820">"Արտահանել տվյալների շտեմարանի ֆայլերը"</string>
<string name="contact_detail_picture_description" msgid="6083230522651287030">"Նկար: Ընտրեք՝ փոխելու համար"</string>
- <!-- no translation found for action_menu_add_new_contact_button (3180222523336380017) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_more (3779194067124758079) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_less (5344160551629714168) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_all (3845258737661412627) -->
- <skip />
- <!-- no translation found for communication_card_title (7842656156852232185) -->
- <skip />
- <!-- no translation found for recent_card_title (8982782042698001695) -->
- <skip />
- <!-- no translation found for send_message (8938418965550543196) -->
- <skip />
- <!-- no translation found for toast_making_personal_copy (6137651078366797938) -->
- <skip />
- <!-- no translation found for yesterday (6840858548955018569) -->
- <skip />
- <!-- no translation found for tomorrow (6241969467795308581) -->
- <skip />
- <!-- no translation found for today (8041090779381781781) -->
- <skip />
- <!-- no translation found for today_at_time_fmt (605665249491030460) -->
- <skip />
- <!-- no translation found for tomorrow_at_time_fmt (4856497969617819421) -->
- <skip />
- <!-- no translation found for date_time_fmt (5053178726906863812) -->
- <skip />
- <!-- no translation found for untitled_event (3484859385405939366) -->
- <skip />
+ <string name="action_menu_add_new_contact_button" msgid="3180222523336380017">"ավելացնել նոր կոնտակտ"</string>
+ <string name="expanding_entry_card_view_see_more" msgid="3779194067124758079">"Տեսնել ավելին"</string>
+ <string name="expanding_entry_card_view_see_less" msgid="5344160551629714168">"Տեսնել պակաս"</string>
+ <string name="expanding_entry_card_view_see_all" msgid="3845258737661412627">"Տեսնել բոլորը"</string>
+ <string name="communication_card_title" msgid="7842656156852232185">"Կոնտակտ"</string>
+ <string name="recent_card_title" msgid="8982782042698001695">"Վերջին գործողությունները"</string>
+ <string name="send_message" msgid="8938418965550543196">"Ուղարկել հաղորդագրություն"</string>
+ <string name="toast_making_personal_copy" msgid="6137651078366797938">"Ստեղծվում է անձնական պատճենը..."</string>
+ <string name="yesterday" msgid="6840858548955018569">"Երեկ"</string>
+ <string name="tomorrow" msgid="6241969467795308581">"Վաղը"</string>
+ <string name="today" msgid="8041090779381781781">"Այսօր"</string>
+ <string name="today_at_time_fmt" msgid="605665249491030460">"Այսօր՝ <xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="tomorrow_at_time_fmt" msgid="4856497969617819421">"Վաղը՝ <xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="date_time_fmt" msgid="5053178726906863812">"<xliff:g id="DATE">%s</xliff:g>, <xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="untitled_event" msgid="3484859385405939366">"(Անվերնագիր միջոցառում)"</string>
</resources>
diff --git a/res/values-ka-rGE/strings.xml b/res/values-ka-rGE/strings.xml
index 54fc188..4d8009d 100644
--- a/res/values-ka-rGE/strings.xml
+++ b/res/values-ka-rGE/strings.xml
@@ -16,8 +16,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- no translation found for people (1190841469952343354) -->
- <skip />
+ <string name="people" msgid="1190841469952343354">"კონტაქტები"</string>
<string name="contactsList" msgid="8661624236494819731">"კონტაქტები"</string>
<string name="shortcutContact" msgid="749243779392912958">"კონტაქტი"</string>
<string name="shortcutDialContact" msgid="746622101599186779">"სწრაფი დარეკვა"</string>
@@ -65,8 +64,7 @@
<string name="readOnlyContactDeleteConfirmation" msgid="2137170726670196909">"ეს კონტაქტი შეიცავს ინფორმაციას სხვადასხვა ანგარიშებიდან. ინფორმაცია მხოლოდ კითხვადი ანგარიშებიდან არ წაიშლება, არამედ დაიმალება კონტაქტების სიაში."</string>
<string name="multipleContactDeleteConfirmation" msgid="938900978442960800">"ამ კონტაქტის წაშლით წაიშლება ინფორმაცია რამდენიმე ანგარიშიდან."</string>
<string name="deleteConfirmation" msgid="811706994761610640">"ეს კონტაქტი წაიშლება."</string>
- <!-- no translation found for menu_discard (6854657936970228164) -->
- <skip />
+ <string name="menu_discard" msgid="6854657936970228164">"ცვლილებების გაუქმება"</string>
<string name="invalidContactMessage" msgid="8215051456181842274">"კონტაქტი არ არსებობს."</string>
<string name="createContactShortcutSuccessful" msgid="7874133287558150877">"მთავარ ეკრანს დაემატა კონტაქტების ვიჯეტი."</string>
<string name="pickerNewContactHeader" msgid="7750705279843568147">"ახალი კონტაქტის შექმნა"</string>
@@ -214,8 +212,7 @@
<string name="local_profile_title" msgid="2021416826991393684">"ჩემი ადგილობრივი პროფილი"</string>
<string name="external_profile_title" msgid="8034998767621359438">"ჩემი <xliff:g id="EXTERNAL_SOURCE">%1$s</xliff:g> პროფილი"</string>
<string name="toast_displaying_all_contacts" msgid="2737388783898593875">"ყველა კონტაქტის ჩვენება"</string>
- <!-- no translation found for no_account_prompt (6424883302325061025) -->
- <skip />
+ <string name="no_account_prompt" msgid="6424883302325061025">"კონტაქტები Google ანგარიშთან ერთად უკეთ მუშაობს.\n\n• იქონიეთ წვდომა ნებისმიერი ვებ-ბრაუზერიდან.\n• Back up your contacts securely."</string>
<string name="generic_no_account_prompt" msgid="7218827704367325460">"შეინახეთ თქვენი კონტაქტები საიმედოდ ტელეფონის დაკარგვის შემთხვევაშიც კი: მოახდინეთ სინქრონიზაცია ონლაინ სერვისთან."</string>
<string name="generic_no_account_prompt_title" msgid="753783911899054860">"ანგარიშის დამატება"</string>
<string name="contact_editor_prompt_zero_accounts" msgid="1785345895691886499">"თქვენი ახალი კონტაქტი არ დამარქაფდება. გსურთ ანგარიშის დამატება, რომელიც დაამარქაფებს კონტაქტებს ონლაინ?"</string>
@@ -226,34 +223,19 @@
<string name="add_new_account" msgid="5748627740680940264">"ახალი ანგარიშის დამატება"</string>
<string name="menu_export_database" msgid="2659719297530170820">"მონაცემთა ბაზის ფაილების ექსპორტი"</string>
<string name="contact_detail_picture_description" msgid="6083230522651287030">"სურათი. მონიშნეთ შესაცვლელად"</string>
- <!-- no translation found for action_menu_add_new_contact_button (3180222523336380017) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_more (3779194067124758079) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_less (5344160551629714168) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_all (3845258737661412627) -->
- <skip />
- <!-- no translation found for communication_card_title (7842656156852232185) -->
- <skip />
- <!-- no translation found for recent_card_title (8982782042698001695) -->
- <skip />
- <!-- no translation found for send_message (8938418965550543196) -->
- <skip />
- <!-- no translation found for toast_making_personal_copy (6137651078366797938) -->
- <skip />
- <!-- no translation found for yesterday (6840858548955018569) -->
- <skip />
- <!-- no translation found for tomorrow (6241969467795308581) -->
- <skip />
- <!-- no translation found for today (8041090779381781781) -->
- <skip />
- <!-- no translation found for today_at_time_fmt (605665249491030460) -->
- <skip />
- <!-- no translation found for tomorrow_at_time_fmt (4856497969617819421) -->
- <skip />
- <!-- no translation found for date_time_fmt (5053178726906863812) -->
- <skip />
- <!-- no translation found for untitled_event (3484859385405939366) -->
- <skip />
+ <string name="action_menu_add_new_contact_button" msgid="3180222523336380017">"ახალი კონტაქტის დამატება"</string>
+ <string name="expanding_entry_card_view_see_more" msgid="3779194067124758079">"იხილე მეტი"</string>
+ <string name="expanding_entry_card_view_see_less" msgid="5344160551629714168">"ნაკლების ჩვენება"</string>
+ <string name="expanding_entry_card_view_see_all" msgid="3845258737661412627">"ყველას ჩვენება"</string>
+ <string name="communication_card_title" msgid="7842656156852232185">"კონტაქტი"</string>
+ <string name="recent_card_title" msgid="8982782042698001695">"ბოლო"</string>
+ <string name="send_message" msgid="8938418965550543196">"შეტყობინების გაგზავნა"</string>
+ <string name="toast_making_personal_copy" msgid="6137651078366797938">"იქმნება პერსონალური ასლი..."</string>
+ <string name="yesterday" msgid="6840858548955018569">"გუშინ"</string>
+ <string name="tomorrow" msgid="6241969467795308581">"ხვალ"</string>
+ <string name="today" msgid="8041090779381781781">"დღეს"</string>
+ <string name="today_at_time_fmt" msgid="605665249491030460">"დღეს <xliff:g id="TIME_INTERVAL">%s</xliff:g>-ზე"</string>
+ <string name="tomorrow_at_time_fmt" msgid="4856497969617819421">"ხვალ <xliff:g id="TIME_INTERVAL">%s</xliff:g>-ზე"</string>
+ <string name="date_time_fmt" msgid="5053178726906863812">"<xliff:g id="DATE">%s</xliff:g>, <xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="untitled_event" msgid="3484859385405939366">"(უსათაურო მოვლენა)"</string>
</resources>
diff --git a/res/values-ms-rMY/strings.xml b/res/values-ms-rMY/strings.xml
index fc74be4..e1aabf8 100644
--- a/res/values-ms-rMY/strings.xml
+++ b/res/values-ms-rMY/strings.xml
@@ -16,8 +16,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- no translation found for people (1190841469952343354) -->
- <skip />
+ <string name="people" msgid="1190841469952343354">"Kenalan"</string>
<string name="contactsList" msgid="8661624236494819731">"Kenalan"</string>
<string name="shortcutContact" msgid="749243779392912958">"Kenalan"</string>
<string name="shortcutDialContact" msgid="746622101599186779">"Dail terus"</string>
@@ -65,8 +64,7 @@
<string name="readOnlyContactDeleteConfirmation" msgid="2137170726670196909">"Kenalan ini mengandungi maklumat daripada berbilang akaun. Maklumat daripada akaun baca sahaja akan disembunyikan dalam senarai kenalan anda, dan bukannya dipadamkan."</string>
<string name="multipleContactDeleteConfirmation" msgid="938900978442960800">"Pemadaman kenalan ini akan turut memadamkan maklumat daripada berbilang akaun."</string>
<string name="deleteConfirmation" msgid="811706994761610640">"Kenalan ini akan dipadamkan."</string>
- <!-- no translation found for menu_discard (6854657936970228164) -->
- <skip />
+ <string name="menu_discard" msgid="6854657936970228164">"Buang perubahan"</string>
<string name="invalidContactMessage" msgid="8215051456181842274">"Kenalan tidak wujud."</string>
<string name="createContactShortcutSuccessful" msgid="7874133287558150877">"Widget kenalan telah ditambahkan ke skrin Utama."</string>
<string name="pickerNewContactHeader" msgid="7750705279843568147">"Wujudkan kenalan baru"</string>
@@ -214,8 +212,7 @@
<string name="local_profile_title" msgid="2021416826991393684">"Profil setempat saya"</string>
<string name="external_profile_title" msgid="8034998767621359438">"Profil <xliff:g id="EXTERNAL_SOURCE">%1$s</xliff:g> saya"</string>
<string name="toast_displaying_all_contacts" msgid="2737388783898593875">"Memaparkan semua kenalan"</string>
- <!-- no translation found for no_account_prompt (6424883302325061025) -->
- <skip />
+ <string name="no_account_prompt" msgid="6424883302325061025">"Kenalan berfungsi lebih baik dengan Akaun Google.\n\n• Akses dari mana-mana penyemak imbas web.\n• Buat sandaran untuk kenalan anda secara selamat."</string>
<string name="generic_no_account_prompt" msgid="7218827704367325460">"Pastikan kenalan anda selamat walaupun jika anda kehilangan telefon anda: segerakkan dengan perkhidmatan dalam talian."</string>
<string name="generic_no_account_prompt_title" msgid="753783911899054860">"Tambah akaun"</string>
<string name="contact_editor_prompt_zero_accounts" msgid="1785345895691886499">"Kenalan baharu anda tidak akan dibuat sandaran. Tambahkan akaun yang membuat sandaran kenalan dalam talian?"</string>
@@ -226,34 +223,19 @@
<string name="add_new_account" msgid="5748627740680940264">"Tambah akaun baharu"</string>
<string name="menu_export_database" msgid="2659719297530170820">"Eksport fail pangkalan data"</string>
<string name="contact_detail_picture_description" msgid="6083230522651287030">"Gambar. Pilih untuk menukar"</string>
- <!-- no translation found for action_menu_add_new_contact_button (3180222523336380017) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_more (3779194067124758079) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_less (5344160551629714168) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_all (3845258737661412627) -->
- <skip />
- <!-- no translation found for communication_card_title (7842656156852232185) -->
- <skip />
- <!-- no translation found for recent_card_title (8982782042698001695) -->
- <skip />
- <!-- no translation found for send_message (8938418965550543196) -->
- <skip />
- <!-- no translation found for toast_making_personal_copy (6137651078366797938) -->
- <skip />
- <!-- no translation found for yesterday (6840858548955018569) -->
- <skip />
- <!-- no translation found for tomorrow (6241969467795308581) -->
- <skip />
- <!-- no translation found for today (8041090779381781781) -->
- <skip />
- <!-- no translation found for today_at_time_fmt (605665249491030460) -->
- <skip />
- <!-- no translation found for tomorrow_at_time_fmt (4856497969617819421) -->
- <skip />
- <!-- no translation found for date_time_fmt (5053178726906863812) -->
- <skip />
- <!-- no translation found for untitled_event (3484859385405939366) -->
- <skip />
+ <string name="action_menu_add_new_contact_button" msgid="3180222523336380017">"tambah kenalan baharu"</string>
+ <string name="expanding_entry_card_view_see_more" msgid="3779194067124758079">"Lihat lagi"</string>
+ <string name="expanding_entry_card_view_see_less" msgid="5344160551629714168">"Lihat sedikit"</string>
+ <string name="expanding_entry_card_view_see_all" msgid="3845258737661412627">"Lihat semua"</string>
+ <string name="communication_card_title" msgid="7842656156852232185">"Kenalan"</string>
+ <string name="recent_card_title" msgid="8982782042698001695">"Terbaharu"</string>
+ <string name="send_message" msgid="8938418965550543196">"Hantar mesej"</string>
+ <string name="toast_making_personal_copy" msgid="6137651078366797938">"Membuat salinan peribadi..."</string>
+ <string name="yesterday" msgid="6840858548955018569">"Semalam"</string>
+ <string name="tomorrow" msgid="6241969467795308581">"Esok"</string>
+ <string name="today" msgid="8041090779381781781">"Hari ini"</string>
+ <string name="today_at_time_fmt" msgid="605665249491030460">"Hari ini pada <xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="tomorrow_at_time_fmt" msgid="4856497969617819421">"Esok pada <xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="date_time_fmt" msgid="5053178726906863812">"<xliff:g id="DATE">%s</xliff:g>, <xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="untitled_event" msgid="3484859385405939366">"(Acara tidak bertajuk)"</string>
</resources>
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index 1620e48..53f1b07 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -16,8 +16,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- no translation found for people (1190841469952343354) -->
- <skip />
+ <string name="people" msgid="1190841469952343354">"Contatos"</string>
<string name="contactsList" msgid="8661624236494819731">"Contatos"</string>
<string name="shortcutContact" msgid="749243779392912958">"Contato"</string>
<string name="shortcutDialContact" msgid="746622101599186779">"Discagem direta"</string>
@@ -65,8 +64,7 @@
<string name="readOnlyContactDeleteConfirmation" msgid="2137170726670196909">"Este contato contém informações de diversas contas. As informações de contas somente de leitura ficarão ocultas nas suas listas de contatos, mas não serão excluídas."</string>
<string name="multipleContactDeleteConfirmation" msgid="938900978442960800">"Excluir este contato irá excluir informações de várias contas."</string>
<string name="deleteConfirmation" msgid="811706994761610640">"Este contato será excluído."</string>
- <!-- no translation found for menu_discard (6854657936970228164) -->
- <skip />
+ <string name="menu_discard" msgid="6854657936970228164">"Descartar alterações"</string>
<string name="invalidContactMessage" msgid="8215051456181842274">"O contato não existe."</string>
<string name="createContactShortcutSuccessful" msgid="7874133287558150877">"Widget Contato adicionado à tela inicial."</string>
<string name="pickerNewContactHeader" msgid="7750705279843568147">"Criar novo contato"</string>
@@ -214,8 +212,7 @@
<string name="local_profile_title" msgid="2021416826991393684">"Meu perfil local"</string>
<string name="external_profile_title" msgid="8034998767621359438">"Meu perfil <xliff:g id="EXTERNAL_SOURCE">%1$s</xliff:g>"</string>
<string name="toast_displaying_all_contacts" msgid="2737388783898593875">"Exibindo todos os contatos"</string>
- <!-- no translation found for no_account_prompt (6424883302325061025) -->
- <skip />
+ <string name="no_account_prompt" msgid="6424883302325061025">"Contatos funciona melhor com uma conta do Google.\n\n• Acesse-o a partir de qualquer navegador da web.\n• Faça backup de seus contatos com segurança."</string>
<string name="generic_no_account_prompt" msgid="7218827704367325460">"Mantenha seus contatos seguros, mesmo se você perder seu telefone: sincronize com um serviço on-line."</string>
<string name="generic_no_account_prompt_title" msgid="753783911899054860">"Adicionar uma conta"</string>
<string name="contact_editor_prompt_zero_accounts" msgid="1785345895691886499">"Não será possível fazer backup de seu novo contato. Deseja adicionar uma conta que faça backup de contatos on-line?"</string>
@@ -226,34 +223,19 @@
<string name="add_new_account" msgid="5748627740680940264">"Adicionar nova conta"</string>
<string name="menu_export_database" msgid="2659719297530170820">"Exportar arquivos do banco de dados"</string>
<string name="contact_detail_picture_description" msgid="6083230522651287030">"Imagem. Selecione para alterar"</string>
- <!-- no translation found for action_menu_add_new_contact_button (3180222523336380017) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_more (3779194067124758079) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_less (5344160551629714168) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_all (3845258737661412627) -->
- <skip />
- <!-- no translation found for communication_card_title (7842656156852232185) -->
- <skip />
- <!-- no translation found for recent_card_title (8982782042698001695) -->
- <skip />
- <!-- no translation found for send_message (8938418965550543196) -->
- <skip />
- <!-- no translation found for toast_making_personal_copy (6137651078366797938) -->
- <skip />
- <!-- no translation found for yesterday (6840858548955018569) -->
- <skip />
- <!-- no translation found for tomorrow (6241969467795308581) -->
- <skip />
- <!-- no translation found for today (8041090779381781781) -->
- <skip />
- <!-- no translation found for today_at_time_fmt (605665249491030460) -->
- <skip />
- <!-- no translation found for tomorrow_at_time_fmt (4856497969617819421) -->
- <skip />
- <!-- no translation found for date_time_fmt (5053178726906863812) -->
- <skip />
- <!-- no translation found for untitled_event (3484859385405939366) -->
- <skip />
+ <string name="action_menu_add_new_contact_button" msgid="3180222523336380017">"adicionar novo contato"</string>
+ <string name="expanding_entry_card_view_see_more" msgid="3779194067124758079">"Ver mais"</string>
+ <string name="expanding_entry_card_view_see_less" msgid="5344160551629714168">"Ver menos"</string>
+ <string name="expanding_entry_card_view_see_all" msgid="3845258737661412627">"Ver tudo"</string>
+ <string name="communication_card_title" msgid="7842656156852232185">"Contato"</string>
+ <string name="recent_card_title" msgid="8982782042698001695">"Recente"</string>
+ <string name="send_message" msgid="8938418965550543196">"Enviar mensagem"</string>
+ <string name="toast_making_personal_copy" msgid="6137651078366797938">"Criando uma cópia pessoal..."</string>
+ <string name="yesterday" msgid="6840858548955018569">"Ontem"</string>
+ <string name="tomorrow" msgid="6241969467795308581">"Amanhã"</string>
+ <string name="today" msgid="8041090779381781781">"Hoje"</string>
+ <string name="today_at_time_fmt" msgid="605665249491030460">"Hoje, às <xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="tomorrow_at_time_fmt" msgid="4856497969617819421">"Amanhã, às <xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="date_time_fmt" msgid="5053178726906863812">"<xliff:g id="DATE">%s</xliff:g>, <xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="untitled_event" msgid="3484859385405939366">"(Evento sem título)"</string>
</resources>
diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml
index 5a4e02f..ea8cd6a 100644
--- a/res/values-ro/strings.xml
+++ b/res/values-ro/strings.xml
@@ -16,8 +16,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- no translation found for people (1190841469952343354) -->
- <skip />
+ <string name="people" msgid="1190841469952343354">"Agendă"</string>
<string name="contactsList" msgid="8661624236494819731">"Agendă"</string>
<string name="shortcutContact" msgid="749243779392912958">"Persoană din Agendă"</string>
<string name="shortcutDialContact" msgid="746622101599186779">"Apel direct"</string>
@@ -65,8 +64,7 @@
<string name="readOnlyContactDeleteConfirmation" msgid="2137170726670196909">"Informaţiile despre această persoană din agendă provin din mai multe conturi. Informaţiile provenite din conturile numai în citire nu vor fi şterse din lista dvs., ci doar ascunse."</string>
<string name="multipleContactDeleteConfirmation" msgid="938900978442960800">"Ștergerea acestei persoane din agendă va elimina informaţii din mai multe conturi."</string>
<string name="deleteConfirmation" msgid="811706994761610640">"Această persoană va fi ştearsă din agendă."</string>
- <!-- no translation found for menu_discard (6854657936970228164) -->
- <skip />
+ <string name="menu_discard" msgid="6854657936970228164">"Renunțați la modificări"</string>
<string name="invalidContactMessage" msgid="8215051456181842274">"Persoana nu există în agendă."</string>
<string name="createContactShortcutSuccessful" msgid="7874133287558150877">"Widgetul Agendă a fost adăugat la ecranul de pornire."</string>
<string name="pickerNewContactHeader" msgid="7750705279843568147">"Creaţi o persoană nouă în agendă"</string>
@@ -214,8 +212,7 @@
<string name="local_profile_title" msgid="2021416826991393684">"Profilul meu local"</string>
<string name="external_profile_title" msgid="8034998767621359438">"Profilul meu <xliff:g id="EXTERNAL_SOURCE">%1$s</xliff:g>"</string>
<string name="toast_displaying_all_contacts" msgid="2737388783898593875">"Se afişează toată agenda"</string>
- <!-- no translation found for no_account_prompt (6424883302325061025) -->
- <skip />
+ <string name="no_account_prompt" msgid="6424883302325061025">"Agenda funcționează mai bine cu un Cont Google.\n\n• O puteți accesa din orice browser web.\n• Creați în siguranță backup pentru persoanele de contact."</string>
<string name="generic_no_account_prompt" msgid="7218827704367325460">"Păstraţi agenda dvs. în condiţii de siguranţă, chiar dacă pierdeţi telefonul, prin sincronizarea acesteia cu un serviciu online."</string>
<string name="generic_no_account_prompt_title" msgid="753783911899054860">"Adăugaţi un cont"</string>
<string name="contact_editor_prompt_zero_accounts" msgid="1785345895691886499">"Pentru noul contact nu se va crea o copie de rezervă. Adăugați un cont care creează online copii de rezervă pentru contacte?"</string>
@@ -226,34 +223,19 @@
<string name="add_new_account" msgid="5748627740680940264">"Adăugaţi un cont nou"</string>
<string name="menu_export_database" msgid="2659719297530170820">"Exportaţi fişierele bazei de date"</string>
<string name="contact_detail_picture_description" msgid="6083230522651287030">"Fotografie. Selectați pentru a schimba."</string>
- <!-- no translation found for action_menu_add_new_contact_button (3180222523336380017) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_more (3779194067124758079) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_less (5344160551629714168) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_all (3845258737661412627) -->
- <skip />
- <!-- no translation found for communication_card_title (7842656156852232185) -->
- <skip />
- <!-- no translation found for recent_card_title (8982782042698001695) -->
- <skip />
- <!-- no translation found for send_message (8938418965550543196) -->
- <skip />
- <!-- no translation found for toast_making_personal_copy (6137651078366797938) -->
- <skip />
- <!-- no translation found for yesterday (6840858548955018569) -->
- <skip />
- <!-- no translation found for tomorrow (6241969467795308581) -->
- <skip />
- <!-- no translation found for today (8041090779381781781) -->
- <skip />
- <!-- no translation found for today_at_time_fmt (605665249491030460) -->
- <skip />
- <!-- no translation found for tomorrow_at_time_fmt (4856497969617819421) -->
- <skip />
- <!-- no translation found for date_time_fmt (5053178726906863812) -->
- <skip />
- <!-- no translation found for untitled_event (3484859385405939366) -->
- <skip />
+ <string name="action_menu_add_new_contact_button" msgid="3180222523336380017">"adăugați o persoană de contact nouă"</string>
+ <string name="expanding_entry_card_view_see_more" msgid="3779194067124758079">"Mai multe detalii"</string>
+ <string name="expanding_entry_card_view_see_less" msgid="5344160551629714168">"Mai puține detalii"</string>
+ <string name="expanding_entry_card_view_see_all" msgid="3845258737661412627">"Vedeți tot"</string>
+ <string name="communication_card_title" msgid="7842656156852232185">"Contact"</string>
+ <string name="recent_card_title" msgid="8982782042698001695">"Recente"</string>
+ <string name="send_message" msgid="8938418965550543196">"Trimiteți mesajul"</string>
+ <string name="toast_making_personal_copy" msgid="6137651078366797938">"Se creează o copie personală..."</string>
+ <string name="yesterday" msgid="6840858548955018569">"Ieri"</string>
+ <string name="tomorrow" msgid="6241969467795308581">"Mâine"</string>
+ <string name="today" msgid="8041090779381781781">"Astăzi"</string>
+ <string name="today_at_time_fmt" msgid="605665249491030460">"Astăzi, la <xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="tomorrow_at_time_fmt" msgid="4856497969617819421">"Mâine, la <xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="date_time_fmt" msgid="5053178726906863812">"<xliff:g id="DATE">%s</xliff:g>, <xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="untitled_event" msgid="3484859385405939366">"(Eveniment fără titlu)"</string>
</resources>
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 286e303..488d42a 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -16,8 +16,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- no translation found for people (1190841469952343354) -->
- <skip />
+ <string name="people" msgid="1190841469952343354">"联系人"</string>
<string name="contactsList" msgid="8661624236494819731">"联系人"</string>
<string name="shortcutContact" msgid="749243779392912958">"联系人"</string>
<string name="shortcutDialContact" msgid="746622101599186779">"直接拨打电话"</string>
@@ -65,8 +64,7 @@
<string name="readOnlyContactDeleteConfirmation" msgid="2137170726670196909">"该联系人的信息中包含来自多个帐户的信息。来自只读帐户的信息将在您的联系人列表中隐藏,但不会删除。"</string>
<string name="multipleContactDeleteConfirmation" msgid="938900978442960800">"删除该联系人将会删除多个帐户中的信息。"</string>
<string name="deleteConfirmation" msgid="811706994761610640">"将会删除此联系人。"</string>
- <!-- no translation found for menu_discard (6854657936970228164) -->
- <skip />
+ <string name="menu_discard" msgid="6854657936970228164">"舍弃更改"</string>
<string name="invalidContactMessage" msgid="8215051456181842274">"该联系人不存在。"</string>
<string name="createContactShortcutSuccessful" msgid="7874133287558150877">"联系人小部件已添加到主屏幕。"</string>
<string name="pickerNewContactHeader" msgid="7750705279843568147">"新建联系人"</string>
@@ -214,8 +212,7 @@
<string name="local_profile_title" msgid="2021416826991393684">"我的本地个人资料"</string>
<string name="external_profile_title" msgid="8034998767621359438">"我的<xliff:g id="EXTERNAL_SOURCE">%1$s</xliff:g>个人资料"</string>
<string name="toast_displaying_all_contacts" msgid="2737388783898593875">"显示所有联系人"</string>
- <!-- no translation found for no_account_prompt (6424883302325061025) -->
- <skip />
+ <string name="no_account_prompt" msgid="6424883302325061025">"登录Google帐户可获取更棒的“联系人”应用体验。\n\n• 可通过任意浏览器访问。\n• 安全妥善地备份您的联系人数据。"</string>
<string name="generic_no_account_prompt" msgid="7218827704367325460">"即使手机丢了,也能确保您的联系人信息的安全性:与在线服务同步。"</string>
<string name="generic_no_account_prompt_title" msgid="753783911899054860">"添加帐户"</string>
<string name="contact_editor_prompt_zero_accounts" msgid="1785345895691886499">"系统不会备份您的新联系人。要添加用于在线备份联系人的帐户吗?"</string>
@@ -226,34 +223,19 @@
<string name="add_new_account" msgid="5748627740680940264">"添加新帐户"</string>
<string name="menu_export_database" msgid="2659719297530170820">"导出数据库文件"</string>
<string name="contact_detail_picture_description" msgid="6083230522651287030">"照片(选择即可更换)"</string>
- <!-- no translation found for action_menu_add_new_contact_button (3180222523336380017) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_more (3779194067124758079) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_less (5344160551629714168) -->
- <skip />
- <!-- no translation found for expanding_entry_card_view_see_all (3845258737661412627) -->
- <skip />
- <!-- no translation found for communication_card_title (7842656156852232185) -->
- <skip />
- <!-- no translation found for recent_card_title (8982782042698001695) -->
- <skip />
- <!-- no translation found for send_message (8938418965550543196) -->
- <skip />
- <!-- no translation found for toast_making_personal_copy (6137651078366797938) -->
- <skip />
- <!-- no translation found for yesterday (6840858548955018569) -->
- <skip />
- <!-- no translation found for tomorrow (6241969467795308581) -->
- <skip />
- <!-- no translation found for today (8041090779381781781) -->
- <skip />
- <!-- no translation found for today_at_time_fmt (605665249491030460) -->
- <skip />
- <!-- no translation found for tomorrow_at_time_fmt (4856497969617819421) -->
- <skip />
- <!-- no translation found for date_time_fmt (5053178726906863812) -->
- <skip />
- <!-- no translation found for untitled_event (3484859385405939366) -->
- <skip />
+ <string name="action_menu_add_new_contact_button" msgid="3180222523336380017">"添加新联系人"</string>
+ <string name="expanding_entry_card_view_see_more" msgid="3779194067124758079">"查看更多"</string>
+ <string name="expanding_entry_card_view_see_less" msgid="5344160551629714168">"隐藏部分"</string>
+ <string name="expanding_entry_card_view_see_all" msgid="3845258737661412627">"查看全部"</string>
+ <string name="communication_card_title" msgid="7842656156852232185">"联系"</string>
+ <string name="recent_card_title" msgid="8982782042698001695">"最近"</string>
+ <string name="send_message" msgid="8938418965550543196">"发送短信"</string>
+ <string name="toast_making_personal_copy" msgid="6137651078366797938">"正在创建个人副本…"</string>
+ <string name="yesterday" msgid="6840858548955018569">"昨天"</string>
+ <string name="tomorrow" msgid="6241969467795308581">"明天"</string>
+ <string name="today" msgid="8041090779381781781">"今天"</string>
+ <string name="today_at_time_fmt" msgid="605665249491030460">"今天<xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="tomorrow_at_time_fmt" msgid="4856497969617819421">"明天<xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="date_time_fmt" msgid="5053178726906863812">"<xliff:g id="DATE">%s</xliff:g>,<xliff:g id="TIME_INTERVAL">%s</xliff:g>"</string>
+ <string name="untitled_event" msgid="3484859385405939366">"(未命名的活动)"</string>
</resources>
diff --git a/res/values-zh-rHK/strings.xml b/res/values-zh-rHK/strings.xml
index e39ee6f..795163d 100644
--- a/res/values-zh-rHK/strings.xml
+++ b/res/values-zh-rHK/strings.xml
@@ -212,7 +212,7 @@
<string name="local_profile_title" msgid="2021416826991393684">"我的本機個人資料"</string>
<string name="external_profile_title" msgid="8034998767621359438">"我的 <xliff:g id="EXTERNAL_SOURCE">%1$s</xliff:g> 個人資料"</string>
<string name="toast_displaying_all_contacts" msgid="2737388783898593875">"顯示所有聯絡人"</string>
- <string name="no_account_prompt" msgid="6424883302325061025">"聯絡人與 Google 帳戶搭配使用的效能更優異。\n\n• 透過任何網絡瀏覽器皆可存取。\n• 安全備份您的聯絡人。"</string>
+ <string name="no_account_prompt" msgid="6424883302325061025">"聯絡人與 Google 帳戶搭配使用的效能更卓越。\n\n• 透過任何網絡瀏覽器皆可存取。\n• 安全備份您的聯絡人。"</string>
<string name="generic_no_account_prompt" msgid="7218827704367325460">"即使丟失手機,也要確保通訊錄安全:與網上服務保持同步。"</string>
<string name="generic_no_account_prompt_title" msgid="753783911899054860">"新增帳戶"</string>
<string name="contact_editor_prompt_zero_accounts" msgid="1785345895691886499">"您的新聯絡人資料不會備份。要新增可在網上備份聯絡人資料的帳戶嗎?"</string>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 0f5997b..962fe97 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -49,4 +49,7 @@
<!-- Color of the margin for cards -->
<color name="card_margin_color">#ffbbbbbb</color>
+
+ <color name="call_arrow_green">#2aad6f</color>
+ <color name="call_arrow_red">#ff2e58</color>
</resources>
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index bfb661d..db20540 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -1030,17 +1030,16 @@
}
case R.id.menu_settings: {
final Intent intent = new Intent(this, ContactsPreferenceActivity.class);
- // as there is only one section right now, make sure it is selected
- // on small screens, this also hides the section selector
- // Due to b/5045558, this code unfortunately only works properly on phones
- boolean settingsAreMultiPane = getResources().getBoolean(
- com.android.internal.R.bool.preferences_prefer_dual_pane);
- if (!settingsAreMultiPane) {
- intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT,
- DisplayOptionsPreferenceFragment.class.getName());
- intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT_TITLE,
- R.string.activity_title_settings);
- }
+ // Since there is only one section right now, make sure it is selected on
+ // small screens.
+ intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT,
+ DisplayOptionsPreferenceFragment.class.getName());
+ // By default, the title of the activity should be equivalent to the fragment
+ // title. We set this argument to avoid this. Because of a bug, the following
+ // line isn't necessary. But, once the bug is fixed this may become necessary.
+ // b/5045558 refers to this issue, as well as another.
+ intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT_TITLE,
+ R.string.activity_title_settings);
startActivity(intent);
return true;
}
diff --git a/src/com/android/contacts/interactions/CallLogInteraction.java b/src/com/android/contacts/interactions/CallLogInteraction.java
new file mode 100644
index 0000000..8607974
--- /dev/null
+++ b/src/com/android/contacts/interactions/CallLogInteraction.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2014 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.contacts.interactions;
+
+import com.android.contacts.R;
+import com.android.contacts.common.util.BitmapUtil;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.content.Intent;
+import android.content.res.Resources;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.net.Uri;
+import android.provider.CallLog.Calls;
+import android.provider.ContactsContract.CommonDataKinds.Phone;
+import android.util.Log;
+
+/**
+ * Represents a call log event interaction, wrapping the columns in
+ * {@link android.provider.CallLog.Calls}.
+ *
+ * This class does not return log entries related to voicemail or SIP calls. Additionally,
+ * this class ignores number presentation. Number presentation affects how to identify phone
+ * numbers. Since, we already know the identity of the phone number owner we can ignore number
+ * presentation.
+ *
+ * As a result of ignoring voicemail and number presentation, we don't need to worry about API
+ * version.
+ */
+public class CallLogInteraction implements ContactInteraction {
+
+ private static final String URI_TARGET_PREFIX = "tel:";
+ private static final int CALL_LOG_ICON_RES = R.drawable.ic_phone_24dp;
+ private static final int CALL_ARROW_ICON_RES = R.drawable.ic_call_arrow;
+
+ private ContentValues mValues;
+
+ public CallLogInteraction(ContentValues values) {
+ mValues = values;
+ }
+
+ @Override
+ public Intent getIntent() {
+ return new Intent(Intent.ACTION_CALL).setData(Uri.parse(URI_TARGET_PREFIX + getNumber()));
+ }
+
+ @Override
+ public String getViewHeader(Context context) {
+ return getNumber();
+ }
+
+ @Override
+ public long getInteractionDate() {
+ return getDate();
+ }
+
+ @Override
+ public String getViewBody(Context context) {
+ int numberType = getCachedNumberType();
+ if (numberType == -1) {
+ return null;
+ }
+ return Phone.getTypeLabel(context.getResources(), getCachedNumberType(),
+ getCachedNumberLabel()).toString();
+ }
+
+ @Override
+ public String getViewFooter(Context context) {
+ return ContactInteractionUtil.formatDateStringFromTimestamp(getDate(), context);
+ }
+
+ @Override
+ public Drawable getIcon(Context context) {
+ return context.getResources().getDrawable(CALL_LOG_ICON_RES);
+ }
+
+ @Override
+ public Drawable getBodyIcon(Context context) {
+ return null;
+ }
+
+ @Override
+ public Drawable getFooterIcon(Context context) {
+ Drawable callArrow = null;
+ Resources res = context.getResources();
+ switch (getType()) {
+ case Calls.INCOMING_TYPE:
+ callArrow = res.getDrawable(CALL_ARROW_ICON_RES);
+ callArrow.setColorFilter(res.getColor(R.color.call_arrow_green),
+ PorterDuff.Mode.MULTIPLY);
+ break;
+ case Calls.MISSED_TYPE:
+ callArrow = res.getDrawable(CALL_ARROW_ICON_RES);
+ callArrow.setColorFilter(res.getColor(R.color.call_arrow_red),
+ PorterDuff.Mode.MULTIPLY);
+ break;
+ case Calls.OUTGOING_TYPE:
+ callArrow = BitmapUtil.getRotatedDrawable(res, CALL_ARROW_ICON_RES, 180f);
+ callArrow.setColorFilter(res.getColor(R.color.call_arrow_green),
+ PorterDuff.Mode.MULTIPLY);
+ break;
+ }
+ return callArrow;
+ }
+
+ public String getCachedName() {
+ return mValues.getAsString(Calls.CACHED_NAME);
+ }
+
+ public String getCachedNumberLabel() {
+ return mValues.getAsString(Calls.CACHED_NUMBER_LABEL);
+ }
+
+ public int getCachedNumberType() {
+ Integer type = mValues.getAsInteger(Calls.CACHED_NUMBER_TYPE);
+ return type != null ? type : -1;
+ }
+
+ public long getDate() {
+ return mValues.getAsLong(Calls.DATE);
+ }
+
+ public long getDuration() {
+ return mValues.getAsLong(Calls.DURATION);
+ }
+
+ public boolean getIsRead() {
+ return mValues.getAsBoolean(Calls.IS_READ);
+ }
+
+ public int getLimitParamKey() {
+ return mValues.getAsInteger(Calls.LIMIT_PARAM_KEY);
+ }
+
+ public boolean getNew() {
+ return mValues.getAsBoolean(Calls.NEW);
+ }
+
+ public String getNumber() {
+ return mValues.getAsString(Calls.NUMBER);
+ }
+
+ public int getNumberPresentation() {
+ return mValues.getAsInteger(Calls.NUMBER_PRESENTATION);
+ }
+
+ public int getOffsetParamKey() {
+ return mValues.getAsInteger(Calls.OFFSET_PARAM_KEY);
+ }
+
+ public int getType() {
+ return mValues.getAsInteger(Calls.TYPE);
+ }
+}
\ No newline at end of file
diff --git a/src/com/android/contacts/interactions/CallLogInteractionsLoader.java b/src/com/android/contacts/interactions/CallLogInteractionsLoader.java
new file mode 100644
index 0000000..8172232
--- /dev/null
+++ b/src/com/android/contacts/interactions/CallLogInteractionsLoader.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) 2014 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.contacts.interactions;
+
+import android.content.AsyncTaskLoader;
+import android.content.ContentValues;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.database.Cursor;
+import android.database.DatabaseUtils;
+import android.net.Uri;
+import android.provider.CallLog.Calls;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+public class CallLogInteractionsLoader extends AsyncTaskLoader<List<ContactInteraction>> {
+
+ private final String[] mPhoneNumbers;
+ private final int mMaxToRetrieve;
+ private List<ContactInteraction> mData;
+
+ public CallLogInteractionsLoader(Context context, String[] phoneNumbers,
+ int maxToRetrieve) {
+ super(context);
+ mPhoneNumbers = phoneNumbers;
+ mMaxToRetrieve = maxToRetrieve;
+ }
+
+ @Override
+ public List<ContactInteraction> loadInBackground() {
+ if (!getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY)
+ || mPhoneNumbers == null || mPhoneNumbers.length == 0) {
+ return Collections.emptyList();
+ }
+
+ final List<ContactInteraction> interactions = new ArrayList<>();
+ for (String number : mPhoneNumbers) {
+ interactions.addAll(getCallLogInteractions(number));
+ }
+ // Sort the call log interactions by date for duplicate removal
+ Collections.sort(interactions, new Comparator<ContactInteraction>() {
+ @Override
+ public int compare(ContactInteraction i1, ContactInteraction i2) {
+ if (i2.getInteractionDate() - i1.getInteractionDate() > 0) {
+ return 1;
+ } else if (i2.getInteractionDate() == i1.getInteractionDate()) {
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ });
+
+ return pruneDuplicateCallLogInteractions(interactions, mMaxToRetrieve);
+ }
+
+ /**
+ * Two different phone numbers can match the same call log entry (since phone number
+ * matching is inexact). Therefore, we need to remove duplicates. In a reasonable call log,
+ * every entry should have a distinct date. Therefore, we can assume duplicate entries are
+ * adjacent entries.
+ * @param interactions The interaction list potentially containing duplicates
+ * @return The list with duplicates removed
+ */
+ @VisibleForTesting
+ static List<ContactInteraction> pruneDuplicateCallLogInteractions(
+ List<ContactInteraction> interactions, int maxToRetrieve) {
+ final List<ContactInteraction> subsetInteractions = new ArrayList<>();
+ for (int i = 0; i < interactions.size(); i++) {
+ if (i >= 1 && interactions.get(i).getInteractionDate() ==
+ interactions.get(i-1).getInteractionDate()) {
+ continue;
+ }
+ subsetInteractions.add(interactions.get(i));
+ if (subsetInteractions.size() >= maxToRetrieve) {
+ break;
+ }
+ }
+ return subsetInteractions;
+ }
+
+ private List<ContactInteraction> getCallLogInteractions(String phoneNumber) {
+ final Uri uri = Uri.withAppendedPath(Calls.CONTENT_FILTER_URI, phoneNumber);
+ final String orderBy = Calls.DATE + " DESC";
+ final Cursor cursor = getContext().getContentResolver().query(uri, null, null, null,
+ orderBy);
+ try {
+ if (cursor == null || cursor.getCount() < 1) {
+ return Collections.emptyList();
+ }
+ cursor.moveToPosition(-1);
+ List<ContactInteraction> interactions = new ArrayList<>();
+ while (cursor.moveToNext()) {
+ final ContentValues values = new ContentValues();
+ DatabaseUtils.cursorRowToContentValues(cursor, values);
+ interactions.add(new CallLogInteraction(values));
+ }
+ return interactions;
+ } finally {
+ if (cursor != null) {
+ cursor.close();
+ }
+ }
+ }
+
+ @Override
+ protected void onStartLoading() {
+ super.onStartLoading();
+
+ if (mData != null) {
+ deliverResult(mData);
+ }
+
+ if (takeContentChanged() || mData == null) {
+ forceLoad();
+ }
+ }
+
+ @Override
+ protected void onStopLoading() {
+ // Attempt to cancel the current load task if possible.
+ cancelLoad();
+ }
+
+ @Override
+ public void deliverResult(List<ContactInteraction> data) {
+ mData = data;
+ if (isStarted()) {
+ super.deliverResult(data);
+ }
+ }
+
+ @Override
+ protected void onReset() {
+ super.onReset();
+
+ // Ensure the loader is stopped
+ onStopLoading();
+ if (mData != null) {
+ mData.clear();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/com/android/contacts/list/ContactNameHighlightingAnimation.java b/src/com/android/contacts/list/ContactNameHighlightingAnimation.java
deleted file mode 100644
index 46fe88b..0000000
--- a/src/com/android/contacts/list/ContactNameHighlightingAnimation.java
+++ /dev/null
@@ -1,62 +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.contacts.list;
-
-import android.view.View;
-import android.widget.ListView;
-
-import com.android.contacts.common.list.ContactListItemView;
-import com.android.contacts.widget.TextHighlightingAnimation;
-
-/**
- * A {@link TextHighlightingAnimation} that redraws just the contact display name in a
- * list item.
- */
-public class ContactNameHighlightingAnimation extends TextHighlightingAnimation {
- private final ListView mListView;
- private boolean mSavedScrollingCacheEnabledFlag;
-
- public ContactNameHighlightingAnimation(ListView listView, int duration) {
- super(duration);
- this.mListView = listView;
- }
-
- /**
- * Redraws all visible items of the list corresponding to contacts
- */
- @Override
- protected void invalidate() {
- int childCount = mListView.getChildCount();
- for (int i = 0; i < childCount; i++) {
- View itemView = mListView.getChildAt(i);
- if (itemView instanceof ContactListItemView) {
- final ContactListItemView view = (ContactListItemView)itemView;
- view.getNameTextView().invalidate();
- }
- }
- }
-
- @Override
- protected void onAnimationStarted() {
- mSavedScrollingCacheEnabledFlag = mListView.isScrollingCacheEnabled();
- mListView.setScrollingCacheEnabled(false);
- }
-
- @Override
- protected void onAnimationEnded() {
- mListView.setScrollingCacheEnabled(mSavedScrollingCacheEnabledFlag);
- }
-}
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 26dbebe..9533d75 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -82,6 +82,7 @@
import com.android.contacts.detail.ContactDetailDisplayUtils;
import com.android.contacts.common.util.UriUtils;
import com.android.contacts.interactions.CalendarInteractionsLoader;
+import com.android.contacts.interactions.CallLogInteractionsLoader;
import com.android.contacts.interactions.ContactDeletionInteraction;
import com.android.contacts.interactions.ContactInteraction;
import com.android.contacts.interactions.SmsInteractionsLoader;
@@ -191,14 +192,17 @@
/** Id for the background contact loader */
private static final int LOADER_CONTACT_ID = 0;
+ private static final String KEY_LOADER_EXTRA_PHONES =
+ QuickContactActivity.class.getCanonicalName() + ".KEY_LOADER_EXTRA_PHONES";
+
/** Id for the background Sms Loader */
private static final int LOADER_SMS_ID = 1;
- private static final String KEY_LOADER_EXTRA_SMS_PHONES =
- QuickContactActivity.class.getCanonicalName() + ".KEY_LOADER_EXTRA_SMS_PHONES";
private static final int MAX_SMS_RETRIEVE = 3;
+
+ /** Id for the back Calendar Loader */
private static final int LOADER_CALENDAR_ID = 2;
- private static final String KEY_LOADER_EXTRA_CALENDAR_EMAILS =
- QuickContactActivity.class.getCanonicalName() + ".KEY_LOADER_EXTRA_CALENDAR_EMAILS";
+ private static final String KEY_LOADER_EXTRA_EMAILS =
+ QuickContactActivity.class.getCanonicalName() + ".KEY_LOADER_EXTRA_EMAILS";
private static final int MAX_PAST_CALENDAR_RETRIEVE = 3;
private static final int MAX_FUTURE_CALENDAR_RETRIEVE = 3;
private static final long PAST_MILLISECOND_TO_SEARCH_LOCAL_CALENDAR =
@@ -206,7 +210,15 @@
private static final long FUTURE_MILLISECOND_TO_SEARCH_LOCAL_CALENDAR =
36L * 60L * 60L * 1000L /* 36 hours */;
- private static final int[] mRecentLoaderIds = new int[]{LOADER_SMS_ID, LOADER_CALENDAR_ID};
+ /** Id for the background Call Log Loader */
+ private static final int LOADER_CALL_LOG_ID = 3;
+ private static final int MAX_CALL_LOG_RETRIEVE = 3;
+
+
+ private static final int[] mRecentLoaderIds = new int[]{
+ LOADER_SMS_ID,
+ LOADER_CALENDAR_ID,
+ LOADER_CALL_LOG_ID};
private Map<Integer, List<ContactInteraction>> mRecentLoaderResults;
private static final String FRAGMENT_TAG_SELECT_ACCOUNT = "select_account_fragment";
@@ -482,22 +494,29 @@
Set<String> emailAddresses,
List<String> sortedActionMimeTypes) {
Trace.beginSection("start sms loader");
- final Bundle smsExtraBundle = new Bundle();
- smsExtraBundle.putStringArray(KEY_LOADER_EXTRA_SMS_PHONES,
+ final Bundle phonesExtraBundle = new Bundle();
+ phonesExtraBundle.putStringArray(KEY_LOADER_EXTRA_PHONES,
phoneNumbers.toArray(new String[phoneNumbers.size()]));
getLoaderManager().initLoader(
LOADER_SMS_ID,
- smsExtraBundle,
+ phonesExtraBundle,
+ mLoaderInteractionsCallbacks);
+ Trace.endSection();
+
+ Trace.beginSection("start call log loader");
+ getLoaderManager().initLoader(
+ LOADER_CALL_LOG_ID,
+ phonesExtraBundle,
mLoaderInteractionsCallbacks);
Trace.endSection();
Trace.beginSection("start calendar loader");
- final Bundle calendarExtraBundle = new Bundle();
- calendarExtraBundle.putStringArray(KEY_LOADER_EXTRA_CALENDAR_EMAILS,
+ final Bundle emailsExtraBundle = new Bundle();
+ emailsExtraBundle.putStringArray(KEY_LOADER_EXTRA_EMAILS,
emailAddresses.toArray(new String[emailAddresses.size()]));
getLoaderManager().initLoader(
LOADER_CALENDAR_ID,
- calendarExtraBundle,
+ emailsExtraBundle,
mLoaderInteractionsCallbacks);
Trace.endSection();
@@ -886,19 +905,25 @@
Log.v(TAG, "LOADER_SMS_ID");
loader = new SmsInteractionsLoader(
QuickContactActivity.this,
- args.getStringArray(KEY_LOADER_EXTRA_SMS_PHONES),
+ args.getStringArray(KEY_LOADER_EXTRA_PHONES),
MAX_SMS_RETRIEVE);
break;
case LOADER_CALENDAR_ID:
Log.v(TAG, "LOADER_CALENDAR_ID");
loader = new CalendarInteractionsLoader(
QuickContactActivity.this,
- Arrays.asList(args.getStringArray(KEY_LOADER_EXTRA_CALENDAR_EMAILS)),
+ Arrays.asList(args.getStringArray(KEY_LOADER_EXTRA_EMAILS)),
MAX_FUTURE_CALENDAR_RETRIEVE,
MAX_PAST_CALENDAR_RETRIEVE,
FUTURE_MILLISECOND_TO_SEARCH_LOCAL_CALENDAR,
PAST_MILLISECOND_TO_SEARCH_LOCAL_CALENDAR);
break;
+ case LOADER_CALL_LOG_ID:
+ Log.v(TAG, "LOADER_CALL_LOG_ID");
+ loader = new CallLogInteractionsLoader(
+ QuickContactActivity.this,
+ args.getStringArray(KEY_LOADER_EXTRA_PHONES),
+ MAX_CALL_LOG_RETRIEVE);
}
return loader;
}
diff --git a/src/com/android/contacts/widget/TextHighlightingAnimation.java b/src/com/android/contacts/widget/TextHighlightingAnimation.java
deleted file mode 100644
index d269276..0000000
--- a/src/com/android/contacts/widget/TextHighlightingAnimation.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Copyright (C) 2010 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.contacts.widget;
-
-import android.database.CharArrayBuffer;
-import android.graphics.Color;
-import android.os.Handler;
-import android.text.TextPaint;
-import android.text.style.CharacterStyle;
-import android.view.animation.AccelerateInterpolator;
-import android.view.animation.DecelerateInterpolator;
-
-import com.android.contacts.common.format.FormatUtils;
-import com.android.internal.R;
-
-/**
- * An animation that alternately dims and brightens the non-highlighted portion of text.
- */
-public abstract class TextHighlightingAnimation implements Runnable, TextWithHighlightingFactory {
-
- private static final int MAX_ALPHA = 255;
- private static final int MIN_ALPHA = 50;
-
- private AccelerateInterpolator ACCELERATE_INTERPOLATOR = new AccelerateInterpolator();
- private DecelerateInterpolator DECELERATE_INTERPOLATOR = new DecelerateInterpolator();
-
- private final static DimmingSpan[] sEmptySpans = new DimmingSpan[0];
-
- /**
- * Frame rate expressed a number of millis between frames.
- */
- private static final long FRAME_RATE = 50;
-
- private DimmingSpan mDimmingSpan;
- private Handler mHandler;
- private boolean mAnimating;
- private boolean mDimming;
- private long mTargetTime;
- private final int mDuration;
-
- /**
- * A Spanned that highlights a part of text by dimming another part of that text.
- */
- public class TextWithHighlightingImpl implements TextWithHighlighting {
-
- private final DimmingSpan[] mSpans;
- private boolean mDimmingEnabled;
- private CharArrayBuffer mText;
- private int mDimmingSpanStart;
- private int mDimmingSpanEnd;
- private String mString;
-
- public TextWithHighlightingImpl() {
- mSpans = new DimmingSpan[] { mDimmingSpan };
- }
-
- public void setText(CharArrayBuffer baseText, CharArrayBuffer highlightedText) {
- mText = baseText;
-
- // TODO figure out a way to avoid string allocation
- mString = new String(mText.data, 0, mText.sizeCopied);
-
- int index = FormatUtils.overlapPoint(baseText, highlightedText);
-
- if (index == 0 || index == -1) {
- mDimmingEnabled = false;
- } else {
- mDimmingEnabled = true;
- mDimmingSpanStart = 0;
- mDimmingSpanEnd = index;
- }
- }
-
- @SuppressWarnings("unchecked")
- public <T> T[] getSpans(int start, int end, Class<T> type) {
- if (mDimmingEnabled) {
- return (T[])mSpans;
- } else {
- return (T[])sEmptySpans;
- }
- }
-
- public int getSpanStart(Object tag) {
- // We only have one span - no need to check the tag parameter
- return mDimmingSpanStart;
- }
-
- public int getSpanEnd(Object tag) {
- // We only have one span - no need to check the tag parameter
- return mDimmingSpanEnd;
- }
-
- public int getSpanFlags(Object tag) {
- // String is immutable - flags not needed
- return 0;
- }
-
- public int nextSpanTransition(int start, int limit, Class type) {
- // Never called since we only have one span
- return 0;
- }
-
- public char charAt(int index) {
- return mText.data[index];
- }
-
- public int length() {
- return mText.sizeCopied;
- }
-
- public CharSequence subSequence(int start, int end) {
- // Never called - implementing for completeness
- return new String(mText.data, start, end);
- }
-
- @Override
- public String toString() {
- return mString;
- }
- }
-
- /**
- * A Span that modifies alpha of the default foreground color.
- */
- private static class DimmingSpan extends CharacterStyle {
- private int mAlpha;
-
- public void setAlpha(int alpha) {
- mAlpha = alpha;
- }
-
- @Override
- public void updateDrawState(TextPaint ds) {
-
- // Only dim the text in the basic state; not selected, focused or pressed
- int[] states = ds.drawableState;
- if (states != null) {
- int count = states.length;
- for (int i = 0; i < count; i++) {
- switch (states[i]) {
- case R.attr.state_pressed:
- case R.attr.state_selected:
- case R.attr.state_focused:
- // We can simply return, because the supplied text
- // paint is already configured with defaults.
- return;
- }
- }
- }
-
- int color = ds.getColor();
- color = Color.argb(mAlpha, Color.red(color), Color.green(color), Color.blue(color));
- ds.setColor(color);
- }
- }
-
- /**
- * Constructor.
- */
- public TextHighlightingAnimation(int duration) {
- mDuration = duration;
- mHandler = new Handler();
- mDimmingSpan = new DimmingSpan();
- mDimmingSpan.setAlpha(MAX_ALPHA);
- }
-
- /**
- * Returns a Spanned that can be used by a text view to show text with highlighting.
- */
- public TextWithHighlightingImpl createTextWithHighlighting() {
- return new TextWithHighlightingImpl();
- }
-
- /**
- * Override and invalidate (redraw) TextViews showing {@link TextWithHighlightingImpl}.
- */
- protected abstract void invalidate();
-
- /**
- * Starts the highlighting animation, which will dim portions of text.
- */
- public void startHighlighting() {
- startAnimation(true);
- }
-
- /**
- * Starts un-highlighting animation, which will brighten the dimmed portions of text
- * to the brightness level of the rest of text.
- */
- public void stopHighlighting() {
- startAnimation(false);
- }
-
- /**
- * Called when the animation starts.
- */
- protected void onAnimationStarted() {
- }
-
- /**
- * Called when the animation has stopped.
- */
- protected void onAnimationEnded() {
- }
-
- private void startAnimation(boolean dim) {
- if (mDimming != dim) {
- mDimming = dim;
- long now = System.currentTimeMillis();
- if (!mAnimating) {
- mAnimating = true;
- mTargetTime = now + mDuration;
- onAnimationStarted();
- mHandler.post(this);
- } else {
-
- // If we have started dimming, reverse the direction and adjust the target
- // time accordingly.
- mTargetTime = (now + mDuration) - (mTargetTime - now);
- }
- }
- }
-
- /**
- * Animation step.
- */
- public void run() {
- long now = System.currentTimeMillis();
- long timeLeft = mTargetTime - now;
- if (timeLeft < 0) {
- mDimmingSpan.setAlpha(mDimming ? MIN_ALPHA : MAX_ALPHA);
- mAnimating = false;
- onAnimationEnded();
- return;
- }
-
- // Start=1, end=0
- float virtualTime = (float)timeLeft / mDuration;
- if (mDimming) {
- float interpolatedTime = DECELERATE_INTERPOLATOR.getInterpolation(virtualTime);
- mDimmingSpan.setAlpha((int)(MIN_ALPHA + (MAX_ALPHA-MIN_ALPHA) * interpolatedTime));
- } else {
- float interpolatedTime = ACCELERATE_INTERPOLATOR.getInterpolation(virtualTime);
- mDimmingSpan.setAlpha((int)(MIN_ALPHA + (MAX_ALPHA-MIN_ALPHA) * (1-interpolatedTime)));
- }
-
- invalidate();
-
- // Repeat
- mHandler.postDelayed(this, FRAME_RATE);
- }
-}
diff --git a/src/com/android/contacts/widget/TextWithHighlighting.java b/src/com/android/contacts/widget/TextWithHighlighting.java
deleted file mode 100644
index 3a32b02..0000000
--- a/src/com/android/contacts/widget/TextWithHighlighting.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2010 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.contacts.widget;
-
-import android.database.CharArrayBuffer;
-import android.text.Spanned;
-
-/**
- * A Spanned that highlights a part of text by dimming another part of that text.
- */
-public interface TextWithHighlighting extends Spanned {
- void setText(CharArrayBuffer baseText, CharArrayBuffer highlightedText);
-}
diff --git a/src/com/android/contacts/widget/TextWithHighlightingFactory.java b/src/com/android/contacts/widget/TextWithHighlightingFactory.java
deleted file mode 100644
index ee5744d..0000000
--- a/src/com/android/contacts/widget/TextWithHighlightingFactory.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2010 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.contacts.widget;
-
-/**
- * A factory for text fields with animated highlighting.
- */
-public interface TextWithHighlightingFactory {
- TextWithHighlighting createTextWithHighlighting();
-}
diff --git a/tests/src/com/android/contacts/format/TestTextWithHighlightingFactory.java b/tests/src/com/android/contacts/format/TestTextWithHighlightingFactory.java
deleted file mode 100644
index 9dbd364..0000000
--- a/tests/src/com/android/contacts/format/TestTextWithHighlightingFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2011 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.contacts.format;
-
-import android.database.CharArrayBuffer;
-import android.graphics.Typeface;
-import android.test.suitebuilder.annotation.SmallTest;
-import android.text.SpannableStringBuilder;
-import android.text.style.StyleSpan;
-
-import com.android.contacts.widget.TextWithHighlighting;
-import com.android.contacts.widget.TextWithHighlightingFactory;
-
-/** A factory for {@link TextWithHighlighting} that wraps its parts in italics. */
-@SmallTest
-public final class TestTextWithHighlightingFactory implements TextWithHighlightingFactory {
- /** A {@link TextWithHighlighting} implementation that wraps its parts in italics. */
- private final static class TestTextWithHighlighting extends SpannableStringBuilder
- implements TextWithHighlighting {
- @Override
- public void setText(CharArrayBuffer baseText, CharArrayBuffer highlightedText) {
- append(new String(baseText.data, 0, baseText.sizeCopied));
- append(' ');
- append(new String(highlightedText.data, 0, highlightedText.sizeCopied));
- setSpan(new StyleSpan(Typeface.ITALIC), 0, baseText.sizeCopied, 0);
- setSpan(new StyleSpan(Typeface.ITALIC), baseText.sizeCopied + 1,
- baseText.sizeCopied + 1 + highlightedText.sizeCopied, 0);
- }
- }
-
- @Override
- public TextWithHighlighting createTextWithHighlighting() {
- return new TestTextWithHighlighting();
- }
-}
diff --git a/tests/src/com/android/contacts/interactions/CallLogInteractionsLoaderTest.java b/tests/src/com/android/contacts/interactions/CallLogInteractionsLoaderTest.java
new file mode 100644
index 0000000..079411f
--- /dev/null
+++ b/tests/src/com/android/contacts/interactions/CallLogInteractionsLoaderTest.java
@@ -0,0 +1,65 @@
+package com.android.contacts.interactions;
+
+import android.content.ContentValues;
+import android.provider.CallLog.Calls;
+import android.test.AndroidTestCase;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Tests {@link CallLogInteractionsLoader}
+ */
+public class CallLogInteractionsLoaderTest extends AndroidTestCase {
+
+ public void testCallLogInteractions_pruneDuplicates_containsDuplicates() {
+ List<ContactInteraction> interactions = new ArrayList<>();
+ int maxToRetrieve = 5;
+
+ ContentValues interactionOneValues = new ContentValues();
+ interactionOneValues.put(Calls.DATE, 1L);
+ interactions.add(new CallLogInteraction(interactionOneValues));
+
+ ContentValues interactionTwoValues = new ContentValues();
+ interactionTwoValues.put(Calls.DATE, 1L);
+ interactions.add(new CallLogInteraction(interactionTwoValues));
+
+ interactions = CallLogInteractionsLoader.pruneDuplicateCallLogInteractions(interactions,
+ maxToRetrieve);
+ assertEquals(1, interactions.size());
+ }
+
+ public void testCallLogInteractions_pruneDuplicates_containsNoDuplicates() {
+ List<ContactInteraction> interactions = new ArrayList<>();
+ int maxToRetrieve = 5;
+
+ ContentValues interactionOneValues = new ContentValues();
+ interactionOneValues.put(Calls.DATE, 1L);
+ interactions.add(new CallLogInteraction(interactionOneValues));
+
+ ContentValues interactionTwoValues = new ContentValues();
+ interactionTwoValues.put(Calls.DATE, 5L);
+ interactions.add(new CallLogInteraction(interactionTwoValues));
+
+ interactions = CallLogInteractionsLoader.pruneDuplicateCallLogInteractions(interactions,
+ maxToRetrieve);
+ assertEquals(2, interactions.size());
+ }
+
+ public void testCallLogInteractions_maxToRetrieve() {
+ List<ContactInteraction> interactions = new ArrayList<>();
+ int maxToRetrieve = 1;
+
+ ContentValues interactionOneValues = new ContentValues();
+ interactionOneValues.put(Calls.DATE, 1L);
+ interactions.add(new CallLogInteraction(interactionOneValues));
+
+ ContentValues interactionTwoValues = new ContentValues();
+ interactionTwoValues.put(Calls.DATE, 5L);
+ interactions.add(new CallLogInteraction(interactionTwoValues));
+
+ interactions = CallLogInteractionsLoader.pruneDuplicateCallLogInteractions(interactions,
+ maxToRetrieve);
+ assertEquals(1, interactions.size());
+ }
+}