Commit 55817cd7 by Daniel Dahan

minor updates to BasicCaptureView

parent 6802a94d
...@@ -57,7 +57,7 @@ public class BasicCaptureView : MaterialView, CaptureSessionDelegate { ...@@ -57,7 +57,7 @@ public class BasicCaptureView : MaterialView, CaptureSessionDelegate {
/** /**
:name: contentInsetsRef :name: contentInsetsRef
*/ */
public var contentInsetsRef: MaterialInsetsType = MaterialTheme.basicCardView.contentInsetsRef { public var contentInsetsRef: MaterialInsetsType = MaterialTheme.basicCaptureView.contentInsetsRef {
didSet { didSet {
reloadView() reloadView()
} }
...@@ -122,7 +122,7 @@ public class BasicCaptureView : MaterialView, CaptureSessionDelegate { ...@@ -122,7 +122,7 @@ public class BasicCaptureView : MaterialView, CaptureSessionDelegate {
if let v: MaterialButton = switchCamerasButton { if let v: MaterialButton = switchCamerasButton {
addSubview(v) addSubview(v)
MaterialLayout.alignFromBottomRight(self, child: v, bottom: 16, right: 16) MaterialLayout.alignFromBottomRight(self, child: v, bottom: contentInsetsRef.bottom, right: contentInsetsRef.right)
MaterialLayout.size(self, child: v, width: switchCamerasButtonSize.width, height: switchCamerasButtonSize.height) MaterialLayout.size(self, child: v, width: switchCamerasButtonSize.width, height: switchCamerasButtonSize.height)
v.removeTarget(self, action: "handleSwitchCameras", forControlEvents: .TouchUpInside) v.removeTarget(self, action: "handleSwitchCameras", forControlEvents: .TouchUpInside)
v.addTarget(self, action: "handleSwitchCameras", forControlEvents: .TouchUpInside) v.addTarget(self, action: "handleSwitchCameras", forControlEvents: .TouchUpInside)
...@@ -140,6 +140,9 @@ public class BasicCaptureView : MaterialView, CaptureSessionDelegate { ...@@ -140,6 +140,9 @@ public class BasicCaptureView : MaterialView, CaptureSessionDelegate {
print(error) print(error)
} }
//
// :name: handleSwitchCameras
//
internal func handleSwitchCameras() { internal func handleSwitchCameras() {
previewView.captureSession.switchCameras() previewView.captureSession.switchCameras()
} }
......
...@@ -212,7 +212,7 @@ public extension MaterialTheme.basicCaptureView { ...@@ -212,7 +212,7 @@ public extension MaterialTheme.basicCaptureView {
public static var shadowColor: UIColor = MaterialColor.black public static var shadowColor: UIColor = MaterialColor.black
// shape // shape
public static var contentInsetsRef: MaterialInsetsType = MaterialInsetsToValue(.Square2) public static var contentInsetsRef: MaterialInsetsType = MaterialInsetsToValue(.Square3)
// border // border
public static var borderWidth: MaterialBorder = .None public static var borderWidth: MaterialBorder = .None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment