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