summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorc_yiwng <xiyang@codeaurora.org>2016-02-25 14:17:56 +0800
committerLinux Build Service Account <lnxbuild@localhost>2016-08-24 08:07:21 -0600
commitb1054b1c66efe7258f112411140f173a572f90d8 (patch)
treebac5ebd42f83ae6ebd453d90b64d1995f6d96305
parenta08b86d43110dd3dc4cd41e8f34cb551e45e1f54 (diff)
downloadpackages_apps_Contacts-b1054b1c66efe7258f112411140f173a572f90d8.tar.gz
packages_apps_Contacts-b1054b1c66efe7258f112411140f173a572f90d8.tar.bz2
packages_apps_Contacts-b1054b1c66efe7258f112411140f173a572f90d8.zip
Feature: The home location will display in contacts information.
-Add home location in contacts information. Change-Id: Idff23d62146524197e89a1f2cf721d24f65214e3 CRs-Fixed: 1040888
-rw-r--r--res/layout/expanding_entry_card_item.xml19
-rwxr-xr-x[-rw-r--r--]src/com/android/contacts/quickcontact/ExpandingEntryCardView.java11
2 files changed, 24 insertions, 6 deletions
diff --git a/res/layout/expanding_entry_card_item.xml b/res/layout/expanding_entry_card_item.xml
index 7c7337ebc..8adc96841 100644
--- a/res/layout/expanding_entry_card_item.xml
+++ b/res/layout/expanding_entry_card_item.xml
@@ -67,15 +67,26 @@
android:layout_marginEnd="@dimen/expanding_entry_card_item_sub_header_icon_margin_right"
android:layout_marginBottom="@dimen/expanding_entry_card_item_sub_header_icon_margin_bottom" />
- <TextView
- android:layout_width="wrap_content"
+ <LinearLayout
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:id="@+id/text"
+ android:orientation="horizontal"
android:layout_below="@+id/sub_header"
android:layout_toEndOf="@+id/icon_text"
android:layout_toStartOf="@+id/icon_alternate"
android:textAlignment="viewStart"
- android:textColor="@color/quickcontact_entry_sub_header_text_color" />
+ android:textColor="@color/quickcontact_entry_sub_header_text_color">
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/text"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingLeft="16dp"
+ android:id="@+id/home"/>
+ </LinearLayout>
<ImageView
android:layout_width="wrap_content"
diff --git a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
index 762ff6c83..10361263d 100644..100755
--- a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
+++ b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
@@ -52,6 +52,9 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import com.android.contacts.R;
+import com.android.contacts.common.CallUtil;
+import com.android.contacts.common.GeoUtil;
+import com.android.contacts.common.MoreContactUtils;
import com.android.contacts.common.dialog.CallSubjectDialog;
import java.util.ArrayList;
@@ -699,9 +702,13 @@ public class ExpandingEntryCardView extends CardView {
if (entry.getIcon() != null) {
icon.setImageDrawable(entry.getIcon());
}
+
+ final TextView home = (TextView) view.findViewById(R.id.home);
final TextView header = (TextView) view.findViewById(R.id.header);
- if (!TextUtils.isEmpty(entry.getHeader())) {
- header.setText(entry.getHeader());
+ String num = entry.getHeader();
+ if (!TextUtils.isEmpty(num)) {
+ header.setText(num);
+ home.setText(GeoUtil.getGeocodedLocationFor(getContext(), num));
} else {
header.setVisibility(View.GONE);
}