From 416c2ea7482e2ed4bb971ccdcc81a18ccd71fd30 Mon Sep 17 00:00:00 2001 From: Alan Maynard Date: Wed, 17 Apr 2019 17:27:20 -0400 Subject: [PATCH] SWF-17 credit utilization improvements - dynamically resize the radial indicator to allow showing a button below to explain the metric - recolored some buttons on account details screen --- .../Base.lproj/Interface.storyboard | 22 +++++++++++++++---- .../UtilizationfaceController.swift | 16 +++++++++----- .../WellnessInterfaceController.swift | 8 +++---- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/SynchronyFinancial/SynchronyFinancial WatchKit App/Base.lproj/Interface.storyboard b/SynchronyFinancial/SynchronyFinancial WatchKit App/Base.lproj/Interface.storyboard index 4e021ef..3e7c4b3 100644 --- a/SynchronyFinancial/SynchronyFinancial WatchKit App/Base.lproj/Interface.storyboard +++ b/SynchronyFinancial/SynchronyFinancial WatchKit App/Base.lproj/Interface.storyboard @@ -17,7 +17,9 @@ + + diff --git a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/UtilizationfaceController.swift b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/UtilizationfaceController.swift index d0c289b..1c3672f 100644 --- a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/UtilizationfaceController.swift +++ b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/UtilizationfaceController.swift @@ -17,7 +17,11 @@ class UtilizationInterfaceController: WKInterfaceController { @IBOutlet weak var image3: WKInterfaceImage! override func awake(withContext context: Any?) { super.awake(withContext: context) - + + // resize according to screen size so we can display button below + image3.setHeight(contentFrame.height / 2) + image3.setWidth(contentFrame.height / 2) + image3.setHorizontalAlignment(.center) score = context as? Int // get plist data to generate utilization metric @@ -49,16 +53,18 @@ class UtilizationInterfaceController: WKInterfaceController { didAnimate = true } } - + override func willActivate() { // This method is called when watch view controller is about to be visible to user super.willActivate() } - - + override func didDeactivate() { // This method is called when watch view controller is no longer visible super.didDeactivate() } -} + @IBAction func showDetails() { + presentAlert(withTitle: "Utilization Details", message: "Credit utilization is the ratio of credit used compared to total credit. Ideally, this value should be 20% or below.", preferredStyle: .alert, actions: [WKAlertAction(title: "Done", style: .default, handler: {})]) + } +} diff --git a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/WellnessInterfaceController.swift b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/WellnessInterfaceController.swift index 778f7c2..017be6d 100644 --- a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/WellnessInterfaceController.swift +++ b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/WellnessInterfaceController.swift @@ -59,10 +59,10 @@ class WellnessInterfaceController: WKInterfaceController { private func calculateUtilization() { var totalBalance: Double = 0 var totalCredit: Double = 0 - - for index in 0..