-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #240 from afterpay/feature/compact-badge
EIT-1889: Feature: Compact badge option
- Loading branch information
Showing
22 changed files
with
151 additions
and
4 deletions.
There are no files selected for viewing
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
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
6 changes: 6 additions & 0 deletions
6
Sources/Afterpay/Resources/Assets.xcassets/images/compact-badge/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" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...xcassets/images/compact-badge/compact-badge-afterpay-black-on-mint.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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "compact-badge-afterpay-black-on-mint.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+2.54 KB
...ge/compact-badge-afterpay-black-on-mint.imageset/compact-badge-afterpay-black-on-mint.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
...cassets/images/compact-badge/compact-badge-afterpay-black-on-white.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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "compact-badge-afterpay-black-on-white.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+2.52 KB
.../compact-badge-afterpay-black-on-white.imageset/compact-badge-afterpay-black-on-white.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
...xcassets/images/compact-badge/compact-badge-afterpay-mint-on-black.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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "compact-badge-afterpay-mint-on-black.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+2.54 KB
...ge/compact-badge-afterpay-mint-on-black.imageset/compact-badge-afterpay-mint-on-black.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
...cassets/images/compact-badge/compact-badge-afterpay-white-on-black.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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "compact-badge-afterpay-white-on-black.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+2.52 KB
.../compact-badge-afterpay-white-on-black.imageset/compact-badge-afterpay-white-on-black.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
...xcassets/images/compact-badge/compact-badge-clearpay-black-on-mint.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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "compact-badge-clearpay-black-on-mint.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+2.56 KB
...ge/compact-badge-clearpay-black-on-mint.imageset/compact-badge-clearpay-black-on-mint.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
...cassets/images/compact-badge/compact-badge-clearpay-black-on-white.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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "compact-badge-clearpay-black-on-white.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+2.54 KB
.../compact-badge-clearpay-black-on-white.imageset/compact-badge-clearpay-black-on-white.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
...xcassets/images/compact-badge/compact-badge-clearpay-mint-on-black.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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "compact-badge-clearpay-mint-on-black.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+2.55 KB
...ge/compact-badge-clearpay-mint-on-black.imageset/compact-badge-clearpay-mint-on-black.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
...cassets/images/compact-badge/compact-badge-clearpay-white-on-black.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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "compact-badge-clearpay-white-on-black.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+2.54 KB
.../compact-badge-clearpay-white-on-black.imageset/compact-badge-clearpay-white-on-black.pdf
Binary file not shown.
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,33 @@ | ||
// | ||
// BadgeView.swift | ||
// Afterpay | ||
// | ||
// Created by Adam Campbell on 31/7/20. | ||
// Copyright © 2020 Afterpay. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
public class CompactBadgeView: AfterpayLogo { | ||
override public init(colorScheme: ColorScheme = .static(.blackOnMint)) { | ||
super.init(colorScheme: colorScheme) | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
super.init(coder: coder) | ||
} | ||
|
||
override internal func getImageName(brand: String, color: String) -> String { | ||
return "compact-badge-\(brand)-\(color)" | ||
} | ||
|
||
override internal func getImageColor() -> String { | ||
var color = colorScheme.lightPalette.slug | ||
if traitCollection.userInterfaceStyle == .dark { | ||
color = colorScheme.darkPalette.slug | ||
} | ||
|
||
return color | ||
} | ||
} |
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
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