Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "How to use" #6

Merged
merged 1 commit into from
Jun 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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```.