Anchor camera controls when flipping device

Also adjusted margins for camera root view to avoid covering undo bar

Bug: 8758513
Bug: 8714114
Change-Id: If27f55a40f95402923d59d162db0c7cc29eabba4
diff --git a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
index f6439f1..dde4c56 100644
--- a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
+++ b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
@@ -195,6 +195,9 @@
     public static final boolean HAS_MEDIA_MUXER =
                     Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR2;
 
+    public static final boolean HAS_DISPLAY_LISTENER =
+            Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1;
+
     public static int getIntFieldIfExists(Class<?> klass, String fieldName,
             Class<?> obj, int defaultVal) {
         try {