Merge branch 'hotfix/issue-76-XML-preview'

pull/1/head
Matt Fenlon 8 years ago
commit 058dec6b63
  1. 8
      camerakit/src/main/java/com/flurgle/camerakit/CameraView.java

@ -110,6 +110,7 @@ public class CameraView extends FrameLayout {
setPermissions(mPermissions);
setVideoQuality(mVideoQuality);
if(!isInEditMode()){
mDisplayOrientationDetector = new DisplayOrientationDetector(context) {
@Override
public void onDisplayOrientationChanged(int displayOrientation) {
@ -117,6 +118,7 @@ public class CameraView extends FrameLayout {
mPreviewImpl.setDisplayOrientation(displayOrientation);
}
};
}
final FocusMarkerLayout focusMarkerLayout = new FocusMarkerLayout(getContext());
addView(focusMarkerLayout);
@ -137,12 +139,16 @@ public class CameraView extends FrameLayout {
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
if(!isInEditMode()) {
mDisplayOrientationDetector.enable(
ViewCompat.isAttachedToWindow(this)
? DisplayManagerCompat.getInstance(getContext()).getDisplay(Display.DEFAULT_DISPLAY)
? DisplayManagerCompat.getInstance(getContext())
.getDisplay(Display.DEFAULT_DISPLAY)
: null
);
}
}
@Override
protected void onDetachedFromWindow() {

Loading…
Cancel
Save