Is it possible to simulate right or left SfRotator swipe from code?

Hello,

Is it possible to rotate SfRotator left or right from code in same way as it is rotated if you swipe it? When I change SelectedIndex++ current card disappear instantly and the new card appear from right size. Is it possible to simulate rotation so old card will disappear on the left during new card appearing?

Best regards,
Radek

8 Replies 1 reply marked as answer

SP Sakthivel Palaniyappan Syncfusion Team October 22, 2020 07:50 AM UTC

Hi Radoslaw,

Greetings from Syncfusion.

We have analyzed your query. Yes, we can rotate the rotator item from code as like below code snippet.

XAML:

 
     
    <Grid  BackgroundColor="LightGray"> 
 
        <syncfusion:SfRotator DotPlacement="None" Grid.Row="0" x:Name="rotator"  VerticalOptions="Center" BackgroundColor="LightGray" Margin="20,0" 
                                   WidthRequest="330" HeightRequest="500"> 

        </syncfusion:SfRotator> 
 
        <sfborder:SfBorder  BackgroundColor="#FFF200" Padding="5" VerticalOptions="Center" HorizontalOptions="Start" CornerRadius="25"> 
            <sfborder:SfBorder.Content> 
                <ImageButton x:Name="LeftSwipe" Clicked="LeftSwipe_Clicked"  Source="LeftArrow.png" HeightRequest="40" WidthRequest="40" VerticalOptions="Center" HorizontalOptions="Center" > 
                </ImageButton> 
            </sfborder:SfBorder.Content> 
        </sfborder:SfBorder> 
 
        <sfborder:SfBorder BackgroundColor="#FFF200" Padding="5" VerticalOptions="Center" HorizontalOptions="End" CornerRadius="25"> 
            <sfborder:SfBorder.Content> 
                <ImageButton x:Name="RightSwipe"  Clicked="RightSwipe_Clicked"  Source="RightArrow.png" HeightRequest="40" WidthRequest="40" VerticalOptions="Center" HorizontalOptions="Center" > 
                </ImageButton> 
            </sfborder:SfBorder.Content> 
        </sfborder:SfBorder> 
    </Grid> 

C#:

 
   private void LeftSwipe_Clicked(object sender, EventArgs e) 
        { 
            if (rotator.SelectedIndex > 0) 
            { 
                rotator.SelectedIndex--; 
            } 
        } 
 
        private void RightSwipe_Clicked(object sender, EventArgs e) 
        { 
            var item = (rotator.DataSource as List<SfRotatorItem>).Count - 1; 
 
            if (rotator.SelectedIndex != item) 
                rotator.SelectedIndex++; 
        } 

We have created sample based on
this, please find the sample from below.

Sample:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/RotatorSample-1158482784.zip

Please let us know if you have any other queries.

Regards,
Sakthivel P.




RK Radoslaw Kubas October 22, 2020 08:05 AM UTC

Hello, 

Thank you for your answer but this not solving my problem. The way in your example is similar to this what I'm doing now. It works fine about functionality (rotator is showing correct page), but the problem is about transition animation. Please check attached examples.

rotator_nice.mov - transition between pages when using "dots"
rotation_problem.mov - transition between pages when changing SelectedIndex in code.

Best regards,
Radek

 

Attachment: rotator_6e3b2cd8.zip


SP Sakthivel Palaniyappan Syncfusion Team October 23, 2020 01:24 PM UTC

Hi Radoslaw,

Sorry for the inconvenience.

We have checked the reported issue with your provided information, we could able to reproduce the issue. We have logged the bug report for this, please find the feedback portal below.

Feedback portal:
https://www.syncfusion.com/feedback/19081/animation-transition-not-working-when-change-the-selectedindex-in-code

We will fix the issue and provide the patch on November 6, 2020.

Regards,
Sakthivel P.



SP Sakthivel Palaniyappan Syncfusion Team November 9, 2020 03:48 AM UTC

Hi Radoslaw,

Sorry for the inconvenience.

We will provide the patch on or before November 10,2020. We appreciate your patience until then.

Regards,
Sakthivel P.
 



SP Sakthivel Palaniyappan Syncfusion Team November 10, 2020 04:31 AM UTC

Hi Radoslaw,

Thanks for the patience.

We have fixed the reported issue “Animation transition not working when change the SelectedIndex in code”. Please download the path from the following location.

Please find the patch setup from below location:
http://syncfusion.com/Installs/support/patch/18.3.0.47/999661/F158978/SyncfusionPatch_18.3.0.47_999661_11092020053037682_F158978.exe

(OR)

Please find the patch assemblies alone from below location:
http://syncfusion.com/Installs/support/patch/18.3.0.47/999661/F158978/SyncfusionPatch_18.3.0.47_999661_11092020053037682_F158978.zip

(OR)

Please find the NuGet from below location:
http://syncfusion.com/Installs/support/patch/18.3.0.47/999661/F158978/SyncfusionNuget_18.3.0.47_999661_11092020053037682_F158978.zip

Assembly Version: 18.3.0.47

We can take NuGet only using Main release and SP1 release versions, so we have taken the NuGet in 18.3.0.47.

Disclaimer:
Please note that we have created this patch for version 18.3.0.47 specifically to resolve the following issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.

Note: Please clear the cache, before the apply the provided patch
https://www.syncfusion.com/kb/6987/how-to-clear-nuget-cache

This fix will be included in our upcoming weekly NuGet release. Which will be available on third week of November 2020.

Regards,
Sakthivel P.
 


Marked as answer

SP Sakthivel Palaniyappan Syncfusion Team November 18, 2020 10:16 AM UTC

Hi Radoslaw,

Thanks for the patience.

We have fixed the reported issue and included the issue fix in our latest Weekly NuGet release update version 18.3.0.50 which is available for download (https://www.nuget.org/ ).

We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance.

Regards,
Sakthivel P.
 



RK Radoslaw Kubas November 18, 2020 10:19 AM UTC

Thank you very, works perfectly now :)


SP Sakthivel Palaniyappan Syncfusion Team November 18, 2020 02:50 PM UTC

Hi Radoslaw,

Thanks for the update.

We are glad to know that reported issue has been resolved.  Pease get back us if you need further assistance on this.

Regards,
Sakthivel P.


Loader.
Up arrow icon