Skip to content
Snippets Groups Projects
Commit 959ff560 authored by Oliver Wiese's avatar Oliver Wiese
Browse files

update security indicator animation

parent 8a7607d7
No related branches found
No related tags found
No related merge requests found
......@@ -26,30 +26,39 @@ class AnimatedSendIcon: UIView {
var isPostcardOnTop = false
var square = UIImageView(image: StudySettings.securityIndicator.imageOfSecureIndicator(background: true, open: false))
var square2 = UIImageView(image: StudySettings.securityIndicator.imageOfInsecureIndicator(background: true))
let width = 100.0
let height = 70.0
let width: Double //= 100.0
let height: Double// = 70.0
let f = 0.8
var size = CGSize()
var sizeSmall = CGSize()
let front = CGPoint(x: 30, y: 35)
let front = CGPoint(x: 30, y: 30)
let back = CGPoint(x: 100, y: 15)
var scale = false
var scaleFactor = 1.0
override init(frame: CGRect) {
if let w = square.image?.size.width {
scaleFactor = min(100.0 / Double(w), 2.6)
self.width = Double(w) * scaleFactor
}
else {
self.width = 100.0
}
if let h = square.image?.size.height {
self.height = Double(h) * scaleFactor
}
else {
self.height = 70.0
}
super.init(frame: frame)
self.isUserInteractionEnabled = false
let resizing: ResizingBehavior = .aspectFit
// let context = UIGraphicsGetCurrentContext()!
// //// Resize to Target Frame
// CGContextSaveGState(context)
let resizedFrame: CGRect = resizing.apply(rect: CGRect(x: 0, y: 0, width: 200, height: 110), target: CGRect(x: 40, y: -10, width: 113, height: 48))
// CGContextTranslateCTM(context, resizedFrame.minX, resizedFrame.minY)
// CGContextScaleCTM(context, resizedFrame.width / 200, resizedFrame.height / 110)
//
// self.view.transform = CGAffineTransformMakeScale(2, 2)
self.transform = CGAffineTransform(scaleX: resizedFrame.width / 200, y: resizedFrame.height / 110)
// self = UIView(frame: frame) //UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 110))
self.backgroundColor = UIColor.white
size = CGSize(width: width, height: height)
......@@ -64,8 +73,6 @@ class AnimatedSendIcon: UIView {
self.addSubview(square)
self.addSubview(square2)
// CGContextRestoreGState(context)
}
required init?(coder aDecoder: NSCoder) {
......
......@@ -80,7 +80,8 @@ class StudySettings {
static var studyMode = true
static var presentFirstQuestionaireMail = false
static let parameters = [StudyParamter.Indicator]
static let securityIndicator = SecurityIndicator.padlock
static let securityIndicator = SecurityIndicator.letter
static let bitcoinStudyBody =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment