Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ obj/
xam/
Resource.designer.cs
.DS_Store
packages/
17 changes: 0 additions & 17 deletions Components/xamandroidsupportv4-18-4.19.0.1/component/Details.md

This file was deleted.

This file was deleted.

309 changes: 0 additions & 309 deletions Components/xamandroidsupportv4-18-4.19.0.1/component/License.md

This file was deleted.

14 changes: 0 additions & 14 deletions Components/xamandroidsupportv4-18-4.19.0.1/component/Manifest.xml

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 5 additions & 1 deletion PullToRefresharp.Android/PullToRefresharp.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AssemblyName>PullToRefresharp</AssemblyName>
<TargetFrameworkVersion>v2.3</TargetFrameworkVersion>
<ReleaseVersion>1.0.2</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand All @@ -40,7 +41,7 @@
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
<Reference Include="Xamarin.Android.Support.v4">
<HintPath>..\Components\xamandroidsupportv4-18-4.19.0.1\lib\android\Xamarin.Android.Support.v4.dll</HintPath>
<HintPath>..\packages\Xamarin.Android.Support.v4.21.0.3.0\lib\MonoAndroid10\Xamarin.Android.Support.v4.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -94,4 +95,7 @@
<ItemGroup>
<Folder Include="Resources\values-sv\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions PullToRefresharp.Android/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Android.Support.v4" version="21.0.3.0" targetFramework="MonoAndroid23" />
</packages>
33 changes: 33 additions & 0 deletions component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
%YAML 1.2
---

id: pulltorefresharp
name: PullToRefresharp
version: 1.0.2
summary: Add pull-to-refresh to your Xamarin.Android apps.

publisher: OxyPlot.org
publisher-url: http://github.com/bduncavage/PullToRefresharp
src-url: http://github.com/bduncavage/PullToRefresharp

details: component/Details.md
license: component/License.md
getting-started: component/GettingStarted.md

icons:
- component/icons/pulltorefresharp_128x128.png
- component/icons/pulltorefresharp_512x512.png


build:
- PullToRefresharp.Android.sln
libraries:
android: PullToRefresharp.Android/bin/Release/PullToRefresharp.dll
packages:
android: Xamarin.Android.Support.v4, Version=21.0.3.0


samples:
- name: "Android Sample"
summary: "Demonstrates basic usage with ListView, GridView, and ScrollView"
path: samples/Sample.Android.sln
46 changes: 46 additions & 0 deletions component/Details.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# PullToRefresharp

## Pull To Refresh for Android in `C#`

Add pull-to-refresh functionality to your Android app quickly and easily.

PullToRefresharp is the only C# library that provides pull-to-refresh functionality to ListView, GridView, and ScrollView on Android. It is simple to integrate with, customizable and extensible.

### Simple integration:

Update your layout:

```
<pulltorefresharp.views.ViewWrapper
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<pulltorefresharp.widget.GridView
android:id="@id/myGridView" />

</pulltorefresharp.views.ViewWrapper>
```

Hook into the `RefreshActivated` event

```csharp
var gridView = FindViewById<IPullToRefresharpView>(Resource.Id.myGridView);
gridView.RefreshActivated += (o, e) { RefreshMyContent(); };

// when content refresh complete
gridView.OnRefreshCompleted();

```

### Features

Out of the box PullToFrefresharp gives you a clean pull-to-refresh header UI and assets. You can change the colors or image assets via XML attributes, or include your own fully custom header.

If you want to add pull-to-refresh to a view type other than GridView, ListView, or ScrollView, you can! Simply create a subclass of the view and implement the `IPullToRefreshWrappedView` interface (there's almost nothing to it, all you need to do is write a little bit of glue code to proxy most calls to `PullToRefresharp.Delegates.ViewDelegate`).

### Fork it on GitHub!

[PullToRefresharp on GitHub](http://github.com/bduncavage/PullToRefresharp)

PullToRefresharp is free and open source software. If there's something you want to add, please do! The goal of PullToRefresharp is to provide a robust pull-to-refresh framework for all Xamarin.Android (and possiby Xamarin.iOS in the future) applications.

56 changes: 56 additions & 0 deletions component/GettingStarted.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## PullToRefresharp

Integrating PullToRefresharp into your existing application requires only a small amount of work. Modifying your layout to use the PullToRefresharp view and widget, then hooking into the RefreshActivated event, and finally calling OnRefreshComplete when you're done refreshing your content is all that you need to do.

Let's get started!

### Modifying your layout

The first thing you need to replace is any ListView, GridView, or ScrollView you wish to enable pull-to-refresh on with the PullToRefresharp equivalent.

```
<ListView />
```

Would become:

```
<pulltorefresharp.widget.ListView />
```

The next, and last, thing you need to do to your layout is to wrap the view with a `ViewWrapper`. This is the bit that will inject the pull-to-refresh header and manage event handling (it's how PullToRefresharp can be used with more than just ListView).

```
<pulltorefresharp.views.ViewWrapper
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<pulltorefresharp.widget.ListView />

</pulltorefresharp.views.ViewWrapper>
```

You are now done integrating PullToRefresharp into your layout!

### Hooking up Events

You'll want to know when a refresh has been activated. This is easy, just hook up a handler to your GridView, ListView, or ScrollView that has been PullToRefresharp-enabled.

```
var gridView = FindViewById<IPullToRefresharpView>(Resource.Id.myGridView);
gridView.RefreshActivated += (o, e) => { RefreshContent(); };
```

As you can see, your GridView implements the `IPullToRefresharpView` interface. This interface exposes some useful methods and properties (such as enabling/disabling pull-to-refresh). Right now, we only care about the RefreshActivated event, this is raised when the user has pulled beyond the threshold and released.

Now you will want to inform your IPullToRefreshView when you are done refreshing. This is done thusly:

```
gridView.OnRefreshCompleted();
```

This causes the header to snapback up in an animated fashion.

### Congratulations!

You're done! There is no more you need to do to start using PullToRefresharp. Also look at the source for `IPullToRefreshView` and `attrs.xml` to discover more advanced options (http://github.com/bduncavage/PullToRefresharp).
26 changes: 26 additions & 0 deletions component/License.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```
This software is distributed under the MIT software license.

The MIT License (MIT)

Copyright (c) 2015 Brett Duncavage

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

```
Binary file added component/icons/pulltorefresharp_128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added component/icons/pulltorefresharp_512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion samples/Sample.Android/Sample.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AssemblyName>PullToRefresharp.Android</AssemblyName>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<TargetFrameworkVersion>v2.3</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -27,6 +28,7 @@
<ConsolePause>false</ConsolePause>
<AndroidLinkMode>None</AndroidLinkMode>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
Expand All @@ -35,14 +37,16 @@
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<AndroidSupportedAbis>armeabi;armeabi-v7a;x86</AndroidSupportedAbis>
<DebugType>full</DebugType>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
<Reference Include="Xamarin.Android.Support.v4">
<HintPath>..\..\Components\xamandroidsupportv4-18-4.19.0.1\lib\android\Xamarin.Android.Support.v4.dll</HintPath>
<HintPath>..\packages\Xamarin.Android.Support.v4.21.0.3.0\lib\MonoAndroid10\Xamarin.Android.Support.v4.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand All @@ -57,6 +61,7 @@
</ItemGroup>
<ItemGroup>
<None Include="Properties\AndroidManifest.xml" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions samples/Sample.Android/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Android.Support.v4" version="21.0.3.0" targetFramework="MonoAndroid23" />
</packages>