-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SWF-21 Extensions on WKInterfaceImage
- this will enable us to quickly show, hide and configure “activity indicators” - to be used when we are waiting for web service calls to return - added Image assets for animation
- Loading branch information
Showing
27 changed files
with
177 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
SynchronyFinancial/SynchronyFinancial WatchKit App/Assets.xcassets/cc_activity/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...nyFinancial WatchKit App/Assets.xcassets/cc_activity/cc_activity_0.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity0.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity0@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity0@3x.png", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+1.13 KB
...atchKit App/Assets.xcassets/cc_activity/cc_activity_0.imageset/cc_activity0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.07 KB
...hKit App/Assets.xcassets/cc_activity/cc_activity_0.imageset/cc_activity0@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.58 KB
...hKit App/Assets.xcassets/cc_activity/cc_activity_0.imageset/cc_activity0@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
...nyFinancial WatchKit App/Assets.xcassets/cc_activity/cc_activity_1.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity1.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity1@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity1@3x.png", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+1.32 KB
...atchKit App/Assets.xcassets/cc_activity/cc_activity_1.imageset/cc_activity1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.63 KB
...hKit App/Assets.xcassets/cc_activity/cc_activity_1.imageset/cc_activity1@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.98 KB
...hKit App/Assets.xcassets/cc_activity/cc_activity_1.imageset/cc_activity1@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
...nyFinancial WatchKit App/Assets.xcassets/cc_activity/cc_activity_2.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity2.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity2@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity2@3x.png", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+1.33 KB
...atchKit App/Assets.xcassets/cc_activity/cc_activity_2.imageset/cc_activity2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.63 KB
...hKit App/Assets.xcassets/cc_activity/cc_activity_2.imageset/cc_activity2@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.96 KB
...hKit App/Assets.xcassets/cc_activity/cc_activity_2.imageset/cc_activity2@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
...nyFinancial WatchKit App/Assets.xcassets/cc_activity/cc_activity_3.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity3.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity3@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity3@3x.png", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+1.35 KB
...atchKit App/Assets.xcassets/cc_activity/cc_activity_3.imageset/cc_activity3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.6 KB
...hKit App/Assets.xcassets/cc_activity/cc_activity_3.imageset/cc_activity3@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4 KB
...hKit App/Assets.xcassets/cc_activity/cc_activity_3.imageset/cc_activity3@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
...nyFinancial WatchKit App/Assets.xcassets/cc_activity/cc_activity_4.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity4.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity4@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity4@3x.png", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+1.36 KB
...atchKit App/Assets.xcassets/cc_activity/cc_activity_4.imageset/cc_activity4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.63 KB
...hKit App/Assets.xcassets/cc_activity/cc_activity_4.imageset/cc_activity4@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4 KB
...hKit App/Assets.xcassets/cc_activity/cc_activity_4.imageset/cc_activity4@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
...nyFinancial WatchKit App/Assets.xcassets/cc_activity/cc_activity_5.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity5.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity5@2x.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "cc_activity5@3x.png", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+1.36 KB
...atchKit App/Assets.xcassets/cc_activity/cc_activity_5.imageset/cc_activity5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.64 KB
...hKit App/Assets.xcassets/cc_activity/cc_activity_5.imageset/cc_activity5@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.02 KB
...hKit App/Assets.xcassets/cc_activity/cc_activity_5.imageset/cc_activity5@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions
29
SynchronyFinancial/SynchronyFinancial WatchKit Extension/WKInterfaceImage+Extensions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// WKInterfaceImage+Extensions.swift | ||
// SynchronyFinancial WatchKit Extension | ||
// | ||
// Created by Alan Maynard on 3/28/19. | ||
// Copyright © 2019 Alan Maynard. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import WatchKit | ||
|
||
extension WKInterfaceImage { | ||
public func configureForActivityIndicator() { | ||
self.setHidden(false) | ||
self.setImageNamed("cc_activity_") | ||
self.setHorizontalAlignment(.center) | ||
self.setVerticalAlignment(.center) | ||
startAnimatingAsIndicator() | ||
} | ||
|
||
public func startAnimatingAsIndicator() { | ||
self.startAnimatingWithImages(in: .init(location: 0, length: 6), duration: 0.5, repeatCount: 0) | ||
} | ||
|
||
public func stopAnimatingAsIndicator() { | ||
self.setHidden(true) | ||
self.stopAnimating() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters