summaryrefslogtreecommitdiff
path: root/src/com/android/dialer/calllog/CallLogFragment.java
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2014-05-21 11:51:38 -0700
committerTyler Gunn <tgunn@google.com>2014-05-21 11:51:38 -0700
commit8ef8020b8b792026a8dd15e029055f7d5e2d48f6 (patch)
treec2a324522560f10633cc75cbb14011eb00be00f9 /src/com/android/dialer/calllog/CallLogFragment.java
parente35c31a77186f096be65538c7e8e0f6a69086f17 (diff)
Changing expand/collapse so that only a single row is expanded at once.
Bug: 13962594 Change-Id: I2a553e65b447d4b944e20ee420da3a726ec30aeb
Diffstat (limited to 'src/com/android/dialer/calllog/CallLogFragment.java')
-rw-r--r--src/com/android/dialer/calllog/CallLogFragment.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java
index 6caa25cf3..cc22a752b 100644
--- a/src/com/android/dialer/calllog/CallLogFragment.java
+++ b/src/com/android/dialer/calllog/CallLogFragment.java
@@ -617,4 +617,30 @@ public class CallLogFragment extends ListFragment
}
});
}
+
+ /**
+ * Determines whether a call log entry with a given ID is currently visible in the list view.
+ *
+ * @param callId The call ID to check.
+ * @return True if the call log entry with the given ID is visible.
+ */
+ @Override
+ public boolean isItemVisible(long callId) {
+ ListView listView = getListView();
+
+ int firstPosition = listView.getFirstVisiblePosition();
+ int lastPosition = listView.getLastVisiblePosition();
+
+ for (int position = 0; position <= lastPosition - firstPosition; position++) {
+ View view = listView.getChildAt(position);
+
+ if (view != null) {
+ final CallLogListItemViews viewHolder = (CallLogListItemViews) view.getTag();
+ if (viewHolder != null && viewHolder.rowId == callId) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
}