Skip to content

Commit

Permalink
Add "How to use"
Browse files Browse the repository at this point in the history
  • Loading branch information
VasenevEA authored May 16, 2019
1 parent 9b9f7c5 commit 403eef8
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,24 @@ Efficient way to add a shimmering effect to your Xamarin.Forms applications.

# How To Use

ToDo the specifications. For now, check the sample. It's quite easy.
* Add nuget package Xamarin.Essentials to all projects
* Add Init method to ```App.cs``` constructor:
```
InitializeComponent();
var density = Xamarin.Essentials.DeviceDisplay.MainDisplayInfo.Density;
ShimmerLayout.Init(density);
```

* add reference:
```xml
xmlns:controls="clr-namespace:XFShimmerLayout.Controls;assembly=XFShimmerLayout"
```
* Paste content inside shimmerLayout:
```xml
<controls:ShimmerLayout Angle="-45" GradientSize=".2" IsLoading="True">
<!--Yours awesome view-->
</controls:ShimmerLayout>
```
# How it works

## Drawing Process
Expand Down Expand Up @@ -52,4 +68,4 @@ To make the animation happen, we need startX and endX:
* The StartX will be 0 - GradientSizeInPixels
* The EndX will be the Width + GradientSizeInPixels

We created an animation that animates a value from the StartX to EndX and every time we ```InvalidateSurface``` of the ```Canvas```.
We created an animation that animates a value from the StartX to EndX and every time we ```InvalidateSurface``` of the ```Canvas```.

0 comments on commit 403eef8

Please sign in to comment.