summaryrefslogtreecommitdiffstats
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
commitb477b42906a3f8b299ddaeede3940e6344fb6825 (patch)
tree3389c92076efc5ae1b404e6cf9022ed56189173d
parent7fef4963161ddc60472b6414be0b3d57744deb6b (diff)
downloadandroid_packages_apps_Snap-b477b42906a3f8b299ddaeede3940e6344fb6825.tar.gz
android_packages_apps_Snap-b477b42906a3f8b299ddaeede3940e6344fb6825.tar.bz2
android_packages_apps_Snap-b477b42906a3f8b299ddaeede3940e6344fb6825.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
-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) {