Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Commit

Permalink
last changes before shipping v1.1 (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
dokun1 authored and stevemart committed Jun 2, 2018
1 parent 2e4b5e9 commit 31f69eb
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 18 deletions.
6 changes: 2 additions & 4 deletions iOS/rainbow/Config/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>2</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand All @@ -28,9 +28,7 @@
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>WatsonML can't see very well without a camera!</string>
<key>NSMicrophoneUsageDescription</key>
<string>WatsonML requires the use of a microphone for using the camera.</string>
<string>To play WatsonML, we require the use of your device camera.</string>
<key>UIAppFonts</key>
<array>
<string>IBMPlexSans-Bold.ttf</string>
Expand Down
6 changes: 6 additions & 0 deletions iOS/rainbow/Controller/AvatarAPI/AvatarClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Foundation
import UIKit
import SVProgressHUD

struct UserAvatar: Codable {
var name: String
Expand All @@ -30,6 +31,11 @@ class AvatarClient {

static func getRandomAvatar(completion: @escaping (_ avatar: UserAvatar?, _ error: Error?) -> Void) {
let request = RestRequest(method: .get, url: "https://avatar-rainbow.mybluemix.net/new", containsSelfSignedCert: false)
// request.circuitParameters = CircuitParameters(timeout: 30, fallback: { _, _ in
// DispatchQueue.main.async {
// SVProgressHUD.showError(withStatus: "Could not get avatar")
// }
// })
request.responseObject { (response: RestResponse<UserAvatar>) in
DispatchQueue.main.async {
switch response.result {
Expand Down
2 changes: 1 addition & 1 deletion iOS/rainbow/Controller/Camera/CameraController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class CameraController: LuminaViewController {
}

private func promptForLatestModel() {
let alert = UIAlertController.init(title: "Load New Visual Model", message: "This will attempt to download a file that is between 15-20 MBs. Do you want to continue?", preferredStyle: .alert)
let alert = UIAlertController.init(title: "Load New Visual Model", message: "A new recognition model is available, and requires a download of 15-20 MB. Would you like to improve your gameplay?", preferredStyle: .alert)
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
let okAction = UIAlertAction(title: "Download", style: .default) { _ in
UIApplication.shared.isNetworkActivityIndicatorVisible = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class ParticipantViewController: UIViewController {
@IBOutlet weak var nowPlayingLabel: UILabel?

override func viewDidAppear(_ animated: Bool) {
ScoreEntry.ServerCalls.getCount { count, error in
ScoreEntry.ServerCalls.getCount { count, _ in
DispatchQueue.main.async {
if let count = count {
self.nowPlayingLabel?.text = "Now Playing: \(count.totalUsers) players"
self.nowPlayingLabel?.text = "\(count.totalUsers) Players"
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion iOS/rainbow/Controller/MainTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ class MainTabBarController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
NotificationCenter.default.addObserver(self, selector: #selector(MainTabBarController.deviceRegistrationComplete(notification:)), name: Notification.Name("viva-ml-device-token-registered"), object: nil)
SVProgressHUD.show(withStatus: "Preparing WatsonML...")
do {
_ = try ScoreEntry.ClientPersistence.get()
} catch {
// if there are any issues finding an existing users, this is the only reason we need to show this
SVProgressHUD.show(withStatus: "Preparing WatsonML...")
}
}

@objc func deviceRegistrationComplete(notification: Notification) {
Expand Down
42 changes: 32 additions & 10 deletions iOS/rainbow/View/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -411,23 +411,45 @@
<constraint firstAttribute="width" constant="300" id="Xzi-Uu-zF5"/>
</constraints>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Now Playing: --" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YRX-QD-BPb">
<rect key="frame" x="37" y="504" width="300" height="41"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NU5-8T-sZZ">
<rect key="frame" x="37" y="505" width="300" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Now Playing:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="12" translatesAutoresizingMaskIntoConstraints="NO" id="aAM-4w-jTk">
<rect key="frame" x="0.0" y="5" width="136" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="4KD-B0-vLb"/>
<constraint firstAttribute="width" constant="136" id="wpF-9X-Xad"/>
</constraints>
<fontDescription key="fontDescription" name="IBMPlexSans-Bold" family="IBM Plex Sans" pointSize="22"/>
<color key="textColor" red="0.23529411759999999" green="0.32156862749999998" blue="0.4431372549" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="----" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YRX-QD-BPb">
<rect key="frame" x="144" y="4" width="148" height="42"/>
<fontDescription key="fontDescription" name="IBMPlexSans-Medium" family="IBM Plex Sans" pointSize="22"/>
<color key="textColor" red="0.23529411759999999" green="0.32156862749999998" blue="0.4431372549" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="300" id="JHk-a1-XgN"/>
<constraint firstAttribute="height" constant="41" id="Xjb-A6-yus"/>
<constraint firstItem="YRX-QD-BPb" firstAttribute="top" secondItem="NU5-8T-sZZ" secondAttribute="top" constant="4" id="Bm7-k6-iIF"/>
<constraint firstItem="aAM-4w-jTk" firstAttribute="leading" secondItem="NU5-8T-sZZ" secondAttribute="leading" id="GSc-Ex-M2q"/>
<constraint firstItem="YRX-QD-BPb" firstAttribute="leading" secondItem="aAM-4w-jTk" secondAttribute="trailing" constant="8" id="HPm-3T-Lnk"/>
<constraint firstItem="aAM-4w-jTk" firstAttribute="top" secondItem="NU5-8T-sZZ" secondAttribute="top" constant="5" id="UcV-9e-YL9"/>
<constraint firstAttribute="height" constant="50" id="V8H-8U-DUE"/>
<constraint firstAttribute="trailing" secondItem="YRX-QD-BPb" secondAttribute="trailing" constant="8" id="jpA-Kg-r0r"/>
<constraint firstAttribute="width" constant="300" id="tTu-sp-xQd"/>
<constraint firstAttribute="bottom" secondItem="YRX-QD-BPb" secondAttribute="bottom" constant="4" id="xPM-ya-Eut"/>
</constraints>
<fontDescription key="fontDescription" name="IBMPlexSans-Medium" family="IBM Plex Sans" pointSize="22"/>
<color key="textColor" red="0.23529411759999999" green="0.32156862749999998" blue="0.4431372549" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="YRX-QD-BPb" firstAttribute="top" secondItem="j0j-Xz-mVk" secondAttribute="bottom" id="LxJ-jb-4N5"/>
<constraint firstItem="j0j-Xz-mVk" firstAttribute="centerX" secondItem="1X2-xn-izW" secondAttribute="centerX" id="UOR-p1-HKe"/>
<constraint firstItem="YRX-QD-BPb" firstAttribute="centerX" secondItem="1X2-xn-izW" secondAttribute="centerX" id="VJL-lW-Qcs"/>
<constraint firstItem="NU5-8T-sZZ" firstAttribute="top" secondItem="j0j-Xz-mVk" secondAttribute="bottom" constant="1.5" id="f6J-WK-gVt"/>
<constraint firstItem="j0j-Xz-mVk" firstAttribute="centerY" secondItem="1X2-xn-izW" secondAttribute="centerY" id="g7a-uH-OOf"/>
<constraint firstItem="NU5-8T-sZZ" firstAttribute="centerX" secondItem="1X2-xn-izW" secondAttribute="centerX" id="wx0-L1-TNZ"/>
</constraints>
<viewLayoutGuide key="safeArea" id="Yqv-hy-23R"/>
</view>
Expand Down

0 comments on commit 31f69eb

Please sign in to comment.