OSDN Git Service

Added source label name to account name hsection.
authorTadashi G. Takaoka <takaoka@google.com>
Tue, 29 Sep 2009 23:04:08 +0000 (16:04 -0700)
committerTadashi G. Takaoka <takaoka@google.com>
Wed, 30 Sep 2009 00:35:22 +0000 (17:35 -0700)
Internal Bug: 2154925

res/drawable-hdpi/bg_infobar_new.9.png [new file with mode: 0644]
res/drawable-mdpi/bg_infobar_new.9.png [new file with mode: 0644]
res/layout-finger/tab_account_name.xml
res/values/strings.xml
src/com/android/contacts/ViewContactActivity.java
src/com/android/contacts/ui/EditContactActivity.java

diff --git a/res/drawable-hdpi/bg_infobar_new.9.png b/res/drawable-hdpi/bg_infobar_new.9.png
new file mode 100644 (file)
index 0000000..104ced9
Binary files /dev/null and b/res/drawable-hdpi/bg_infobar_new.9.png differ
diff --git a/res/drawable-mdpi/bg_infobar_new.9.png b/res/drawable-mdpi/bg_infobar_new.9.png
new file mode 100644 (file)
index 0000000..f3a83d4
Binary files /dev/null and b/res/drawable-mdpi/bg_infobar_new.9.png differ
index c9e1745..dc99af1 100644 (file)
@@ -17,7 +17,7 @@
 <!-- looks like Widget.TextView.ListSeparator -->
 <TextView  xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/account_name"
-    android:background="@drawable/section_dark"
+    android:background="@drawable/bg_infobar_new"
     android:layout_width="fill_parent"
     android:layout_height="@dimen/account_name_height"
     android:layout_below="@+id/tab_scroll_view"
index 35c0bf8..6411578 100644 (file)
     <string name="split_explanation">Make this data its own contact.</string>
     
     <!-- Formatting string for account name -->
-    <string name="account_name_format">From account: <xliff:g id="account" example="user@gmail.com">%s</xliff:g></string>
+    <string name="account_name_format">From <xliff:g id="source" example="Gmail">%1$s</xliff:g> account: <xliff:g id="account" example="user@gmail.com">%2$s</xliff:g></string>
 
 </resources>
index a0f7061..c27262d 100644 (file)
@@ -947,8 +947,11 @@ public class ViewContactActivity extends Activity
                     continue;
                 }
 
+                final ContactsSource source = sources.getInflatedSource(accountType,
+                        ContactsSource.LEVEL_SUMMARY);
                 final String accountName = entValues.getAsString(RawContacts.ACCOUNT_NAME);
-                mAccountName.setText(getString(R.string.account_name_format, accountName));
+                mAccountName.setText(getString(R.string.account_name_format,
+                        source.getDisplayLabel(this), accountName));
 
                 for (NamedContentValues subValue : entity.getSubValues()) {
                     ViewEntry entry = new ViewEntry();
index 9290b96..450f4a9 100644 (file)
@@ -402,7 +402,9 @@ public final class EditContactActivity extends Activity implements View.OnClickL
         final ContactsSource source = sources.getInflatedSource(accountType,
                 ContactsSource.LEVEL_CONSTRAINTS);
 
-        mAccountName.setText(getString(R.string.account_name_format, accountName));
+        mAccountName.setText(getString(R.string.account_name_format,
+                source.getDisplayLabel(this), accountName));
+        mAccountName.setVisibility(View.VISIBLE);
 
         // Assign editor state based on entity and source
         mEditor.setState(entity, source);