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

[Android] Fixed the SwipeView items were not displayed properly #27399

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Ahamed-Ali
Copy link
Contributor

Issue 1:

On right swipe, the text is not visible on Android.

Issue 2:

On left swipe, the text is not centered and remains at the start position on Android.

Root Cause of the issues

  • The issue occurs because MeasureSpecMode.AtMost causes the TextView to be rendered with a small size based on its content, resulting in improper display when swiping right on items and misalignment when swiping left.

Description of Change

  • The fix involves changing MeasureSpecMode to MeasureSpecMode.Exactly, ensuring the TextView is rendered with the specified SwipeItemWidth, thereby resolving both issues.

Regressed PR

Issues Fixed

Fixes #27367

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshot

Before Issue Fix After Issue Fix
SwipeViewTextIssue.mov
SwipeViewTextFix.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jan 28, 2025
@karthikraja-arumugam karthikraja-arumugam added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jan 28, 2025
@@ -0,0 +1,27 @@
#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS
// On Catalyst, Swipe actions not supported in Appium.
//Unable to capture a screenshot with the swipe open in windows, as SwipeRightToLeft does not fully open the SwipeItems and instead closes them.
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds like a bug could you confirm and create a new issue? If create a new issue, please add the link to it in the comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have a created the 27436 bug report and added the link in the test case.

@@ -0,0 +1,27 @@
#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS
// On Catalyst, Swipe actions not supported in Appium.
Copy link
Contributor

Choose a reason for hiding this comment

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

Will include a specific swipe action using the Appium Mac Driver.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jsuarezruiz
Copy link
Contributor

/rebase

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).


namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue27367 : _IssuesUITest
Copy link
Contributor

Choose a reason for hiding this comment

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

Both tests are failing on Android with small snapshot differences. For example:
image
Look wrong now, could you review it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @jsuarezruiz ,

The test fails because the CI takes a screenshot before the swipe is fully completed, resulting in a slight visual difference. Adding a WaitForElement before VerifyScreenshot resolves the issue.

@Ahamed-Ali Ahamed-Ali marked this pull request as ready for review February 3, 2025 07:47
@Ahamed-Ali Ahamed-Ali requested a review from a team as a code owner February 3, 2025 07:47
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] Right SwipeView items are not visible in the SwipeView.
3 participants