diff --git a/Guibe.xcodeproj/project.pbxproj b/Guibe.xcodeproj/project.pbxproj index 04a5a2c..93e931f 100644 --- a/Guibe.xcodeproj/project.pbxproj +++ b/Guibe.xcodeproj/project.pbxproj @@ -7,6 +7,12 @@ objects = { /* Begin PBXBuildFile section */ + 502AAC4522B5721E00A37EBE /* i-wear.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 502AAC4022B5721D00A37EBE /* i-wear.mp3 */; }; + 502AAC4622B5721E00A37EBE /* i-connect.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 502AAC4122B5721E00A37EBE /* i-connect.mp3 */; }; + 502AAC4722B5721E00A37EBE /* i-language.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 502AAC4222B5721E00A37EBE /* i-language.mp3 */; }; + 502AAC4822B5721E00A37EBE /* i-charging.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 502AAC4322B5721E00A37EBE /* i-charging.mp3 */; }; + 502AAC4922B5721E00A37EBE /* i-interface.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 502AAC4422B5721E00A37EBE /* i-interface.mp3 */; }; + 5038A33022B68526004B2645 /* SecretsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5038A32F22B68526004B2645 /* SecretsViewController.swift */; }; 505AFEF8229FE1BD004FF0F1 /* settingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */; }; 506421C922A33D87001E8877 /* InstructionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506421C822A33D87001E8877 /* InstructionsViewController.swift */; }; 506421CD22A33EA5001E8877 /* TechSpecsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506421CC22A33EA5001E8877 /* TechSpecsViewController.swift */; }; @@ -40,6 +46,12 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 502AAC4022B5721D00A37EBE /* i-wear.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "i-wear.mp3"; sourceTree = ""; }; + 502AAC4122B5721E00A37EBE /* i-connect.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "i-connect.mp3"; sourceTree = ""; }; + 502AAC4222B5721E00A37EBE /* i-language.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "i-language.mp3"; sourceTree = ""; }; + 502AAC4322B5721E00A37EBE /* i-charging.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "i-charging.mp3"; sourceTree = ""; }; + 502AAC4422B5721E00A37EBE /* i-interface.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "i-interface.mp3"; sourceTree = ""; }; + 5038A32F22B68526004B2645 /* SecretsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecretsViewController.swift; sourceTree = ""; }; 505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = settingsViewController.swift; sourceTree = ""; }; 506421C822A33D87001E8877 /* InstructionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstructionsViewController.swift; sourceTree = ""; }; 506421CC22A33EA5001E8877 /* TechSpecsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TechSpecsViewController.swift; sourceTree = ""; }; @@ -114,6 +126,7 @@ 50A7ADD6229D6A4200D58743 /* ViewController.swift */, 50A7ADE6229D6C7100D58743 /* Assets.xcassets */, 50A7ADD8229D6A4200D58743 /* Main.storyboard */, + 5038A32F22B68526004B2645 /* SecretsViewController.swift */, 50969F5922AFD57E0000C5ED /* GameLearnViewController.swift */, 50969F5D22AFEBE80000C5ED /* SecondGameLearnViewController.swift */, 50E3DDF222AC5F9200E04D0B /* setupTextInstructionsViewController.swift */, @@ -138,6 +151,11 @@ 50969F6122B08A350000C5ED /* guibe_long_right.mp3 */, 50969F6522B08A350000C5ED /* guibe_right.mp3 */, 50969F6222B08A350000C5ED /* guibe_wrongdirection.mp3 */, + 502AAC4322B5721E00A37EBE /* i-charging.mp3 */, + 502AAC4122B5721E00A37EBE /* i-connect.mp3 */, + 502AAC4422B5721E00A37EBE /* i-interface.mp3 */, + 502AAC4222B5721E00A37EBE /* i-language.mp3 */, + 502AAC4022B5721D00A37EBE /* i-wear.mp3 */, ); path = Guibe; sourceTree = ""; @@ -227,9 +245,14 @@ 50969F6C22B08A350000C5ED /* guibe_right.mp3 in Resources */, 50969F6622B08A350000C5ED /* guibe_left.mp3 in Resources */, 50E3DDF122AC59EA00E04D0B /* placeholder.mp4 in Resources */, + 502AAC4822B5721E00A37EBE /* i-charging.mp3 in Resources */, 50969F6822B08A350000C5ED /* guibe_long_right.mp3 in Resources */, + 502AAC4722B5721E00A37EBE /* i-language.mp3 in Resources */, + 502AAC4522B5721E00A37EBE /* i-wear.mp3 in Resources */, + 502AAC4922B5721E00A37EBE /* i-interface.mp3 in Resources */, 50A7ADDF229D6A4200D58743 /* LaunchScreen.storyboard in Resources */, 50969F6B22B08A350000C5ED /* guibe_long_left.mp3 in Resources */, + 502AAC4622B5721E00A37EBE /* i-connect.mp3 in Resources */, 50A7ADE7229D6C7100D58743 /* Assets.xcassets in Resources */, 50A7ADDA229D6A4200D58743 /* Main.storyboard in Resources */, 50969F6A22B08A350000C5ED /* guibe_begin.mp3 in Resources */, @@ -248,6 +271,7 @@ 506421CD22A33EA5001E8877 /* TechSpecsViewController.swift in Sources */, 50A7ADF9229D75C100D58743 /* 5_HandChoiceViewController.swift in Sources */, 50969F5A22AFD57E0000C5ED /* GameLearnViewController.swift in Sources */, + 5038A33022B68526004B2645 /* SecretsViewController.swift in Sources */, 50B1485E22A46F7A008B16AF /* VideoInstrictionsViewController.swift in Sources */, 50969F5E22AFEBE80000C5ED /* SecondGameLearnViewController.swift in Sources */, 50E3DDF322AC5F9200E04D0B /* setupTextInstructionsViewController.swift in Sources */, diff --git a/Guibe/3_StartViewController.swift b/Guibe/3_StartViewController.swift index a808a5c..228e483 100644 --- a/Guibe/3_StartViewController.swift +++ b/Guibe/3_StartViewController.swift @@ -20,27 +20,29 @@ class S3artViewController: UIViewController, CLLocationManagerDelegate { let locationManager = CLLocationManager() @IBAction func startBtnPressed(_ sender: Any) { - DispatchQueue.main.asyncAfter(deadline: .now() + 1){ - self.getStartedBtn.isHidden = true - self.playAgainBtn.isHidden = false - self.nextBtn.isHidden = false - self.nextBtn.layer.shadowColor = UIColor.black.cgColor - self.nextBtn.layer.shadowOffset = CGSize(width: 2, height: 5) - self.nextBtn.layer.shadowRadius = 5 - self.nextBtn.layer.shadowOpacity = 0.2 - } - playVideo() - - - +// DispatchQueue.main.asyncAfter(deadline: .now() + 1){ +// self.getStartedBtn.isHidden = true +// self.playAgainBtn.isHidden = false +// self.nextBtn.isHidden = false +// self.nextBtn.layer.shadowColor = UIColor.black.cgColor +// self.nextBtn.layer.shadowOffset = CGSize(width: 2, height: 5) +// self.nextBtn.layer.shadowRadius = 5 +// self.nextBtn.layer.shadowOpacity = 0.2 +// } +// playVideo() + let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen5") as! H5ndChoiceViewController + nextViewController.modalTransitionStyle = .crossDissolve + self.present(nextViewController, animated: true, completion: nil) } + + @IBAction func playAgainBtnPressed(_ sender: Any) { playVideo() } @IBAction func nextBtnPressed(_ sender: Any) { - let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen5") as! H5ndChoiceViewController - nextViewController.modalTransitionStyle = .crossDissolve - self.present(nextViewController, animated: true, completion: nil) +// let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen5") as! H5ndChoiceViewController +// nextViewController.modalTransitionStyle = .crossDissolve +// self.present(nextViewController, animated: true, completion: nil) } @@ -70,6 +72,7 @@ class S3artViewController: UIViewController, CLLocationManagerDelegate { player.play() } } + /* // MARK: - Navigation diff --git a/Guibe/5_HandChoiceViewController.swift b/Guibe/5_HandChoiceViewController.swift index f7b4c1b..ef60313 100644 --- a/Guibe/5_HandChoiceViewController.swift +++ b/Guibe/5_HandChoiceViewController.swift @@ -12,6 +12,8 @@ class H5ndChoiceViewController: UIViewController { @IBOutlet weak var lBtn: UIButton! @IBOutlet weak var rBtn: UIButton! + @IBOutlet weak var textLbl: UITextView! + @IBOutlet weak var altLbl: UILabel! let defaults = UserDefaults.standard @@ -32,6 +34,8 @@ class H5ndChoiceViewController: UIViewController { super.viewDidLoad() lBtn.accessibilityLabel = "Left Hand" rBtn.accessibilityLabel = "Right Hand" + textLbl.accessibilityLabel = "where would you like to wear ghibe" + altLbl.accessibilityLabel = "where would you like to wear ghibe" // Do any additional setup after loading the view. } diff --git a/Guibe/6_SideChoiceViewController.swift b/Guibe/6_SideChoiceViewController.swift index e4549f8..8730c1b 100644 --- a/Guibe/6_SideChoiceViewController.swift +++ b/Guibe/6_SideChoiceViewController.swift @@ -12,7 +12,9 @@ class S6deChoiceViewController: UIViewController { @IBOutlet weak var bTtn: UIButton! @IBOutlet weak var sBtn: UIButton! - + @IBOutlet weak var textLbl: UITextView! + @IBOutlet weak var altLbl: UILabel! + let defaults = UserDefaults.standard @IBAction func topBigPressed(_ sender: Any) { @@ -33,6 +35,8 @@ class S6deChoiceViewController: UIViewController { bTtn.accessibilityLabel = "Big on top" sBtn.accessibilityLabel = "Small on top" + textLbl.accessibilityLabel = "How would you like to wear ghibe" + altLbl.accessibilityLabel = "How would you like to wear ghibe" // Do any additional setup after loading the view. } diff --git a/Guibe/7_ReadyViewController.swift b/Guibe/7_ReadyViewController.swift index b90f535..9f20f7d 100644 --- a/Guibe/7_ReadyViewController.swift +++ b/Guibe/7_ReadyViewController.swift @@ -12,6 +12,8 @@ class R7adyViewController: UIViewController { let defaults = UserDefaults.standard + @IBOutlet weak var loadingScreen: UIImageView! + override func viewDidLoad() { super.viewDidLoad() @@ -23,6 +25,8 @@ class R7adyViewController: UIViewController { self.present(nextViewController, animated: true, completion: nil) } + loadingScreen.accessibilityLabel = "ghibe is loading" + // Do any additional setup after loading the view. } diff --git a/Guibe/Assets.xcassets/stop.imageset/Contents.json b/Guibe/Assets.xcassets/stop.imageset/Contents.json new file mode 100644 index 0000000..79bb789 --- /dev/null +++ b/Guibe/Assets.xcassets/stop.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "stop.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "stop-1.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "stop-2.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Guibe/Assets.xcassets/stop.imageset/stop-1.png b/Guibe/Assets.xcassets/stop.imageset/stop-1.png new file mode 100644 index 0000000..4170e5d Binary files /dev/null and b/Guibe/Assets.xcassets/stop.imageset/stop-1.png differ diff --git a/Guibe/Assets.xcassets/stop.imageset/stop-2.png b/Guibe/Assets.xcassets/stop.imageset/stop-2.png new file mode 100644 index 0000000..4170e5d Binary files /dev/null and b/Guibe/Assets.xcassets/stop.imageset/stop-2.png differ diff --git a/Guibe/Assets.xcassets/stop.imageset/stop.png b/Guibe/Assets.xcassets/stop.imageset/stop.png new file mode 100644 index 0000000..4170e5d Binary files /dev/null and b/Guibe/Assets.xcassets/stop.imageset/stop.png differ diff --git a/Guibe/Base.lproj/Main.storyboard b/Guibe/Base.lproj/Main.storyboard index d35719f..b09e965 100644 --- a/Guibe/Base.lproj/Main.storyboard +++ b/Guibe/Base.lproj/Main.storyboard @@ -114,26 +114,38 @@ - - + + + + + - + @@ -165,7 +177,7 @@ - + @@ -173,18 +185,30 @@ + + + - + @@ -269,6 +293,9 @@ + + + @@ -394,19 +421,6 @@ - + @@ -536,7 +563,7 @@ - + @@ -732,12 +759,14 @@ @@ -793,10 +822,6 @@ - - - - - - - - - + - - @@ -966,8 +967,8 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1230,6 +1354,7 @@ And that’s all you need to know to follow the vibe! + diff --git a/Guibe/GameLearnViewController.swift b/Guibe/GameLearnViewController.swift index 32234c1..29ce14c 100644 --- a/Guibe/GameLearnViewController.swift +++ b/Guibe/GameLearnViewController.swift @@ -35,10 +35,11 @@ class GameLearnViewController: UIViewController, AVAudioPlayerDelegate { override func viewDidLoad() { super.viewDidLoad() - textLabel.text = "Now we will learn the different haptic patterns for navigationg with Guibe" - textLabel.accessibilityLabel = "Now we will learn the different haptic patterns for navigationg with geibe" + textLabel.text = "Now we will learn the different haptic patterns for navigating with Guibe" + textLabel.accessibilityLabel = "Now we will learn the different haptic patterns for navigationg with ghibe" mainButton.accessibilityLabel = "Play vibration" mainButton.alpha = 0.0 + nextBtn.accessibilityLabel = "Next" // Do any additional setup after loading the view. diff --git a/Guibe/InstructionsViewController.swift b/Guibe/InstructionsViewController.swift index 99f0d89..420455b 100644 --- a/Guibe/InstructionsViewController.swift +++ b/Guibe/InstructionsViewController.swift @@ -10,40 +10,40 @@ import UIKit import MapKit class InstructionsViewController: UIViewController { - @IBOutlet weak var separator: UIImageView! - @IBOutlet weak var easterEggBtn: UIButton! + + @IBOutlet weak var backBtn: UIButton! @IBAction func backBtnPressed(_ sender: Any) { self.dismiss(animated: true, completion: nil) } - @IBAction func writtenInstructionsBtnPressed(_ sender: Any) { +// @IBAction func writtenInstructionsBtnPressed(_ sender: Any) { // let mvc = MainViewController() // let ivc = WrittenInstructionsViewController() // // ivc.stepBySteps = mvc.textSteps // ivc.currentStep = mvc.stepCounter - } +// } - @IBAction func easterEggPressed(_ sender: Any) { - self.separator.isHidden = true - self.separator.alpha = 0.0 - UIView.animate(withDuration: 0.2, animations: {self.view.backgroundColor = .green}) - DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .red})} - DispatchQueue.main.asyncAfter(deadline: .now() + 0.8) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .blue})} - DispatchQueue.main.asyncAfter(deadline: .now() + 1.2) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .yellow})} - DispatchQueue.main.asyncAfter(deadline: .now() + 1.6) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .cyan})} - DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .magenta})} - DispatchQueue.main.asyncAfter(deadline: .now() + 2.4) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .white})} - self.separator.isHidden = false - self.separator.alpha = 1.0 - } +// @IBAction func easterEggPressed(_ sender: Any) { +// self.separator.isHidden = true +// self.separator.alpha = 0.0 +// UIView.animate(withDuration: 0.2, animations: {self.view.backgroundColor = .green}) +// DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .red})} +// DispatchQueue.main.asyncAfter(deadline: .now() + 0.8) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .blue})} +// DispatchQueue.main.asyncAfter(deadline: .now() + 1.2) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .yellow})} +// DispatchQueue.main.asyncAfter(deadline: .now() + 1.6) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .cyan})} +// DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .magenta})} +// DispatchQueue.main.asyncAfter(deadline: .now() + 2.4) {UIView.animate(withDuration: 0.3, animations: {self.view.backgroundColor = .white})} +// self.separator.isHidden = false +// self.separator.alpha = 1.0 +// } - @IBAction func VABtnPressed(_ sender: Any) { - - } +// @IBAction func VABtnPressed(_ sender: Any) { +// +// } // ivc.stepBySteps = mvc.textSteps @@ -54,7 +54,7 @@ class InstructionsViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - easterEggBtn.accessibilityLabel = "Easter egg, do not press" +// easterEggBtn.accessibilityLabel = "Easter egg, do not press" backBtn.accessibilityLabel = "Back" // let mvc = MainViewController() // let ivc = WrittenInstructionsViewController() diff --git a/Guibe/MainViewController.swift b/Guibe/MainViewController.swift index e732bd0..9d35db9 100644 --- a/Guibe/MainViewController.swift +++ b/Guibe/MainViewController.swift @@ -46,8 +46,8 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate, myProtocol { @IBOutlet weak var menuView: UIView! @IBOutlet weak var menuBtn: UIButton! @IBOutlet weak var dismissBtn: UIButton! - @IBOutlet weak var howToUseGuibeBtn: UIView! - // --------------------- + @IBOutlet weak var howToUseGuibeBtn: UIButton! +// --------------------- @IBOutlet weak var searchBarBg: UIButton! @IBOutlet weak var searchView: UIView! @IBOutlet weak var searchBar: UISearchBar! @@ -148,6 +148,16 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate, myProtocol { override func viewDidLoad() { super.viewDidLoad() + + let debugVar = defaults.integer(forKey: "debug") + + if debugVar == 2 { + debugLbl.alpha = 1.0 + } + else { + debugLbl.alpha = 0.0 + } + searchBar.delegate = self searchBarBg.layer.shadowColor = UIColor.black.cgColor searchBarBg.layer.cornerRadius = 10 @@ -227,7 +237,7 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate, myProtocol { mapView.accessibilityElementsHidden = true startNaviImg.accessibilityLabel = "Follow the vibe" arrivedAtDestinationBtn.accessibilityLabel = "End Navigation" - howToUseGuibeBtn.accessibilityLabel = "this is How to use geibe" + howToUseGuibeBtn.accessibilityLabel = "How to use ghibe" } //END OF VIEW DID LOAD diff --git a/Guibe/SecondGameLearnViewController.swift b/Guibe/SecondGameLearnViewController.swift index 7f51e14..e60f968 100644 --- a/Guibe/SecondGameLearnViewController.swift +++ b/Guibe/SecondGameLearnViewController.swift @@ -39,10 +39,11 @@ class SecondGameLearnViewController: UIViewController, AVAudioPlayerDelegate { override func viewDidLoad() { super.viewDidLoad() - textLabel.text = "Now we will learn the different haptic patterns for navigationg with Guibe" - textLabel.accessibilityLabel = "Now we will learn the different haptic patterns for navigationg with geibe" + textLabel.text = "Now we will learn the different haptic patterns for navigating with Guibe" + textLabel.accessibilityLabel = "Now we will learn the different haptic patterns for navigationg with ghibe" mainButton.accessibilityLabel = "Play vibration" mainButton.alpha = 0.0 + nextBtn.accessibilityLabel = "Next" // Do any additional setup after loading the view. } diff --git a/Guibe/SecretsViewController.swift b/Guibe/SecretsViewController.swift new file mode 100644 index 0000000..64111f1 --- /dev/null +++ b/Guibe/SecretsViewController.swift @@ -0,0 +1,69 @@ +// +// SecretsViewController.swift +// Guibe +// +// Created by Max Hunt on 16/06/2019. +// Copyright © 2019 8. All rights reserved. +// + +import UIKit + +class SecretsViewController: UIViewController { + + let defaults = UserDefaults.standard + +// @IBOutlet weak var menuView: UIView! + @IBOutlet weak var resetCfg: UIButton! + @IBOutlet weak var easterEgg: UIButton! + @IBOutlet weak var backBtn: UIButton! + @IBOutlet weak var DLblSwitch: UISwitch! + + + @IBAction func resetBtnPressed(_ sender: Any) { + defaults.set(0, forKey: "setupDone") + self.resetCfg.alpha = 0.0 + } + + @IBAction func valueToggled(_ sender: Any) { + if self.DLblSwitch.isOn == true { + defaults.set(2, forKey: "debug") + } + else { + defaults.set(1, forKey: "debug") + } + } + + + + @IBAction func easterBtnPressed(_ sender: Any) { + UIView.animate(withDuration: 0.2, animations: {self.view.backgroundColor = .green}) + DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {UIView.animate(withDuration: 0.3, animations:{self.view.backgroundColor = .red})} + DispatchQueue.main.asyncAfter(deadline: .now() + 0.8) {UIView.animate(withDuration: 0.3, animations:{self.view.backgroundColor = .blue})} + DispatchQueue.main.asyncAfter(deadline: .now() + 1.2) {UIView.animate(withDuration: 0.3, animations:{self.view.backgroundColor = .yellow})} + DispatchQueue.main.asyncAfter(deadline: .now() + 1.6) {UIView.animate(withDuration: 0.3, animations:{self.view.backgroundColor = .cyan})} + DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {UIView.animate(withDuration: 0.3, animations:{self.view.backgroundColor = .magenta})} + DispatchQueue.main.asyncAfter(deadline: .now() + 2.4) {UIView.animate(withDuration: 0.3, animations:{self.view.backgroundColor = .white})} + } + + @IBAction func backBtnPressed(_ sender: Any) { + self.dismiss(animated: true, completion: nil) + } + + override func viewDidLoad() { + super.viewDidLoad() + + let DBVal = defaults.integer(forKey: "debug") + + if DBVal == 2 { + DLblSwitch.isOn = true + } + else { + defaults.set(1, forKey: "debug") + DLblSwitch.isOn = false + } + + } + +// defaults.set(0, forKey: "setupDone") + +} diff --git a/Guibe/VideoInstrictionsViewController.swift b/Guibe/VideoInstrictionsViewController.swift index 9a12410..d6ac654 100644 --- a/Guibe/VideoInstrictionsViewController.swift +++ b/Guibe/VideoInstrictionsViewController.swift @@ -10,23 +10,53 @@ import UIKit import AVKit class VideoInstrictionsViewController: UIViewController, AVAudioPlayerDelegate { - - @IBOutlet weak var tuturialBtn: UIButton! - @IBOutlet weak var setupBtn: UIButton! + var player = AVAudioPlayer() + @IBOutlet weak var backBtn: UIButton! + @IBOutlet weak var b1: UIButton! + @IBOutlet weak var b2: UIButton! + @IBOutlet weak var b3: UIButton! + @IBOutlet weak var b4: UIButton! + @IBOutlet weak var b5: UIButton! + @IBOutlet weak var stopBtn: UIButton! + + + @IBAction func b1p(_ sender: Any) { + disableAllButtons() + audioPlay(fName: "i-connect") + } + + @IBAction func b2p(_ sender: Any) { + disableAllButtons() + audioPlay(fName: "i-wear") + } + + @IBAction func b3p(_ sender: Any) { + disableAllButtons() + audioPlay(fName: "i-language") + } + + @IBAction func b4p(_ sender: Any) { + disableAllButtons() + audioPlay(fName: "i-interface") + } + + @IBAction func b5p(_ sender: Any) { + disableAllButtons() + audioPlay(fName: "i-charging") + } + + @IBAction func stopBtnPressed(_ sender: Any) { + self.player.stop() + enableAllButtons() + } + @IBAction func backBtnPressed(_ sender: Any) { self.dismiss(animated: true, completion: nil) } - - @IBAction func tutorialBtnPressed(_ sender: Any) { - playVideo1() - } - - @IBAction func setupBtnPressed(_ sender: Any) { - playVideo2() - } + @@ -34,50 +64,74 @@ class VideoInstrictionsViewController: UIViewController, AVAudioPlayerDelegate { override func viewDidLoad() { super.viewDidLoad() + b1.accessibilityLabel = "connecting your ghibe" + b2.accessibilityLabel = "wearing your ghibe" + b3.accessibilityLabel = "ghibe language" + b4.accessibilityLabel = "ghibe interface" + b5.accessibilityLabel = "charging your ghibe" + backBtn.accessibilityLabel = "back" + stopBtn.accessibilityLabel = "stop" - tuturialBtn.layer.shadowColor = UIColor.black.cgColor - tuturialBtn.layer.cornerRadius = 9 - tuturialBtn.layer.shadowOffset = CGSize(width: 7, height: 9) - tuturialBtn.layer.shadowRadius = 9 - tuturialBtn.layer.shadowOpacity = 0.4 - - setupBtn.layer.shadowColor = UIColor.black.cgColor - setupBtn.layer.cornerRadius = 9 - setupBtn.layer.shadowOffset = CGSize(width: 7, height: 9) - setupBtn.layer.shadowRadius = 9 - setupBtn.layer.shadowOpacity = 0.4 - - backBtn.accessibilityLabel = "Back" - tuturialBtn.accessibilityLabel = "Usage Tutorial" - setupBtn.accessibilityLabel = "Guibe bracelet setup tutorial" + stopBtn.alpha = 0.5 + stopBtn.isEnabled = false // Do any additional setup after loading the view. } - private func playVideo1() { - guard let path = Bundle.main.path(forResource: "placeholder", ofType:"mp4") else { - debugPrint("404") - return } - let player = AVPlayer(url: URL(fileURLWithPath: path)) - let playerController = AVPlayerViewController() - playerController.player = player - // playerController.modalPresentationStyle = .popover - present(playerController, animated: true) { + func disableAllButtons() { + self.b1.isEnabled = false + self.b2.isEnabled = false + self.b3.isEnabled = false + self.b4.isEnabled = false + self.b5.isEnabled = false + self.stopBtn.isEnabled = true + + UIView.animate(withDuration: 0.3, animations: { + self.b1.alpha = 0.5 + self.b2.alpha = 0.5 + self.b3.alpha = 0.5 + self.b4.alpha = 0.5 + self.b5.alpha = 0.5 + self.stopBtn.alpha = 1.0 + }) + + + + + } + + func enableAllButtons() { + self.b1.isEnabled = true + self.b2.isEnabled = true + self.b3.isEnabled = true + self.b4.isEnabled = true + self.b5.isEnabled = true + self.stopBtn.isEnabled = false + + UIView.animate(withDuration: 0.3, animations: { + self.b1.alpha = 1.0 + self.b2.alpha = 1.0 + self.b3.alpha = 1.0 + self.b4.alpha = 1.0 + self.b5.alpha = 1.0 + self.stopBtn.alpha = 0.5 + }) + } + + func audioPlay (fName: String) { + let path = Bundle.main.path(forResource: fName, ofType : "mp3")! + let url = URL(fileURLWithPath : path) + do { + player = try AVAudioPlayer(contentsOf: url) + player.delegate = self player.play() + } catch { + debugPrint("Error in playing sound file \(fName).mp3") } } - private func playVideo2() { - guard let path = Bundle.main.path(forResource: "placeholder", ofType:"mp4") else { - debugPrint("404") - return } - let player = AVPlayer(url: URL(fileURLWithPath: path)) - let playerController = AVPlayerViewController() - playerController.player = player - // playerController.modalPresentationStyle = .popover - present(playerController, animated: true) { - player.play() - } + func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool) { + enableAllButtons() } diff --git a/Guibe/ViewController.swift b/Guibe/ViewController.swift index 4ab282d..c5e0724 100644 --- a/Guibe/ViewController.swift +++ b/Guibe/ViewController.swift @@ -16,7 +16,7 @@ class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - guibeScreen.accessibilityLabel = "geibe" + guibeScreen.accessibilityLabel = "ghibe" let setupDone = defaults.integer(forKey: "setupDone") diff --git a/Guibe/i-charging.mp3 b/Guibe/i-charging.mp3 new file mode 100644 index 0000000..b35e746 Binary files /dev/null and b/Guibe/i-charging.mp3 differ diff --git a/Guibe/i-connect.mp3 b/Guibe/i-connect.mp3 new file mode 100644 index 0000000..b4835ee Binary files /dev/null and b/Guibe/i-connect.mp3 differ diff --git a/Guibe/i-interface.mp3 b/Guibe/i-interface.mp3 new file mode 100644 index 0000000..e45efe5 Binary files /dev/null and b/Guibe/i-interface.mp3 differ diff --git a/Guibe/i-language.mp3 b/Guibe/i-language.mp3 new file mode 100644 index 0000000..a72e0a9 Binary files /dev/null and b/Guibe/i-language.mp3 differ diff --git a/Guibe/i-wear.mp3 b/Guibe/i-wear.mp3 new file mode 100644 index 0000000..d53639a Binary files /dev/null and b/Guibe/i-wear.mp3 differ diff --git a/Guibe/settingsViewController.swift b/Guibe/settingsViewController.swift index c91d64a..73086f6 100644 --- a/Guibe/settingsViewController.swift +++ b/Guibe/settingsViewController.swift @@ -61,9 +61,7 @@ class settingsViewController: UIViewController { UIView.animate(withDuration: 0.4, animations: {self.CSTop.alpha = 1.0}) } } - @IBAction func resetCfgPressed(_ sender: Any) { - defaults.set(0, forKey: "setupDone") - } + // ACTIONS--------------ACTIONS override func viewDidLoad() { @@ -100,8 +98,8 @@ class settingsViewController: UIViewController { bTopBtn.accessibilityLabel = "Big side on top" CSTop.accessibilityLabel = "Small side on top" sTopBtn.accessibilityLabel = "Small side on top" - sideText.accessibilityLabel = "Where would you like to wear geibe" - teoSideText.accessibilityLabel = "How would you like to wear geibe?" + sideText.accessibilityLabel = "Where would you like to wear ghibe" + teoSideText.accessibilityLabel = "How would you like to wear ghibe?" }