├── .gitignore ├── LICENSE ├── README.md ├── Xamarin.Android.AVLoadingIndicatorViewBinding.sln ├── appveyor.yml ├── art ├── all_loadings.gif └── loading_detail.gif ├── build.cake ├── build.ps1 ├── build.sh ├── nuspec └── Xamarin.Android.AVLoadingIndicatorView.nuspec ├── src ├── Xamarin.Android.AVLoadingIndicatorViewBinding.Sample │ ├── IndicatorActivity.cs │ ├── Properties │ │ ├── AndroidManifest.xml │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── layout │ │ │ ├── activity_indicator.xml │ │ │ ├── activity_sample.xml │ │ │ └── item_indicator.xml │ │ ├── mipmap-hdpi │ │ │ └── Icon.png │ │ ├── mipmap-mdpi │ │ │ └── Icon.png │ │ ├── mipmap-xhdpi │ │ │ └── Icon.png │ │ ├── mipmap-xxhdpi │ │ │ └── Icon.png │ │ ├── mipmap-xxxhdpi │ │ │ └── Icon.png │ │ └── values │ │ │ └── Strings.xml │ ├── SampleActivity.cs │ ├── Xamarin.Android.AVLoadingIndicatorViewBinding.Sample.csproj │ └── packages.config └── Xamarin.Android.AVLoadingIndicatorViewBinding │ ├── Jars │ └── library-release.aar │ └── Xamarin.Android.AVLoadingIndicatorViewBinding.csproj └── tools └── packages.config /.gitignore: -------------------------------------------------------------------------------- 1 | ## Xamarin stuff 2 | Components 3 | [Pp]ackages 4 | *.userprefs 5 | Resource.designer.cs 6 | 7 | 8 | # Cake Build related 9 | artifacts/ 10 | tools/* 11 | !tools/packages.config 12 | 13 | ## Ignore Visual Studio temporary files, build results, and 14 | ## files generated by popular Visual Studio add-ons. 15 | 16 | # User-specific files 17 | *.suo 18 | *.user 19 | *.sln.docstates 20 | *.vs/ 21 | 22 | # Build results 23 | [Dd]ebug/ 24 | [Dd]ebugPublic/ 25 | [Rr]elease/ 26 | x64/ 27 | build/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | project.lock.json 32 | 33 | # MSTest test Results 34 | [Tt]est[Rr]esult*/ 35 | [Bb]uild[Ll]og.* 36 | 37 | #NUNIT 38 | *.VisualState.xml 39 | TestResult.xml 40 | 41 | # Build Results of an ATL Project 42 | [Dd]ebugPS/ 43 | [Rr]eleasePS/ 44 | dlldata.c 45 | 46 | *_i.c 47 | *_p.c 48 | *_i.h 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.tmp_proj 63 | *.log 64 | *.vspscc 65 | *.vssscc 66 | .builds 67 | *.pidb 68 | *.svclog 69 | *.scc 70 | 71 | # Chutzpah Test files 72 | _Chutzpah* 73 | 74 | # Visual C++ cache files 75 | ipch/ 76 | *.aps 77 | *.ncb 78 | *.opensdf 79 | *.sdf 80 | *.cachefile 81 | 82 | # Visual Studio profiler 83 | *.psess 84 | *.vsp 85 | *.vspx 86 | 87 | # TFS 2012 Local Workspace 88 | $tf/ 89 | 90 | # Guidance Automation Toolkit 91 | *.gpState 92 | 93 | # ReSharper is a .NET coding add-in 94 | _ReSharper*/ 95 | *.[Rr]e[Ss]harper 96 | *.DotSettings.user 97 | 98 | # JustCode is a .NET coding addin-in 99 | .JustCode 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | _NCrunch_* 110 | .*crunch*.local.xml 111 | 112 | # MightyMoose 113 | *.mm.* 114 | AutoTest.Net/ 115 | 116 | # Web workbench (sass) 117 | .sass-cache/ 118 | 119 | # Installshield output folder 120 | [Ee]xpress/ 121 | 122 | # DocProject is a documentation generator add-in 123 | DocProject/buildhelp/ 124 | DocProject/Help/*.HxT 125 | DocProject/Help/*.HxC 126 | DocProject/Help/*.hhc 127 | DocProject/Help/*.hhk 128 | DocProject/Help/*.hhp 129 | DocProject/Help/Html2 130 | DocProject/Help/html 131 | 132 | # Click-Once directory 133 | publish/ 134 | 135 | # Publish Web Output 136 | *.[Pp]ublish.xml 137 | *.azurePubxml 138 | 139 | # NuGet Packages Directory 140 | packages/ 141 | ## TODO: If the tool you use requires repositories.config uncomment the next line 142 | #!packages/repositories.config 143 | 144 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 145 | # This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) 146 | !packages/build/ 147 | 148 | # Windows Azure Build Output 149 | csx/ 150 | *.build.csdef 151 | 152 | # Windows Store app package directory 153 | AppPackages/ 154 | 155 | # Others 156 | sql/ 157 | *.Cache 158 | ClientBin/ 159 | [Ss]tyle[Cc]op.* 160 | ~$* 161 | *~ 162 | *.dbmdl 163 | *.dbproj.schemaview 164 | *.pfx 165 | *.publishsettings 166 | node_modules/ 167 | 168 | # RIA/Silverlight projects 169 | Generated_Code/ 170 | 171 | # Backup & report files from converting an old project file to a newer 172 | # Visual Studio version. Backup files are not needed, because we have git ;-) 173 | _UpgradeReport_Files/ 174 | Backup*/ 175 | UpgradeLog*.XML 176 | UpgradeLog*.htm 177 | 178 | # SQL Server files 179 | *.mdf 180 | *.ldf 181 | 182 | # Business Intelligence projects 183 | *.rdl.data 184 | *.bim.layout 185 | *.bim_*.settings 186 | 187 | # Microsoft Fakes 188 | FakesAssemblies/ 189 | 190 | *.userprefs 191 | 192 | .DS_Store 193 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 jzeferino 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build status](https://ci.appveyor.com/api/projects/status/kay0t8hupi2ka9k7?svg=true)](https://ci.appveyor.com/project/jzeferino/xamarin-android-avloadingindicatorview) 2 | [![NuGet](https://img.shields.io/nuget/v/Xamarin.Android.AVLoadingIndicatorView.svg?label=NuGet)](https://www.nuget.org/packages/Xamarin.Android.AVLoadingIndicatorView/) 3 | 4 | Xamarin.Android.AVLoadingIndicatorView 5 | =================== 6 | 7 | This is a Xamarin Android Binding for the [AVLoadingIndicatorView](https://github.com/81813780/AVLoadingIndicatorView). 8 | 9 | AVLoadingIndicatorView is a collection of nice loading animations for Android. 10 | 11 | ## Demo 12 |

13 | 14 | 15 |

16 | 17 | ## Usage 18 | (see the [sample](https://github.com/jzeferino/Xamarin.Android.AVLoadingIndicatorView/tree/master/src/Xamarin.Android.AVLoadingIndicatorViewBinding.Sample) project for a detailed working example) 19 | 20 | ### Step 1 21 | 22 | Install NuGet [package](https://www.nuget.org/packages/Xamarin.Android.AVLoadingIndicatorView/). 23 | 24 | ### Step 2 25 | 26 | Add the AVLoadingIndicatorView to your layout: 27 | 28 | Define xmlns:app in your root view. 29 | 30 | ```xml 31 | xmlns:app="http://schemas.android.com/apk/res-auto" 32 | ``` 33 | 34 | Simple Loading 35 | 36 | ```xml 37 | 42 | ``` 43 | 44 | Advanced Loading 45 | 46 | ```xml 47 | // indicator color 55 | ``` 56 | 57 | ### Step 3 58 | 59 | Show or hide the progress. (starts showing by default) 60 | ```c# 61 | 62 | protected override void OnCreate(Bundle savedInstanceState) 63 | { 64 | base.OnCreate(savedInstanceState); 65 | 66 | avi = FindViewById(Resource.Id.avi); 67 | avi.Show(): 68 | } 69 | 70 | void ShowLoading() 71 | { 72 | avi.Show(); 73 | // or avi.SmoothToShow(); 74 | } 75 | 76 | void HideLoading() 77 | { 78 | avi.Hide(); 79 | // or avi.SmoothToHide(); 80 | } 81 | 82 | ``` 83 | ## Using programmatically 84 | 85 | ```c# 86 | protected override void OnCreate(Bundle savedInstanceState) 87 | { 88 | base.OnCreate(savedInstanceState); 89 | 90 | var avLoadingIndicatorView = new AVLoadingIndicatorView(this); 91 | avLoadingIndicatorView.SetIndicator("SquareSpinIndicator"); 92 | AddContentView(avLoadingIndicatorView, new ViewGroup.LayoutParams(80, 80)); 93 | } 94 | ``` 95 | ## Proguard 96 | 97 | When using proguard need to add this rules: 98 | 99 | ``` 100 | -keep class com.wang.avi.** { *; } 101 | -keep class com.wang.avi.indicators.** { *; } 102 | ``` 103 | 104 | Indicators are loaded from class names, proguard may change it (rename). 105 | 106 | ## Indicators 107 | 108 | As seen above in the **Demo**, the indicators are as follows: 109 | 110 | **Row 1** 111 | * `BallPulseIndicator` 112 | * `BallGridPulseIndicator` 113 | * `BallClipRotateIndicator` 114 | * `BallClipRotatePulseIndicator` 115 | 116 | **Row 2** 117 | * `SquareSpinIndicator` 118 | * `BallClipRotateMultipleIndicator` 119 | * `BallPulseRiseIndicator` 120 | * `BallRotateIndicator` 121 | 122 | **Row 3** 123 | * `CubeTransitionIndicator` 124 | * `BallZigZagIndicator` 125 | * `BallZigZagDeflectIndicator` 126 | * `BallTrianglePathIndicator` 127 | 128 | **Row 4** 129 | * `BallScaleIndicator` 130 | * `LineScaleIndicator` 131 | * `LineScalePartyIndicator` 132 | * `BallScaleMultipleIndicator` 133 | 134 | **Row 5** 135 | * `BallPulseSyncIndicator` 136 | * `BallBeatIndicator` 137 | * `LineScalePulseOutIndicator` 138 | * `LineScalePulseOutRapidIndicator` 139 | 140 | **Row 6** 141 | * `BallScaleRippleIndicator` 142 | * `BallScaleRippleMultipleIndicator` 143 | * `BallSpinFadeLoaderIndicator` 144 | * `LineSpinFadeLoaderIndicator` 145 | 146 | **Row 7** 147 | * `TriangleSkewSpinIndicator` 148 | * `PacmanIndicator` 149 | * `BallGridBeatIndicator` 150 | * `SemiCircleSpinIndicator` 151 | 152 | ### License 153 | [MIT Licence](LICENSE) 154 | -------------------------------------------------------------------------------- /Xamarin.Android.AVLoadingIndicatorViewBinding.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.AVLoadingIndicatorViewBinding", "src\Xamarin.Android.AVLoadingIndicatorViewBinding\Xamarin.Android.AVLoadingIndicatorViewBinding.csproj", "{6D5976A3-A53A-4FAE-8731-1623D0A06A07}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.AVLoadingIndicatorViewBinding.Sample", "src\Xamarin.Android.AVLoadingIndicatorViewBinding.Sample\Xamarin.Android.AVLoadingIndicatorViewBinding.Sample.csproj", "{D50C6FA4-B6A2-4111-A53A-99C4D0B11895}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {6D5976A3-A53A-4FAE-8731-1623D0A06A07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {6D5976A3-A53A-4FAE-8731-1623D0A06A07}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {6D5976A3-A53A-4FAE-8731-1623D0A06A07}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {6D5976A3-A53A-4FAE-8731-1623D0A06A07}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {D50C6FA4-B6A2-4111-A53A-99C4D0B11895}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {D50C6FA4-B6A2-4111-A53A-99C4D0B11895}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {D50C6FA4-B6A2-4111-A53A-99C4D0B11895}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {D50C6FA4-B6A2-4111-A53A-99C4D0B11895}.Release|Any CPU.Build.0 = Release|Any CPU 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: '2.1.3-build{build}' 2 | image: Visual Studio 2017 3 | 4 | branches: 5 | only: 6 | - develop 7 | - master 8 | build_script: 9 | - ps: .\build.ps1 10 | 11 | test: off 12 | 13 | artifacts: 14 | - path: ./artifacts/*.nupkg 15 | name: nugetpackage 16 | 17 | cache: 18 | - tools -> build.cake, tools\packages.config # Cache \tools until build.cake and/or packages.config change 19 | -------------------------------------------------------------------------------- /art/all_loadings.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jzeferino/Xamarin.Android.AVLoadingIndicatorView/06ee764eea288b6794add0370dd20cd0f2041077/art/all_loadings.gif -------------------------------------------------------------------------------- /art/loading_detail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jzeferino/Xamarin.Android.AVLoadingIndicatorView/06ee764eea288b6794add0370dd20cd0f2041077/art/loading_detail.gif -------------------------------------------------------------------------------- /build.cake: -------------------------------------------------------------------------------- 1 | #addin nuget:?package=Cake.SemVer&loaddependencies=true 2 | 3 | // Enviroment 4 | var isRunningOnAppVeyor = AppVeyor.IsRunningOnAppVeyor; 5 | var isRunningOnWindows = IsRunningOnWindows(); 6 | 7 | // Arguments. 8 | var target = Argument("target", "Default"); 9 | var configuration = "Release"; 10 | 11 | // Define directories. 12 | var solutionFile = new FilePath("Xamarin.Android.AVLoadingIndicatorViewBinding.sln"); 13 | var artifactsDirectory = new DirectoryPath("artifacts"); 14 | 15 | // Versioning. 16 | var version = EnvironmentVariable ("APPVEYOR_BUILD_VERSION") ?? Argument("version", "9.9.9-build9"); 17 | 18 | Setup((context) => 19 | { 20 | Information("AppVeyor: {0}", isRunningOnAppVeyor); 21 | Information ("Running on Windows: {0}", isRunningOnWindows); 22 | Information("Configuration: {0}", configuration); 23 | }); 24 | 25 | Task("Clean") 26 | .Does(() => 27 | { 28 | CleanDirectory(artifactsDirectory); 29 | 30 | MSBuild(solutionFile, settings => settings 31 | .SetConfiguration(configuration) 32 | .WithTarget("Clean") 33 | .SetVerbosity(Verbosity.Minimal)); 34 | }); 35 | 36 | Task("Restore") 37 | .Does(() => 38 | { 39 | NuGetRestore(solutionFile); 40 | }); 41 | 42 | Task("Build") 43 | .IsDependentOn("Clean") 44 | .IsDependentOn("Restore") 45 | .Does(() => 46 | { 47 | MSBuild(solutionFile, settings => settings 48 | .SetConfiguration(configuration) 49 | .WithTarget("Build") 50 | .SetVerbosity(Verbosity.Minimal)); 51 | }); 52 | 53 | Task ("NuGet") 54 | .IsDependentOn ("Build") 55 | .Does (() => 56 | { 57 | var sv = ParseSemVer (version); 58 | var nugetVersion = CreateSemVer (sv.Major, sv.Minor, sv.Patch).ToString(); 59 | 60 | NuGetPack ("./nuspec/Xamarin.Android.AVLoadingIndicatorView.nuspec", 61 | new NuGetPackSettings 62 | { 63 | Version = nugetVersion, 64 | Verbosity = NuGetVerbosity.Normal, 65 | OutputDirectory = artifactsDirectory, 66 | BasePath = "./", 67 | ArgumentCustomization = args => args.Append("-NoDefaultExcludes") 68 | }); 69 | }); 70 | 71 | Task("Default") 72 | .IsDependentOn("NuGet") 73 | .Does(() => {}); 74 | 75 | RunTarget(target); -------------------------------------------------------------------------------- /build.ps1: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | # This is the Cake bootstrapper script for PowerShell. 3 | # This file was downloaded from https://github.com/cake-build/resources 4 | # Feel free to change this file to fit your needs. 5 | ########################################################################## 6 | 7 | <# 8 | 9 | .SYNOPSIS 10 | This is a Powershell script to bootstrap a Cake build. 11 | 12 | .DESCRIPTION 13 | This Powershell script will download NuGet if missing, restore NuGet tools (including Cake) 14 | and execute your Cake build script with the parameters you provide. 15 | 16 | .PARAMETER Script 17 | The build script to execute. 18 | .PARAMETER Target 19 | The build script target to run. 20 | .PARAMETER Configuration 21 | The build configuration to use. 22 | .PARAMETER Verbosity 23 | Specifies the amount of information to be displayed. 24 | .PARAMETER Experimental 25 | Tells Cake to use the latest Roslyn release. 26 | .PARAMETER WhatIf 27 | Performs a dry run of the build script. 28 | No tasks will be executed. 29 | .PARAMETER Mono 30 | Tells Cake to use the Mono scripting engine. 31 | .PARAMETER SkipToolPackageRestore 32 | Skips restoring of packages. 33 | .PARAMETER ScriptArgs 34 | Remaining arguments are added here. 35 | 36 | .LINK 37 | http://cakebuild.net 38 | 39 | #> 40 | 41 | [CmdletBinding()] 42 | Param( 43 | [string]$Script = "build.cake", 44 | [string]$Target = "Default", 45 | [ValidateSet("Release", "Debug")] 46 | [string]$Configuration = "Release", 47 | [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] 48 | [string]$Verbosity = "Verbose", 49 | [switch]$Experimental, 50 | [Alias("DryRun","Noop")] 51 | [switch]$WhatIf, 52 | [switch]$Mono, 53 | [switch]$SkipToolPackageRestore, 54 | [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] 55 | [string[]]$ScriptArgs 56 | ) 57 | 58 | [Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null 59 | function MD5HashFile([string] $filePath) 60 | { 61 | if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf)) 62 | { 63 | return $null 64 | } 65 | 66 | [System.IO.Stream] $file = $null; 67 | [System.Security.Cryptography.MD5] $md5 = $null; 68 | try 69 | { 70 | $md5 = [System.Security.Cryptography.MD5]::Create() 71 | $file = [System.IO.File]::OpenRead($filePath) 72 | return [System.BitConverter]::ToString($md5.ComputeHash($file)) 73 | } 74 | finally 75 | { 76 | if ($file -ne $null) 77 | { 78 | $file.Dispose() 79 | } 80 | } 81 | } 82 | 83 | Write-Host "Preparing to run build script..." 84 | 85 | if(!$PSScriptRoot){ 86 | $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent 87 | } 88 | 89 | $TOOLS_DIR = Join-Path $PSScriptRoot "tools" 90 | $NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe" 91 | $CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe" 92 | $NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" 93 | $PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config" 94 | $PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum" 95 | 96 | # Should we use mono? 97 | $UseMono = ""; 98 | if($Mono.IsPresent) { 99 | Write-Verbose -Message "Using the Mono based scripting engine." 100 | $UseMono = "-mono" 101 | } 102 | 103 | # Should we use the new Roslyn? 104 | $UseExperimental = ""; 105 | if($Experimental.IsPresent -and !($Mono.IsPresent)) { 106 | Write-Verbose -Message "Using experimental version of Roslyn." 107 | $UseExperimental = "-experimental" 108 | } 109 | 110 | # Is this a dry run? 111 | $UseDryRun = ""; 112 | if($WhatIf.IsPresent) { 113 | $UseDryRun = "-dryrun" 114 | } 115 | 116 | # Make sure tools folder exists 117 | if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) { 118 | Write-Verbose -Message "Creating tools directory..." 119 | New-Item -Path $TOOLS_DIR -Type directory | out-null 120 | } 121 | 122 | # Make sure that packages.config exist. 123 | if (!(Test-Path $PACKAGES_CONFIG)) { 124 | Write-Verbose -Message "Downloading packages.config..." 125 | try { (New-Object System.Net.WebClient).DownloadFile("http://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch { 126 | Throw "Could not download packages.config." 127 | } 128 | } 129 | 130 | # Try find NuGet.exe in path if not exists 131 | if (!(Test-Path $NUGET_EXE)) { 132 | Write-Verbose -Message "Trying to find nuget.exe in PATH..." 133 | $existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_) } 134 | $NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1 135 | if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) { 136 | Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)." 137 | $NUGET_EXE = $NUGET_EXE_IN_PATH.FullName 138 | } 139 | } 140 | 141 | # Try download NuGet.exe if not exists 142 | if (!(Test-Path $NUGET_EXE)) { 143 | Write-Verbose -Message "Downloading NuGet.exe..." 144 | try { 145 | (New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE) 146 | } catch { 147 | Throw "Could not download NuGet.exe." 148 | } 149 | } 150 | 151 | # Save nuget.exe path to environment to be available to child processed 152 | $ENV:NUGET_EXE = $NUGET_EXE 153 | 154 | # Restore tools from NuGet? 155 | if(-Not $SkipToolPackageRestore.IsPresent) { 156 | Push-Location 157 | Set-Location $TOOLS_DIR 158 | 159 | # Check for changes in packages.config and remove installed tools if true. 160 | [string] $md5Hash = MD5HashFile($PACKAGES_CONFIG) 161 | if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or 162 | ($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) { 163 | Write-Verbose -Message "Missing or changed package.config hash..." 164 | Remove-Item * -Recurse -Exclude packages.config,nuget.exe 165 | } 166 | 167 | Write-Verbose -Message "Restoring tools from NuGet..." 168 | $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`"" 169 | 170 | if ($LASTEXITCODE -ne 0) { 171 | Throw "An error occured while restoring NuGet tools." 172 | } 173 | else 174 | { 175 | $md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII" 176 | } 177 | Write-Verbose -Message ($NuGetOutput | out-string) 178 | Pop-Location 179 | } 180 | 181 | # Make sure that Cake has been installed. 182 | if (!(Test-Path $CAKE_EXE)) { 183 | Throw "Could not find Cake.exe at $CAKE_EXE" 184 | } 185 | 186 | # Start Cake 187 | Write-Host "Running build script..." 188 | Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs" 189 | exit $LASTEXITCODE -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ########################################################################## 4 | # This is the Cake bootstrapper script for Linux and OS X. 5 | # This file was downloaded from https://github.com/cake-build/resources 6 | # Feel free to change this file to fit your needs. 7 | ########################################################################## 8 | 9 | # Define directories. 10 | SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 11 | TOOLS_DIR=$SCRIPT_DIR/tools 12 | NUGET_EXE=$TOOLS_DIR/nuget.exe 13 | CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe 14 | PACKAGES_CONFIG=$TOOLS_DIR/packages.config 15 | PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum 16 | 17 | # Define md5sum or md5 depending on Linux/OSX 18 | MD5_EXE= 19 | if [[ "$(uname -s)" == "Darwin" ]]; then 20 | MD5_EXE="md5 -r" 21 | else 22 | MD5_EXE="md5sum" 23 | fi 24 | 25 | # Define default arguments. 26 | SCRIPT="build.cake" 27 | TARGET="Default" 28 | CONFIGURATION="Release" 29 | VERBOSITY="verbose" 30 | DRYRUN= 31 | SHOW_VERSION=false 32 | SCRIPT_ARGUMENTS=() 33 | 34 | # Parse arguments. 35 | for i in "$@"; do 36 | case $1 in 37 | -s|--script) SCRIPT="$2"; shift ;; 38 | -t|--target) TARGET="$2"; shift ;; 39 | -c|--configuration) CONFIGURATION="$2"; shift ;; 40 | -v|--verbosity) VERBOSITY="$2"; shift ;; 41 | -d|--dryrun) DRYRUN="-dryrun" ;; 42 | --version) SHOW_VERSION=true ;; 43 | --) shift; SCRIPT_ARGUMENTS+=("$@"); break ;; 44 | *) SCRIPT_ARGUMENTS+=("$1") ;; 45 | esac 46 | shift 47 | done 48 | 49 | # Make sure the tools folder exist. 50 | if [ ! -d "$TOOLS_DIR" ]; then 51 | mkdir "$TOOLS_DIR" 52 | fi 53 | 54 | # Make sure that packages.config exist. 55 | if [ ! -f "$TOOLS_DIR/packages.config" ]; then 56 | echo "Downloading packages.config..." 57 | curl -Lsfo "$TOOLS_DIR/packages.config" http://cakebuild.net/download/bootstrapper/packages 58 | if [ $? -ne 0 ]; then 59 | echo "An error occured while downloading packages.config." 60 | exit 1 61 | fi 62 | fi 63 | 64 | # Download NuGet if it does not exist. 65 | if [ ! -f "$NUGET_EXE" ]; then 66 | echo "Downloading NuGet..." 67 | curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe 68 | if [ $? -ne 0 ]; then 69 | echo "An error occured while downloading nuget.exe." 70 | exit 1 71 | fi 72 | fi 73 | 74 | # Restore tools from NuGet. 75 | pushd "$TOOLS_DIR" >/dev/null 76 | if [ ! -f $PACKAGES_CONFIG_MD5 ] || [ "$( cat $PACKAGES_CONFIG_MD5 | sed 's/\r$//' )" != "$( $MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' )" ]; then 77 | find . -type d ! -name . | xargs rm -rf 78 | fi 79 | 80 | mono "$NUGET_EXE" install -ExcludeVersion 81 | if [ $? -ne 0 ]; then 82 | echo "Could not restore NuGet packages." 83 | exit 1 84 | fi 85 | 86 | $MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' >| $PACKAGES_CONFIG_MD5 87 | 88 | popd >/dev/null 89 | 90 | # Make sure that Cake has been installed. 91 | if [ ! -f "$CAKE_EXE" ]; then 92 | echo "Could not find Cake.exe at '$CAKE_EXE'." 93 | exit 1 94 | fi 95 | 96 | # Start Cake 97 | if $SHOW_VERSION; then 98 | exec mono "$CAKE_EXE" -version 99 | else 100 | exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -configuration=$CONFIGURATION -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" 101 | fi -------------------------------------------------------------------------------- /nuspec/Xamarin.Android.AVLoadingIndicatorView.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Xamarin.Android.AVLoadingIndicatorView 5 | $version$ 6 | Xamarin.Android.AVLoadingIndicatorView 7 | jzeferino 8 | https://github.com/jzeferino/Xamarin.Android.AVLoadingIndicatorView/blob/master/LICENSE 9 | https://github.com/jzeferino/Xamarin.Android.AVLoadingIndicatorView 10 | false 11 | AVLoadingIndicatorView is a collection of nice loading animations for Android. 12 | xamarin, android, loading 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Xamarin.Android.AVLoadingIndicatorViewBinding.Sample/IndicatorActivity.cs: -------------------------------------------------------------------------------- 1 | using Android.App; 2 | using Android.Widget; 3 | using Android.OS; 4 | using Com.Wang.Avi; 5 | using Android.Views; 6 | using Java.Interop; 7 | 8 | namespace Xamarin.Android.AVLoadingIndicatorViewBinding.Sample 9 | { 10 | [Activity(Label = "Xamarin.Android.AVLoadingIndicatorViewBinding.Sample.IndicatorActivity", Icon = "@mipmap/icon")] 11 | public class IndicatorActivity : Activity 12 | { 13 | public static string ExtraIndicator = "indicator"; 14 | 15 | private AVLoadingIndicatorView avi; 16 | 17 | protected override void OnCreate(Bundle savedInstanceState) 18 | { 19 | base.OnCreate(savedInstanceState); 20 | 21 | // Set our view from the "main" layout resource 22 | SetContentView(Resource.Layout.activity_indicator); 23 | 24 | avi = FindViewById(Resource.Id.avi); 25 | avi.SetIndicator(Intent.GetStringExtra(ExtraIndicator)); 26 | } 27 | 28 | [Export("HideClick")] 29 | public void HideClick(View view) 30 | { 31 | avi.Hide(); 32 | // or avi.SmoothToHide(); 33 | } 34 | 35 | [Export("ShowClick")] 36 | public void ShowClick(View view) 37 | { 38 | avi.Show(); 39 | // or avi.SmoothToShow(); 40 | } 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /src/Xamarin.Android.AVLoadingIndicatorViewBinding.Sample/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Xamarin.Android.AVLoadingIndicatorViewBinding.Sample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using Android.App; 4 | 5 | // Information about this assembly is defined by the following attributes. 6 | // Change them to the values specific to your project. 7 | 8 | [assembly: AssemblyTitle("Xamarin.Android.AVLoadingIndicatorViewBinding.Sample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("jzeferino")] 12 | [assembly: AssemblyProduct("")] 13 | [assembly: AssemblyCopyright("jzeferino - 2016")] 14 | [assembly: AssemblyTrademark("jzeferino")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 20 | 21 | [assembly: AssemblyVersion("1.0.0")] 22 | 23 | // The following attributes are used to specify the signing key for the assembly, 24 | // if desired. See the Mono documentation for more information about signing. 25 | 26 | //[assembly: AssemblyDelaySign(false)] 27 | //[assembly: AssemblyKeyFile("")] 28 | -------------------------------------------------------------------------------- /src/Xamarin.Android.AVLoadingIndicatorViewBinding.Sample/Resources/layout/activity_indicator.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 17 | 18 | 21 |