Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[iOS, Android] Change the SwipeView Content BackgroundColor Behavior #13673

Merged
merged 2 commits into from
May 6, 2021

Conversation

jsuarezruiz
Copy link
Contributor

Description of Change

Change the SwipeView Content BackgroundColor Behavior.

What should be the default behavior of the background color of the SwipeView content?

Previously (Xamarin.Forms 4.8), if a background color was not assigned to the content of the SwipeView, the background color of the SwipeView was set to the content.

Pros

  • Most devs assign the background color to the SwipeView, not the content.

Cons

  • If you want to use the default color (transparent), you must assign it explicitly.

The current behavior assigns the background color of the SwipeView in the renderer, but does nothing with the Content. Content must be explicitly assigned.

Pros

  • Allows content with transparent color.

Cons

  • Without assigning the background color, when swiping the effect is weird because the content is transparent.

This PR apply changes to use the behavior from 4.8. If we agree that must be the default behavior we can merge this PR, in other case close it and maybe update the docs.

What do you think about it? cc @PureWeen @davidbritch

Issues Resolved

API Changes

None

Platforms Affected

  • iOS
  • Android

Behavioral/Visual Changes

None

Before/After Screenshots

fix13670

Testing Procedure

Launch Core Gallery and navigate to the issue 13670. Without setting the BackgroundColor of the SwipeView Content, the BackgroundColor of the SwipeView is used.

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@davidbritch
Copy link

I think the behaviour from 4.8 is correct. This seems like it should be the default behaviour, which users can opt out of if they want to. Whereas in 5.0, by default, you have weird behaviour if you don't set the BackgroundColor. Sure, the docs can point that out, but ideally (IMHO) controls should be easy enough to use that it's not necessary to read the doc.

@jsuarezruiz
Copy link
Contributor Author

Thanks for the feedback @davidbritch!

@jsuarezruiz
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rachelkang
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@rachelkang rachelkang left a comment

Choose a reason for hiding this comment

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

@jsuarezruiz On Android, when swiping left to collapse the extra content, the swipe animation is not as smooth as on iOS and is a bit glitchy. Is this behavior related or a potentially separate issue?

Other than this, all tests are passing, fix works great against the original issue, and LGTM on both iOS and Android!

@jsuarezruiz jsuarezruiz merged commit 144d48e into 5.0.0 May 6, 2021
@jsuarezruiz jsuarezruiz deleted the fix-13670 branch May 6, 2021 10:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [XF 5] SwipeView not rendering properly on iOS and Android when swiping
4 participants