diff options
author | Doris Liu <tianliu@google.com> | 2013-05-03 11:44:45 -0700 |
---|---|---|
committer | Doris Liu <tianliu@google.com> | 2013-05-03 11:44:45 -0700 |
commit | d45258375a9356475377f6bdc7a504cd9acb937a (patch) | |
tree | 663e6e9c8f2a1a6c1a062f1f98fbf7308138c6db /src/com/android/camera/ui/CameraRootView.java | |
parent | cbefed61cf0a7f28afb1221e95ee80c14d190243 (diff) | |
download | android_packages_apps_Snap-d45258375a9356475377f6bdc7a504cd9acb937a.tar.gz android_packages_apps_Snap-d45258375a9356475377f6bdc7a504cd9acb937a.tar.bz2 android_packages_apps_Snap-d45258375a9356475377f6bdc7a504cd9acb937a.zip |
Fix NPE caused by insets never being set
Bug: 8804054
Change-Id: Ie0f2dec9681977621ba95650aa714b0733a30858
Diffstat (limited to 'src/com/android/camera/ui/CameraRootView.java')
-rw-r--r-- | src/com/android/camera/ui/CameraRootView.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/com/android/camera/ui/CameraRootView.java b/src/com/android/camera/ui/CameraRootView.java index 0cff14480..e49ac59a6 100644 --- a/src/com/android/camera/ui/CameraRootView.java +++ b/src/com/android/camera/ui/CameraRootView.java @@ -89,12 +89,14 @@ public class CameraRootView extends RelativeLayout { left += mOffset; break; } - if (mCurrentInsets.right > 0) { - // navigation bar on the right - right = right > 0 ? right : mCurrentInsets.right; - } else { - // navigation bar on the bottom - bottom = bottom > 0 ? bottom : mCurrentInsets.bottom; + if (mCurrentInsets != null) { + if (mCurrentInsets.right > 0) { + // navigation bar on the right + right = right > 0 ? right : mCurrentInsets.right; + } else { + // navigation bar on the bottom + bottom = bottom > 0 ? bottom : mCurrentInsets.bottom; + } } for (int i = 0; i < getChildCount(); i++) { View v = getChildAt(i); |