Skip to content

Conversation

@kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Nov 1, 2025

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

Corrects label padding handling in RTL mode by using SetPaddingRelative on Android and flipping left/right insets on iOS. Adds test cases and UI tests to verify correct padding mirroring for labels in RTL layouts.

Issues Fixed

Fixes #32316

Corrects label padding handling in RTL mode by using SetPaddingRelative on Android and flipping left/right insets on iOS. Adds test cases and UI tests to verify correct padding mirroring for labels in RTL layouts.
Copilot AI review requested due to automatic review settings November 1, 2025 15:28
@kubaflo kubaflo self-assigned this Nov 1, 2025
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Nov 1, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request fixes an issue where label padding does not properly mirror in RTL (right-to-left) mode on iOS and Android platforms. The fix ensures that when a layout direction is set to RTL, the left and right padding values are swapped appropriately.

Key Changes:

  • iOS: Modified MauiLabel.DrawText to swap left/right insets when in RTL layout direction
  • Android: Changed SetPadding to SetPaddingRelative to use Android's built-in RTL support
  • Added UI tests to validate RTL padding behavior

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/Core/src/Platform/iOS/MauiLabel.cs Adds RTL-aware inset flipping logic to swap left/right text insets when layout direction is RTL
src/Core/src/Platform/Android/TextViewExtensions.cs Changes from absolute padding to relative padding method for automatic RTL support
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32316.cs Adds NUnit test implementation to validate RTL padding behavior
src/Controls/tests/TestCases.HostApp/Issues/Issue32316.cs Creates test UI page demonstrating label padding with RTL flow direction toggling

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

{
App.WaitForElement("ToggleFlowDirectionButton");
App.Tap("ToggleFlowDirectionButton");
VerifyScreenshot();
Copy link
Contributor

Choose a reason for hiding this comment

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

Pending snapshots, running a build.

Copy link
Contributor

Choose a reason for hiding this comment

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

Snapshots are available in the latest build.
image
Could you commit the images?

@rmarinho
Copy link
Member

rmarinho commented Nov 5, 2025

/azp run MAUI-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Label] RTL mode: Padding for the label is not mirroring properly(Android, iOS, Mac)

3 participants