initial
This commit is contained in:
35
Pods/SwiftEntryKit/Source/MessageViews/Notes/EKAccessoryNoteMessageView.swift
generated
Normal file
35
Pods/SwiftEntryKit/Source/MessageViews/Notes/EKAccessoryNoteMessageView.swift
generated
Normal file
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// EKAccessoryNoteMessageView.swift
|
||||
// SwiftEntryKit
|
||||
//
|
||||
// Created by Daniel Huri on 5/4/18.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public class EKAccessoryNoteMessageView: UIView {
|
||||
|
||||
// MARK: Props
|
||||
private let contentView = UIView()
|
||||
private var noteMessageView: EKNoteMessageView!
|
||||
var accessoryView: UIView!
|
||||
|
||||
func setup(with content: EKProperty.LabelContent) {
|
||||
clipsToBounds = true
|
||||
|
||||
addSubview(contentView)
|
||||
contentView.layoutToSuperview(.centerX, .top, .bottom)
|
||||
contentView.layoutToSuperview(.left, relation: .greaterThanOrEqual, offset: 16)
|
||||
contentView.layoutToSuperview(.right, relation: .lessThanOrEqual, offset: -16)
|
||||
|
||||
noteMessageView = EKNoteMessageView(with: content)
|
||||
noteMessageView.horizontalOffset = 8
|
||||
noteMessageView.verticalOffset = 7
|
||||
contentView.addSubview(noteMessageView)
|
||||
noteMessageView.layoutToSuperview(.top, .bottom, .trailing)
|
||||
|
||||
contentView.addSubview(accessoryView)
|
||||
accessoryView.layoutToSuperview(.leading, .centerY)
|
||||
accessoryView.layout(.trailing, to: .leading, of: noteMessageView)
|
||||
}
|
||||
}
|
||||
28
Pods/SwiftEntryKit/Source/MessageViews/Notes/EKImageNoteMessageView.swift
generated
Normal file
28
Pods/SwiftEntryKit/Source/MessageViews/Notes/EKImageNoteMessageView.swift
generated
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// EKImageNoteMessageView.swift
|
||||
// SwiftEntryKit
|
||||
//
|
||||
// Created by Daniel Huri on 5/4/18.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public class EKImageNoteMessageView: EKAccessoryNoteMessageView {
|
||||
|
||||
// MARK: Setup
|
||||
public required init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
public init(with content: EKProperty.LabelContent, imageContent: EKProperty.ImageContent) {
|
||||
super.init(frame: UIScreen.main.bounds)
|
||||
setup(with: content, imageContent: imageContent)
|
||||
}
|
||||
|
||||
private func setup(with content: EKProperty.LabelContent, imageContent: EKProperty.ImageContent) {
|
||||
let imageView = UIImageView()
|
||||
imageView.imageContent = imageContent
|
||||
accessoryView = imageView
|
||||
super.setup(with: content)
|
||||
}
|
||||
}
|
||||
52
Pods/SwiftEntryKit/Source/MessageViews/Notes/EKNoteMessageView.swift
generated
Normal file
52
Pods/SwiftEntryKit/Source/MessageViews/Notes/EKNoteMessageView.swift
generated
Normal file
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// EKNoteMessageView.swift
|
||||
// SwiftEntryKit
|
||||
//
|
||||
// Created by Daniel Huri on 4/19/18.
|
||||
// Copyright (c) 2018 huri000@gmail.com. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public class EKNoteMessageView: UIView {
|
||||
|
||||
// MARK: Props
|
||||
private let label = UILabel()
|
||||
|
||||
private var horizontalConstrainsts: QLAxisConstraints!
|
||||
private var verticalConstrainsts: QLAxisConstraints!
|
||||
|
||||
public var horizontalOffset: CGFloat = 10 {
|
||||
didSet {
|
||||
horizontalConstrainsts.first.constant = horizontalOffset
|
||||
horizontalConstrainsts.second.constant = -horizontalOffset
|
||||
layoutIfNeeded()
|
||||
}
|
||||
}
|
||||
|
||||
public var verticalOffset: CGFloat = 5 {
|
||||
didSet {
|
||||
verticalConstrainsts.first.constant = verticalOffset
|
||||
verticalConstrainsts.second.constant = -verticalOffset
|
||||
layoutIfNeeded()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Setup
|
||||
public init(with content: EKProperty.LabelContent) {
|
||||
super.init(frame: UIScreen.main.bounds)
|
||||
setup(with: content)
|
||||
}
|
||||
|
||||
public required init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
private func setup(with content: EKProperty.LabelContent) {
|
||||
clipsToBounds = true
|
||||
addSubview(label)
|
||||
label.content = content
|
||||
horizontalConstrainsts = label.layoutToSuperview(axis: .horizontally, offset: horizontalOffset, priority: .must)
|
||||
verticalConstrainsts = label.layoutToSuperview(axis: .vertically, offset: verticalOffset, priority: .must)
|
||||
}
|
||||
}
|
||||
45
Pods/SwiftEntryKit/Source/MessageViews/Notes/EKProcessingNoteMessageView.swift
generated
Normal file
45
Pods/SwiftEntryKit/Source/MessageViews/Notes/EKProcessingNoteMessageView.swift
generated
Normal file
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// EKProcessingNoteMessageView.swift
|
||||
// SwiftEntryKit
|
||||
//
|
||||
// Created by Daniel Huri on 4/20/18.
|
||||
// Copyright (c) 2018 huri000@gmail.com. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public class EKProcessingNoteMessageView: EKAccessoryNoteMessageView {
|
||||
|
||||
// MARK: Props
|
||||
private var activityIndicatorView: UIActivityIndicatorView!
|
||||
private var noteMessageView: EKNoteMessageView!
|
||||
|
||||
/** Activity indication can be turned off / on */
|
||||
public var isProcessing: Bool = true {
|
||||
didSet {
|
||||
if isProcessing {
|
||||
activityIndicatorView.startAnimating()
|
||||
} else {
|
||||
activityIndicatorView.stopAnimating()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Setup
|
||||
public required init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
public init(with content: EKProperty.LabelContent, activityIndicator: UIActivityIndicatorView.Style) {
|
||||
super.init(frame: UIScreen.main.bounds)
|
||||
setup(with: content, activityIndicator: activityIndicator)
|
||||
}
|
||||
|
||||
private func setup(with content: EKProperty.LabelContent, activityIndicator: UIActivityIndicatorView.Style, setProcessing: Bool = true) {
|
||||
activityIndicatorView = UIActivityIndicatorView()
|
||||
activityIndicatorView.style = activityIndicator
|
||||
isProcessing = setProcessing
|
||||
accessoryView = activityIndicatorView
|
||||
super.setup(with: content)
|
||||
}
|
||||
}
|
||||
46
Pods/SwiftEntryKit/Source/MessageViews/Notes/EKXStatusBarMessageView.swift
generated
Normal file
46
Pods/SwiftEntryKit/Source/MessageViews/Notes/EKXStatusBarMessageView.swift
generated
Normal file
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// EKXStatusBarMessageView.swift
|
||||
// SwiftEntryKit
|
||||
//
|
||||
// Created by Daniel Huri on 4/19/18.
|
||||
// Copyright (c) 2018 huri000@gmail.com. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public class EKXStatusBarMessageView: UIView {
|
||||
|
||||
// MARK: Props
|
||||
private let leadingLabel = UILabel()
|
||||
private let trailingLabel = UILabel()
|
||||
|
||||
// MARK: Setup
|
||||
public init(leading: EKProperty.LabelContent, trailing: EKProperty.LabelContent) {
|
||||
super.init(frame: UIScreen.main.bounds)
|
||||
setup(leading: leading, trailing: trailing)
|
||||
}
|
||||
|
||||
public required init?(coder aDecoder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
private func setup(leading: EKProperty.LabelContent, trailing: EKProperty.LabelContent) {
|
||||
clipsToBounds = true
|
||||
|
||||
set(.height, of: UIApplication.shared.statusBarFrame.maxY)
|
||||
|
||||
addSubview(leadingLabel)
|
||||
leadingLabel.content = leading
|
||||
|
||||
leadingLabel.layoutToSuperview(axis: .vertically)
|
||||
leadingLabel.layoutToSuperview(.leading)
|
||||
leadingLabel.layoutToSuperview(.width, ratio: 0.26)
|
||||
|
||||
addSubview(trailingLabel)
|
||||
trailingLabel.content = trailing
|
||||
|
||||
trailingLabel.layoutToSuperview(axis: .vertically)
|
||||
trailingLabel.layoutToSuperview(.trailing)
|
||||
trailingLabel.layoutToSuperview(.width, ratio: 0.26)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user