Skip to content

Commit

Permalink
Merge pull request #39 from cemolcay/feature/cemolcay-vector-assets
Browse files Browse the repository at this point in the history
Update vector assets
  • Loading branch information
cemolcay authored Jun 19, 2016
2 parents 070b5b2 + f65821e commit 5d6327e
Show file tree
Hide file tree
Showing 28 changed files with 133 additions and 129 deletions.
6 changes: 3 additions & 3 deletions Keyboard/DefaultKeyboard/CustomKeyboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -304,23 +304,23 @@ public class CustomKeyboard: UIView, KeyboardLayoutDelegate {
keyboardLayoutState = .Symbols

// Update shift state
case .Shift:
case .ShiftOff:
if shiftToggleTimer == nil {
keyboardLayoutState = .Letters(shiftState: .Once)
startShiftToggleTimer()
} else {
keyboardLayoutState = .Letters(shiftState: .On)
invalidateShiftToggleTimer()
}
case .ShiftToggledOnce:
case .ShiftOnce:
if shiftToggleTimer == nil {
keyboardLayoutState = .Letters(shiftState: .Off)
startShiftToggleTimer()
} else {
keyboardLayoutState = .Letters(shiftState: .On)
invalidateShiftToggleTimer()
}
case .ShiftToggled:
case .ShiftOn:
if shiftToggleTimer == nil {
keyboardLayoutState = .Letters(shiftState: .Off)
}
Expand Down
38 changes: 19 additions & 19 deletions Keyboard/DefaultKeyboard/CustomKeyboardLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ public enum CustomKeyboardIdentifier: String {
case Numbers = "Numbers"
case Letters = "Letters"
case Symbols = "Symbols"
case Shift = "Shift"
case ShiftToggled = "ShiftToggled"
case ShiftToggledOnce = "ShiftToggledOnce"
case ShiftOff = "ShiftOff"
case ShiftOn = "ShiftOn"
case ShiftOnce = "ShiftOnce"
}

// MARK: - CustomKeyboardLayout
Expand Down Expand Up @@ -120,12 +120,12 @@ public class CustomKeyboardLayout {
characters: [
KeyboardButton(
type: .Image(UIImage(
named: "shiftToggledOnce",
named: "ShiftOnce",
inBundle: NSBundle(forClass: CustomKeyboard.self),
compatibleWithTraitCollection: nil)),
style: CustomKeyboardShiftButtonStyle,
width: .Relative(percent: 0.115),
identifier: CustomKeyboardIdentifier.ShiftToggledOnce.rawValue),
identifier: CustomKeyboardIdentifier.ShiftOnce.rawValue),
KeyboardRow(
style: CustomKeyboardChildRowStyle,
characters: [
Expand All @@ -140,7 +140,7 @@ public class CustomKeyboardLayout {
),
KeyboardButton(
type: .Image(UIImage(
named: "backspace",
named: "Backspace",
inBundle: NSBundle(forClass: CustomKeyboard.self),
compatibleWithTraitCollection: nil)),
style: CustomKeyboardBackspaceButtonStyle,
Expand All @@ -158,7 +158,7 @@ public class CustomKeyboardLayout {
identifier: CustomKeyboardIdentifier.Numbers.rawValue),
KeyboardButton(
type: .Image(UIImage(
named: "globe",
named: "Globe",
inBundle: NSBundle(forClass: CustomKeyboard.self),
compatibleWithTraitCollection: nil)),
style: CustomKeyboardGlobeButtonStyle,
Expand Down Expand Up @@ -215,12 +215,12 @@ public class CustomKeyboardLayout {
characters: [
KeyboardButton(
type: .Image(UIImage(
named: "shiftToggled",
named: "ShiftOn",
inBundle: NSBundle(forClass: CustomKeyboard.self),
compatibleWithTraitCollection: nil)),
style: CustomKeyboardShiftButtonStyle,
width: .Relative(percent: 0.115),
identifier: CustomKeyboardIdentifier.ShiftToggled.rawValue),
identifier: CustomKeyboardIdentifier.ShiftOn.rawValue),
KeyboardRow(
style: CustomKeyboardChildRowStyle,
characters: [
Expand All @@ -235,7 +235,7 @@ public class CustomKeyboardLayout {
),
KeyboardButton(
type: .Image(UIImage(
named: "backspace",
named: "Backspace",
inBundle: NSBundle(forClass: CustomKeyboard.self),
compatibleWithTraitCollection: nil)),
style: CustomKeyboardBackspaceButtonStyle,
Expand All @@ -253,7 +253,7 @@ public class CustomKeyboardLayout {
identifier: CustomKeyboardIdentifier.Numbers.rawValue),
KeyboardButton(
type: .Image(UIImage(
named: "globe",
named: "Globe",
inBundle: NSBundle(forClass: CustomKeyboard.self),
compatibleWithTraitCollection: nil)),
style: CustomKeyboardGlobeButtonStyle,
Expand Down Expand Up @@ -310,12 +310,12 @@ public class CustomKeyboardLayout {
characters: [
KeyboardButton(
type: .Image(UIImage(
named: "shift",
named: "ShiftOff",
inBundle: NSBundle(forClass: CustomKeyboard.self),
compatibleWithTraitCollection: nil)),
style: CustomKeyboardShiftButtonStyle,
width: .Relative(percent: 0.115),
identifier: CustomKeyboardIdentifier.Shift.rawValue),
identifier: CustomKeyboardIdentifier.ShiftOff.rawValue),
KeyboardRow(
style: CustomKeyboardChildRowStyle,
characters: [
Expand All @@ -330,7 +330,7 @@ public class CustomKeyboardLayout {
),
KeyboardButton(
type: .Image(UIImage(
named: "backspace",
named: "Backspace",
inBundle: NSBundle(forClass: CustomKeyboard.self),
compatibleWithTraitCollection: nil)),
style: CustomKeyboardBackspaceButtonStyle,
Expand All @@ -348,7 +348,7 @@ public class CustomKeyboardLayout {
identifier: CustomKeyboardIdentifier.Numbers.rawValue),
KeyboardButton(
type: .Image(UIImage(
named: "globe",
named: "Globe",
inBundle: NSBundle(forClass: CustomKeyboard.self),
compatibleWithTraitCollection: nil)),
style: CustomKeyboardGlobeButtonStyle,
Expand Down Expand Up @@ -421,7 +421,7 @@ public class CustomKeyboardLayout {
),
KeyboardButton(
type: .Image(UIImage(
named: "backspace",
named: "Backspace",
inBundle: NSBundle(forClass: CustomKeyboard.self),
compatibleWithTraitCollection: nil)),
style: CustomKeyboardBackspaceButtonStyle,
Expand All @@ -439,7 +439,7 @@ public class CustomKeyboardLayout {
identifier: CustomKeyboardIdentifier.Letters.rawValue),
KeyboardButton(
type: .Image(UIImage(
named: "globe",
named: "Globe",
inBundle: NSBundle(forClass: CustomKeyboard.self),
compatibleWithTraitCollection: nil)),
style: CustomKeyboardGlobeButtonStyle,
Expand Down Expand Up @@ -512,7 +512,7 @@ public class CustomKeyboardLayout {
),
KeyboardButton(
type: .Image(UIImage(
named: "backspace",
named: "Backspace",
inBundle: NSBundle(forClass: CustomKeyboard.self),
compatibleWithTraitCollection: nil)),
style: CustomKeyboardBackspaceButtonStyle,
Expand All @@ -530,7 +530,7 @@ public class CustomKeyboardLayout {
identifier: CustomKeyboardIdentifier.Letters.rawValue),
KeyboardButton(
type: .Image(UIImage(
named: "globe",
named: "Globe",
inBundle: NSBundle(forClass: CustomKeyboard.self),
compatibleWithTraitCollection: nil)),
style: CustomKeyboardGlobeButtonStyle,
Expand Down
4 changes: 4 additions & 0 deletions Keyboard/KeyboardLayoutEngine/KeyboardButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public struct KeyboardButtonStyle {

// Image
public var imageSize: CGFloat?
public var tintColor: UIColor

// KeyPop
public var keyPopType: KeyPopType?
Expand All @@ -68,6 +69,7 @@ public struct KeyboardButtonStyle {
font: UIFont? = nil,
textOffsetY: CGFloat? = nil,
imageSize: CGFloat? = nil,
tintColor: UIColor = UIColor.blackColor(),
keyPopType: KeyPopType? = nil,
keyPopWidthMultiplier: CGFloat? = nil,
keyPopHeightMultiplier: CGFloat? = nil,
Expand All @@ -86,6 +88,7 @@ public struct KeyboardButtonStyle {
self.font = font ?? UIFont.systemFontOfSize(21)
self.textOffsetY = textOffsetY ?? 0
self.imageSize = imageSize
self.tintColor = tintColor
self.keyPopType = keyPopType
self.keyPopWidthMultiplier = keyPopWidthMultiplier ?? 1.5
self.keyPopHeightMultiplier = keyPopHeightMultiplier ?? 1.1
Expand Down Expand Up @@ -180,6 +183,7 @@ public class KeyboardButton: UIView {
case .Image(let image):
imageView = UIImageView(image: image)
imageView?.contentMode = .ScaleAspectFit
imageView?.tintColor = style.tintColor
addSubview(imageView!)
}
}
Expand Down
Binary file not shown.
15 changes: 15 additions & 0 deletions Keyboard/Resources.xcassets/Backspace.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Backspace.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
15 changes: 15 additions & 0 deletions Keyboard/Resources.xcassets/Emoji.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Emoji.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
15 changes: 15 additions & 0 deletions Keyboard/Resources.xcassets/Globe.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Globe.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
15 changes: 15 additions & 0 deletions Keyboard/Resources.xcassets/ShiftOff.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ShiftOff.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
15 changes: 15 additions & 0 deletions Keyboard/Resources.xcassets/ShiftOn.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ShiftOn.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
15 changes: 15 additions & 0 deletions Keyboard/Resources.xcassets/ShiftOnce.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ShiftOnce.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
15 changes: 15 additions & 0 deletions Keyboard/Resources.xcassets/Siri.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Siri.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
21 changes: 0 additions & 21 deletions Keyboard/Resources.xcassets/backspace.imageset/Contents.json

This file was deleted.

Binary file not shown.
21 changes: 0 additions & 21 deletions Keyboard/Resources.xcassets/globe.imageset/Contents.json

This file was deleted.

Binary file removed Keyboard/Resources.xcassets/globe.imageset/globe.png
Binary file not shown.
21 changes: 0 additions & 21 deletions Keyboard/Resources.xcassets/shift.imageset/Contents.json

This file was deleted.

Binary file removed Keyboard/Resources.xcassets/shift.imageset/shift.png
Binary file not shown.
Loading

0 comments on commit 5d6327e

Please sign in to comment.