Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified design and improve accessibility #444

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x1A",
"green" : "0x7D",
"red" : "0x4B"
"blue" : "0x23",
"green" : "0x81",
"red" : "0x21"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x35",
"green" : "0x7C",
"red" : "0x4F"
"blue" : "0x34",
"green" : "0x7F",
"red" : "0x57"
}
},
"idiom" : "universal"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
},
"colors" : [
{
"idiom" : "universal",
"color" : {
"color-space" : "srgb",
"components" : {
"red" : "0x8C",
"alpha" : "1.000",
"blue" : "0x68",
"green" : "0xC3"
"blue" : "0x35",
"green" : "0x7C",
"red" : "0x4F"
}
}
},
"idiom" : "universal"
}
]
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 3 additions & 3 deletions MoppApp/MoppApp/Assets.xcassets/Colors/Others/Contents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

This file was deleted.

44 changes: 21 additions & 23 deletions MoppApp/MoppApp/Container.storyboard

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion MoppApp/MoppApp/ContainerNotificationCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ class ContainerNotificationCell: UITableViewCell {
}

func populate(isSuccess: Bool, text: String) {
contentView.backgroundColor = isSuccess ? UIColor.moppSuccess : UIColor.moppWarning
contentView.backgroundColor = isSuccess ? UIColor.moppGreen700 : UIColor.moppWarning
infoLabel.text = text
infoLabel.textColor = isSuccess ? .white : .black
}
}
6 changes: 3 additions & 3 deletions MoppApp/MoppApp/ContainerSignatureCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ class ContainerSignatureCell: UITableViewCell {
let signatureStatusText = translationPrefix + " " + translationSufix
let signatureStatus = NSMutableAttributedString(string: signatureStatusText)
let mainColor: UIColor
if(valid){
mainColor = UIColor.moppSuccessTextDarker
}else{
if (valid) {
mainColor = UIColor.moppGreenValid
} else {
mainColor = UIColor.moppError
}
signatureStatus.addAttribute(NSAttributedString.Key.foregroundColor, value: mainColor, range: NSRange(location:0,length:translationPrefix.count))
Expand Down
21 changes: 9 additions & 12 deletions MoppApp/MoppApp/Extensions/UIColor+Additions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ extension UIColor {
class var moppSuccess: UIColor {
return UIColor(named: "MoppSuccess")!
}

class var moppSuccessText: UIColor {
return UIColor(named: "MoppSuccessText")!
}

class var moppWarning: UIColor {
return UIColor(named: "MoppWarning")!
Expand Down Expand Up @@ -110,6 +106,14 @@ extension UIColor {
return UIColor(named: "MoppLabelDarker")!
}

class var moppGreen700: UIColor {
return UIColor(named: "MoppGreen700")!
}

class var moppGreenValid: UIColor {
return UIColor(named: "MoppGreenValid")!
}

class var moppWarningTextDarker: UIColor {
return UIColor(named: "MoppWarningTextDarker")!
}
Expand All @@ -129,17 +133,10 @@ extension UIColor {
return UIColor(named: "MoppLabelBackgroundDarker")!
}

class var moppSuccessTextDarker: UIColor {
return UIColor(named: "MoppSuccessTextDarker")!
}

class var moppSuccessDarker: UIColor {
return UIColor(named: "MoppSuccessDarker")!
}

class var moppDetailText: UIColor {
return UIColor(named: "MoppDetailText")!
}

class var moppDetailValue: UIColor {
return UIColor(named: "MoppDetailValue")!
}
Expand Down
2 changes: 1 addition & 1 deletion MoppApp/MoppApp/MyeIDInfoManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class MyeIDInfoManager {
if isValid {
let certValidText = capitalized ? L(.myEidCertValid).capitalized : L(.myEidCertValid)
let validText = NSAttributedString(string: certValidText, attributes:
[.foregroundColor : UIColor.moppSuccessTextDarker])
[.foregroundColor : UIColor.moppGreen700])
attrText.append(validText)
} else {
let certExpiredText = capitalized ? L(.myEidCertExpired).capitalized : L(.myEidCertExpired)
Expand Down
6 changes: 6 additions & 0 deletions MoppApp/MoppApp/SwitchButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,20 @@ class SwitchButton: UISwitch {

override init(frame: CGRect) {
super.init(frame: frame)
setDefaultOnColor()
setDefaultOffColor()
}

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
setDefaultOnColor()
setDefaultOffColor()
}

private func setDefaultOnColor() {
self.onTintColor = UIColor.moppGreenValid
}

private func setDefaultOffColor() {
self.offColor = UIColor.moppLabel
}
Expand Down
13 changes: 7 additions & 6 deletions MoppApp/MoppApp/TokenFlow.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="right" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MHH-mX-gAV" customClass="SwitchButton" customModule="MoppApp" customModuleProvider="target">
<rect key="frame" x="276" y="0.0" width="51" height="31"/>
<rect key="frame" x="284.5" y="0.0" width="42.5" height="31"/>
<color key="onTintColor" red="0.54901960780000003" green="0.76470588240000004" blue="0.40784313729999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</switch>
</subviews>
</stackView>
Expand All @@ -292,7 +293,7 @@
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YH8-us-1Zw" customClass="MoppButton" customModule="MoppApp" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="160" height="32"/>
<color key="backgroundColor" red="0.0" green="0.43137254899999999" blue="0.70980392160000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" name="MoppError"/>
<fontDescription key="fontDescription" name="RobotoCondensed-Regular" family="Roboto Condensed" pointSize="17"/>
<state key="normal">
<color key="titleColor" red="0.9630651563" green="0.9630651563" blue="0.9630651563" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down Expand Up @@ -513,7 +514,7 @@
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3Oa-qq-zja" customClass="MoppButton" customModule="MoppApp" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="166.5" height="32"/>
<color key="backgroundColor" red="0.0" green="0.43137254899999999" blue="0.70980392160000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" name="MoppError"/>
<accessibility key="accessibilityConfiguration" identifier="IdCardCancelButton"/>
<fontDescription key="fontDescription" name="RobotoCondensed-Regular" family="Roboto Condensed" pointSize="17"/>
<state key="normal">
Expand Down Expand Up @@ -801,7 +802,7 @@
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="right" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7QK-Af-BRR" customClass="SwitchButton" customModule="MoppApp" customModuleProvider="target">
<rect key="frame" x="244" y="0.0" width="51" height="31"/>
<rect key="frame" x="253.5" y="0.0" width="41.5" height="31"/>
</switch>
</subviews>
</stackView>
Expand All @@ -810,7 +811,7 @@
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zrW-Cm-87h" customClass="ScaledButton" customModule="MoppApp" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="144" height="32"/>
<color key="backgroundColor" red="0.0" green="0.43137254899999999" blue="0.70980392160000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" name="MoppError"/>
<fontDescription key="fontDescription" name="RobotoCondensed-Regular" family="Roboto Condensed" pointSize="17"/>
<state key="normal">
<color key="titleColor" red="0.9630651563" green="0.9630651563" blue="0.9630651563" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down Expand Up @@ -1190,7 +1191,7 @@
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="x1X-cW-HvC" customClass="ScaledButton" customModule="MoppApp" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="160" height="40"/>
<color key="backgroundColor" red="0.0" green="0.43137254899999999" blue="0.70980392160000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" name="MoppError"/>
<fontDescription key="fontDescription" name="RobotoCondensed-Regular" family="Roboto Condensed" pointSize="17"/>
<state key="normal" title="CANCEL">
<color key="titleColor" red="0.9630651563" green="0.9630651563" blue="0.9630651563" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down