Skip to content

Swf 17 credit health #17

Merged
merged 26 commits into from May 1, 2019
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
38a78cf
radial progress indicators and page-based nav
ahm11003 Feb 13, 2019
5d7cb80
Added Balance, Utilization, and AccountNumber Controllers. Added PLis…
Mar 6, 2019
10e6442
PList Functions
ahm11003 Mar 6, 2019
c212e13
Merge pull request #5 from rrk12005/demo-radial-style-progress-indica…
jod13004 Mar 6, 2019
83e5766
Added Utilization score calculation
Mar 28, 2019
3be3eef
Renamed files to more accurately represent them. Changed wellness rad…
Mar 29, 2019
5a821f7
no message
Mar 29, 2019
a2f3c9d
Merge branch 'master' into SWF-17-credit-health
ahm11003 Apr 9, 2019
9303329
- Functions for utilization and account (temporary) metrics.
Apr 11, 2019
3599c77
SWF-17 remove storyboard segue
ahm11003 Apr 11, 2019
2c07f8e
SWF-17 pass our metrics to page hierarchy
ahm11003 Apr 11, 2019
416c2ea
SWF-17 credit utilization improvements
ahm11003 Apr 17, 2019
3e7ddcd
SWE-17 remove unused classes and files
ahm11003 Apr 17, 2019
8e8dec7
SWF-17 fix logical error leading to bad utilization score
ahm11003 Apr 17, 2019
a5c4ac1
SWF-17 remove unused class
ahm11003 Apr 17, 2019
85fd3e2
SWF-17 new class to display trends in credit utilization
ahm11003 Apr 17, 2019
4f67b56
SWF-17 new image assets, implementation for utilization trend
ahm11003 Apr 17, 2019
23fb930
SWF-17 Added basic details for utilization trends
ahm11003 Apr 17, 2019
80acdbf
Merge branch 'master' into SWF-17-credit-health
ahm11003 Apr 17, 2019
ddbc228
SWF-17 More wellness implementation
ahm11003 Apr 23, 2019
4a55d89
SWF-17 more wellness configuration
ahm11003 Apr 23, 2019
d170909
SWF-17 remove unused code
ahm11003 Apr 23, 2019
433ebac
SWF-17 More wellness implementation and improvements
ahm11003 Apr 23, 2019
17dd1df
SWF-17 metric calculations
ahm11003 Apr 23, 2019
a949599
SWF-17 clean up how we receive data for utilization
ahm11003 Apr 23, 2019
f84701b
SWF-17 new image assets, wellness calculation
ahm11003 Apr 24, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+33 −13
Diff settings

Always

Just for now

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
  • Loading branch information...
ahm11003 committed Apr 17, 2019
commit 416c2ea7482e2ed4bb971ccdcc81a18ccd71fd30
@@ -17,7 +17,9 @@
<button alignment="center" id="8yj-m6-1L9">
<group key="contentGroup" width="1" height="0.5" alignment="left" contentMode="scaleAspectFit" layout="vertical" id="SBG-wc-YDJ">
<items>
<imageView height="0.69999999999999996" alignment="center" image="account_menu_cc_icon" contentMode="scaleAspectFit" id="zAJ-yo-M72"/>
<imageView height="0.69999999999999996" alignment="center" image="account_menu_cc_icon" contentMode="scaleAspectFit" id="zAJ-yo-M72">
<color key="tintColor" red="0.070061393082141876" green="0.36642074584960938" blue="0.30139422416687012" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</imageView>
<label alignment="center" text="Accounts" id="Ohi-ve-NfC"/>
</items>
</group>
@@ -56,7 +58,7 @@
<items>
<label width="1" alignment="center" text="Credit Wellness" textAlignment="center" id="eqA-XH-rlH"/>
<imageView width="1" height="86" alignment="center" verticalAlignment="center" image="scores" contentMode="scaleAspectFit" initiallyAnimated="NO" animationDuration="2" id="aTf-mo-FEr"/>
<button width="1" alignment="center" verticalAlignment="bottom" title="Tap For More" id="yYk-gv-I5B">
<button width="1" alignment="center" verticalAlignment="bottom" title="Breakdown" id="yYk-gv-I5B">
<fontDescription key="font" type="system" pointSize="13"/>
<connections>
<action selector="moreButtonTapped" destination="FsK-xr-8Fi" id="uxY-jK-pTW"/>
@@ -134,12 +136,15 @@
<group width="1" alignment="left" id="ohQ-In-SGt">
<items>
<button width="67" alignment="left" title="Pay" id="zeF-ky-mkm">
<color key="backgroundColor" red="0.070061393080000006" green="0.3664207458" blue="0.3013942242" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<action selector="payBillTapped" destination="yrN-yp-gkH" id="iQy-Ty-omn"/>
<segue destination="XXR-hJ-s6t" kind="push" identifier="payBill" id="jGh-Ix-ean"/>
</connections>
</button>
<button width="64" alignment="right" title="Recent" id="0HI-HK-yDl">
<color key="titleColor" red="0.070061393080000006" green="0.3664207458" blue="0.3013942242" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<action selector="recentButtonTapped" destination="yrN-yp-gkH" id="8Rp-SG-lGZ"/>
</connections>
@@ -314,8 +319,17 @@
<objects>
<controller identifier="UtilizationScore" id="RNe-Ul-1jm" customClass="UtilizationInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<items>
<label width="1" alignment="left" text="Utilization Score" textAlignment="center" id="Rzj-RR-iat"/>
<imageView width="1" height="120" alignment="center" verticalAlignment="center" image="scores" contentMode="scaleAspectFit" initiallyAnimated="NO" id="MkL-48-J8l"/>
<group width="1" height="1" alignment="left" layout="vertical" id="ad4-JN-O9D">
<items>
<label width="1" alignment="left" text="Credit Utilization" textAlignment="center" id="Rzj-RR-iat"/>
<imageView width="1" height="100" alignment="center" verticalAlignment="center" image="scores" contentMode="scaleAspectFit" initiallyAnimated="NO" id="MkL-48-J8l"/>
<button width="1" alignment="left" verticalAlignment="center" title="Details" id="AR5-QD-8ad">
<connections>
<action selector="showDetails" destination="RNe-Ul-1jm" id="jBx-8s-RHe"/>
</connections>
</button>
</items>
</group>
</items>
<connections>
<outlet property="image3" destination="MkL-48-J8l" id="QRq-aZ-tTD"/>
@@ -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: {})])
}
}
@@ -59,10 +59,10 @@ class WellnessInterfaceController: WKInterfaceController {
private func calculateUtilization() {
var totalBalance: Double = 0
var totalCredit: Double = 0
for index in 0..<accounts.count {
totalBalance += accounts[index].curBalance
totalCredit += accounts[index].creditLimit

accounts.forEach {
totalCredit += $0.availCredit
totalBalance += $0.curBalance
}

let util = round(((totalBalance)/(totalCredit)) * 100)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.