ChasakisD / XFShimmerLayout

Efficient way to add a shimmering effect to your Xamarin.Forms applications.
Apache License 2.0
53 stars 12 forks source link

ANDROID: Shimmering effect is incorrect for Android #10

Open myworkpage opened 2 years ago

myworkpage commented 2 years ago

Sometimes the shimmer effect fade animation is not properly overlapping the actual content in Android.

shimmer

Usage:

xmlns:controls="clr-namespace:XFShimmerLayout.Controls;assembly=XFShimmerLayout" xmlns:ff="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"

<controls:ShimmerLayout Grid.Row="3" Grid.RowSpan="2" Grid.ColumnSpan="2" Angle="-45" GradientSize="0.2" ForegroundGradientColor="#F5F5F8"  BackgroundGradientColor="#e2e6eb" IsLoading="{Binding IsBootShimmerEffect}">
                                    <Grid RowSpacing="0" ColumnSpacing="0">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="0.3*"/>
                                            <ColumnDefinition Width="0.7*"/>
                                        </Grid.ColumnDefinitions>
                                        <Frame Grid.Column="0" Margin="0,10,0,0" HasShadow="False" Padding="1" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" IsClippedToBounds="True" CornerRadius="8">
                                            <ff:CachedImage VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Aspect="AspectFill" Source="{Binding ImageOne}" LoadingPlaceholder="image_placeholder.png" ErrorPlaceholder="image_placeholder.png" AutomationProperties.IsInAccessibleTree="False"/>
                                        </Frame>
                                        <StackLayout Grid.Column="1" Orientation="Vertical" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand">
                                            <Label VerticalOptions="End" Margin="10,0" Text="{Binding HeaderOne}" LineBreakMode="NoWrap" FontSize="14" TextColor="#222222" Style="{StaticResource HeaderStyle}" AutomationProperties.IsInAccessibleTree="True"/>
                                            <Label VerticalOptions="Start" Margin="10,0" Text="{Binding DescOne}" LineBreakMode="WordWrap" FontSize="12" TextColor="#222222" Opacity="0.7" Style="{StaticResource DescStyle}" AutomationProperties.IsInAccessibleTree="True"/>
                                        </StackLayout>
                                        <Grid.GestureRecognizers>
                                            <TapGestureRecognizer NumberOfTapsRequired="1" Command="{Binding OnItemTapCommand}" />
                                        </Grid.GestureRecognizers>
                                    </Grid>
                                </controls:ShimmerLayout>