summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2013-05-03 11:44:45 -0700
committerDoris Liu <tianliu@google.com>2013-05-03 11:44:45 -0700
commitcd0fb7af20f855e1190122467c5650e46bfe820c (patch)
treed519ffecaad0992395739ffcc116cb685a91b050 /src
parent4b9dea3a1496271b73a7b5a4f62ad3bb3b5cdadc (diff)
downloadandroid_packages_apps_Gallery2-cd0fb7af20f855e1190122467c5650e46bfe820c.tar.gz
android_packages_apps_Gallery2-cd0fb7af20f855e1190122467c5650e46bfe820c.tar.bz2
android_packages_apps_Gallery2-cd0fb7af20f855e1190122467c5650e46bfe820c.zip
Fix NPE caused by insets never being set
Bug: 8804054 Change-Id: Ie0f2dec9681977621ba95650aa714b0733a30858
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/ui/CameraRootView.java14
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);