summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2013-07-09 09:30:32 -0700
committerAngus Kong <shkong@google.com>2013-07-09 09:31:55 -0700
commit891a318de969a197c4a49b60abcaa0603bbd9b77 (patch)
treef93396fd71dc08e66eb126b28fac44bb9e9410e4 /src
parent0c6bf51126220554a7aa416d3486ee9b8928540b (diff)
downloadandroid_packages_apps_Gallery2-891a318de969a197c4a49b60abcaa0603bbd9b77.tar.gz
android_packages_apps_Gallery2-891a318de969a197c4a49b60abcaa0603bbd9b77.tar.bz2
android_packages_apps_Gallery2-891a318de969a197c4a49b60abcaa0603bbd9b77.zip
Measure children after the dimension is determined.
Also, the setMeasuredDimension() in onMeasure() is not necessary as we already called super. bug:9680271 Change-Id: I639454e515edb3027c9e79347d2124a1fcaa529b
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/ui/FilmStripView.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java
index c1b677204..085cba57a 100644
--- a/src/com/android/camera/ui/FilmStripView.java
+++ b/src/com/android/camera/ui/FilmStripView.java
@@ -348,6 +348,11 @@ public class FilmStripView extends ViewGroup {
int boundWidth = MeasureSpec.getSize(widthMeasureSpec);
int boundHeight = MeasureSpec.getSize(heightMeasureSpec);
+ if (boundWidth == 0 || boundHeight == 0) {
+ // Either width or height is unknown, can't measure children yet.
+ return;
+ }
+
if (mDataAdapter != null) {
mDataAdapter.suggestDecodeSize(boundWidth / 2, boundHeight / 2);
}
@@ -368,7 +373,6 @@ public class FilmStripView extends ViewGroup {
View.MeasureSpec.makeMeasureSpec(
dim[1], View.MeasureSpec.EXACTLY));
}
- setMeasuredDimension(boundWidth, boundHeight);
}
private int findTheNearestView(int pointX) {