-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request eu-digital-green-certificates#15 from eu-digital-g…
…reen-certificates/feature/Display-Cert
- Loading branch information
Showing
37 changed files
with
1,673 additions
and
142 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
PatientScannerDemo/Components/FullFloatingPanelLayout.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// FullFloatingPanelLayout.swift | ||
// PatientScannerDemo | ||
// | ||
// Created by Yannick Spreen on 4/19/21. | ||
// | ||
|
||
import FloatingPanel | ||
|
||
class FullFloatingPanelLayout: FloatingPanelLayout { | ||
var position: FloatingPanelPosition = .bottom | ||
|
||
var initialState: FloatingPanelState = .full | ||
|
||
var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] { | ||
let top = FloatingPanelLayoutAnchor(absoluteInset: 16.0, edge: .top, referenceGuide: .safeArea) | ||
return [ | ||
.full: top, | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// InfoCell.swift | ||
// PatientScannerDemo | ||
// | ||
// Created by Yannick Spreen on 4/20/21. | ||
// | ||
|
||
import UIKit | ||
|
||
class InfoCell: UITableViewCell { | ||
@IBOutlet weak var headerLabel: UILabel! | ||
@IBOutlet weak var contentLabel: UILabel! | ||
|
||
func draw(_ info: InfoSection) { | ||
headerLabel?.text = info.header | ||
contentLabel?.text = info.content | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// RoundedButton.swift | ||
// PatientScannerDemo | ||
// | ||
// Created by Yannick Spreen on 4/19/21. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
@IBDesignable | ||
class RoundedButton: UIButton { | ||
@IBInspectable var radius: CGFloat = 6.0 { didSet(v) { initialize() } } | ||
@IBInspectable var padding: CGFloat = 4.0 { didSet(v) { initialize() } } | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
|
||
initialize() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
super.init(coder: coder) | ||
|
||
initialize() | ||
} | ||
|
||
func initialize() { | ||
layer.cornerRadius = radius | ||
contentEdgeInsets = UIEdgeInsets(top: padding, left: padding, bottom: padding, right: padding) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// SelfSizedTableView.swift | ||
// PatientScannerDemo | ||
// | ||
// Created by Yannick Spreen on 4/20/21. | ||
// | ||
// https://dushyant37.medium.com/swift-4-recipe-self-sizing-table-view-2635ac3df8ab | ||
// | ||
|
||
import UIKit | ||
|
||
class SelfSizedTableView: UITableView { | ||
var maxHeight: CGFloat = UIScreen.main.bounds.size.height | ||
|
||
override func reloadData() { | ||
super.reloadData() | ||
self.invalidateIntrinsicContentSize() | ||
self.layoutIfNeeded() | ||
} | ||
|
||
override var intrinsicContentSize: CGSize { | ||
let height = min(contentSize.height, maxHeight) | ||
return CGSize(width: contentSize.width, height: height) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// Data+Base45.swift | ||
// PatientScannerDemo | ||
// | ||
// Created by Yannick Spreen on 4/21/21. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
extension Data { | ||
public func toBase45()->String { | ||
var o = String() | ||
for i in stride(from:0, to:self.count, by: 2) { | ||
if (self.count - i > 1) { | ||
let x : Int = (Int(self[i])<<8) + Int(self[i+1]) | ||
let e : Int = x / (45*45) | ||
let x2 : Int = x % (45*45) | ||
let d : Int = x2 / 45 | ||
let c : Int = x2 % 45 | ||
o.append(BASE45_CHARSET[c]) | ||
o.append(BASE45_CHARSET[d]) | ||
o.append(BASE45_CHARSET[e]) | ||
} else { | ||
let x2 : Int = Int(self[i]) | ||
let d : Int = x2 / 45 | ||
let c : Int = x2 % 45 | ||
o.append(BASE45_CHARSET[c]) | ||
o.append(BASE45_CHARSET[d]) | ||
} | ||
} | ||
return o | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.