Skip to content
This repository was archived by the owner on Oct 15, 2018. It is now read-only.

Commit 9ca623e

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 0bc57fc + 37f5a72 commit 9ca623e

File tree

59 files changed

+2536
-642
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2536
-642
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ This project aims to provide a reusable Pull to Refresh widget for Android. It w
77
## Features
88

99
* Supports both Pulling Down from the top, and Pulling Up from the bottom (or even both).
10-
* Animated Scrolling for all devices (Tested on 1.6+)
11-
* Works for all AbsListView derived classes. ListView, ExpandableListView & GridView have been implemented.
12-
* Also Works with WebView!
10+
* Animated Scrolling for all devices.
11+
* Over Scroll supports for devices on Android v2.3+.
12+
* Currently works with **ListView**, **ExpandableListView** & **GridView**, **WebView** and **ScrollView**!
1313
* Integrated End of List Listener for use of detecting when the user has scrolled to the bottom.
14-
* Maven Support (thanks to Stefano Dacchille)
15-
* Indicators to show the user when a Pull-to-Refresh is available
14+
* Maven Support.
15+
* Indicators to show the user when a Pull-to-Refresh is available.
16+
* Support for **ListFragment**!
1617
* Lots of [Customisation](https://github.com/chrisbanes/Android-PullToRefresh/wiki/Customisation) options!
1718

1819
Repository at <https://github.com/chrisbanes/Android-PullToRefresh>.
@@ -23,7 +24,7 @@ The sample application (the source is in the repository) has been published onto
2324
[![Get it on Google Play](http://www.android.com/images/brand/get_it_on_play_logo_small.png)](http://play.google.com/store/apps/details?id=com.handmark.pulltorefresh.samples)
2425

2526
## Usage
26-
To begin using the libary, please see the [Quick Start Guide](https://github.com/chrisbanes/Android-PullToRefresh/wiki/Quick-Start-Guide) page.
27+
To begin using the library, please see the [Quick Start Guide](https://github.com/chrisbanes/Android-PullToRefresh/wiki/Quick-Start-Guide) page.
2728

2829
### Customisation
2930
Please see the [Customisation](https://github.com/chrisbanes/Android-PullToRefresh/wiki/Customisation) page for more information on how to change the behaviour and look of the View.
@@ -46,6 +47,7 @@ I will gladly accept pull requests for fixes and feature enhancements but please
4647
* [Stefano Dacchille](https://github.com/stefanodacchille)
4748
* [Steve Lhomme](https://github.com/robUx4)
4849
* [Maxim Galkin](https://github.com/mgalkin)
50+
* [Scorcher](https://github.com/Scorcher)
4951

5052

5153
## License
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.handmark.pulltorefresh.extras.listfragment"
4+
android:versionCode="1420"
5+
android:versionName="1.4.2" >
6+
7+
<application />
8+
9+
</manifest>
341 KB
Binary file not shown.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>com.github.chrisbanes.pulltorefresh</groupId>
6+
<artifactId>extra-listfragment</artifactId>
7+
<packaging>apklib</packaging>
8+
<name>Android-PullToRefresh Extras: ListFragment</name>
9+
10+
<parent>
11+
<groupId>com.github.chrisbanes.pulltorefresh</groupId>
12+
<artifactId>extras</artifactId>
13+
<version>1.4.2</version>
14+
</parent>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>com.google.android</groupId>
19+
<artifactId>android</artifactId>
20+
</dependency>
21+
<dependency>
22+
<groupId>com.google.android</groupId>
23+
<artifactId>support-v4</artifactId>
24+
<version>r7</version>
25+
</dependency>
26+
<dependency>
27+
<groupId>${project.groupId}</groupId>
28+
<artifactId>library</artifactId>
29+
<type>apklib</type>
30+
<version>${project.version}</version>
31+
</dependency>
32+
</dependencies>
33+
34+
<build>
35+
<plugins>
36+
<plugin>
37+
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
38+
<artifactId>android-maven-plugin</artifactId>
39+
</plugin>
40+
<plugin>
41+
<groupId>org.apache.maven.plugins</groupId>
42+
<artifactId>maven-eclipse-plugin</artifactId>
43+
</plugin>
44+
</plugins>
45+
</build>
46+
</project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system edit
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
#
10+
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11+
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12+
13+
android.library=true
14+
# Project target.
15+
target=android-16
16+
android.library.reference.1=../../library
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:orientation="vertical" >
6+
7+
<!-- Need this for Maven, otherwise it doesn't build. I hate Maven. -->
8+
9+
</LinearLayout>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*******************************************************************************
2+
* Copyright 2011, 2012 Chris Banes.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*******************************************************************************/
16+
package com.handmark.pulltorefresh.extras.listfragment;
17+
18+
import android.os.Bundle;
19+
import android.support.v4.app.ListFragment;
20+
import android.view.LayoutInflater;
21+
import android.view.View;
22+
import android.view.ViewGroup;
23+
import android.widget.ListView;
24+
import com.handmark.pulltorefresh.library.PullToRefreshListView;
25+
26+
/**
27+
* A sample implementation of how to the PullToRefreshListView with
28+
* ListFragment. This implementation simply replaces the ListView that
29+
* ListFragment creates with a new PullToRefreshListView. This means that
30+
* ListFragment still works 100% (e.g. <code>setListShown(...)</code>).
31+
*
32+
* The new PullToRefreshListView is created in the method
33+
* <code>onCreatePullToRefreshListView()</code>. If you wish to customise the
34+
* PullToRefreshListView then override this method and return your customised
35+
* instance.
36+
*
37+
* @author Chris Banes
38+
*
39+
*/
40+
public class PullToRefreshListFragment extends ListFragment {
41+
42+
private PullToRefreshListView mPullToRefreshListView;
43+
44+
@Override
45+
public final View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
46+
View layout = super.onCreateView(inflater, container, savedInstanceState);
47+
48+
ListView lv = (ListView) layout.findViewById(android.R.id.list);
49+
ViewGroup parent = (ViewGroup) lv.getParent();
50+
51+
//Remove ListView and add PullToRefreshListView in its place
52+
int lvIndex = parent.indexOfChild(lv);
53+
parent.removeViewAt(lvIndex);
54+
mPullToRefreshListView = onCreatePullToRefreshListView(inflater, savedInstanceState);
55+
parent.addView(mPullToRefreshListView, lvIndex, lv.getLayoutParams());
56+
57+
return layout;
58+
}
59+
60+
/**
61+
* @return The {@link PullToRefreshListView} attached to this ListFragment.
62+
*/
63+
public final PullToRefreshListView getPullToRefreshListView() {
64+
return mPullToRefreshListView;
65+
}
66+
67+
/**
68+
* Returns the {@link PullToRefreshListView} which will replace the ListView
69+
* created from ListFragment. You should override this method if you wish to
70+
* customise the {@link PullToRefreshListView} from the default.
71+
*
72+
* @param inflater
73+
* - LayoutInflater which can be used to inflate from XML.
74+
* @param savedInstanceState
75+
* - Bundle passed through from
76+
* {@link ListFragment#onCreateView(LayoutInflater, ViewGroup, Bundle)
77+
* onCreateView(...)}
78+
* @return The {@link PullToRefreshListView} which will replace the
79+
* ListView.
80+
*/
81+
protected PullToRefreshListView onCreatePullToRefreshListView(LayoutInflater inflater, Bundle savedInstanceState) {
82+
return new PullToRefreshListView(getActivity());
83+
}
84+
85+
}

extras/pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>com.github.chrisbanes.pulltorefresh</groupId>
6+
<artifactId>extras</artifactId>
7+
<packaging>pom</packaging>
8+
<name>Android-PullToRefresh Extras</name>
9+
10+
<parent>
11+
<groupId>com.github.chrisbanes.pulltorefresh</groupId>
12+
<artifactId>parent</artifactId>
13+
<version>1.4.2</version>
14+
</parent>
15+
16+
<modules>
17+
<module>PullToRefreshListFragment</module>
18+
</modules>
19+
</project>

library/AndroidManifest.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.handmark.pulltorefresh.library"
4-
android:versionCode="1330"
5-
android:versionName="1.3.3" >
4+
android:versionCode="1420"
5+
android:versionName="1.4.2" >
66

7-
<uses-sdk
8-
android:minSdkVersion="4" />
7+
<uses-sdk android:minSdkVersion="4" />
98

109
<application />
1110

library/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>com.github.chrisbanes.pulltorefresh</groupId>
1212
<artifactId>parent</artifactId>
13-
<version>1.3.4-SNAPSHOT</version>
13+
<version>1.4.2</version>
1414
</parent>
1515

1616
<dependencies>

0 commit comments

Comments
 (0)