Skip to content

CT-3262 Payment Methods rotation layout issues - #344

Open
RafalOzogJudopay wants to merge 9 commits into
masterfrom
CT-3262-payment-methods-layout-issues-on-rotation
Open

CT-3262 Payment Methods rotation layout issues#344
RafalOzogJudopay wants to merge 9 commits into
masterfrom
CT-3262-payment-methods-layout-issues-on-rotation

Conversation

@RafalOzogJudopay

@RafalOzogJudopay RafalOzogJudopay commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Restores missing branch for portrait in updateLayoutForCurrentOrientation.
After orientation changes, it forces layout and re-runs viewModelNeedsUpdate so the header frame, table inset, and aspect-ratio-based constraints match the new screen size after rotation.
CGFloat headerHeight = kPortraitHeaderHeight * getWidthAspectRatio();
self.headerView.frame = CGRectMake(0, 0, screenWidth, headerHeight);
self.tableView.contentInset = UIEdgeInsetsMake(kPortraitContentInset * getWidthAspectRatio(), 0, 0, 0);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for corrupted Card layout on top, when being rotated from landscape to portrait.


[self.paymentStackView addArrangedSubview:self.payButton];
[self.payButton.widthAnchor constraintEqualToConstant:kHeaderPaymentButtonHeight * getWidthAspectRatio()].active = YES;
[self.payButton.widthAnchor constraintEqualToConstant:paymentButtonWidth].active = YES;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for inconsistent width of the button in landscape (depending whether it's been opened in landscape or switched to landscape from portrait).

- (void)prepareForOrientationChange {
[_cardHeaderView removeFromSuperview];
_cardHeaderView = nil;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removes leftover pieces of the top card in landscape (it was hidden correctly when opened in landscape, but leaving rubbish after rotation).

// Re-runs configureWithViewModel so header constraints pick up the new screen aspect ratio.
[self.presenter viewModelNeedsUpdate];
}];
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes incorrect Paym. Methods UI proportions after rotation.
It forces layout and re-runs viewModelNeedsUpdate so the header frame, table inset, and aspect-ratio-based constraints are recalculated properly for new orientation.

@RafalOzogJudopay RafalOzogJudopay changed the title DRAFT CT-3262 Payment Methods rotation layout issues CT-3262 Payment Methods rotation layout issues Jul 21, 2026
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
16 Security Hotspots
12.8% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

💡 Need a hand with PR review? Try Gitar by Sonar!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants