Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
0d503a05
Commit
0d503a05
authored
Dec 15, 2015
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aligned NavigationBarView and fixed fault in callback for timer update
parent
d3b4ccc1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
Examples/Programmatic/CaptureView/CaptureView/ViewController.swift
+1
-1
Sources/CameraView.swift
+8
-1
Sources/CaptureView.swift
+4
-4
No files found.
Examples/Programmatic/CaptureView/CaptureView/ViewController.swift
View file @
0d503a05
...
@@ -36,8 +36,8 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
...
@@ -36,8 +36,8 @@ class ViewController: UIViewController, CaptureViewDelegate, CaptureSessionDeleg
}
}
private
func
prepareCameraView
()
{
private
func
prepareCameraView
()
{
cameraView
.
translatesAutoresizingMaskIntoConstraints
=
false
view
.
addSubview
(
cameraView
)
view
.
addSubview
(
cameraView
)
cameraView
.
translatesAutoresizingMaskIntoConstraints
=
false
MaterialLayout
.
alignToParent
(
view
,
child
:
cameraView
)
MaterialLayout
.
alignToParent
(
view
,
child
:
cameraView
)
}
}
...
...
Sources/CameraView.swift
View file @
0d503a05
...
@@ -40,15 +40,18 @@ public class CameraView : CaptureView, CaptureViewDelegate, CaptureSessionDelega
...
@@ -40,15 +40,18 @@ public class CameraView : CaptureView, CaptureViewDelegate, CaptureSessionDelega
*/
*/
public
override
func
prepareView
()
{
public
override
func
prepareView
()
{
super
.
prepareView
()
super
.
prepareView
()
prepareNavigationBarView
()
prepareCaptureButton
()
prepareCaptureButton
()
prepareCameraButton
()
prepareCameraButton
()
prepareVideoButton
()
prepareVideoButton
()
prepareCloseButton
()
prepareCloseButton
()
prepareSwitchCameraButton
()
prepareSwitchCameraButton
()
prepareFlashButton
()
prepareFlashButton
()
prepareNavigationBarView
()
}
}
/**
:name: captureViewDidUpdateRecordTimer
*/
public
func
captureViewDidUpdateRecordTimer
(
captureView
:
CaptureView
,
duration
:
CMTime
,
time
:
Double
,
hours
:
Int
,
minutes
:
Int
,
seconds
:
Int
)
{
public
func
captureViewDidUpdateRecordTimer
(
captureView
:
CaptureView
,
duration
:
CMTime
,
time
:
Double
,
hours
:
Int
,
minutes
:
Int
,
seconds
:
Int
)
{
MaterialAnimation
.
animationDisabled
{
MaterialAnimation
.
animationDisabled
{
self
.
navigationBarView
.
titleLabel
!.
text
=
String
(
format
:
"%02i:%02i:%02i"
,
arguments
:
[
hours
,
minutes
,
seconds
])
self
.
navigationBarView
.
titleLabel
!.
text
=
String
(
format
:
"%02i:%02i:%02i"
,
arguments
:
[
hours
,
minutes
,
seconds
])
...
@@ -56,6 +59,9 @@ public class CameraView : CaptureView, CaptureViewDelegate, CaptureSessionDelega
...
@@ -56,6 +59,9 @@ public class CameraView : CaptureView, CaptureViewDelegate, CaptureSessionDelega
}
}
/**
:name: captureViewDidStopRecordTimer
*/
public
func
captureViewDidStopRecordTimer
(
captureView
:
CaptureView
,
duration
:
CMTime
,
time
:
Double
,
hours
:
Int
,
minutes
:
Int
,
seconds
:
Int
)
{
public
func
captureViewDidStopRecordTimer
(
captureView
:
CaptureView
,
duration
:
CMTime
,
time
:
Double
,
hours
:
Int
,
minutes
:
Int
,
seconds
:
Int
)
{
navigationBarView
.
titleLabel
!.
hidden
=
true
navigationBarView
.
titleLabel
!.
hidden
=
true
navigationBarView
.
detailLabel
!.
hidden
=
true
navigationBarView
.
detailLabel
!.
hidden
=
true
...
@@ -236,6 +242,7 @@ public class CameraView : CaptureView, CaptureViewDelegate, CaptureSessionDelega
...
@@ -236,6 +242,7 @@ public class CameraView : CaptureView, CaptureViewDelegate, CaptureSessionDelega
addSubview
(
navigationBarView
)
addSubview
(
navigationBarView
)
navigationBarView
.
translatesAutoresizingMaskIntoConstraints
=
false
navigationBarView
.
translatesAutoresizingMaskIntoConstraints
=
false
MaterialLayout
.
alignFromTop
(
self
,
child
:
navigationBarView
)
MaterialLayout
.
alignToParentHorizontally
(
self
,
child
:
navigationBarView
)
MaterialLayout
.
alignToParentHorizontally
(
self
,
child
:
navigationBarView
)
MaterialLayout
.
height
(
self
,
child
:
navigationBarView
,
height
:
70
)
MaterialLayout
.
height
(
self
,
child
:
navigationBarView
,
height
:
70
)
}
}
...
...
Sources/CaptureView.swift
View file @
0d503a05
...
@@ -29,12 +29,12 @@ public protocol CaptureViewDelegate : MaterialDelegate {
...
@@ -29,12 +29,12 @@ public protocol CaptureViewDelegate : MaterialDelegate {
/**
/**
:name: captureViewDidUpdateRecordTimer
:name: captureViewDidUpdateRecordTimer
*/
*/
optional
func
captureViewDidUpdateRecordTimer
(
captureView
:
CaptureView
,
duration
:
CMTime
,
time
:
Double
,
hours
:
Int
,
minutes
:
Int
,
seconds
:
Int
)
optional
func
captureViewDidUpdateRecordTimer
(
captureView
:
CaptureView
,
hours
:
Int
,
minutes
:
Int
,
seconds
:
Int
)
/**
/**
:name: captureViewDidStopRecordTimer
:name: captureViewDidStopRecordTimer
*/
*/
optional
func
captureViewDidStopRecordTimer
(
captureView
:
CaptureView
,
duration
:
CMTime
,
time
:
Double
,
hours
:
Int
,
minutes
:
Int
,
seconds
:
Int
)
optional
func
captureViewDidStopRecordTimer
(
captureView
:
CaptureView
,
hours
:
Int
,
minutes
:
Int
,
seconds
:
Int
)
/**
/**
:name: captureViewDidTapToFocusAtPoint
:name: captureViewDidTapToFocusAtPoint
...
@@ -195,7 +195,7 @@ public class CaptureView : MaterialView, UIGestureRecognizerDelegate {
...
@@ -195,7 +195,7 @@ public class CaptureView : MaterialView, UIGestureRecognizerDelegate {
let
hours
:
Int
=
Int
(
time
/
3600
)
let
hours
:
Int
=
Int
(
time
/
3600
)
let
minutes
:
Int
=
Int
((
time
/
60
)
%
60
)
let
minutes
:
Int
=
Int
((
time
/
60
)
%
60
)
let
seconds
:
Int
=
Int
(
time
%
60
)
let
seconds
:
Int
=
Int
(
time
%
60
)
(
delegate
as?
CaptureViewDelegate
)?
.
captureViewDidUpdateRecordTimer
?(
self
,
duration
:
duration
,
time
:
time
,
hours
:
hours
,
minutes
:
minutes
,
seconds
:
seconds
)
(
delegate
as?
CaptureViewDelegate
)?
.
captureViewDidUpdateRecordTimer
?(
self
,
hours
:
hours
,
minutes
:
minutes
,
seconds
:
seconds
)
}
}
/**
/**
...
@@ -209,7 +209,7 @@ public class CaptureView : MaterialView, UIGestureRecognizerDelegate {
...
@@ -209,7 +209,7 @@ public class CaptureView : MaterialView, UIGestureRecognizerDelegate {
let
seconds
:
Int
=
Int
(
time
%
60
)
let
seconds
:
Int
=
Int
(
time
%
60
)
timer
?
.
invalidate
()
timer
?
.
invalidate
()
timer
=
nil
timer
=
nil
(
delegate
as?
CaptureViewDelegate
)?
.
captureViewDidStopRecordTimer
?(
self
,
duration
:
duration
,
time
:
time
,
hours
:
hours
,
minutes
:
minutes
,
seconds
:
seconds
)
(
delegate
as?
CaptureViewDelegate
)?
.
captureViewDidStopRecordTimer
?(
self
,
hours
:
hours
,
minutes
:
minutes
,
seconds
:
seconds
)
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment