summaryrefslogtreecommitdiffstats
path: root/ui/src/com/android/providers/downloads/ui/DateSortedDownloadAdapter.java
diff options
context:
space:
mode:
authorVasu Nori <vnori@google.com>2011-03-09 10:43:28 -0800
committerVasu Nori <vnori@google.com>2011-03-09 15:32:11 -0800
commit81101942f55ae76824d244ef0cbf579fb84922fe (patch)
tree3dbba4c283be8304e6cb8e94ea0caad1115f3304 /ui/src/com/android/providers/downloads/ui/DateSortedDownloadAdapter.java
parent58b8f6709503c70f30497a38fd10b6e2b12bf808 (diff)
downloadandroid_packages_providers_DownloadProvider-81101942f55ae76824d244ef0cbf579fb84922fe.tar.gz
android_packages_providers_DownloadProvider-81101942f55ae76824d244ef0cbf579fb84922fe.tar.bz2
android_packages_providers_DownloadProvider-81101942f55ae76824d244ef0cbf579fb84922fe.zip
multiple bug fixes when handling ExpandableListView
bug:3511180 can't select items from non-adjacent groups bug:3510769 Long-pressing on section headers causes strange behavior bug:4065226 Downloads list switch sorting button has wrong width Change-Id: If7dd36078224766555f1d2cf18ec364812dcdeb9
Diffstat (limited to 'ui/src/com/android/providers/downloads/ui/DateSortedDownloadAdapter.java')
-rw-r--r--ui/src/com/android/providers/downloads/ui/DateSortedDownloadAdapter.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/src/com/android/providers/downloads/ui/DateSortedDownloadAdapter.java b/ui/src/com/android/providers/downloads/ui/DateSortedDownloadAdapter.java
index 8e93eab6..b69fb8b8 100644
--- a/ui/src/com/android/providers/downloads/ui/DateSortedDownloadAdapter.java
+++ b/ui/src/com/android/providers/downloads/ui/DateSortedDownloadAdapter.java
@@ -21,6 +21,7 @@ import android.app.DownloadManager;
import android.database.Cursor;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ExpandableListView;
import android.widget.RelativeLayout;
/**
@@ -28,12 +29,14 @@ import android.widget.RelativeLayout;
* {@link DownloadAdapter}.
*/
public class DateSortedDownloadAdapter extends DateSortedExpandableListAdapter {
- private DownloadAdapter mDelegate;
+ private final DownloadAdapter mDelegate;
+ private final DownloadList mDownloadList;
public DateSortedDownloadAdapter(DownloadList downloadList, Cursor cursor) {
super(downloadList, cursor,
cursor.getColumnIndexOrThrow(DownloadManager.COLUMN_LAST_MODIFIED_TIMESTAMP));
mDelegate = new DownloadAdapter(downloadList, cursor);
+ mDownloadList = downloadList;
}
@Override
@@ -49,7 +52,8 @@ public class DateSortedDownloadAdapter extends DateSortedExpandableListAdapter {
return convertView;
}
- int pos = getAbsolutePositionForGroupAndChildPositions(groupPosition, childPosition);
+ int pos = mDownloadList.getExpandableListView().getFlatListPosition(
+ ExpandableListView.getPackedPositionForChild(groupPosition, childPosition));
mDelegate.bindView(convertView, pos);
return convertView;
}