Skip to content

Commit 9a52eb2

Browse files
authored
Enable scrolling in card present modals when it cannot grow in size anymore (#15328)
2 parents 74b52ab + 38d1c30 commit 9a52eb2

File tree

5 files changed

+158
-117
lines changed

5 files changed

+158
-117
lines changed

RELEASE-NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
-----
66
- [*] Product Form: Fix crash related to picking photos [https://github.com/woocommerce/woocommerce-ios/pull/15275]
77
- [internal] Assign `siteID` and `productID` to image product upload statuses. [https://github.com/woocommerce/woocommerce-ios/pull/15196]
8-
8+
- [*] Payments: Improved payment views' adaptability to larger accessibility font sizes [https://github.com/woocommerce/woocommerce-ios/pull/15328].
99

1010
21.9
1111
-----

WooCommerce/Classes/ViewModels/CardPresentPayments/CardPresentModalBuiltInSuccessEmailSent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ final class CardPresentModalBuiltInSuccessEmailSent: CardPresentPaymentsModalVie
4545
let attributedString = NSMutableAttributedString(string: formattedMessage)
4646
if let emailRange = formattedMessage.range(of: email) {
4747
let nsRange = NSRange(emailRange, in: formattedMessage)
48-
attributedString.addAttributes([.font: UIFont.boldSystemFont(ofSize: UIFont.systemFontSize)], range: nsRange)
48+
attributedString.addAttributes([.font: UIFont.preferredFont(forTextStyle: .body).bold], range: nsRange)
4949
}
5050
self.bottomAttributedTitle = attributedString
5151
}

WooCommerce/Classes/ViewModels/CardPresentPayments/CardPresentModalSuccessEmailSent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ final class CardPresentModalSuccessEmailSent: CardPresentPaymentsModalViewModel
4545
let attributedString = NSMutableAttributedString(string: formattedMessage)
4646
if let emailRange = formattedMessage.range(of: email) {
4747
let nsRange = NSRange(emailRange, in: formattedMessage)
48-
attributedString.addAttributes([.font: UIFont.boldSystemFont(ofSize: UIFont.systemFontSize)], range: nsRange)
48+
attributedString.addAttributes([.font: UIFont.preferredFont(forTextStyle: .body).bold], range: nsRange)
4949
}
5050
self.bottomAttributedTitle = attributedString
5151
}

WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,12 @@ private extension CardPresentPaymentsModalViewController {
149149

150150
func styleTopTitle() {
151151
topTitleLabel.applyBodyStyle()
152+
topTitleLabel.numberOfLines = 0
152153
}
153154

154155
func styleTopSubtitle() {
155156
topSubtitleLabel.applyTitleStyle()
157+
topSubtitleLabel.numberOfLines = 0
156158
}
157159

158160
func styleBottomLabels() {
@@ -166,10 +168,12 @@ private extension CardPresentPaymentsModalViewController {
166168

167169
func styleBottomTitle() {
168170
bottomTitleLabel.applySubheadlineStyle()
171+
bottomTitleLabel.numberOfLines = 0
169172
}
170173

171174
func styleBottomSubtitle() {
172175
bottomSubtitleLabel.applyFootnoteStyle()
176+
bottomSubtitleLabel.numberOfLines = 0
173177
}
174178

175179
func styleActionButtons() {
@@ -185,22 +189,22 @@ private extension CardPresentPaymentsModalViewController {
185189
func stylePrimaryButton() {
186190
primaryButton.applyPrimaryButtonStyle()
187191
primaryButton.titleLabel?.adjustsFontSizeToFitWidth = true
188-
primaryButton.titleLabel?.minimumScaleFactor = 0.5
192+
primaryButton.titleLabel?.minimumScaleFactor = 0.3
189193
primaryButton.titleLabel?.lineBreakMode = .byClipping
190194
}
191195

192196
func styleSecondaryButton() {
193197
secondaryButton.applyPaymentsModalCancelButtonStyle()
194198
secondaryButton.titleLabel?.adjustsFontSizeToFitWidth = true
195-
secondaryButton.titleLabel?.minimumScaleFactor = 0.5
199+
secondaryButton.titleLabel?.minimumScaleFactor = 0.3
196200
secondaryButton.titleLabel?.lineBreakMode = .byClipping
197201
}
198202

199203
func styleAuxiliaryButton() {
200204
if viewModel.actionsMode != .secondaryActionAndAuxiliaryButton {
201205
auxiliaryButton.applyLinkButtonStyle()
202206
}
203-
auxiliaryButton.titleLabel?.minimumScaleFactor = 0.5
207+
auxiliaryButton.titleLabel?.minimumScaleFactor = 0.3
204208
auxiliaryButton.titleLabel?.adjustsFontSizeToFitWidth = true
205209
auxiliaryButton.titleLabel?.lineBreakMode = .byClipping
206210
}

0 commit comments

Comments
 (0)