From 42b987b7f0513c4a5df9f7c7083aba8936f2c845 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Thu, 22 Jan 2009 00:13:44 -0800 Subject: [PATCH] auto import from //branches/cupcake/...@127436 --- res/layout-finger/edit_contact.xml | 31 +----------- res/layout-finger/edit_phonetic_name.xml | 62 +++++++++++++++++++++++ res/layout-finger/view_contact.xml | 10 +--- res/layout-finger/view_contact_name.xml | 26 ++++++++++ res/layout-ja-finger/edit_phonetic_name.xml | 46 +++++++++++++++++ res/layout-ja-finger/view_contact_name.xml | 41 +++++++++++++++ res/values-cs/strings.xml | 16 +++++- res/values-de/strings.xml | 16 +++++- res/values-es/strings.xml | 16 +++++- res/values-fr/strings.xml | 16 +++++- res/values-it/strings.xml | 16 +++++- res/values-ja/strings.xml | 16 +++++- res/values-nl/strings.xml | 16 +++++- res/values-pl/strings.xml | 16 +++++- res/values-ru/strings.xml | 16 +++++- res/values-zh-rCN/strings.xml | 16 +++++- res/values-zh-rTW/strings.xml | 16 +++++- src/com/android/contacts/EditContactActivity.java | 15 +----- src/com/android/contacts/ViewContactActivity.java | 12 +++-- 19 files changed, 343 insertions(+), 76 deletions(-) create mode 100644 res/layout-finger/edit_phonetic_name.xml create mode 100644 res/layout-finger/view_contact_name.xml create mode 100644 res/layout-ja-finger/edit_phonetic_name.xml create mode 100644 res/layout-ja-finger/view_contact_name.xml diff --git a/res/layout-finger/edit_contact.xml b/res/layout-finger/edit_contact.xml index f2f8e38..027af9a 100644 --- a/res/layout-finger/edit_contact.xml +++ b/res/layout-finger/edit_contact.xml @@ -77,35 +77,8 @@ /> - - - - + + + + + + + + + diff --git a/res/layout-finger/view_contact.xml b/res/layout-finger/view_contact.xml index 23393a4..e02e143 100644 --- a/res/layout-finger/view_contact.xml +++ b/res/layout-finger/view_contact.xml @@ -38,14 +38,8 @@ android:background="@drawable/border" /> - + + + + + + diff --git a/res/layout-ja-finger/edit_phonetic_name.xml b/res/layout-ja-finger/edit_phonetic_name.xml new file mode 100644 index 0000000..41a4059 --- /dev/null +++ b/res/layout-ja-finger/edit_phonetic_name.xml @@ -0,0 +1,46 @@ + + + + + + + + diff --git a/res/layout-ja-finger/view_contact_name.xml b/res/layout-ja-finger/view_contact_name.xml new file mode 100644 index 0000000..bd72bba --- /dev/null +++ b/res/layout-ja-finger/view_contact_name.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index 99c99e4..d299e7f 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -1,8 +1,20 @@ + - - "Kontakty" "Kontakt" "Označené hvězdičkou" diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index cf419a2..f004268 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -1,8 +1,20 @@ + - - "Kontakte" "Kontakt" "Markiert" diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index 6125ac1..9251140 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -1,8 +1,20 @@ + - - "Contactos" "Contacto" "Destacados" diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index b8b088b..88285b0 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -1,8 +1,20 @@ + - - "Contacts" "Contact" "Marqués d\'une étoile" diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index c54631d..2b16d13 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -1,8 +1,20 @@ + - - "Contatti" "Contatto" "Speciali" diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml index 0c65789..18a280e 100644 --- a/res/values-ja/strings.xml +++ b/res/values-ja/strings.xml @@ -1,8 +1,20 @@ + - - "連絡先" "連絡先" "スター付き" diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index 21c97f5..041c8c9 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -1,8 +1,20 @@ + - - "Contactpersonen" "Contactpersonen" "Met ster" diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index 71422cc..5917a28 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -1,8 +1,20 @@ + - - "Kontakty" "Kontakt" "Oznaczony gwiazdką" diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index fec3012..b45528b 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -1,8 +1,20 @@ + - - "Контакты" "Контакт" "Помеченные" diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 05dfe31..c787c16 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -1,8 +1,20 @@ + - - "联系人" "联系人" "已加星标" diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml index d5fd578..c3f55e9 100644 --- a/res/values-zh-rTW/strings.xml +++ b/res/values-zh-rTW/strings.xml @@ -1,8 +1,20 @@ + - - "連絡人" "連絡人" "已標記星號" diff --git a/src/com/android/contacts/EditContactActivity.java b/src/com/android/contacts/EditContactActivity.java index cdf2cef..fb8dd70 100644 --- a/src/com/android/contacts/EditContactActivity.java +++ b/src/com/android/contacts/EditContactActivity.java @@ -105,7 +105,6 @@ import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import java.util.Locale; import java.util.Map; /** @@ -177,8 +176,7 @@ public final class EditContactActivity extends Activity implements View.OnClickL private LayoutInflater mInflater; private MenuItem mPhotoMenuItem; private boolean mPhotoPresent = false; - private EditText mPhoneticNameView; - private LinearLayout mPhoneticNameLayout; + private EditText mPhoneticNameView; // invisible in some locales, but always present /** Flag marking this contact as changed, meaning we should write changes back. */ private boolean mContactChanged = false; @@ -319,17 +317,6 @@ public final class EditContactActivity extends Activity implements View.OnClickL mPhotoButton.setOnClickListener(this); mSendToVoicemailCheckBox = (CheckBox) findViewById(R.id.send_to_voicemail); mPhoneticNameView = (EditText) findViewById(R.id.phonetic_name); - mPhoneticNameLayout = (LinearLayout) findViewById(R.id.phonetic_name_layout); - - // Setup phonetic name field. mPhoneticNameLayout is GONE by default. - // TODO: Don't do this here in Java; instead do it purely using - // resources, by having mPhoneticNameLayout come from an XML - // file that contains the real UI in layout-ja, but is - // empty in layout-finger... - String language = Locale.getDefault().getLanguage(); - if (language != null && language.equals("ja")) { - mPhoneticNameLayout.setVisibility(View.VISIBLE); - } // Setup the bottom buttons View view = findViewById(R.id.addMore); diff --git a/src/com/android/contacts/ViewContactActivity.java b/src/com/android/contacts/ViewContactActivity.java index 9a11f76..4690b12 100644 --- a/src/com/android/contacts/ViewContactActivity.java +++ b/src/com/android/contacts/ViewContactActivity.java @@ -19,6 +19,7 @@ package com.android.contacts; import static com.android.contacts.ContactEntryAdapter.CONTACT_CUSTOM_RINGTONE_COLUMN; import static com.android.contacts.ContactEntryAdapter.CONTACT_NAME_COLUMN; import static com.android.contacts.ContactEntryAdapter.CONTACT_NOTES_COLUMN; +import static com.android.contacts.ContactEntryAdapter.CONTACT_PHONETIC_NAME_COLUMN; import static com.android.contacts.ContactEntryAdapter.CONTACT_PROJECTION; import static com.android.contacts.ContactEntryAdapter.CONTACT_SEND_TO_VOICEMAIL_COLUMN; import static com.android.contacts.ContactEntryAdapter.CONTACT_STARRED_COLUMN; @@ -182,6 +183,7 @@ public class ViewContactActivity extends ListActivity } private TextView mNameView; + private TextView mPhoneticNameView; // may be null in some locales private ImageView mPhotoView; private int mNoPhotoResource; private CheckBox mStarView; @@ -195,6 +197,7 @@ public class ViewContactActivity extends ListActivity getListView().setOnCreateContextMenuListener(this); mNameView = (TextView) findViewById(R.id.name); + mPhoneticNameView = (TextView) findViewById(R.id.phonetic_name); mPhotoView = (ImageView) findViewById(R.id.photo); mStarView = (CheckBox) findViewById(R.id.star); mStarView.setOnClickListener(this); @@ -280,7 +283,7 @@ public class ViewContactActivity extends ListActivity } return null; } - + private void dataChanged() { mCursor.requery(); if (mCursor.moveToFirst()) { @@ -292,6 +295,11 @@ public class ViewContactActivity extends ListActivity mNameView.setText(name); } + if (mPhoneticNameView != null) { + String phoneticName = mCursor.getString(CONTACT_PHONETIC_NAME_COLUMN); + mPhoneticNameView.setText(phoneticName); + } + // Load the photo mPhotoView.setImageBitmap(People.loadContactPhoto(this, mUri, mNoPhotoResource, null /* use the default options */)); @@ -1029,5 +1037,3 @@ public class ViewContactActivity extends ListActivity } } } - - -- 2.11.0