diff options
author | Vasu Nori <vnori@google.com> | 2011-03-03 20:01:31 -0800 |
---|---|---|
committer | Vasu Nori <vnori@google.com> | 2011-03-03 20:01:31 -0800 |
commit | 8cf72b84b15ad3887b00f16f02a79ea304469548 (patch) | |
tree | c1622f230edb196186aafa1bbd477b811ad157b1 /ui/src/com/android/providers/downloads | |
parent | 030862489796bda9645ec2282f556f732e720283 (diff) | |
download | android_packages_providers_DownloadProvider-8cf72b84b15ad3887b00f16f02a79ea304469548.tar.gz android_packages_providers_DownloadProvider-8cf72b84b15ad3887b00f16f02a79ea304469548.tar.bz2 android_packages_providers_DownloadProvider-8cf72b84b15ad3887b00f16f02a79ea304469548.zip |
bug:3510826 longpress, then shortpress behave differenctly in ExpandedListView
in ListView, the following is the behavior
assume setOnItemClickListener() is set on the ListView object.
longpress starts selection
shortpress thereafter selects the item and DOES NOT
call the callback set by setOnItemClickListener()
without preceding longpress, shortpress calls
the callback set by setOnItemClickListener()
in ExpandedListView,
assume setOnChildClickListener() is set
longpress starts selection, as in ListView
shortpress thereafter calls the callback set by setOnChildClickListener()
without preceding longpress, shortpress calls
the callback set by setOnChildClickListener()
as expected.
is this expected behavior in ExpandedListView. sounds like some sort
of bug in ExpandedListView handling.
if this is application bug, is this CL a valid fix?
Change-Id: I4e290b5dcaa263c9ea76ba7926a0131d296c86c2
Diffstat (limited to 'ui/src/com/android/providers/downloads')
-rw-r--r-- | ui/src/com/android/providers/downloads/ui/DownloadList.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/src/com/android/providers/downloads/ui/DownloadList.java b/ui/src/com/android/providers/downloads/ui/DownloadList.java index 978416c7..4c8c36bb 100644 --- a/ui/src/com/android/providers/downloads/ui/DownloadList.java +++ b/ui/src/com/android/providers/downloads/ui/DownloadList.java @@ -232,8 +232,16 @@ public class DownloadList extends Activity { @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { - mDateSortedAdapter.moveCursorToChildPosition(groupPosition, childPosition); - handleItemClick(mDateSortedCursor); + if (!(v instanceof DownloadItem)) { + // can this even happen? + return false; + } + if (mSelectedIds.size() > 0) { + ((DownloadItem)v).setChecked(true); + } else { + mDateSortedAdapter.moveCursorToChildPosition(groupPosition, childPosition); + handleItemClick(mDateSortedCursor); + } return true; } }); |