diff options
author | Yorke Lee <yorkelee@google.com> | 2013-07-23 16:53:36 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2013-07-23 18:25:34 -0700 |
commit | 481994f4962ec937ba8775578c2bb9d76141fd7f (patch) | |
tree | bc4ee7da87d8ad0d30f852e7678074cda13d9756 /src | |
parent | f2dc8a2704486eb031cfa5014d0626e96f5d5a43 (diff) |
Redlines for call history screen, as well as most recent call log
* Add and change background and layout for CallLogListItem
* Create wrapper view for most recent call log item
* Change actionbar background in Call History activity
* Hide phone number in call log items
* Add tab indicator drawables
Change-Id: Ic86c3fac857971aba58ba3ac1d79ddebaf663da6
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/PhoneCallDetailsHelper.java | 14 | ||||
-rw-r--r-- | src/com/android/dialer/list/NewPhoneFavoriteMergedAdapter.java | 34 |
2 files changed, 42 insertions, 6 deletions
diff --git a/src/com/android/dialer/PhoneCallDetailsHelper.java b/src/com/android/dialer/PhoneCallDetailsHelper.java index 37394c30f..0da0d0c39 100644 --- a/src/com/android/dialer/PhoneCallDetailsHelper.java +++ b/src/com/android/dialer/PhoneCallDetailsHelper.java @@ -115,19 +115,25 @@ public class PhoneCallDetailsHelper { } else { numberText = details.geocode; } - labelText = null; + labelText = numberText; // We have a real phone number as "nameView" so make it always LTR views.nameView.setTextDirection(View.TEXT_DIRECTION_LTR); } else { nameText = details.name; numberText = displayNumber; - labelText = numberFormattedLabel; + labelText = TextUtils.isEmpty(numberFormattedLabel) ? numberText : + numberFormattedLabel; // We have a real phone number as "numberView" so make it always LTR - views.numberView.setTextDirection(View.TEXT_DIRECTION_LTR); + if (views.numberView != null) { + views.numberView.setTextDirection(View.TEXT_DIRECTION_LTR); + } } views.nameView.setText(nameText); - views.numberView.setText(numberText); + if (views.numberView != null) { + views.numberView.setText(numberText); + } + views.labelView.setText(labelText); views.labelView.setVisibility(TextUtils.isEmpty(labelText) ? View.GONE : View.VISIBLE); } diff --git a/src/com/android/dialer/list/NewPhoneFavoriteMergedAdapter.java b/src/com/android/dialer/list/NewPhoneFavoriteMergedAdapter.java index fff5c9f7c..742892b61 100644 --- a/src/com/android/dialer/list/NewPhoneFavoriteMergedAdapter.java +++ b/src/com/android/dialer/list/NewPhoneFavoriteMergedAdapter.java @@ -23,6 +23,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.FrameLayout; +import android.widget.LinearLayout; import android.widget.SectionIndexer; import com.android.contacts.common.list.ContactEntryListAdapter; @@ -60,6 +61,9 @@ public class NewPhoneFavoriteMergedAdapter extends BaseAdapter implements Sectio private final int mItemPaddingLeft; private final int mItemPaddingRight; + private final int mCallLogPadding; + + private final Context mContext; private final DataSetObserver mObserver; @@ -70,8 +74,10 @@ public class NewPhoneFavoriteMergedAdapter extends BaseAdapter implements Sectio NewCallLogAdapter callLogAdapter, View loadingView) { final Resources resources = context.getResources(); + mContext = context; mItemPaddingLeft = resources.getDimensionPixelSize(R.dimen.detail_item_side_margin); mItemPaddingRight = resources.getDimensionPixelSize(R.dimen.list_visible_scrollbar_padding); + mCallLogPadding = resources.getDimensionPixelSize(R.dimen.recent_call_log_item_padding); mContactTileAdapter = contactTileAdapter; mContactEntryListAdapter = contactEntryListAdapter; mCallLogAdapter = callLogAdapter; @@ -237,8 +243,32 @@ public class NewPhoneFavoriteMergedAdapter extends BaseAdapter implements Sectio // TODO krelease: Handle the new callLogAdapterCount and position offsets properly if (callLogAdapterCount > 0) { if (position == 0) { - final View view = mCallLogAdapter.getView(position, convertView, parent); - return view; + final FrameLayout wrapper; + if (convertView == null) { + wrapper = new FrameLayout(mContext); + } else { + wrapper = (FrameLayout) convertView; + } + + // Special case wrapper view for the most recent call log item. This allows + // us to create a card-like effect for the more recent call log item in + // the PhoneFavoriteMergedAdapter, but keep the original look of the item in + // the CallLogAdapter. + final View view = mCallLogAdapter.getView(position, convertView == null ? + null : wrapper.getChildAt(0), parent); + wrapper.removeAllViews(); + view.setBackgroundResource(R.drawable.dialer_recent_card_bg); + + final FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( + FrameLayout.LayoutParams.WRAP_CONTENT, + FrameLayout.LayoutParams.WRAP_CONTENT); + + params.setMarginsRelative(mCallLogPadding, mCallLogPadding, mCallLogPadding, + mCallLogPadding); + view.setLayoutParams(params); + wrapper.addView(view); + + return wrapper; } position -= callLogAdapterCount; } |