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

Enable scrolling in card present modals when it cannot grow in size anymore #15328

Merged
merged 6 commits into from
Mar 12, 2025
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
2 changes: 1 addition & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,12 @@ private extension CardPresentPaymentsModalViewController {

func styleTopTitle() {
topTitleLabel.applyBodyStyle()
topTitleLabel.numberOfLines = 0
}

func styleTopSubtitle() {
topSubtitleLabel.applyTitleStyle()
topSubtitleLabel.numberOfLines = 0
}

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

func styleBottomTitle() {
bottomTitleLabel.applySubheadlineStyle()
bottomTitleLabel.numberOfLines = 0
}

func styleBottomSubtitle() {
bottomSubtitleLabel.applyFootnoteStyle()
bottomSubtitleLabel.numberOfLines = 0
}

func styleActionButtons() {
Expand All @@ -185,22 +189,22 @@ 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
}

func styleAuxiliaryButton() {
if viewModel.actionsMode != .secondaryActionAndAuxiliaryButton {
auxiliaryButton.applyLinkButtonStyle()
}
auxiliaryButton.titleLabel?.minimumScaleFactor = 0.5
auxiliaryButton.titleLabel?.minimumScaleFactor = 0.3
auxiliaryButton.titleLabel?.adjustsFontSizeToFitWidth = true
auxiliaryButton.titleLabel?.lineBreakMode = .byClipping
}
Expand Down
Loading