From e6e6544b78845f3e5ad719c6eedbaa5bbdd71703 Mon Sep 17 00:00:00 2001 From: Povilas Staskus <4062343+staskus@users.noreply.github.com> Date: Wed, 12 Mar 2025 09:56:05 +0200 Subject: [PATCH 1/6] Embed CardPresentPaymentModalViewController in self-sizing scrollView The modal continues to behave as before - grows in size if content expands but when the content doesn't fit anymore the modal starts support scrolling. In 99% of cases it only kicks in with larger dynamic type size --- ...CardPresentPaymentsModalViewController.xib | 260 ++++++++++-------- 1 file changed, 149 insertions(+), 111 deletions(-) diff --git a/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.xib b/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.xib index c5fba549de0..1d291b63e39 100644 --- a/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.xib +++ b/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.xib @@ -15,7 +15,7 @@ - + @@ -25,6 +25,7 @@ + @@ -40,137 +41,180 @@ - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + - - - - - - - - - - - + + + - + + + - - - - + - + - - - @@ -179,12 +223,6 @@ - - - - - - @@ -199,7 +237,7 @@ - + From 854fe39d720da3ec654972cac570d5727d5a8011 Mon Sep 17 00:00:00 2001 From: Povilas Staskus <4062343+staskus@users.noreply.github.com> Date: Wed, 12 Mar 2025 09:57:39 +0200 Subject: [PATCH 2/6] Allow titles for buttons to shrink to make sure the button text fits Only applies to large accessibility sizes and long button titles --- .../CardPresentPaymentsModalViewController.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.swift b/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.swift index 7f0e3c08517..7473c9714ab 100644 --- a/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.swift +++ b/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.swift @@ -185,14 +185,14 @@ private extension CardPresentPaymentsModalViewController { func stylePrimaryButton() { primaryButton.applyPrimaryButtonStyle() primaryButton.titleLabel?.adjustsFontSizeToFitWidth = true - primaryButton.titleLabel?.minimumScaleFactor = 0.5 + primaryButton.titleLabel?.minimumScaleFactor = 0.3 primaryButton.titleLabel?.lineBreakMode = .byClipping } func styleSecondaryButton() { secondaryButton.applyPaymentsModalCancelButtonStyle() secondaryButton.titleLabel?.adjustsFontSizeToFitWidth = true - secondaryButton.titleLabel?.minimumScaleFactor = 0.5 + secondaryButton.titleLabel?.minimumScaleFactor = 0.3 secondaryButton.titleLabel?.lineBreakMode = .byClipping } @@ -200,7 +200,7 @@ private extension CardPresentPaymentsModalViewController { if viewModel.actionsMode != .secondaryActionAndAuxiliaryButton { auxiliaryButton.applyLinkButtonStyle() } - auxiliaryButton.titleLabel?.minimumScaleFactor = 0.5 + auxiliaryButton.titleLabel?.minimumScaleFactor = 0.3 auxiliaryButton.titleLabel?.adjustsFontSizeToFitWidth = true auxiliaryButton.titleLabel?.lineBreakMode = .byClipping } From 1fa771519bc927d2c851d02647772eb0199e3efa Mon Sep 17 00:00:00 2001 From: Povilas Staskus <4062343+staskus@users.noreply.github.com> Date: Wed, 12 Mar 2025 09:59:05 +0200 Subject: [PATCH 3/6] Allow unlimited length of text within card present payment modals Modals now support scrolling so longer content can be shown without cutting it off or shrinking it --- .../CardPresentPaymentsModalViewController.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.swift b/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.swift index 7473c9714ab..13ec14409e7 100644 --- a/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.swift +++ b/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.swift @@ -149,10 +149,12 @@ private extension CardPresentPaymentsModalViewController { func styleTopTitle() { topTitleLabel.applyBodyStyle() + topTitleLabel.numberOfLines = 0 } func styleTopSubtitle() { topSubtitleLabel.applyTitleStyle() + topSubtitleLabel.numberOfLines = 0 } func styleBottomLabels() { @@ -166,10 +168,12 @@ private extension CardPresentPaymentsModalViewController { func styleBottomTitle() { bottomTitleLabel.applySubheadlineStyle() + bottomTitleLabel.numberOfLines = 0 } func styleBottomSubtitle() { bottomSubtitleLabel.applyFootnoteStyle() + bottomSubtitleLabel.numberOfLines = 0 } func styleActionButtons() { From 9e225de825761dcf961e9828746d8cf7ae422f11 Mon Sep 17 00:00:00 2001 From: Povilas Staskus <4062343+staskus@users.noreply.github.com> Date: Wed, 12 Mar 2025 09:59:39 +0200 Subject: [PATCH 4/6] Set card present email attributed text to support dynamic type --- .../CardPresentModalBuiltInSuccessEmailSent.swift | 2 +- .../CardPresentPayments/CardPresentModalSuccessEmailSent.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WooCommerce/Classes/ViewModels/CardPresentPayments/CardPresentModalBuiltInSuccessEmailSent.swift b/WooCommerce/Classes/ViewModels/CardPresentPayments/CardPresentModalBuiltInSuccessEmailSent.swift index b14393e4b2b..9be9bc82492 100644 --- a/WooCommerce/Classes/ViewModels/CardPresentPayments/CardPresentModalBuiltInSuccessEmailSent.swift +++ b/WooCommerce/Classes/ViewModels/CardPresentPayments/CardPresentModalBuiltInSuccessEmailSent.swift @@ -45,7 +45,7 @@ final class CardPresentModalBuiltInSuccessEmailSent: CardPresentPaymentsModalVie let attributedString = NSMutableAttributedString(string: formattedMessage) if let emailRange = formattedMessage.range(of: email) { let nsRange = NSRange(emailRange, in: formattedMessage) - attributedString.addAttributes([.font: UIFont.boldSystemFont(ofSize: UIFont.systemFontSize)], range: nsRange) + attributedString.addAttributes([.font: UIFont.preferredFont(forTextStyle: .body).bold], range: nsRange) } self.bottomAttributedTitle = attributedString } diff --git a/WooCommerce/Classes/ViewModels/CardPresentPayments/CardPresentModalSuccessEmailSent.swift b/WooCommerce/Classes/ViewModels/CardPresentPayments/CardPresentModalSuccessEmailSent.swift index 4aa3af1f173..2ee6a1fea22 100644 --- a/WooCommerce/Classes/ViewModels/CardPresentPayments/CardPresentModalSuccessEmailSent.swift +++ b/WooCommerce/Classes/ViewModels/CardPresentPayments/CardPresentModalSuccessEmailSent.swift @@ -45,7 +45,7 @@ final class CardPresentModalSuccessEmailSent: CardPresentPaymentsModalViewModel let attributedString = NSMutableAttributedString(string: formattedMessage) if let emailRange = formattedMessage.range(of: email) { let nsRange = NSRange(emailRange, in: formattedMessage) - attributedString.addAttributes([.font: UIFont.boldSystemFont(ofSize: UIFont.systemFontSize)], range: nsRange) + attributedString.addAttributes([.font: UIFont.preferredFont(forTextStyle: .body).bold], range: nsRange) } self.bottomAttributedTitle = attributedString } From 7f12e2a88efdc1c1c71fa84a8ab7db803e2c4876 Mon Sep 17 00:00:00 2001 From: Povilas Staskus <4062343+staskus@users.noreply.github.com> Date: Wed, 12 Mar 2025 10:13:30 +0200 Subject: [PATCH 5/6] Update CardPresentPaymentsModalViewController.xib --- .../CardPresentPaymentsModalViewController.xib | 1 - 1 file changed, 1 deletion(-) diff --git a/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.xib b/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.xib index 1d291b63e39..c3d56ef90b2 100644 --- a/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.xib +++ b/WooCommerce/Classes/ViewRelated/CardPresentPayments/CardPresentPaymentsModalViewController.xib @@ -25,7 +25,6 @@ - From 38d1c30a5325b2e45615241218389db1354c186b Mon Sep 17 00:00:00 2001 From: Povilas Staskus <4062343+staskus@users.noreply.github.com> Date: Wed, 12 Mar 2025 10:26:01 +0200 Subject: [PATCH 6/6] Update RELEASE-NOTES.txt --- RELEASE-NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 9d1f78201db..a2af10a8794 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -5,7 +5,7 @@ ----- - [*] Product Form: Fix crash related to picking photos [https://github.com/woocommerce/woocommerce-ios/pull/15275] - [internal] Assign `siteID` and `productID` to image product upload statuses. [https://github.com/woocommerce/woocommerce-ios/pull/15196] - +- [*] Payments: Improved payment views' adaptability to larger accessibility font sizes [https://github.com/woocommerce/woocommerce-ios/pull/15328]. 21.9 -----