Possible to reset the scale on EffectsView on the TouchUpEffects?
We've recently just found the SfEffectsView and thought it would be useful to give users some sort of visual feedback they've tapped something on the screen, especially when this tap navigates to a new screen and takes a few seconds to load
The Scale on the TouchDownEffects is working fine, and we are able to change the ScaleFactor and during of the effect, however what we cannot figure out is how to revert the scale back to its original size (i.e scalefactor = 1) when the user lifts their finger from the device.
The ideal situation is user clicks taps the screen, our visual element scales down, user lifts their finger and visual element returns to its original size
Hi Josh,
Currently, we are validating the reported query, and we will provide you with details on or before February 14, 2024. We appreciate your patience until then.
Regards,
Ahamed Ali Nishad.
Thanks Ahamend, looking forward to hearing from you
Hi Josh,
Query : Possible to reset the scale on EffectsView on the TouchUpEffects? however what we cannot figure out is how to revert the scale back to its original size (i.e scalefactor = 1) when the user lifts their finger from the device.
We regret to inform you that it is not possible to reset the scale back to its original size on the TouchUpEffects when the user lifts their finger from the device. This is because the animation process did not complete properly when attempting to do so. If you have any other queries, please provide us with the details.
Regards,
Ahamed Ali Nishad.
Ah i see, that makes sense.
How about then, would it be possible to do the full scale down, and the scale back up just on the TouchDownEffect? So the full effect would be ScaleDown => ScaleUp
This way there is no need for the animation to finish to use the TouchUpEffect as the full effect would be fired from the TouchDown? Maybe this is possible in the code, rather than in the xmal?
Thanks
Hi Josh,
We are currently exploring possibilities based on your suggestions, and we will provide you with the details on or before February 21, 2024. We appreciate your patience until then.
Regards,
Ahamed Ali Nishad.
Hi Josh,
Query : However what we cannot figure out is how to revert the scale back to its original size (i.e scalefactor = 1) when the user lifts their finger from the device.
We have reviewed your query and prepared a sample based on your requirements. In the sample, we have included an SfEffectsView. We modified the scale factor in the touch-up event and additionally called the ApplyEffects method, which is working as expected. Now, you can scale back to its original size (scale factor = 1) when the user lifts their finger from the device.
Furthermore, you can customize the duration of the scale animation using ScaleAnimationDuration, as demonstrated in the code snippet below. We have attached a sample for your reference. Kindly review it and let us know the details.
Code Snippet :
|
Mainpage.xaml
<StackLayout VerticalOptions="Center" HorizontalOptions="Center"> <sfEffectsView:SfEffectsView x:Name="Friends" TouchDownEffects="Scale" TouchDown="Friends_TouchDown" TouchUpEffects="Scale" TouchUp="Friends_TouchUp"
BackgroundColor="AliceBlue" SelectionBackground="Transparent"
ScaleAnimationDuration="50" > <Image x:Name="FriendsImage" WidthRequest="300" HeightRequest="300" Aspect="AspectFill" Source="dotnet_bot.png" /> </sfEffectsView:SfEffectsView> </StackLayout>
Mainpage.xaml.cs
private void Friends_TouchDown(object sender, EventArgs e) { Friends.ScaleFactor = 0.85;
}
private void Friends_TouchUp(object sender, EventArgs e) { Friends.ScaleFactor = 1; Friends.ApplyEffects(SfEffects.Scale); }
|
Regards,
Ahamed Ali Nishad.
Attachment: SfEffecstViewMaui_(2)_f5bdbdea.zip
- 6 Replies
- 2 Participants
-
JS Josh Southern
- Feb 10, 2024 08:17 PM UTC
- Feb 21, 2024 02:39 PM UTC