summaryrefslogtreecommitdiff
path: root/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2015-09-30 18:24:48 -0700
committerAndrew Lee <anwlee@google.com>2015-10-02 17:06:02 -0700
commit7b127d43de0de29c27a9db19f0a7e792ac678c05 (patch)
tree56f130e190ef4f99ef23aa85cad041ea1fe388a0 /src/com/android/dialer/calllog/CallDetailHistoryAdapter.java
parentea0742761c5511a713b43af16d4abd1a9059dcd8 (diff)
Prepatory CallDetailActivity tweaks.
Incremental CL in changing actions/layout of CallDetailActivity to move actions such as Block/Edit/Copy out of the overflow menu. + Make header at top of Call Detail Activity smaller. + Move delete options into actionbar button. - Delete call list header in CallDetailActivity. Bug: 24109819 Change-Id: If75f016e14de9e2c5ac8629c4bfa38e2380ce48b
Diffstat (limited to 'src/com/android/dialer/calllog/CallDetailHistoryAdapter.java')
-rw-r--r--src/com/android/dialer/calllog/CallDetailHistoryAdapter.java28
1 files changed, 5 insertions, 23 deletions
diff --git a/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java b/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java
index 3b488a8ae..ac56332ce 100644
--- a/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java
+++ b/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java
@@ -38,8 +38,6 @@ import java.util.ArrayList;
* Adapter for a ListView containing history items from the details of a call.
*/
public class CallDetailHistoryAdapter extends BaseAdapter {
- /** The top element is a blank header, which is hidden under the rest of the UI. */
- private static final int VIEW_TYPE_HEADER = 0;
/** Each history item shows the detail of a call. */
private static final int VIEW_TYPE_HISTORY_ITEM = 1;
@@ -69,53 +67,37 @@ public class CallDetailHistoryAdapter extends BaseAdapter {
@Override
public int getCount() {
- return mPhoneCallDetails.length + 1;
+ return mPhoneCallDetails.length;
}
@Override
public Object getItem(int position) {
- if (position == 0) {
- return null;
- }
- return mPhoneCallDetails[position - 1];
+ return mPhoneCallDetails[position];
}
@Override
public long getItemId(int position) {
- if (position == 0) {
- return -1;
- }
- return position - 1;
+ return position;
}
@Override
public int getViewTypeCount() {
- return 2;
+ return 1;
}
@Override
public int getItemViewType(int position) {
- if (position == 0) {
- return VIEW_TYPE_HEADER;
- }
return VIEW_TYPE_HISTORY_ITEM;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
- if (position == 0) {
- final View header = convertView == null
- ? mLayoutInflater.inflate(R.layout.call_detail_history_header, parent, false)
- : convertView;
- return header;
- }
-
// Make sure we have a valid convertView to start with
final View result = convertView == null
? mLayoutInflater.inflate(R.layout.call_detail_history_item, parent, false)
: convertView;
- PhoneCallDetails details = mPhoneCallDetails[position - 1];
+ PhoneCallDetails details = mPhoneCallDetails[position];
CallTypeIconsView callTypeIconView =
(CallTypeIconsView) result.findViewById(R.id.call_type_icon);
TextView callTypeTextView = (TextView) result.findViewById(R.id.call_type_text);