summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/category/CategoryTrack.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/filtershow/category/CategoryTrack.java')
-rw-r--r--src/com/android/gallery3d/filtershow/category/CategoryTrack.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/category/CategoryTrack.java b/src/com/android/gallery3d/filtershow/category/CategoryTrack.java
index e0a8a2fab..f55431293 100644
--- a/src/com/android/gallery3d/filtershow/category/CategoryTrack.java
+++ b/src/com/android/gallery3d/filtershow/category/CategoryTrack.java
@@ -18,7 +18,9 @@ package com.android.gallery3d.filtershow.category;
import android.content.Context;
import android.content.res.TypedArray;
+import android.database.DataSetObserver;
import android.util.AttributeSet;
+import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import com.android.gallery3d.R;
@@ -27,6 +29,13 @@ public class CategoryTrack extends LinearLayout {
private CategoryAdapter mAdapter;
private int mElemSize;
+ private DataSetObserver mDataSetObserver = new DataSetObserver() {
+ @Override
+ public void onChanged() {
+ super.onChanged();
+ invalidate();
+ }
+ };
public CategoryTrack(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -38,6 +47,7 @@ public class CategoryTrack extends LinearLayout {
mAdapter = adapter;
mAdapter.setItemWidth(mElemSize);
mAdapter.setItemHeight(LayoutParams.MATCH_PARENT);
+ mAdapter.registerDataSetObserver(mDataSetObserver);
fillContent();
}
@@ -51,4 +61,12 @@ public class CategoryTrack extends LinearLayout {
requestLayout();
}
+ @Override
+ public void invalidate() {
+ for (int i = 0; i < this.getChildCount(); i++) {
+ View child = getChildAt(i);
+ child.invalidate();
+ }
+ }
+
}