11 import org.xmlpull.v1.XmlPullParserException; |
11 import org.xmlpull.v1.XmlPullParserException; |
12 import org.xmlpull.v1.XmlPullParserFactory; |
12 import org.xmlpull.v1.XmlPullParserFactory; |
13 |
13 |
14 import android.graphics.Color; |
14 import android.graphics.Color; |
15 import android.os.Bundle; |
15 import android.os.Bundle; |
16 import android.support.v4.app.DialogFragment; |
|
17 import android.support.v4.app.Fragment; |
|
18 import android.support.v4.app.FragmentTransaction; |
|
19 import android.support.v4.app.ListFragment; |
16 import android.support.v4.app.ListFragment; |
20 import android.util.Log; |
17 import android.util.Log; |
21 import android.view.View; |
18 import android.view.View; |
22 import android.widget.AbsListView; |
19 import android.widget.AbsListView; |
23 import android.widget.AbsListView.OnScrollListener; |
20 import android.widget.AbsListView.OnScrollListener; |
101 } |
98 } |
102 return eventType; |
99 return eventType; |
103 } |
100 } |
104 |
101 |
105 public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) { |
102 public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) { |
|
103 DownloadPackage task = (DownloadPackage)arg0.getAdapter().getItem(position); |
|
104 /* |
106 FragmentTransaction ft = getFragmentManager().beginTransaction(); |
105 FragmentTransaction ft = getFragmentManager().beginTransaction(); |
107 Fragment prev = getFragmentManager().findFragmentByTag("dialog"); |
106 Fragment prev = getFragmentManager().findFragmentByTag("dialog"); |
108 |
107 |
109 //remove any old dialogs |
108 //remove any old dialogs |
110 if(prev != null) ft.remove(prev); |
109 if(prev != null) ft.remove(prev); |
111 ft.addToBackStack(null); |
110 ft.addToBackStack(null); |
112 |
111 |
113 //create a new dialog based on this task |
112 //create a new dialog based on this task |
114 DownloadPackage task = (DownloadPackage)arg0.getAdapter().getItem(position); |
113 |
115 DialogFragment newFragment = DownloadDialogFragment.newInstance(task); |
114 DialogFragment newFragment = DownloadDialogFragment.newInstance(task); |
116 |
115 |
117 //show it |
116 //show it |
118 //newFragment.show(ft, "dialog"); |
117 newFragment.show(ft, "dialog"); |
119 |
118 */ |
120 targetView = arg1; |
119 targetView = arg1; |
121 |
120 |
122 //determine state |
121 //determine state |
123 int min = arg0.getTop(); |
122 int min = arg0.getTop(); |
124 int max = arg0.getBottom(); |
123 int max = arg0.getBottom(); |