diff --git a/res/layout/event_list_row.xml b/res/layout/event_list_row.xml
index 93ba490..2e9d90a 100644
--- a/res/layout/event_list_row.xml
+++ b/res/layout/event_list_row.xml
@@ -6,23 +6,35 @@
android:paddingTop="3px"
android:paddingBottom="3px">
-
+ android:padding="5dp"
+ android:layout_marginRight="5dp" >
+
+
+
+
{
private final ViewGroup parent;
private final int position;
private final int imageId;
+ private int progressbarId = -1;
public ImageLoader(ViewGroup parent, int position, int imageId) {
this.parent = parent;
@@ -30,7 +32,7 @@ public class ImageLoader extends AsyncTask {
protected Drawable doInBackground(String... params) {
if (params.length > 1)
throw new InvalidParameterException("Too many arguments to the function!");
-
+
Drawable d = cache.get(params[0]);
if (d != null)
return d;
@@ -55,9 +57,18 @@ public class ImageLoader extends AsyncTask {
ViewGroup row = (ViewGroup)parent.getChildAt(position);
if (row != null) {
+ if (progressbarId > 0) {
+ View pb = row.findViewById(progressbarId);
+ pb.setVisibility(View.GONE);
+ }
ImageView image = (ImageView)row.findViewById(imageId);
image.setImageDrawable(result);
+ image.setVisibility(View.VISIBLE);
}
}
}
+
+ public void setProgressbar(int id) {
+ this.progressbarId = id;
+ }
}
diff --git a/src/com/studentersamfundet/app/ui/lists/EventListActivity.java b/src/com/studentersamfundet/app/ui/lists/EventListActivity.java
index ea7243a..371379d 100644
--- a/src/com/studentersamfundet/app/ui/lists/EventListActivity.java
+++ b/src/com/studentersamfundet/app/ui/lists/EventListActivity.java
@@ -96,6 +96,7 @@ public class EventListActivity extends BaseListActivity {
/* Set images: */
ImageLoader loader = new ImageLoader(parent, position, R.id.event_list_row_image);
+ loader.setProgressbar(R.id.event_list_row_image_pb);
loader.execute(e.getImageUri(imageSize).toString());