diff options
-rw-r--r-- | AndroidManifest.xml | 16 | ||||
-rw-r--r-- | res/values-es-rUS/strings.xml | 4 | ||||
-rw-r--r-- | res/values-es/strings.xml | 2 | ||||
-rw-r--r-- | res/values-fr/strings.xml | 2 | ||||
-rw-r--r-- | res/values-ja/strings.xml | 6 | ||||
-rw-r--r-- | res/values-nl/strings.xml | 40 | ||||
-rw-r--r-- | res/values-ro/strings.xml | 22 | ||||
-rw-r--r-- | res/values-uz-rUZ/strings.xml | 2 | ||||
-rw-r--r-- | src/com/android/contacts/quickcontact/ExpandingEntryCardView.java | 48 | ||||
-rw-r--r-- | src/com/android/contacts/quickcontact/QuickContactActivity.java | 53 | ||||
-rw-r--r-- | src/com/android/contacts/widget/PinnedHeaderListDemoActivity.java | 147 | ||||
-rw-r--r-- | tests/src/com/android/contacts/tests/widget/PinnedHeaderUseCaseActivity.java | 90 |
12 files changed, 138 insertions, 294 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 1f13c0465..11a259af2 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -496,14 +496,6 @@ android:exported="false" /> <!-- end vCard related --> - <!-- Pinned header list demo --> - <activity android:name=".widget.PinnedHeaderListDemoActivity"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.DEFAULT" /> - </intent-filter> - </activity> - <!-- Intercept Dialer Intents for devices without a phone. This activity should have the same intent filters as the DialtactsActivity, so that its capturing the same events. Omit android.intent.category.LAUNCHER, because @@ -533,6 +525,14 @@ </intent-filter> </activity> + <activity android:name="com.android.contacts.common.dialog.CallSubjectDialog" + android:theme="@style/Theme.CallSubjectDialogTheme" + android:windowSoftInputMode="stateVisible|adjustResize"> + <intent-filter> + <action android:name="android.intent.action.VIEW"/> + </intent-filter> + </activity> + <!-- Service that is exclusively for the Phone application that sends out a view notification. This service might be removed in future versions of the app. diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml index 2a26f3d99..0d28c5919 100644 --- a/res/values-es-rUS/strings.xml +++ b/res/values-es-rUS/strings.xml @@ -65,14 +65,14 @@ <string name="separatorJoinAggregateSuggestions" msgid="2831414448851313345">"Contactos sugeridos"</string> <string name="separatorJoinAggregateAll" msgid="7939932265026181043">"Todos los contactos"</string> <string name="contactsJoinedMessage" msgid="656936718666768589">"Contactos combinados"</string> - <string name="contacts_deleted_toast" msgid="286851430992788215">"Contactos eliminados"</string> + <string name="contacts_deleted_toast" msgid="286851430992788215">"Contactos borrados"</string> <string name="menu_set_ring_tone" msgid="8728345772068064946">"Establecer tono"</string> <string name="menu_redirect_calls_to_vm" msgid="4181789196416396656">"Llamadas al buzón de voz"</string> <string name="readOnlyContactWarning" msgid="7808825687289848259">"No puedes eliminar contactos de cuentas de solo lectura, pero puedes ocultarlos en tus listas de contactos."</string> <string name="readOnlyContactDeleteConfirmation" msgid="2137170726670196909">"Este contacto contiene información de varias cuentas. La información de las cuentas de solo lectura se ocultará en tus listas de contactos, pero no se eliminará."</string> <string name="batch_merge_single_contact_warning" msgid="982585201970392110">"Debes seleccionar al menos dos contactos para efectuar una combinación."</string> <string name="batch_merge_confirmation" msgid="8551299480317422420">"Los contactos seleccionados se combinarán en un solo contacto."</string> - <string name="batch_delete_confirmation" msgid="2564172328268885394">"Se eliminarán los contactos seleccionados."</string> + <string name="batch_delete_confirmation" msgid="2564172328268885394">"Se borrarán los contactos seleccionados."</string> <string name="batch_delete_read_only_contact_confirmation" msgid="6614878716815412523">"La información de las cuentas de solo lectura no se eliminará, sino que se ocultará en las listas de contactos."</string> <string name="batch_delete_multiple_accounts_confirmation" msgid="5189722181586680185">"Estos contactos contienen información de varias cuentas. La información de las cuentas de solo lectura no se eliminará, sino que se ocultará en las listas de contactos."</string> <string name="multipleContactDeleteConfirmation" msgid="938900978442960800">"Eliminar este contacto suprimirá la información de mútliples cuentas."</string> diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index b56cbdc84..84c9d7e1c 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -189,7 +189,7 @@ <string name="date_year_toggle" msgid="7356532842767854606">"Introducir año"</string> <string name="social_widget_label" msgid="6378905543028924592">"Contacto"</string> <string name="social_widget_loading" msgid="5327336597364074608">"Cargando..."</string> - <string name="contacts_unavailable_create_contact" msgid="7014525713871959208">"Crear nuevo contacto"</string> + <string name="contacts_unavailable_create_contact" msgid="7014525713871959208">"Crear un contacto"</string> <string name="contacts_unavailable_add_account" msgid="7911101713860139754">"Iniciar sesión en una cuenta"</string> <string name="contacts_unavailable_import_contacts" msgid="4957393255392437529">"Importar contactos"</string> <string name="create_group_dialog_title" msgid="6874527142828424475">"Crear nuevo grupo"</string> diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index 960c90b1d..58680c5ef 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -250,7 +250,7 @@ <string name="date_time_set" msgid="4761419824439606690">"Définir"</string> <string name="header_im_entry" msgid="3581720979640225615">"Messagerie instantanée"</string> <string name="header_organization_entry" msgid="8515394955666265406">"Organisation"</string> - <string name="header_nickname_entry" msgid="6743561883967451485">"Pseudo"</string> + <string name="header_nickname_entry" msgid="6743561883967451485">"Surnom"</string> <string name="header_note_entry" msgid="4320190426480612344">"Note"</string> <string name="header_website_entry" msgid="1411467850000824745">"Site Web"</string> <string name="header_event_entry" msgid="6738250422744401460">"Événement"</string> diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml index 492560d71..fc905e2bc 100644 --- a/res/values-ja/strings.xml +++ b/res/values-ja/strings.xml @@ -214,11 +214,11 @@ <string name="toast_text_copied" msgid="5143776250008541719">"テキストをコピーしました"</string> <string name="cancel_confirmation_dialog_message" msgid="5885724679874403115">"変更を破棄しますか?"</string> <string name="call_type_and_date" msgid="747163730039311423">"<xliff:g id="CALL_TYPE">%1$s</xliff:g> <xliff:g id="CALL_SHORT_DATE">%2$s</xliff:g>"</string> - <string name="profile_display_name" msgid="4127389543625918771">"プロフィールを設定"</string> + <string name="profile_display_name" msgid="4127389543625918771">"プロファイルを設定"</string> <string name="enter_contact_name" msgid="1738391320566349924">"名前を入力"</string> <string name="group_name_hint" msgid="238359485263401293">"グループの名前"</string> - <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="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="generic_no_account_prompt" msgid="7218827704367325460">"携帯端末を紛失したときにも連絡先を保護するため、オンラインサービスと同期させます。"</string> diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index 4623ebdbd..dd7a640ff 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -60,7 +60,7 @@ <string name="menu_joinAggregate" msgid="4050157483569357666">"Samenvoegen"</string> <string name="menu_save" msgid="1727844363591825909">"Opslaan"</string> <string name="titleJoinContactDataWith" msgid="7684875775798635354">"Contacten samenvoegen"</string> - <string name="blurbJoinContactDataWith" msgid="8736488417422708236">"Selecteer het contact dat u met <xliff:g id="NAME">%s</xliff:g> wilt samenvoegen:"</string> + <string name="blurbJoinContactDataWith" msgid="8736488417422708236">"Selecteer het contact dat je met <xliff:g id="NAME">%s</xliff:g> wilt samenvoegen:"</string> <string name="showAllContactsJoinItem" msgid="2189695051430392383">"Alle contacten weergeven"</string> <string name="separatorJoinAggregateSuggestions" msgid="2831414448851313345">"Mogelijke contacten"</string> <string name="separatorJoinAggregateAll" msgid="7939932265026181043">"Alle contacten"</string> @@ -68,14 +68,14 @@ <string name="contacts_deleted_toast" msgid="286851430992788215">"Contacten verwijderd"</string> <string name="menu_set_ring_tone" msgid="8728345772068064946">"Beltoon instellen"</string> <string name="menu_redirect_calls_to_vm" msgid="4181789196416396656">"Alle oproepen naar voicemail"</string> - <string name="readOnlyContactWarning" msgid="7808825687289848259">"U kunt contacten niet verwijderen uit alleen-lezen-accounts, maar u kunt ze verbergen in uw contactenlijst."</string> - <string name="readOnlyContactDeleteConfirmation" msgid="2137170726670196909">"Dit contact bevat gegevens uit meerdere accounts. Gegevens uit alleen-lezen accounts worden verborgen in uw contactenlijst, maar niet verwijderd."</string> - <string name="batch_merge_single_contact_warning" msgid="982585201970392110">"U moet minimaal twee contacten selecteren om te kunnen samenvoegen."</string> + <string name="readOnlyContactWarning" msgid="7808825687289848259">"Je kunt contacten niet verwijderen uit alleen-lezen-accounts, maar je kunt ze verbergen in je contactenlijst."</string> + <string name="readOnlyContactDeleteConfirmation" msgid="2137170726670196909">"Dit contact bevat gegevens uit meerdere accounts. Gegevens uit alleen-lezen accounts worden verborgen in je contactenlijst, maar niet verwijderd."</string> + <string name="batch_merge_single_contact_warning" msgid="982585201970392110">"Je moet minimaal twee contacten selecteren om te kunnen samenvoegen."</string> <string name="batch_merge_confirmation" msgid="8551299480317422420">"De geselecteerde contacten worden samengevoegd tot één contact."</string> <string name="batch_delete_confirmation" msgid="2564172328268885394">"De geselecteerde contacten worden verwijderd."</string> - <string name="batch_delete_read_only_contact_confirmation" msgid="6614878716815412523">"Gegevens uit alleen-lezen accounts worden verborgen in uw contactenlijst, maar niet verwijderd."</string> - <string name="batch_delete_multiple_accounts_confirmation" msgid="5189722181586680185">"Deze contacten bevatten gegevens uit meerdere accounts. Gegevens uit alleen-lezen accounts worden verborgen in uw contactenlijst, maar niet verwijderd."</string> - <string name="multipleContactDeleteConfirmation" msgid="938900978442960800">"Als u dit contact verwijdert, worden gegevens van meerdere accounts verwijderd."</string> + <string name="batch_delete_read_only_contact_confirmation" msgid="6614878716815412523">"Gegevens uit alleen-lezen accounts worden verborgen in je contactenlijst, maar niet verwijderd."</string> + <string name="batch_delete_multiple_accounts_confirmation" msgid="5189722181586680185">"Deze contacten bevatten gegevens uit meerdere accounts. Gegevens uit alleen-lezen accounts worden verborgen in je contactenlijst, maar niet verwijderd."</string> + <string name="multipleContactDeleteConfirmation" msgid="938900978442960800">"Als je dit contact verwijdert, worden gegevens van meerdere accounts verwijderd."</string> <string name="deleteConfirmation" msgid="811706994761610640">"Dit contact wordt verwijderd."</string> <string name="menu_discard" msgid="6854657936970228164">"Wijzigingen niet opslaan"</string> <string name="invalidContactMessage" msgid="8215051456181842274">"Het contact bestaat niet."</string> @@ -94,7 +94,7 @@ <string name="removePhoto" msgid="4898105274130284565">"Foto verwijderen"</string> <string name="noContacts" msgid="8579310973261953559">"Geen contacten."</string> <string name="noGroups" msgid="8614664663561385253">"Geen groepen."</string> - <string name="noAccounts" msgid="7768267764545265909">"U heeft een account nodig om groepen te maken."</string> + <string name="noAccounts" msgid="7768267764545265909">"Je hebt een account nodig om groepen te maken."</string> <string name="emptyGroup" msgid="7502116218697177370">"Geen personen in deze groep."</string> <string name="addPeopleToGroup" msgid="7879585947222263516">"Bewerk de groep om leden toe te voegen."</string> <string name="savingContact" msgid="4075751076741924939">"Contact opslaan..."</string> @@ -126,7 +126,7 @@ <string name="description_contact_photo" msgid="3387458082667894062">"contactfoto"</string> <string name="description_plus_button" msgid="515164827856229880">"plus"</string> <string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> van <xliff:g id="TOTAL_NUMBER">%s</xliff:g> contacten"</string> - <string name="search_settings_description" msgid="2675223022992445813">"Namen van uw contacten"</string> + <string name="search_settings_description" msgid="2675223022992445813">"Namen van je contacten"</string> <string name="quickcontact_missing_app" msgid="358168575340921552">"Er is geen app gevonden om deze actie uit te voeren."</string> <string name="quickcontact_transparent_view_description" msgid="987959416759562455">"Klik om terug te keren naar het vorige scherm"</string> <string name="quickcontact_add_phone_number" msgid="731665835910658965">"Telefoonnummer toevoegen"</string> @@ -170,8 +170,8 @@ <item quantity="other">samengevoegd uit <xliff:g id="COUNT">%0$d</xliff:g> bronnen</item> <item quantity="one">niet samengevoegd</item> </plurals> - <string name="aggregation_suggestion_join_dialog_message" msgid="3842757977671434836">"Wilt u het huidige contact samenvoegen met het geselecteerde contact?"</string> - <string name="aggregation_suggestion_edit_dialog_message" msgid="6549585283910518095">"Wilt u overschakelen naar het bewerken van het geselecteerde contact? Gegevens die u tot nu toe heeft ingevoerd, worden gekopieerd."</string> + <string name="aggregation_suggestion_join_dialog_message" msgid="3842757977671434836">"Wil je het huidige contact samenvoegen met het geselecteerde contact?"</string> + <string name="aggregation_suggestion_edit_dialog_message" msgid="6549585283910518095">"Wil je overschakelen naar het bewerken van het geselecteerde contact? Gegevens die je tot nu toe hebt ingevoerd, worden gekopieerd."</string> <string name="menu_copyContact" msgid="1573960845106822639">"Kopiëren naar mijn contacten"</string> <string name="add_to_my_contacts" msgid="1068274916793627723">"Toevoegen aan Mijn contacten"</string> <string name="contact_directory_description" msgid="683398073603909119">"Directory <xliff:g id="TYPE">%1$s</xliff:g>"</string> @@ -207,7 +207,7 @@ <item quantity="other"><xliff:g id="COUNT_1">%1$d</xliff:g> mensen</item> <item quantity="one"><xliff:g id="COUNT_0">%1$d</xliff:g> persoon</item> </plurals> - <string name="toast_join_with_empty_contact" msgid="2238581529864542985">"Geef een contactnaam op voordat u dit contact samenvoegt met een ander contact."</string> + <string name="toast_join_with_empty_contact" msgid="2238581529864542985">"Geef een contactnaam op voordat je dit contact samenvoegt met een ander contact."</string> <string name="copy_text" msgid="3257145021583508761">"Kopiëren naar klembord"</string> <string name="set_default" msgid="4417505153468300351">"Standaard instellen"</string> <string name="clear_default" msgid="7193185801596678067">"Standaardwaarden wissen"</string> @@ -220,13 +220,13 @@ <string name="local_profile_title" msgid="2021416826991393684">"Mijn lokale profiel"</string> <string name="external_profile_title" msgid="8034998767621359438">"Mijn <xliff:g id="EXTERNAL_SOURCE">%1$s</xliff:g>-profiel"</string> <string name="toast_displaying_all_contacts" msgid="2737388783898593875">"Alle contacten worden weergegeven"</string> - <string name="no_account_prompt" msgid="6424883302325061025">"Contacten werkt beter met een Google-account.\n\n• Toegang via elke webbrowser.\n• Veilig een back-up van uw contacten maken."</string> - <string name="generic_no_account_prompt" msgid="7218827704367325460">"Zorg dat uw contacten veilig zijn, zelfs wanneer u uw telefoon verliest: synchroniseer met een online service."</string> + <string name="no_account_prompt" msgid="6424883302325061025">"Contacten werkt beter met een Google-account.\n\n• Toegang via elke webbrowser.\n• Veilig een back-up van je contacten maken."</string> + <string name="generic_no_account_prompt" msgid="7218827704367325460">"Zorg dat je contacten veilig zijn, zelfs wanneer je je telefoon verliest: synchroniseer met een online service."</string> <string name="generic_no_account_prompt_title" msgid="753783911899054860">"Account toevoegen"</string> - <string name="contact_editor_prompt_zero_accounts" msgid="1785345895691886499">"Er wordt geen back-up van uw nieuwe contact gemaakt. Een account toevoegen waarmee online een back-up van contacten wordt gemaakt?"</string> - <string name="contact_editor_prompt_one_account" msgid="8669032699767375976">"Uw nieuwe contact wordt gesynchroniseerd met <xliff:g id="ACCOUNT_NAME">%1$s</xliff:g>."</string> - <string name="contact_editor_prompt_multiple_accounts" msgid="611828200100438242">"U kunt uw nieuwe contact synchroniseren met een van de volgende accounts. Welk account wilt u gebruiken?"</string> - <string name="contact_editor_title_new_contact" msgid="7192223018128934940">"Nw contact toevoegen"</string> + <string name="contact_editor_prompt_zero_accounts" msgid="1785345895691886499">"Er wordt geen back-up van je nieuwe contact gemaakt. Een account toevoegen waarmee online een back-up van contacten wordt gemaakt?"</string> + <string name="contact_editor_prompt_one_account" msgid="8669032699767375976">"Je nieuwe contact wordt gesynchroniseerd met <xliff:g id="ACCOUNT_NAME">%1$s</xliff:g>."</string> + <string name="contact_editor_prompt_multiple_accounts" msgid="611828200100438242">"Je kunt je nieuwe contact synchroniseren met een van de volgende accounts. Welk account wil je gebruiken?"</string> + <string name="contact_editor_title_new_contact" msgid="7192223018128934940">"Contact toevoegen"</string> <string name="contact_editor_title_existing_contact" msgid="4898475703683187798">"Contact bewerken"</string> <string name="keep_local" msgid="1258761699192993322">"Lokaal opslaan"</string> <string name="add_account" msgid="8201790677994503186">"Account toevoegen"</string> @@ -268,8 +268,8 @@ <string name="content_description_recent_call_type_outgoing" msgid="5156553338985232744">"uitgaand"</string> <string name="content_description_recent_call_type_missed" msgid="7371810920196048204">"gemist"</string> <string name="content_description_recent_call" msgid="5183800406316723676">"recente oproep. <xliff:g id="CALL_TYPE">%s</xliff:g>. <xliff:g id="PHONE_NUMBER">%s</xliff:g>. <xliff:g id="DATE">%s</xliff:g>. klik om terug te bellen"</string> - <string name="message_from_you_prefix" msgid="7180706529908434482">"U: <xliff:g id="SMS_BODY">%s</xliff:g>"</string> - <string name="contact_editor_hangouts_im_alert" msgid="114855385615225735">"Hangouts werkt beter wanneer u de Hangouts-ID van de betreffende persoon in het veld \'E-mail\' of \'Telefoon\' opgeeft."</string> + <string name="message_from_you_prefix" msgid="7180706529908434482">"Jij: <xliff:g id="SMS_BODY">%s</xliff:g>"</string> + <string name="contact_editor_hangouts_im_alert" msgid="114855385615225735">"Hangouts werkt beter wanneer je de Hangouts-ID van de betreffende persoon in het veld \'E-mail\' of \'Telefoon\' opgeeft."</string> <string name="compact_editor_more_fields" msgid="2874181192382284115">"Meer velden"</string> <string name="compact_editor_change_photo_content_description" msgid="5495487714301211540">"Foto wijzigen"</string> <string name="quick_contact_display_name_with_phonetic" msgid="3692038078718876610">"<xliff:g id="DISPLAY_NAME">%s</xliff:g> (<xliff:g id="PHONETIC_NAME">%s</xliff:g>)"</string> diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml index 79aa0f8cb..503122aa5 100644 --- a/res/values-ro/strings.xml +++ b/res/values-ro/strings.xml @@ -47,9 +47,9 @@ <string name="menu_editContact" msgid="9042415603857662633">"Editaţi"</string> <string name="menu_deleteContact" msgid="6788644058868189393">"Ștergeţi"</string> <string name="menu_change_photo" msgid="7769177631511496210">"Schimbați fotografia"</string> - <string name="menu_create_contact_shortcut" msgid="1217971915748509640">"Plasaţi în ecranul de pornire"</string> + <string name="menu_create_contact_shortcut" msgid="1217971915748509640">"Plasați în ecranul de pornire"</string> <string name="menu_call" msgid="3992595586042260618">"Apelaţi persoana din agendă"</string> - <string name="menu_sendSMS" msgid="5535886767547006515">"Trimiteţi mesaj text către o persoană din agendă"</string> + <string name="menu_sendSMS" msgid="5535886767547006515">"Trimiteți mesaj text către o persoană din agendă"</string> <string name="menu_splitAggregate" msgid="8368636463748691868">"Separaţi"</string> <string name="menu_editGroup" msgid="5062005185370983720">"Editaţi"</string> <string name="menu_deleteGroup" msgid="3486380004411482874">"Ștergeţi"</string> @@ -68,7 +68,7 @@ <string name="contacts_deleted_toast" msgid="286851430992788215">"Persoane de contact șterse"</string> <string name="menu_set_ring_tone" msgid="8728345772068064946">"Setaţi ton apel"</string> <string name="menu_redirect_calls_to_vm" msgid="4181789196416396656">"Toate apel. către mesag. voc."</string> - <string name="readOnlyContactWarning" msgid="7808825687289848259">"Nu puteţi şterge persoane din agendă, din conturi cu permisiuni doar de citire, însă puteţi să le ascundeţi în lista dvs. de persoane din agendă."</string> + <string name="readOnlyContactWarning" msgid="7808825687289848259">"Nu puteţi șterge persoane din agendă, din conturi cu permisiuni doar de citire, însă puteţi să le ascundeţi în lista dvs. de persoane din agendă."</string> <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="batch_merge_single_contact_warning" msgid="982585201970392110">"Pentru o îmbinare aveți nevoie de cel puțin două persoane de contact selectate."</string> <string name="batch_merge_confirmation" msgid="8551299480317422420">"Persoanele de contact selectate vor fi îmbinate într-o singură persoană de contact."</string> @@ -83,14 +83,14 @@ <string name="pickerNewContactHeader" msgid="7750705279843568147">"Creaţi o intrare nouă în agendă"</string> <string name="pickerNewContactText" msgid="6166997164401048211">"Creaţi o intrare nouă în Agendă"</string> <string-array name="otherLabels"> - <item msgid="8287841928119937597">"Organizaţie"</item> + <item msgid="8287841928119937597">"Organizație"</item> <item msgid="7196592230748086755">"Notă"</item> </string-array> <string name="photoPickerNotFoundText" product="tablet" msgid="6247290728908599701">"Nu există imagini disponibile pe tabletă."</string> <string name="photoPickerNotFoundText" product="default" msgid="431331662154342581">"Nicio fotografie disponibilă în telefon."</string> <string name="attach_photo_dialog_title" msgid="5599827035558557169">"Fotografie persoană din agendă"</string> <string name="customLabelPickerTitle" msgid="1081475101983255212">"Numele etichetei personalizate"</string> - <string name="send_to_voicemail_checkbox" msgid="9001686764070676353">"Trimiteţi apelurile direct către mesageria vocală"</string> + <string name="send_to_voicemail_checkbox" msgid="9001686764070676353">"Trimiteți apelurile direct către mesageria vocală"</string> <string name="removePhoto" msgid="4898105274130284565">"Eliminaţi fotografia"</string> <string name="noContacts" msgid="8579310973261953559">"Nicio persoană în agendă."</string> <string name="noGroups" msgid="8614664663561385253">"Nu există grupuri."</string> @@ -158,11 +158,11 @@ <string name="upgrade_in_progress" msgid="474511436863451061">"Se actualizează lista de persoane din agendă."</string> <string name="search_results_searching" msgid="3984833028938569930">"Se caută..."</string> <string name="menu_display_selected" msgid="6470001164297969034">"Afişaţi elementele selectate"</string> - <string name="menu_display_all" msgid="8887488642609786198">"Afişaţi-i pe toţi"</string> + <string name="menu_display_all" msgid="8887488642609786198">"Afișați-i pe toţi"</string> <string name="menu_select_all" msgid="621719255150713545">"Selectaţi-le pe toate"</string> <string name="menu_select_none" msgid="7093222469852132345">"Deselectaţi-le pe toate"</string> <string name="add_new_entry_for_section" msgid="5223080690667565044">"Adăugaţi intrare nouă"</string> - <string name="add_organization" msgid="7311893231158291197">"Adăugaţi o organizaţie"</string> + <string name="add_organization" msgid="7311893231158291197">"Adăugaţi o organizație"</string> <string name="event_edit_field_hint_text" msgid="5794424930242630477">"Dată"</string> <string name="group_edit_field_hint_text" msgid="3966441850870457808">"Nume grup"</string> <string name="change_photo" msgid="8530597935483526383">"Modificați"</string> @@ -194,7 +194,7 @@ <string name="social_widget_label" msgid="6378905543028924592">"Persoană din agendă"</string> <string name="social_widget_loading" msgid="5327336597364074608">"Se încarcă..."</string> <string name="contacts_unavailable_create_contact" msgid="7014525713871959208">"Creaţi o intrare nouă în Agendă"</string> - <string name="contacts_unavailable_add_account" msgid="7911101713860139754">"Conectaţi-vă la un cont"</string> + <string name="contacts_unavailable_add_account" msgid="7911101713860139754">"Conectați-vă la un cont"</string> <string name="contacts_unavailable_import_contacts" msgid="4957393255392437529">"Importaţi Agenda"</string> <string name="create_group_dialog_title" msgid="6874527142828424475">"Creaţi un grup nou"</string> <string name="create_group_item_label" msgid="4411981763169654825">"Creaţi un grup nou"</string> @@ -226,13 +226,13 @@ <string name="group_name_hint" msgid="238359485263401293">"Numele grupului"</string> <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> + <string name="toast_displaying_all_contacts" msgid="2737388783898593875">"Se afișează toată agenda"</string> <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> <string name="contact_editor_prompt_one_account" msgid="8669032699767375976">"Noul dvs. contact va fi sincronizat cu <xliff:g id="ACCOUNT_NAME">%1$s</xliff:g>."</string> - <string name="contact_editor_prompt_multiple_accounts" msgid="611828200100438242">"Puteţi să sincronizaţi noul dvs. contact cu unul dintre următoarele conturi. Pe care doriţi să îl utilizaţi?"</string> + <string name="contact_editor_prompt_multiple_accounts" msgid="611828200100438242">"Puteţi să sincronizați noul dvs. contact cu unul dintre următoarele conturi. Pe care doriţi să îl utilizaţi?"</string> <string name="contact_editor_title_new_contact" msgid="7192223018128934940">"Adăugați contact nou"</string> <string name="contact_editor_title_existing_contact" msgid="4898475703683187798">"Editați intrarea"</string> <string name="keep_local" msgid="1258761699192993322">"Păstraţi local"</string> @@ -256,7 +256,7 @@ <string name="untitled_event" msgid="3484859385405939366">"(Eveniment fără titlu)"</string> <string name="date_time_set" msgid="4761419824439606690">"Setați"</string> <string name="header_im_entry" msgid="3581720979640225615">"IM"</string> - <string name="header_organization_entry" msgid="8515394955666265406">"Organizaţie"</string> + <string name="header_organization_entry" msgid="8515394955666265406">"Organizație"</string> <string name="header_nickname_entry" msgid="6743561883967451485">"Pseudonim"</string> <string name="header_note_entry" msgid="4320190426480612344">"Notă"</string> <string name="header_website_entry" msgid="1411467850000824745">"Site web"</string> diff --git a/res/values-uz-rUZ/strings.xml b/res/values-uz-rUZ/strings.xml index 0a70fac52..3e633ae7a 100644 --- a/res/values-uz-rUZ/strings.xml +++ b/res/values-uz-rUZ/strings.xml @@ -36,7 +36,7 @@ <string name="insertContactDescription" msgid="4709878105452681987">"Kontakt yaratish"</string> <string name="editGroupDescription" msgid="6321161304201540561">"Guruhni tahrirlash"</string> <string name="insertGroupDescription" msgid="5658512271662210139">"Guruh yaratish"</string> - <string name="contactDetailAbout" msgid="5430408883907061400">"Haqida"</string> + <string name="contactDetailAbout" msgid="5430408883907061400">"Aloqa ma’lumoti"</string> <string name="contactDetailUpdates" msgid="3780588624763446941">"Yangilanishlar"</string> <string name="searchHint" msgid="8482945356247760701">"Kontaktlarni izlash"</string> <string name="menu_viewContact" msgid="2795575601596468581">"Kontaktni ko‘rish"</string> diff --git a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java index 4b76987e4..f14392c93 100644 --- a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java +++ b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java @@ -19,6 +19,7 @@ import android.animation.Animator; import android.animation.Animator.AnimatorListener; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; +import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.res.Resources; @@ -27,6 +28,7 @@ import android.graphics.ColorFilter; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.net.Uri; +import android.os.Bundle; import android.support.v7.widget.CardView; import android.text.Spannable; import android.text.TextUtils; @@ -52,6 +54,7 @@ import android.widget.RelativeLayout; import android.widget.TextView; import com.android.contacts.R; +import com.android.contacts.common.dialog.CallSubjectDialog; import java.util.ArrayList; import java.util.List; @@ -89,6 +92,12 @@ public class ExpandingEntryCardView extends CardView { * Entry data. */ public static final class Entry { + // No action when clicking a button is specified. + public static final int ACTION_NONE = 1; + // Button action is an intent. + public static final int ACTION_INTENT = 2; + // Button action will open the call with subject dialog. + public static final int ACTION_CALL_WITH_SUBJECT = 3; private final int mId; private final Drawable mIcon; @@ -109,6 +118,8 @@ public class ExpandingEntryCardView extends CardView { private final Intent mThirdIntent; private final String mThirdContentDescription; private final int mIconResourceId; + private final int mThirdAction; + private final Bundle mThirdExtras; public Entry(int id, Drawable mainIcon, String header, String subHeader, Drawable subHeaderIcon, String text, Drawable textIcon, @@ -116,7 +127,8 @@ public class ExpandingEntryCardView extends CardView { Drawable alternateIcon, Intent alternateIntent, String alternateContentDescription, boolean shouldApplyColor, boolean isEditable, EntryContextMenuInfo entryContextMenuInfo, Drawable thirdIcon, Intent thirdIntent, - String thirdContentDescription, int iconResourceId) { + String thirdContentDescription, int thirdAction, Bundle thirdExtras, + int iconResourceId) { mId = id; mIcon = mainIcon; mHeader = header; @@ -135,6 +147,8 @@ public class ExpandingEntryCardView extends CardView { mThirdIcon = thirdIcon; mThirdIntent = thirdIntent; mThirdContentDescription = thirdContentDescription; + mThirdAction = thirdAction; + mThirdExtras = thirdExtras; mIconResourceId = iconResourceId; } @@ -213,6 +227,14 @@ public class ExpandingEntryCardView extends CardView { int getIconResourceId() { return mIconResourceId; } + + public int getThirdAction() { + return mThirdAction; + } + + public Bundle getThirdExtras() { + return mThirdExtras; + } } public interface ExpandingEntryCardViewListener { @@ -810,10 +832,28 @@ public class ExpandingEntryCardView extends CardView { alternateIcon.setContentDescription(entry.getAlternateContentDescription()); } - if (entry.getThirdIcon() != null && entry.getThirdIntent() != null) { + if (entry.getThirdIcon() != null && entry.getThirdAction() != Entry.ACTION_NONE) { thirdIcon.setImageDrawable(entry.getThirdIcon()); - thirdIcon.setOnClickListener(mOnClickListener); - thirdIcon.setTag(new EntryTag(entry.getId(), entry.getThirdIntent())); + if (entry.getThirdAction() == Entry.ACTION_INTENT) { + thirdIcon.setOnClickListener(mOnClickListener); + thirdIcon.setTag(new EntryTag(entry.getId(), entry.getThirdIntent())); + } else if (entry.getThirdAction() == Entry.ACTION_CALL_WITH_SUBJECT) { + thirdIcon.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Object tag = v.getTag(); + if (!(tag instanceof Bundle)) { + return; + } + + Context context = getContext(); + if (context instanceof Activity) { + CallSubjectDialog.start((Activity) context, entry.getThirdExtras()); + } + } + }); + thirdIcon.setTag(entry.getThirdExtras()); + } thirdIcon.setVisibility(View.VISIBLE); thirdIcon.setContentDescription(entry.getThirdContentDescription()); } diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java index 09ddf35db..9a83cf4f6 100644 --- a/src/com/android/contacts/quickcontact/QuickContactActivity.java +++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java @@ -109,6 +109,7 @@ import com.android.contacts.common.Collapser; import com.android.contacts.common.ContactsUtils; import com.android.contacts.common.GroupMetaData; import com.android.contacts.common.activity.RequestPermissionsActivity; +import com.android.contacts.common.dialog.CallSubjectDialog; import com.android.contacts.common.editor.SelectAccountDialogFragment; import com.android.contacts.common.interactions.TouchPointManager; import com.android.contacts.common.lettertiles.LetterTileDrawable; @@ -142,6 +143,7 @@ import com.android.contacts.common.SimContactsConstants; import com.android.contacts.common.util.DateUtils; import com.android.contacts.common.util.MaterialColorMapUtils; import com.android.contacts.common.util.MaterialColorMapUtils.MaterialPalette; +import com.android.contacts.common.util.UriUtils; import com.android.contacts.common.util.ViewUtil; import com.android.contacts.detail.ContactDisplayUtils; import com.android.contacts.editor.ContactEditorFragment; @@ -1399,7 +1401,9 @@ public class QuickContactActivity extends ContactsActivity { /* thirdIcon = */ null, /* thirdIntent = */ null, /* thirdContentDescription = */ null, - /* iconResourceId = */ 0); + /* thirdAction = */ Entry.ACTION_NONE, + /* thirdExtras = */ null, + /* iconResourceId = */ 0); List<Entry> phoneticList = new ArrayList<>(); phoneticList.add(phoneticEntry); // Phonetic name comes after nickname. Check to see if the first entry type is nickname @@ -1475,7 +1479,10 @@ public class QuickContactActivity extends ContactsActivity { /* alternateContentDescription = */ null, /* shouldApplyColor = */ true, /* isEditable = */ false, /* EntryContextMenuInfo = */ null, /* thirdIcon = */ null, /* thirdIntent = */ null, - /* thirdContentDescription = */ null, R.drawable.ic_phone_24dp); + /* thirdContentDescription = */ null, + /* thirdAction = */ Entry.ACTION_NONE, + /* thirdExtras = */ null, + R.drawable.ic_phone_24dp); final Drawable emailIcon = getResources().getDrawable( R.drawable.ic_email_24dp).mutate(); @@ -1488,6 +1495,7 @@ public class QuickContactActivity extends ContactsActivity { /* shouldApplyColor = */ true, /* isEditable = */ false, /* EntryContextMenuInfo = */ null, /* thirdIcon = */ null, /* thirdIntent = */ null, /* thirdContentDescription = */ null, + /* thirdAction = */ Entry.ACTION_NONE, /* thirdExtras = */ null, R.drawable.ic_email_24dp); final List<List<Entry>> promptEntries = new ArrayList<>(); @@ -1654,7 +1662,9 @@ public class QuickContactActivity extends ContactsActivity { EntryContextMenuInfo entryContextMenuInfo = null; Drawable thirdIcon = null; Intent thirdIntent = null; + int thirdAction = Entry.ACTION_NONE; String thirdContentDescription = null; + Bundle thirdExtras = null; int iconResourceId = 0; context = context.getApplicationContext(); @@ -1767,6 +1777,7 @@ public class QuickContactActivity extends ContactsActivity { } } else if (dataItem instanceof PhoneDataItem) { final PhoneDataItem phone = (PhoneDataItem) dataItem; + String phoneLabel = null; if (!TextUtils.isEmpty(phone.getNumber())) { primaryContentDescription.append(res.getString(R.string.call_other)).append(" "); header = sBidiFormatter.unicodeWrap(phone.buildDataStringForDisplay(context, kind), @@ -1795,10 +1806,12 @@ public class QuickContactActivity extends ContactsActivity { if (phone.hasKindTypeColumn(kind)) { final int kindTypeColumn = phone.getKindTypeColumn(kind); final String label = phone.getLabel(); + phoneLabel = label; if (kindTypeColumn == Phone.TYPE_CUSTOM && TextUtils.isEmpty(label)) { text = ""; } else { text = Phone.getTypeLabel(res, kindTypeColumn, label).toString(); + phoneLabel= text; primaryContentDescription.append(text).append(" "); } } @@ -1814,9 +1827,33 @@ public class QuickContactActivity extends ContactsActivity { alternateIcon = res.getDrawable(R.drawable.ic_message_24dp); alternateContentDescription.append(res.getString(R.string.sms_custom, header)); - // Add video call button if supported - if (CallUtil.isVideoEnabled(context)) { + if (CallUtil.isCallWithSubjectSupported(context)) { + thirdIcon = res.getDrawable(R.drawable.ic_call_note_white_24dp); + thirdAction = Entry.ACTION_CALL_WITH_SUBJECT; + thirdContentDescription = + res.getString(R.string.call_with_a_note); + + // Create a bundle containing the data the call subject dialog requires. + thirdExtras = new Bundle(); + thirdExtras.putLong(CallSubjectDialog.ARG_PHOTO_ID, + contactData.getPhotoId()); + thirdExtras.putParcelable(CallSubjectDialog.ARG_PHOTO_URI, + UriUtils.parseUriOrNull(contactData.getPhotoUri())); + thirdExtras.putParcelable(CallSubjectDialog.ARG_CONTACT_URI, + contactData.getLookupUri()); + thirdExtras.putString(CallSubjectDialog.ARG_NAME_OR_NUMBER, + contactData.getDisplayName()); + thirdExtras.putBoolean(CallSubjectDialog.ARG_IS_BUSINESS, false); + thirdExtras.putString(CallSubjectDialog.ARG_NUMBER, + phone.getNumber()); + thirdExtras.putString(CallSubjectDialog.ARG_DISPLAY_NUMBER, + phone.getFormattedPhoneNumber()); + thirdExtras.putString(CallSubjectDialog.ARG_NUMBER_LABEL, + phoneLabel); + } else if (CallUtil.isVideoEnabled(context)) { + // Add video call button if supported thirdIcon = res.getDrawable(R.drawable.ic_videocam); + thirdAction = Entry.ACTION_INTENT; thirdIntent = CallUtil.getVideoCallIntent(phone.getNumber(), CALL_ORIGIN_QUICK_CONTACTS_ACTIVITY); thirdContentDescription = @@ -1927,6 +1964,8 @@ public class QuickContactActivity extends ContactsActivity { /* thirdIcon = */null, /* thirdIntent = */null, /* thirdContentDescription = */null, + /* thirdAction = */ Entry.ACTION_NONE, + /* thirdExtras = */ null, /* iconResourceId = */0); } return null; @@ -2040,8 +2079,8 @@ public class QuickContactActivity extends ContactsActivity { new SpannableString(primaryContentDescription.toString()), intent, alternateIcon, alternateIntent, alternateContentDescription.toString(), shouldApplyColor, isEditable, - entryContextMenuInfo, thirdIcon, thirdIntent, thirdContentDescription, - iconResourceId); + entryContextMenuInfo, thirdIcon, thirdIntent, thirdContentDescription, thirdAction, + thirdExtras, iconResourceId); } private List<Entry> dataItemsToEntries(List<DataItem> dataItems, @@ -2312,6 +2351,8 @@ public class QuickContactActivity extends ContactsActivity { /* thirdIcon = */ null, /* thirdIntent = */ null, /* thirdContentDescription = */ null, + /* thirdAction = */ Entry.ACTION_NONE, + /* thirdActionExtras = */ null, interaction.getIconResourceId())); } return entries; diff --git a/src/com/android/contacts/widget/PinnedHeaderListDemoActivity.java b/src/com/android/contacts/widget/PinnedHeaderListDemoActivity.java deleted file mode 100644 index bc9f07efe..000000000 --- a/src/com/android/contacts/widget/PinnedHeaderListDemoActivity.java +++ /dev/null @@ -1,147 +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.app.ListActivity; -import android.content.Context; -import android.database.Cursor; -import android.database.MatrixCursor; -import android.os.Bundle; -import android.os.Handler; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.TextView; - -import com.android.contacts.R; -import com.android.contacts.common.activity.RequestPermissionsActivity; -import com.android.contacts.common.list.PinnedHeaderListAdapter; - -/** - * An activity that demonstrates various use cases for the {@link com.android.contacts.common.list.PinnedHeaderListView}. - * If we decide to move PinnedHeaderListView to the framework, this class could go - * to API demos. - */ -public class PinnedHeaderListDemoActivity extends ListActivity { - - public final static class TestPinnedHeaderListAdapter extends PinnedHeaderListAdapter { - - public TestPinnedHeaderListAdapter(Context context) { - super(context); - setPinnedPartitionHeadersEnabled(true); - } - - private String[] mHeaders; - private int mPinnedHeaderCount; - - public void setHeaders(String[] headers) { - this.mHeaders = headers; - } - - @Override - protected View newHeaderView(Context context, int partition, Cursor cursor, - ViewGroup parent) { - LayoutInflater inflater = LayoutInflater.from(context); - return inflater.inflate(R.layout.list_section, null); - } - - @Override - protected void bindHeaderView(View view, int parition, Cursor cursor) { - TextView headerText = (TextView)view.findViewById(R.id.header_text); - headerText.setText(mHeaders[parition]); - } - - @Override - protected View newView(Context context, int partition, Cursor cursor, int position, - ViewGroup parent) { - LayoutInflater inflater = LayoutInflater.from(context); - return inflater.inflate(android.R.layout.simple_list_item_1, null); - } - - @Override - protected void bindView(View v, int partition, Cursor cursor, int position) { - TextView text = (TextView)v.findViewById(android.R.id.text1); - text.setText(cursor.getString(1)); - } - - @Override - public View getPinnedHeaderView(int viewIndex, View convertView, ViewGroup parent) { - LayoutInflater inflater = LayoutInflater.from(getContext()); - View view = inflater.inflate(R.layout.list_section, parent, false); - view.setFocusable(false); - view.setEnabled(false); - bindHeaderView(view, viewIndex, null); - return view; - } - - @Override - public int getPinnedHeaderCount() { - return mPinnedHeaderCount; - } - } - - private Handler mHandler = new Handler(); - - @Override - protected void onCreate(Bundle bundle) { - super.onCreate(bundle); - if (RequestPermissionsActivity.startPermissionActivity(this)) { - return; - } - - setContentView(R.layout.pinned_header_list_demo); - - final TestPinnedHeaderListAdapter adapter = new TestPinnedHeaderListAdapter(this); - - Bundle extras = getIntent().getExtras(); - int[] counts = extras.getIntArray("counts"); - String[] names = extras.getStringArray("names"); - boolean[] showIfEmpty = extras.getBooleanArray("showIfEmpty"); - boolean[] hasHeader = extras.getBooleanArray("headers"); - int[] delays = extras.getIntArray("delays"); - - if (counts == null || names == null || showIfEmpty == null || delays == null) { - throw new IllegalArgumentException("Missing required extras"); - } - - adapter.setHeaders(names); - for (int i = 0; i < counts.length; i++) { - adapter.addPartition(showIfEmpty[i], names[i] != null); - adapter.mPinnedHeaderCount = names.length; - } - setListAdapter(adapter); - for (int i = 0; i < counts.length; i++) { - final int sectionId = i; - final Cursor cursor = makeCursor(names[i], counts[i]); - mHandler.postDelayed(new Runnable() { - - public void run() { - adapter.changeCursor(sectionId, cursor); - - } - }, delays[i]); - } - } - - private Cursor makeCursor(String name, int count) { - MatrixCursor cursor = new MatrixCursor(new String[]{"_id", name}); - for (int i = 0; i < count; i++) { - cursor.addRow(new Object[]{i, name + "[" + i + "]"}); - } - return cursor; - } -} diff --git a/tests/src/com/android/contacts/tests/widget/PinnedHeaderUseCaseActivity.java b/tests/src/com/android/contacts/tests/widget/PinnedHeaderUseCaseActivity.java deleted file mode 100644 index 46a1f4381..000000000 --- a/tests/src/com/android/contacts/tests/widget/PinnedHeaderUseCaseActivity.java +++ /dev/null @@ -1,90 +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.tests.widget; - -import android.app.ListActivity; -import android.content.ComponentName; -import android.content.Intent; -import android.os.Bundle; -import android.view.View; -import android.widget.ArrayAdapter; -import android.widget.ListView; - -import com.android.contacts.tests.R; -import com.android.contacts.common.list.PinnedHeaderListView; - -/** - * An activity that demonstrates various use cases for the {@link PinnedHeaderListView}. - */ -public class PinnedHeaderUseCaseActivity extends ListActivity { - - private static final int SINGLE_SHORT_SECTION_NO_HEADERS = 0; - private static final int TWO_SHORT_SECTIONS_WITH_HEADERS = 1; - private static final int FIVE_SHORT_SECTIONS_WITH_HEADERS = 2; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setListAdapter(new ArrayAdapter<String>(this, R.layout.intent_list_item, - getResources().getStringArray(R.array.pinnedHeaderUseCases))); - } - - @Override - protected void onListItemClick(ListView l, View v, int position, long id) { - switch (position) { - case SINGLE_SHORT_SECTION_NO_HEADERS: - startActivity( - new int[]{5}, - new String[]{"Line"}, - new boolean[]{false}, - new boolean[]{false}, - new int[]{0}); - break; - case TWO_SHORT_SECTIONS_WITH_HEADERS: - startActivity( - new int[]{2, 30}, - new String[]{"First", "Second"}, - new boolean[]{true, true}, - new boolean[]{false, false}, - new int[]{0, 2000}); - break; - case FIVE_SHORT_SECTIONS_WITH_HEADERS: - startActivity( - new int[]{1, 5, 5, 5, 5}, - new String[]{"First", "Second", "Third", "Fourth", "Fifth"}, - new boolean[]{true, true, true, true, true}, - new boolean[]{false, false, false, false, false}, - new int[]{0, 2000, 3000, 4000, 5000}); - break; - } - } - - private void startActivity(int[] counts, String[] names, boolean[] headers, - boolean[] showIfEmpty, int[] delays) { - Intent intent = new Intent(); - intent.setComponent(new ComponentName( - getResources().getString(R.string.target_package_name), - "com.android.contacts.widget.PinnedHeaderListDemoActivity")); - intent.putExtra("counts", counts); - intent.putExtra("names", names); - intent.putExtra("headers", headers); - intent.putExtra("showIfEmpty", showIfEmpty); - intent.putExtra("delays", delays); - - startActivity(intent); - } -} |