[Issue 2097049] Updating the header of contact join screen - new icon and text
Change-Id: Ib780fba650dad0e070eabce497dde3ffa75661f5
diff --git a/res/drawable-hdpi-finger/ic_join.png b/res/drawable-hdpi-finger/ic_join.png
new file mode 100644
index 0000000..8f140d4
--- /dev/null
+++ b/res/drawable-hdpi-finger/ic_join.png
Binary files differ
diff --git a/res/drawable-mdpi-finger/ic_join.png b/res/drawable-mdpi-finger/ic_join.png
new file mode 100644
index 0000000..177a582
--- /dev/null
+++ b/res/drawable-mdpi-finger/ic_join.png
Binary files differ
diff --git a/res/layout-finger/contacts_list_content_join.xml b/res/layout-finger/contacts_list_content_join.xml
index ce82d2c..95f9c20 100644
--- a/res/layout-finger/contacts_list_content_join.xml
+++ b/res/layout-finger/contacts_list_content_join.xml
@@ -25,14 +25,15 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@*android:drawable/title_bar_medium"
- android:padding="5dip"
+ android:paddingLeft="5dip"
+ android:paddingRight="5dip"
android:gravity="center_vertical"
>
<ImageView
android:layout_width="48dip"
android:layout_height="48dip"
- android:src="@drawable/ic_menu_merge"
+ android:src="@drawable/ic_join"
android:gravity="center"
android:scaleType="fitCenter"
/>
@@ -48,9 +49,11 @@
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<TextView
+ android:id="@+id/join_contact_blurb"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:text="@string/blurbJoinContactDataWith"
+ android:layout_marginTop="-2dip"
+ android:maxLines="2"
android:textAppearance="?android:attr/textAppearanceSmall"
/>
</LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6411578..da7bb88 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -142,8 +142,7 @@
<string name="titleJoinContactDataWith">Join contacts</string>
<!-- Info blurb on the Join Contact screen -->
- <string name="blurbJoinContactDataWith">Contact data will be combined with
- another contact selected from the list.</string>
+ <string name="blurbJoinContactDataWith">Select the contact you want to join with <xliff:g id="name">%s</xliff:g>.</string>
<!-- List separator for the Join Contact list: Suggestions -->
<string name="separatorJoinAggregateSuggestions">Suggestions</string>
diff --git a/src/com/android/contacts/ContactsListActivity.java b/src/com/android/contacts/ContactsListActivity.java
index 1c30ebb..aa6654d 100644
--- a/src/com/android/contacts/ContactsListActivity.java
+++ b/src/com/android/contacts/ContactsListActivity.java
@@ -160,6 +160,14 @@
*/
public static final String EXTRA_AGGREGATE_ID =
"com.android.contacts.action.AGGREGATE_ID";
+ /**
+ * Used with {@link #JOIN_AGGREGATE} to give it the name of the aggregation target.
+ * <p>
+ * Type: STRING
+ */
+ public static final String EXTRA_AGGREGATE_NAME =
+ "com.android.contacts.action.AGGREGATE_NAME";
+
public static final String AUTHORITIES_FILTER_KEY = "authorities";
@@ -550,6 +558,15 @@
if (mMode == MODE_JOIN_CONTACT) {
setContentView(R.layout.contacts_list_content_join);
+ TextView blurbView = (TextView)findViewById(R.id.join_contact_blurb);
+ String contactName = intent.getStringExtra(EXTRA_AGGREGATE_NAME);
+ if (contactName == null) {
+ contactName = "";
+ }
+
+ String blurb = getString(R.string.blurbJoinContactDataWith, contactName);
+ blurbView.setText(blurb);
+
} else {
setContentView(R.layout.contacts_list_content);
}
diff --git a/src/com/android/contacts/ViewContactActivity.java b/src/com/android/contacts/ViewContactActivity.java
index c27262d..8172423 100644
--- a/src/com/android/contacts/ViewContactActivity.java
+++ b/src/com/android/contacts/ViewContactActivity.java
@@ -763,8 +763,15 @@
* Shows a list of aggregates that can be joined into the currently viewed aggregate.
*/
public void showJoinAggregateActivity() {
+ String displayName = null;
+ if (mCursor.moveToFirst()) {
+ displayName = mCursor.getString(0);
+ }
Intent intent = new Intent(ContactsListActivity.JOIN_AGGREGATE);
intent.putExtra(ContactsListActivity.EXTRA_AGGREGATE_ID, ContentUris.parseId(mUri));
+ if (displayName != null) {
+ intent.putExtra(ContactsListActivity.EXTRA_AGGREGATE_NAME, displayName);
+ }
startActivityForResult(intent, REQUEST_JOIN_CONTACT);
}