summaryrefslogtreecommitdiffstats
path: root/src/com/android/contacts/common/list/ContactListItemView.java
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-05-30 15:31:57 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-30 15:31:57 +0000
commit62ad29abe26021ef82243289b8e140f5814645e7 (patch)
treef80a33972f9452df7ced978a315ef9674070a9aa /src/com/android/contacts/common/list/ContactListItemView.java
parent4e41b155a330155b22f601c87f4cd0ee96f7fe2f (diff)
parentf6141bd806446928038f97bedcbdc3b69b5f1e15 (diff)
downloadandroid_packages_apps_ContactsCommon-62ad29abe26021ef82243289b8e140f5814645e7.tar.gz
android_packages_apps_ContactsCommon-62ad29abe26021ef82243289b8e140f5814645e7.tar.bz2
android_packages_apps_ContactsCommon-62ad29abe26021ef82243289b8e140f5814645e7.zip
am f6141bd8: Merge "Updating contact list item for Dialer search redlines." into lmp-preview-dev
* commit 'f6141bd806446928038f97bedcbdc3b69b5f1e15': Updating contact list item for Dialer search redlines.
Diffstat (limited to 'src/com/android/contacts/common/list/ContactListItemView.java')
-rw-r--r--src/com/android/contacts/common/list/ContactListItemView.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/contacts/common/list/ContactListItemView.java b/src/com/android/contacts/common/list/ContactListItemView.java
index 94d7aa0b..fe98b2ce 100644
--- a/src/com/android/contacts/common/list/ContactListItemView.java
+++ b/src/com/android/contacts/common/list/ContactListItemView.java
@@ -86,6 +86,7 @@ public class ContactListItemView extends ViewGroup
private int mPresenceIconMargin = 4;
private int mPresenceIconSize = 16;
private int mTextIndent = 0;
+ private int mTextOffsetTop;
private int mNameTextViewTextSize;
private int mHeaderWidth;
private Drawable mActivatedBackgroundDrawable;
@@ -250,6 +251,8 @@ public class ContactListItemView extends ViewGroup
R.styleable.ContactListItemView_list_item_photo_size, mDefaultPhotoViewSize);
mTextIndent = a.getDimensionPixelOffset(
R.styleable.ContactListItemView_list_item_text_indent, mTextIndent);
+ mTextOffsetTop = a.getDimensionPixelOffset(
+ R.styleable.ContactListItemView_list_item_text_offset_top, mTextOffsetTop);
mDataViewWidthWeight = a.getInteger(
R.styleable.ContactListItemView_list_item_data_width_weight, mDataViewWidthWeight);
mLabelViewWidthWeight = a.getInteger(
@@ -523,10 +526,10 @@ public class ContactListItemView extends ViewGroup
leftBound += mTextIndent;
}
- // Center text vertically
+ // Center text vertically, then apply the top offset.
final int totalTextHeight = mNameTextViewHeight + mPhoneticNameTextViewHeight +
mLabelAndDataViewMaxHeight + mSnippetTextViewHeight + mStatusTextViewHeight;
- int textTopBound = (bottomBound + topBound - totalTextHeight) / 2;
+ int textTopBound = (bottomBound + topBound - totalTextHeight) / 2 + mTextOffsetTop;
// Layout all text view and presence icon
// Put name TextView first
@@ -850,6 +853,7 @@ public class ContactListItemView extends ViewGroup
mNameTextView.setGravity(Gravity.CENTER_VERTICAL);
mNameTextView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START);
mNameTextView.setId(R.id.cliv_name_textview);
+ mNameTextView.setElegantTextHeight(false);
addView(mNameTextView);
}
return mNameTextView;
@@ -1006,6 +1010,7 @@ public class ContactListItemView extends ViewGroup
mDataView.setTextAppearance(getContext(), R.style.TextAppearanceSmall);
mDataView.setActivated(isActivated());
mDataView.setId(R.id.cliv_data_view);
+ mDataView.setElegantTextHeight(false);
addView(mDataView);
}
return mDataView;