Skip to content

Commit

Permalink
Fixed Bulletin Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-headspace committed Nov 25, 2018
1 parent 318f458 commit 6917f87
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 64 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Musgravite/Controller/DetailViewController.swift"
timestampString = "564861121.219802"
timestampString = "564862025.403434"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "205"
endingLineNumber = "205"
startingLineNumber = "195"
endingLineNumber = "195"
landmarkName = "getData(_:_:_:)"
landmarkType = "7">
</BreakpointContent>
Expand Down Expand Up @@ -42,11 +42,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Musgravite/Controller/DetailViewController.swift"
timestampString = "564861121.220378"
timestampString = "564862025.403586"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "206"
endingLineNumber = "206"
startingLineNumber = "196"
endingLineNumber = "196"
landmarkName = "getData(_:_:_:)"
landmarkType = "7">
</BreakpointContent>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "buletin-lab.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion Musgravite/Controller/CharacterCreatorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ class CharacterCreatorViewController: UIViewController, UIImagePickerControllerD
}

override func viewDidAppear(_ animated: Bool) {
if UserDefaults.standard.bool(forKey: "characterLaunchedBefore") {
if !UserDefaults.standard.bool(forKey: "characterLaunchedBefore") {
inBulletin.backgroundViewStyle = .dimmed
inBulletin.showBulletin(above: self)
UserDefaults.standard.set(true, forKey: "characterLaunchedBefore")
}
}

Expand Down
10 changes: 0 additions & 10 deletions Musgravite/Controller/DetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,6 @@ class DetailViewController: UIViewController, UICollectionViewDelegate, UICollec
}

func displayMapDirections(){
/* Request Location */
locationManager.requestAlwaysAuthorization()
locationManager.requestWhenInUseAuthorization()

if CLLocationManager.locationServicesEnabled() {
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.startUpdatingLocation()
}

let sourceCoordinates = locationManager.location?.coordinate
let destinationCoordinates = CLLocationCoordinate2D(latitude: 19.2833333, longitude: -99.1352777777779)
let sourcePlacemark = MKPlacemark(coordinate: sourceCoordinates!)
Expand Down
4 changes: 2 additions & 2 deletions Musgravite/Controller/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension UIImageView {
}
}

class ViewController: UIViewController, CLLocationManagerDelegate, UICollectionViewDelegate, UICollectionViewDataSource, WCSessionDelegate{
class ViewController: UIViewController, CLLocationManagerDelegate, UICollectionViewDelegate, UICollectionViewDataSource, WCSessionDelegate {
/* Apple Watch Required Sources */
func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {}
func sessionDidBecomeInactive(_ session: WCSession) {}
Expand Down Expand Up @@ -104,7 +104,7 @@ class ViewController: UIViewController, CLLocationManagerDelegate, UICollectionV
}

override func viewDidAppear(_ animated: Bool) {
if (appHasBeenLaunchedBefore()){
if !appHasBeenLaunchedBefore() {
self.notification.notificationOccurred(.warning)
bulletinManager.backgroundViewStyle = .dimmed
bulletinManager.showBulletin(above: self)
Expand Down
92 changes: 47 additions & 45 deletions Musgravite/Model/MainMenuCards.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

import Foundation
import BLTNBoard
import CoreLocation

class MainMenuCards {

/* Haptic Feeback */
public let impact = UIImpactFeedbackGenerator()
public let notification = UINotificationFeedbackGenerator()
Expand All @@ -19,7 +21,8 @@ class MainMenuCards {
let titles = ["Crea tu propio avatar","Busca laboratorios","Acerca de la aplicacion"]
let subtitles = ["Personaliza tu experiencia virtual","¡Crea tu siguiente inovacion ahora!","Autores detras de este proyecto"]
let targets = ["CharacterCreatorViewController","LaboratorySearchViewController","AboutPageViewController"]

/* Location */
let locationManager = CLLocationManager()

/**
This launches the onboarding experience on first launch
Expand Down Expand Up @@ -61,38 +64,29 @@ class MainMenuCards {
page.actionButtonTitle = "Crear perfil"
page.textInputHandler = {(item,text) in
//We need to store it in CoreData
self.selection.selectionChanged()
UtilityFunctions().storeUserName(text!)
let next = self.createLocationServicesBLTNPage()
let next = self.showAvatarPageBLTNPage()
item.manager?.push(item: next)
}
return page
}

/**
This launches the location services BLTN Page
- Returns: OnboardingBLTNPageItem
- Remark: This should call our support file for location services
- Requires: It requires to be called by another BTLNPage and is not the first page to show
*/
func createLocationServicesBLTNPage() -> BLTNPageItem {
let firstPage = BLTNPageItem(title: "Servicios de Localizacion")
firstPage.image = UIImage(named: "buletin-2")
firstPage.descriptionText = "Para personalizar tu experiencia necesitamos tu localizacion. Esta informacion sera enviada a nuestros servidores de forma anonima. Puedes cambiar de opinion mas adelante en las preferencias de la aplicacion."
firstPage.actionButtonTitle = "Activar Localizacion"
firstPage.alternativeButtonTitle = "Ahora no"
firstPage.requiresCloseButton = false
firstPage.isDismissable = false
firstPage.appearance.shouldUseCompactDescriptionText = true
firstPage.next = createNotificationServicesBLTNPage()
firstPage.actionHandler = { item in
self.selection.selectionChanged()
item.manager?.displayNextItem()
}
firstPage.alternativeHandler = { item in
func showAvatarPageBLTNPage() -> BLTNPageItem {
let page = BLTNPageItem(title:"Crea tu propio avatar!")
page.isDismissable = true
page.image = UIImage(named: "buletin-character")
page.descriptionText = "Selecciona en la primer opción el creador de Avatares dentro de la aplicación, este te seguirá a todos tus dispositivos"
page.appearance.actionButtonColor = UIColor(red:0.20, green:0.14, blue:0.14, alpha:1.0)
page.actionButtonTitle = "Continuar"
page.requiresCloseButton = false
page.appearance.shouldUseCompactDescriptionText = true
page.next = showLabSearchBLTNPage()
page.actionHandler = { item in
self.selection.selectionChanged()
item.manager?.displayNextItem()
}
return firstPage
return page
}

/** This launches the Notification services BLTN Page
Expand All @@ -101,19 +95,18 @@ class MainMenuCards {
- Requires : It requires to be called by another BLTNPage and is not our first page
*/

func createNotificationServicesBLTNPage() -> BLTNPageItem {
let firstPage = BLTNPageItem(title: "Notificaciones Push")
firstPage.image = UIImage(named: "buletin-3")
firstPage.descriptionText = "Recibe notificaciones push cuando cambios en la aplicacion sucedan."
firstPage.actionButtonTitle = "Activar notificaciones"
firstPage.alternativeButtonTitle = "Ahora no"
func showLabSearchBLTNPage() -> BLTNPageItem {
let firstPage = BLTNPageItem(title: "Encuentra los laboratorios")
firstPage.image = UIImage(named: "buletin-lab")
firstPage.descriptionText = "Presiona el segundo elemento en el menu para ver los diferentes salones divididos por pisos de CDTC"
firstPage.actionButtonTitle = "Continuar"
firstPage.requiresCloseButton = false
firstPage.isDismissable = false
firstPage.appearance.shouldUseCompactDescriptionText = true
firstPage.next = createJSONDownloadBLTNPage()
firstPage.next = createLocationServicesBLTNPage()
firstPage.actionHandler = { item in
item.manager?.displayNextItem()
self.notification.notificationOccurred(.success)
item.manager?.displayNextItem()
self.notification.notificationOccurred(.success)
}
firstPage.alternativeHandler = { item in
item.manager?.displayNextItem()
Expand All @@ -122,27 +115,36 @@ class MainMenuCards {
return firstPage
}


/* Shows that the JSON's were succesfully downloaded
- Returns : OnboardingBLTNPageItem
- Remartk: This should subsequently call the next file
/**
This launches the location services BLTN Page
- Returns: OnboardingBLTNPageItem
- Remark: This should call our support file for location services
- Requires: It requires to be called by another BTLNPage and is not the first page to show
*/
func createJSONDownloadBLTNPage() -> BLTNPageItem {
let firstPage = BLTNPageItem(title: "Datos descargados")
firstPage.image = UIImage(named: "buletin-5")
firstPage.descriptionText = "Se han descargado los datos necesarios para usar la aplicacion"
firstPage.actionButtonTitle = "Continuar"
func createLocationServicesBLTNPage() -> BLTNPageItem {
let firstPage = BLTNPageItem(title: "Servicios de Localizacion")
firstPage.image = UIImage(named: "buletin-2")
firstPage.descriptionText = "Para personalizar tu experiencia necesitamos tu localizacion. Esta informacion sera enviada a nuestros servidores de forma anonima. Puedes cambiar de opinion mas adelante en las preferencias de la aplicacion."
firstPage.actionButtonTitle = "Activar Localizacion"
firstPage.alternativeButtonTitle = "Ahora no"
firstPage.requiresCloseButton = false
firstPage.isDismissable = false
firstPage.appearance.shouldUseCompactDescriptionText = false
firstPage.appearance.actionButtonColor = UIColor(red:0.31, green:0.89, blue:0.76, alpha:1.0)
firstPage.appearance.shouldUseCompactDescriptionText = true
firstPage.next = createSuccessBLTNPage()
firstPage.actionHandler = { item in
/* Request Location */
self.locationManager.requestAlwaysAuthorization()
self.locationManager.requestWhenInUseAuthorization()
self.selection.selectionChanged()
item.manager?.displayNextItem()
}
firstPage.alternativeHandler = { item in
self.selection.selectionChanged()
item.manager?.displayNextItem()
self.notification.notificationOccurred(.success)
}
return firstPage
}


/** This launches the Success BLTN Page
- Returns : OnboardingBLTNPageItem
Expand Down

0 comments on commit 6917f87

Please sign in to comment.