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
d9ed5cb8
Unverified
Commit
d9ed5cb8
authored
Oct 31, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: additional updates to Capture
parent
efd0aea4
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
14 additions
and
103 deletions
+14
-103
Sources/Assets.xcassets/ic_photo_camera_white_36pt.imageset/Contents.json
+0
-24
Sources/Assets.xcassets/ic_photo_camera_white_36pt.imageset/ic_photo_camera_white_36pt.png
+0
-0
Sources/Assets.xcassets/ic_photo_camera_white_36pt.imageset/ic_photo_camera_white_36pt@2x.png
+0
-0
Sources/Assets.xcassets/ic_photo_camera_white_36pt.imageset/ic_photo_camera_white_36pt@3x.png
+0
-0
Sources/Assets.xcassets/ic_videocam_white_36pt.imageset/Contents.json
+0
-24
Sources/Assets.xcassets/ic_videocam_white_36pt.imageset/ic_videocam_white_36pt.png
+0
-0
Sources/Assets.xcassets/ic_videocam_white_36pt.imageset/ic_videocam_white_36pt@2x.png
+0
-0
Sources/Assets.xcassets/ic_videocam_white_36pt.imageset/ic_videocam_white_36pt@3x.png
+0
-0
Sources/iOS/Capture/Capture.swift
+10
-49
Sources/iOS/FabButton.swift
+1
-3
Sources/iOS/HeightPreset.swift
+1
-0
Sources/iOS/Icon.swift
+0
-2
Sources/iOS/NavigationBar.swift
+2
-1
No files found.
Sources/Assets.xcassets/ic_photo_camera_white_36pt.imageset/Contents.json
deleted
100644 → 0
View file @
efd0aea4
{
"images"
:
[
{
"idiom"
:
"universal"
,
"filename"
:
"ic_photo_camera_white_36pt.png"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"ic_photo_camera_white_36pt@2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"ic_photo_camera_white_36pt@3x.png"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
Sources/Assets.xcassets/ic_photo_camera_white_36pt.imageset/ic_photo_camera_white_36pt.png
deleted
100644 → 0
View file @
efd0aea4
364 Bytes
Sources/Assets.xcassets/ic_photo_camera_white_36pt.imageset/ic_photo_camera_white_36pt@2x.png
deleted
100644 → 0
View file @
efd0aea4
666 Bytes
Sources/Assets.xcassets/ic_photo_camera_white_36pt.imageset/ic_photo_camera_white_36pt@3x.png
deleted
100644 → 0
View file @
efd0aea4
985 Bytes
Sources/Assets.xcassets/ic_videocam_white_36pt.imageset/Contents.json
deleted
100644 → 0
View file @
efd0aea4
{
"images"
:
[
{
"idiom"
:
"universal"
,
"filename"
:
"ic_videocam_white_36pt.png"
,
"scale"
:
"1x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"ic_videocam_white_36pt@2x.png"
,
"scale"
:
"2x"
},
{
"idiom"
:
"universal"
,
"filename"
:
"ic_videocam_white_36pt@3x.png"
,
"scale"
:
"3x"
}
],
"info"
:
{
"version"
:
1
,
"author"
:
"xcode"
}
}
\ No newline at end of file
Sources/Assets.xcassets/ic_videocam_white_36pt.imageset/ic_videocam_white_36pt.png
deleted
100644 → 0
View file @
efd0aea4
1.21 KB
Sources/Assets.xcassets/ic_videocam_white_36pt.imageset/ic_videocam_white_36pt@2x.png
deleted
100644 → 0
View file @
efd0aea4
1.51 KB
Sources/Assets.xcassets/ic_videocam_white_36pt.imageset/ic_videocam_white_36pt@3x.png
deleted
100644 → 0
View file @
efd0aea4
1.97 KB
Sources/iOS/Capture/Capture.swift
View file @
d9ed5cb8
...
...
@@ -270,7 +270,7 @@ open class Capture: View {
open
var
isAnimating
=
false
/// A reference to the capture mode.
open
var
mode
=
CaptureMode
.
vide
o
open
var
mode
=
CaptureMode
.
phot
o
/// Delegation handler.
open
weak
var
delegate
:
CaptureDelegate
?
...
...
@@ -281,9 +281,6 @@ open class Capture: View {
/// A Timer reference for when recording is enabled.
internal
var
timer
:
Timer
?
/// A reference to the visualEffect .
internal
var
visualEffect
:
UIView
!
/// A tap gesture reference for focus events.
internal
var
tapToFocusGesture
:
UITapGestureRecognizer
?
...
...
@@ -606,7 +603,6 @@ open class Capture: View {
super
.
prepare
()
backgroundColor
=
.
black
prepareVisualEffect
()
prepareSession
()
prepareSessionQueue
()
prepareActiveVideoInput
()
...
...
@@ -621,19 +617,10 @@ open class Capture: View {
}
extension
Capture
{
/// Prepares the visualEffect.
internal
func
prepareVisualEffect
()
{
let
blurEffect
=
UIVisualEffectView
(
effect
:
UIBlurEffect
(
style
:
.
light
))
visualEffect
=
UIView
()
visualEffect
.
backgroundColor
=
nil
visualEffect
.
layout
(
blurEffect
)
.
edges
()
}
/// Prepares the preview.
internal
func
preparePreview
()
{
preview
=
CapturePreview
()
layout
(
preview
)
.
edges
()
bringSubview
(
toFront
:
visualEffect
)
(
preview
.
layer
as!
AVCaptureVideoPreviewLayer
)
.
session
=
session
startSession
()
...
...
@@ -777,25 +764,7 @@ extension Capture {
session
.
commitConfiguration
()
isAnimating
=
true
Motion
.
delay
(
time
:
0.15
)
{
[
weak
self
]
in
guard
let
s
=
self
else
{
return
}
s
.
delegate
?
.
captureDidSwitchCameras
?(
capture
:
s
,
device
:
s
.
devicePosition
!
)
UIView
.
animate
(
withDuration
:
0.15
,
animations
:
{
[
weak
self
]
in
self
?
.
visualEffect
.
alpha
=
0
},
completion
:
{
[
weak
self
]
_
in
guard
let
s
=
self
else
{
return
}
s
.
visualEffect
.
removeFromSuperview
()
s
.
isAnimating
=
false
})
}
delegate
?
.
captureDidSwitchCameras
?(
capture
:
self
,
device
:
devicePosition
!
)
}
catch
let
e
as
NSError
{
delegate
?
.
captureFailedWithError
?(
capture
:
self
,
error
:
e
)
}
...
...
@@ -1107,12 +1076,13 @@ extension Capture {
}
/**
Handler for the
flash
Button.
Handler for the
video
Button.
- Parameter button: A UIButton that is associated with the event.
*/
@objc
internal
func
handleFlashButton
(
button
:
UIButton
)
{
delegate
?
.
captureDidPressFlashButton
?(
capture
:
self
,
button
:
button
)
internal
func
handleVideoButton
(
button
:
UIButton
)
{
mode
=
.
video
delegate
?
.
captureDidPressVideoButton
?(
capture
:
self
,
button
:
button
)
}
/**
...
...
@@ -1121,26 +1091,17 @@ extension Capture {
*/
@objc
internal
func
handleSwitchCamerasButton
(
button
:
UIButton
)
{
visualEffect
.
alpha
=
0
layout
(
visualEffect
)
.
edges
()
UIView
.
animate
(
withDuration
:
0.15
,
animations
:
{
[
weak
self
]
in
self
?
.
visualEffect
.
alpha
=
1
})
{
[
weak
self
]
_
in
self
?
.
switchCameras
()
}
switchCameras
()
delegate
?
.
captureDidPressSwitchCamerasButton
?(
capture
:
self
,
button
:
button
)
}
/**
Handler for the
video
Button.
Handler for the
flash
Button.
- Parameter button: A UIButton that is associated with the event.
*/
@objc
internal
func
handleVideoButton
(
button
:
UIButton
)
{
mode
=
.
video
delegate
?
.
captureDidPressVideoButton
?(
capture
:
self
,
button
:
button
)
internal
func
handleFlashButton
(
button
:
UIButton
)
{
delegate
?
.
captureDidPressFlashButton
?(
capture
:
self
,
button
:
button
)
}
/**
...
...
Sources/iOS/FabButton.swift
View file @
d9ed5cb8
...
...
@@ -43,8 +43,6 @@ open class FabButton: Button {
depthPreset
=
.
depth1
shapePreset
=
.
circle
pulseAnimation
=
.
centerWithBacking
tintColor
=
.
white
pulseColor
=
.
white
backgroundColor
=
Color
.
red
.
base
backgroundColor
=
.
white
}
}
Sources/iOS/HeightPreset.swift
View file @
d9ed5cb8
...
...
@@ -40,4 +40,5 @@ public enum HeightPreset: Int {
case
medium
=
52
case
large
=
60
case
xlarge
=
68
case
xxlarge
=
104
}
Sources/iOS/Icon.swift
View file @
d9ed5cb8
...
...
@@ -86,7 +86,6 @@ public struct Icon {
public
static
let
place
=
Icon
.
icon
(
"ic_place_white"
)
public
static
let
phone
=
Icon
.
icon
(
"ic_phone_white"
)
public
static
let
photoCamera
=
Icon
.
icon
(
"ic_photo_camera_white"
)
public
static
let
photoCameraLarge
=
Icon
.
icon
(
"ic_photo_camera_white_36pt"
)
public
static
let
photoLibrary
=
Icon
.
icon
(
"ic_photo_library_white"
)
public
static
let
search
=
Icon
.
icon
(
"ic_search_white"
)
public
static
let
settings
=
Icon
.
icon
(
"ic_settings_white"
)
...
...
@@ -95,7 +94,6 @@ public struct Icon {
public
static
let
starBorder
=
Icon
.
icon
(
"ic_star_border_white"
)
public
static
let
starHalf
=
Icon
.
icon
(
"ic_star_half_white"
)
public
static
let
videocam
=
Icon
.
icon
(
"ic_videocam_white"
)
public
static
let
videocamLarge
=
Icon
.
icon
(
"ic_videocam_white_36pt"
)
public
static
let
visibility
=
Icon
.
icon
(
"ic_visibility_white"
)
/// CosmicMind icons.
...
...
Sources/iOS/NavigationBar.swift
View file @
d9ed5cb8
...
...
@@ -215,6 +215,7 @@ open class NavigationBar: UINavigationBar {
}
item
.
contentView
.
grid
.
begin
()
item
.
contentView
.
grid
.
offset
.
columns
=
0
var
l
:
CGFloat
=
0
var
r
:
CGFloat
=
0
...
...
@@ -232,7 +233,7 @@ open class NavigationBar: UINavigationBar {
let
p
=
width
-
l
-
r
-
contentEdgeInsets
.
left
-
contentEdgeInsets
.
right
let
columns
=
Int
(
ceil
(
p
/
gridFactor
))
if
.
center
==
contentViewAlignment
{
if
.
center
==
item
.
contentViewAlignment
{
if
lc
<
rc
{
item
.
contentView
.
grid
.
columns
=
columns
-
2
*
rc
item
.
contentView
.
grid
.
offset
.
columns
=
rc
-
lc
...
...
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