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

Commit 12ebe85

Browse files
author
Chris Banes
committed
Merge tag 'v2.1.1'
[maven-release-plugin] copy for tag v2.1.1
2 parents 9c3ff3a + 0a9e6fd commit 12ebe85

27 files changed

Lines changed: 696 additions & 427 deletions

extras/PullToRefreshListFragment/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.handmark.pulltorefresh.extras.listfragment"
4-
android:versionCode="2100"
5-
android:versionName="2.1" >
4+
android:versionCode="2110"
5+
android:versionName="2.1.1" >
66

77
<application />
88

extras/PullToRefreshListFragment/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>extras</artifactId>
13-
<version>2.1</version>
13+
<version>2.1.1</version>
1414
</parent>
1515

1616
<dependencies>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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.AbsListView;
24+
import android.widget.ListView;
25+
26+
import com.handmark.pulltorefresh.library.PullToRefreshBase;
27+
28+
abstract class PullToRefreshBaseListFragment<T extends PullToRefreshBase<? extends AbsListView>> extends ListFragment {
29+
30+
private T mPullToRefreshListView;
31+
32+
@Override
33+
public final View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
34+
View layout = super.onCreateView(inflater, container, savedInstanceState);
35+
36+
ListView lv = (ListView) layout.findViewById(android.R.id.list);
37+
ViewGroup parent = (ViewGroup) lv.getParent();
38+
39+
// Remove ListView and add PullToRefreshListView in its place
40+
int lvIndex = parent.indexOfChild(lv);
41+
parent.removeViewAt(lvIndex);
42+
mPullToRefreshListView = onCreatePullToRefreshListView(inflater, savedInstanceState);
43+
parent.addView(mPullToRefreshListView, lvIndex, lv.getLayoutParams());
44+
45+
return layout;
46+
}
47+
48+
/**
49+
* @return The {@link PullToRefreshBase} attached to this ListFragment.
50+
*/
51+
public final T getPullToRefreshListView() {
52+
return mPullToRefreshListView;
53+
}
54+
55+
/**
56+
* Returns the {@link PullToRefreshBase} which will replace the ListView
57+
* created from ListFragment. You should override this method if you wish to
58+
* customise the {@link PullToRefreshBase} from the default.
59+
*
60+
* @param inflater - LayoutInflater which can be used to inflate from XML.
61+
* @param savedInstanceState - Bundle passed through from
62+
* {@link ListFragment#onCreateView(LayoutInflater, ViewGroup, Bundle)
63+
* onCreateView(...)}
64+
* @return The {@link PullToRefreshBase} which will replace the ListView.
65+
*/
66+
protected abstract T onCreatePullToRefreshListView(LayoutInflater inflater, Bundle savedInstanceState);
67+
68+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
22+
import com.handmark.pulltorefresh.library.PullToRefreshExpandableListView;
23+
24+
/**
25+
* A sample implementation of how to use {@link PullToRefreshExpandableListView}
26+
* with {@link ListFragment}. This implementation simply replaces the ListView
27+
* that {@code ListFragment} creates with a new
28+
* {@code PullToRefreshExpandableListView}. This means that ListFragment still
29+
* works 100% (e.g. <code>setListShown(...)</code> ).
30+
* <p/>
31+
* The new PullToRefreshListView is created in the method
32+
* {@link #onCreatePullToRefreshListView(LayoutInflater, Bundle)}. If you wish
33+
* to customise the {@code PullToRefreshExpandableListView} then override this
34+
* method and return your customised instance.
35+
*
36+
* @author Chris Banes
37+
*
38+
*/
39+
public class PullToRefreshExpandableListFragment extends PullToRefreshBaseListFragment<PullToRefreshExpandableListView> {
40+
41+
protected PullToRefreshExpandableListView onCreatePullToRefreshListView(LayoutInflater inflater,
42+
Bundle savedInstanceState) {
43+
return new PullToRefreshExpandableListView(getActivity());
44+
}
45+
46+
}

extras/PullToRefreshListFragment/src/com/handmark/pulltorefresh/extras/listfragment/PullToRefreshListFragment.java

Lines changed: 10 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,66 +18,25 @@
1818
import android.os.Bundle;
1919
import android.support.v4.app.ListFragment;
2020
import android.view.LayoutInflater;
21-
import android.view.View;
22-
import android.view.ViewGroup;
23-
import android.widget.ListView;
21+
2422
import com.handmark.pulltorefresh.library.PullToRefreshListView;
2523

2624
/**
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-
*
25+
* A sample implementation of how to use {@link PullToRefreshListView} with
26+
* {@link ListFragment}. This implementation simply replaces the ListView that
27+
* {@code ListFragment} creates with a new PullToRefreshListView. This means
28+
* that ListFragment still works 100% (e.g. <code>setListShown(...)</code> ).
29+
* <p/>
3230
* 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.
31+
* {@link #onCreatePullToRefreshListView(LayoutInflater, Bundle)}. If you wish
32+
* to customise the {@code PullToRefreshListView} then override this method and
33+
* return your customised instance.
3634
*
3735
* @author Chris Banes
3836
*
3937
*/
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-
}
38+
public class PullToRefreshListFragment extends PullToRefreshBaseListFragment<PullToRefreshListView> {
6639

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-
*/
8140
protected PullToRefreshListView onCreatePullToRefreshListView(LayoutInflater inflater, Bundle savedInstanceState) {
8241
return new PullToRefreshListView(getActivity());
8342
}

extras/PullToRefreshViewPager/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.handmark.pulltorefresh.extras.viewpager"
4-
android:versionCode="2100"
5-
android:versionName="2.1" >
4+
android:versionCode="2110"
5+
android:versionName="2.1.1" >
66

77
<uses-sdk android:minSdkVersion="4" />
88

extras/PullToRefreshViewPager/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>extras</artifactId>
13-
<version>2.1</version>
13+
<version>2.1.1</version>
1414
</parent>
1515

1616
<dependencies>

extras/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>2.1</version>
13+
<version>2.1.1</version>
1414
</parent>
1515

1616
<modules>

library/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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="2100"
5-
android:versionName="2.1" >
4+
android:versionCode="2110"
5+
android:versionName="2.1.1" >
66

77
<uses-sdk android:minSdkVersion="4" />
88

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>2.1</version>
13+
<version>2.1.1</version>
1414
</parent>
1515

1616
<dependencies>

0 commit comments

Comments
 (0)