Commit 829c8de0 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Kateryna Kostiuk

UI: add ring version info

- adds "In varietate concordia" text to the welcome page
- adds a version info alert accessible via the account(me) view

Change-Id: I3adb1e9e3a74e5d7b766021b3b9ab64923bd8dde
Reviewed-by: Kateryna Kostiuk's avatarKateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
parent 339376a5
......@@ -63,6 +63,7 @@ enum Asset {
static let icContactPicture = ImageAsset(name: "ic_contact_picture")
static let moreSettings = ImageAsset(name: "more_settings")
static let pauseCall = ImageAsset(name: "pause_call")
static let ringIcon = ImageAsset(name: "ringIcon")
static let ringLogo = ImageAsset(name: "ring_logo")
static let settingsIcon = ImageAsset(name: "settings_icon")
static let stopCall = ImageAsset(name: "stop_call")
......@@ -92,6 +93,7 @@ enum Asset {
icContactPicture,
moreSettings,
pauseCall,
ringIcon,
ringLogo,
settingsIcon,
stopCall,
......
......@@ -54,6 +54,16 @@ class MeViewController: EditProfileViewController, StoryboardBased, ViewModelBas
super.setupUI()
let infoButton = UIButton(type: .infoLight)
let infoItem = UIBarButtonItem(customView: infoButton)
infoButton.rx.tap.throttle(0.5, scheduler: MainScheduler.instance)
.subscribe(onNext: { [unowned self] in
self.infoItemTapped()
})
.disposed(by: self.disposeBag)
self.navigationItem.rightBarButtonItem = infoItem
//setup Table
self.settingsTable.estimatedRowHeight = 50
self.settingsTable.rowHeight = UITableViewAutomaticDimension
......@@ -65,6 +75,19 @@ class MeViewController: EditProfileViewController, StoryboardBased, ViewModelBas
self.settingsTable.register(cellType: LinkNewDeviceCell.self)
}
func infoItemTapped() {
let alert = UIAlertController(title: "\nRing\nbuild: 20180131\n\"In varietate concordia\"", message: "", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "ok", style: .default, handler: nil))
let image = UIImageView(image: UIImage(asset: Asset.ringIcon))
alert.view.addSubview(image)
image.translatesAutoresizingMaskIntoConstraints = false
alert.view.addConstraint(NSLayoutConstraint(item: image, attribute: .centerX, relatedBy: .equal, toItem: alert.view, attribute: .centerX, multiplier: 1, constant: 0))
alert.view.addConstraint(NSLayoutConstraint(item: image, attribute: .centerY, relatedBy: .equal, toItem: alert.view, attribute: .top, multiplier: 1, constant: 0.0))
alert.view.addConstraint(NSLayoutConstraint(item: image, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 64.0))
alert.view.addConstraint(NSLayoutConstraint(item: image, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 64.0))
self.present(alert, animated: true, completion: nil)
}
func setUpDataSource() {
let configureCell: (TableViewSectionedDataSource, UITableView, IndexPath, SettingsSection.Item)
......
......@@ -47,8 +47,8 @@
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="Welcome to Ring" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lbn-cd-UXk">
<rect key="frame" x="100.66666666666669" y="391.66666666666669" width="174" height="29"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="In varietate concordia" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lbn-cd-UXk" userLabel="Version Title Label">
<rect key="frame" x="77.000000000000014" y="391.66666666666669" width="221.33333333333337" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "ringIcon-76pt.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ringIcon-76pt-1.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ringIcon-76pt-2.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment