-
Notifications
You must be signed in to change notification settings - Fork 108
Provide animation duration support for Bottom sheet control #175
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
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this 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 PR introduces configurable animation duration support for the bottom sheet transition animations in the toolkit, allowing developers to customize animation speeds.
- Added the AnimationDuration bindable property with a default of 150ms.
- Updated the bottom sheet animation methods to use the clamped animation duration value.
- Created new unit tests to verify the behavior of the AnimationDuration property, including its clamping mechanism.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| maui/tests/Syncfusion.Maui.Toolkit.UnitTest/Navigation/SfBottomSheetUnitTests.cs | Added unit tests to verify the AnimationDuration property and its clamping behavior. |
| maui/src/BottomSheet/SfBottomSheet.cs | Introduced the AnimationDuration property, updated animation methods to utilize a clamped duration, and added helper method for clamping. |
Comments suppressed due to low confidence (1)
maui/src/BottomSheet/SfBottomSheet.cs:1288
- [nitpick] The method name 'SetAnimationDuration' is misleading since it calculates and returns the clamped animation duration rather than setting a value. Consider renaming it to 'GetClampedAnimationDuration' for improved clarity.
int SetAnimationDuration()
There was a problem hiding this 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 PR introduces support for configurable animation durations for the bottom sheet control to enhance UI customization.
- Added the AnimationDuration bindable property with a default value of 150ms in SfBottomSheet.
- Updated animation methods to clamp the duration and use the new property value.
- Introduced new unit tests to verify both the AnimationDuration getter/setter and clamping behavior.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| maui/tests/Syncfusion.Maui.Toolkit.UnitTest/Navigation/SfBottomSheetUnitTests.cs | Added tests for validating the AnimationDuration property and its clamping behavior. |
| maui/src/BottomSheet/SfBottomSheet.cs | Introduced AnimationDuration property and updated animation methods to utilize the clamped duration. |
Comments suppressed due to low confidence (1)
maui/tests/Syncfusion.Maui.Toolkit.UnitTest/Navigation/SfBottomSheetUnitTests.cs:479
- [nitpick] Consider renaming the 'AnimationDuration' test method to something more descriptive (e.g., 'AnimationDurationProperty_ReturnsSetValue') to avoid ambiguity with the property name.
[Theory]
There was a problem hiding this 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 PR introduces support for configurable animation duration for the Bottom Sheet control by adding a new AnimationDuration bindable property.
- Added the AnimationDuration property and its bindable counterpart with documentation and default value.
- Updated animation methods to use a clamped duration to ensure non-negative values.
- Extended unit test coverage to verify property behavior and clamped duration.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| maui/tests/Syncfusion.Maui.Toolkit.UnitTest/Navigation/SfBottomSheetUnitTests.cs | Added unit tests verifying the AnimationDuration property behavior and the clamping functionality. |
| maui/src/BottomSheet/SfBottomSheet.cs | Introduced the AnimationDuration bindable property, implemented a GetClampedAnimationDuration helper, and updated animation calls to use the clamped value. |
Root Cause of the Issue
The transition animation lacked customization, as the duration was fixed and not configurable through the API.
Description of change
Introduced AnimationDuration property to allow developers to configure the duration of the bottom sheet transition animations, enabling smoother or faster UI experiences based on application requirements.
API Summary
API Name: AnimationDuration
Namespace: Syncfusion.Maui.Toolkit.BottomSheet
Input type: bool
Access specifier: public
Issues Fixed
#99
Screenshots
Default Animation Duration
AnimationDuration_Default.mp4
Animation Duration = 1000
AnimationDuration_1000.mp4