HorusSoftwareUY / Xamarin.Forms.Skeleton

The new loading approach for cool apps in Xamarin Forms
MIT License
450 stars 52 forks source link

Not working: I have added this nuget and tried to use it but it not worked #10

Open divyesh008 opened 4 years ago

divyesh008 commented 4 years ago

I have added the latest stable version of this nuget and set the things from the readme as shown in git repo but I'm getting this error while adding extension to my Xaml page

Screenshot 2020-03-04 at 5 54 53 PM

Note: I have used this in FlowListView

felipebaltazar commented 4 years ago

Hey @divyesh008 ! Did you declare the skeleton namespace, at top of page?

xmlns:extension="clr-namespace:Xamarin.Forms.Skeleton;assembly=Xamarin.Forms.Skeleton"

You can check a working example here: https://github.com/TBertuzzi/ExemploSkeleton/blob/master/ExemploSkeleton/MainPage.xaml

divyesh008 commented 4 years ago

Yes

felipebaltazar commented 4 years ago

@divyesh008 can you provide a ".sln" reproducing this problem? Maybe I can solve this problem when I can reproduce it

alistairdyer commented 4 years ago

I am having the same issue. It looks like it is performing the animation once the data is loaded but I don't see the skeleton loading.

Top of page: xmlns:sk="clr-namespace:Xamarin.Forms.Skeleton;assembly=Xamarin.Forms.Skeleton"


<ListView ItemsSource="{Binding Properties}" 
                              CachingStrategy="RecycleElement"
                              SeparatorVisibility="None"
                              RowHeight="90"
                              BackgroundColor="#F8F8F8"
                              sk:Skeleton.IsParent="True"
                              sk:Skeleton.IsBusy="{Binding IsLoading}"
                              sk:Skeleton.Animation="{sk:DefaultAnimation Fade}">
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <ViewCell>
                                    <material:MaterialCard CornerRadius="2" 
                                                           Elevation="1" 
                                                           HeightRequest="300" 
                                                           HorizontalOptions="FillAndExpand"
                                                           VerticalOptions="FillAndExpand"
                                                           Margin="0,0,0,15"
                                                           sk:Skeleton.IsParent="True"
                                                           sk:Skeleton.IsBusy="{Binding IsLoading}"
                                                           sk:Skeleton.BackgroundColor="Red">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="0.1*"></ColumnDefinition>
                                                <ColumnDefinition Width="0.82*"></ColumnDefinition>
                                                <ColumnDefinition Width="0.08*"></ColumnDefinition>
                                            </Grid.ColumnDefinitions>

                                            <Image Grid.Column="0" 
                                                   Source="property" 
                                                   Style="{StaticResource PageHeaderIcon}"
                                                   VerticalOptions="Center"
                                                   sk:Skeleton.IsBusy="{Binding IsLoading}"
                                                   sk:Skeleton.BackgroundColor="Red"/>

                                            <Label Grid.Column="1"
                                                   Margin="10,-13,0,0"
                                                   Text="{Binding Address, Converter={StaticResource AddressDisplayNameConverter}}"
                                                   LineHeight="0.8"
                                                   FontSize="Small"
                                                   VerticalOptions="Center"
                                                   sk:Skeleton.IsBusy="{Binding IsLoading}"
                                                   sk:Skeleton.BackgroundColor="Red"/>

                                            <Label Grid.Column="1" 
                                                   Text="Alistair Dyer"
                                                   FontSize="12"
                                                   VerticalOptions="End"
                                                   Margin="10,0,0,0"
                                                   sk:Skeleton.IsBusy="{Binding IsLoading}"
                                                   sk:Skeleton.BackgroundColor="Red"/>

                                            <material:MaterialMenuButton 
                                                    Grid.Column="2" 
                                                    ButtonType="Text"
                                                    CornerRadius="50"
                                                    Image="menu-more.png"
                                                    Choices="{Binding Actions}"
                                                    BackgroundColor="Black"
                                                    BorderColor="Black"
                                                    MenuTextColor ="Black"
                                                    sk:Skeleton.IsBusy="{Binding IsLoading}"
                                                    sk:Skeleton.BackgroundColor="Red"/>
                                        </Grid>
                                    </material:MaterialCard>
                                </ViewCell>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>
felipebaltazar commented 4 years ago

I am having the same issue. It looks like it is performing the animation once the data is loaded but I don't see the skeleton loading.

Top of page: xmlns:sk="clr-namespace:Xamarin.Forms.Skeleton;assembly=Xamarin.Forms.Skeleton"

<ListView ItemsSource="{Binding Properties}" 
                              CachingStrategy="RecycleElement"
                              SeparatorVisibility="None"
                              RowHeight="90"
                              BackgroundColor="#F8F8F8"
                              sk:Skeleton.IsParent="True"
                            sk:Skeleton.IsBusy="{Binding IsLoading}"
                            sk:Skeleton.Animation="{sk:DefaultAnimation Fade}">
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <ViewCell>
                                    <material:MaterialCard CornerRadius="2" 
                                                           Elevation="1" 
                                                           HeightRequest="300" 
                                                           HorizontalOptions="FillAndExpand"
                                                           VerticalOptions="FillAndExpand"
                                                           Margin="0,0,0,15"
                                                           sk:Skeleton.IsParent="True"
                                                           sk:Skeleton.IsBusy="{Binding IsLoading}"
                                                           sk:Skeleton.BackgroundColor="Red">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="0.1*"></ColumnDefinition>
                                                <ColumnDefinition Width="0.82*"></ColumnDefinition>
                                                <ColumnDefinition Width="0.08*"></ColumnDefinition>
                                            </Grid.ColumnDefinitions>

                                            <Image Grid.Column="0" 
                                                   Source="property" 
                                                   Style="{StaticResource PageHeaderIcon}"
                                                   VerticalOptions="Center"
                                                   sk:Skeleton.IsBusy="{Binding IsLoading}"
                                                   sk:Skeleton.BackgroundColor="Red"/>

                                            <Label Grid.Column="1"
                                                   Margin="10,-13,0,0"
                                                   Text="{Binding Address, Converter={StaticResource AddressDisplayNameConverter}}"
                                                   LineHeight="0.8"
                                                   FontSize="Small"
                                                   VerticalOptions="Center"
                                                   sk:Skeleton.IsBusy="{Binding IsLoading}"
                                                   sk:Skeleton.BackgroundColor="Red"/>

                                            <Label Grid.Column="1" 
                                                   Text="Alistair Dyer"
                                                   FontSize="12"
                                                   VerticalOptions="End"
                                                   Margin="10,0,0,0"
                                                   sk:Skeleton.IsBusy="{Binding IsLoading}"
                                                   sk:Skeleton.BackgroundColor="Red"/>

                                            <material:MaterialMenuButton 
                                                    Grid.Column="2" 
                                                    ButtonType="Text"
                                                    CornerRadius="50"
                                                    Image="menu-more.png"
                                                    Choices="{Binding Actions}"
                                                    BackgroundColor="Black"
                                                    BorderColor="Black"
                                                    MenuTextColor ="Black"
                                                    sk:Skeleton.IsBusy="{Binding IsLoading}"
                                                    sk:Skeleton.BackgroundColor="Red"/>
                                        </Grid>
                                    </material:MaterialCard>
                                </ViewCell>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>

Hello @alistairdyer, thanks for the reply I tryed to reproduce the error, but seems its working. I dont known what is "material:MaterialCard", can you create a simple ".sln" reproducing this issue ?

AnthonyLatty commented 4 years ago

@felipebaltazar material:MaterialCard is from the Google Material Components for XF. I guess you cant load animations through its components but with regular XF components it works

felipebaltazar commented 4 years ago

@felipebaltazar material:MaterialCard is from the Google Material Components for XF. I guess you cant load animations through its components but with regular XF components it works

@AnthonyLatty I verified that this component (MaterialCard) inherits from View, it should work correctly. A project reproducing the problem would be important to try to solve it