diff --git a/enzevalos_iphone/AnimatedSendIcon.swift b/enzevalos_iphone/AnimatedSendIcon.swift index a469e4859eb8c8d7ffa622f2f659eeb77cbf2903..79a93830e4eccd4a59a7c43adb25663c317361ae 100644 --- a/enzevalos_iphone/AnimatedSendIcon.swift +++ b/enzevalos_iphone/AnimatedSendIcon.swift @@ -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) { diff --git a/enzevalos_iphone/StudySettings.swift b/enzevalos_iphone/StudySettings.swift index 22ad9b8cd385cb7d36bcfd552ea7312a66b010a1..2a2ec0faf82cd6c6b362e6a8ade2a2e1423b8167 100644 --- a/enzevalos_iphone/StudySettings.swift +++ b/enzevalos_iphone/StudySettings.swift @@ -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 =