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

Commit

Permalink
Merge tag 'v2.1.1'
Browse files Browse the repository at this point in the history
[maven-release-plugin]  copy for tag v2.1.1
  • Loading branch information
Chris Banes committed Jan 2, 2013
2 parents 9c3ff3a + 0a9e6fd commit 12ebe85
Show file tree
Hide file tree
Showing 27 changed files with 696 additions and 427 deletions.
4 changes: 2 additions & 2 deletions extras/PullToRefreshListFragment/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.handmark.pulltorefresh.extras.listfragment"
android:versionCode="2100"
android:versionName="2.1" >
android:versionCode="2110"
android:versionName="2.1.1" >

<application />

Expand Down
2 changes: 1 addition & 1 deletion extras/PullToRefreshListFragment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.github.chrisbanes.pulltorefresh</groupId>
<artifactId>extras</artifactId>
<version>2.1</version>
<version>2.1.1</version>
</parent>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*******************************************************************************
* Copyright 2011, 2012 Chris Banes.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package com.handmark.pulltorefresh.extras.listfragment;

import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.ListView;

import com.handmark.pulltorefresh.library.PullToRefreshBase;

abstract class PullToRefreshBaseListFragment<T extends PullToRefreshBase<? extends AbsListView>> extends ListFragment {

private T mPullToRefreshListView;

@Override
public final View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View layout = super.onCreateView(inflater, container, savedInstanceState);

ListView lv = (ListView) layout.findViewById(android.R.id.list);
ViewGroup parent = (ViewGroup) lv.getParent();

// Remove ListView and add PullToRefreshListView in its place
int lvIndex = parent.indexOfChild(lv);
parent.removeViewAt(lvIndex);
mPullToRefreshListView = onCreatePullToRefreshListView(inflater, savedInstanceState);
parent.addView(mPullToRefreshListView, lvIndex, lv.getLayoutParams());

return layout;
}

/**
* @return The {@link PullToRefreshBase} attached to this ListFragment.
*/
public final T getPullToRefreshListView() {
return mPullToRefreshListView;
}

/**
* Returns the {@link PullToRefreshBase} which will replace the ListView
* created from ListFragment. You should override this method if you wish to
* customise the {@link PullToRefreshBase} from the default.
*
* @param inflater - LayoutInflater which can be used to inflate from XML.
* @param savedInstanceState - Bundle passed through from
* {@link ListFragment#onCreateView(LayoutInflater, ViewGroup, Bundle)
* onCreateView(...)}
* @return The {@link PullToRefreshBase} which will replace the ListView.
*/
protected abstract T onCreatePullToRefreshListView(LayoutInflater inflater, Bundle savedInstanceState);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*******************************************************************************
* Copyright 2011, 2012 Chris Banes.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package com.handmark.pulltorefresh.extras.listfragment;

import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;

import com.handmark.pulltorefresh.library.PullToRefreshExpandableListView;

/**
* A sample implementation of how to use {@link PullToRefreshExpandableListView}
* with {@link ListFragment}. This implementation simply replaces the ListView
* that {@code ListFragment} creates with a new
* {@code PullToRefreshExpandableListView}. This means that ListFragment still
* works 100% (e.g. <code>setListShown(...)</code> ).
* <p/>
* The new PullToRefreshListView is created in the method
* {@link #onCreatePullToRefreshListView(LayoutInflater, Bundle)}. If you wish
* to customise the {@code PullToRefreshExpandableListView} then override this
* method and return your customised instance.
*
* @author Chris Banes
*
*/
public class PullToRefreshExpandableListFragment extends PullToRefreshBaseListFragment<PullToRefreshExpandableListView> {

protected PullToRefreshExpandableListView onCreatePullToRefreshListView(LayoutInflater inflater,
Bundle savedInstanceState) {
return new PullToRefreshExpandableListView(getActivity());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,66 +18,25 @@
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.handmark.pulltorefresh.library.PullToRefreshListView;

/**
* A sample implementation of how to the PullToRefreshListView with
* ListFragment. This implementation simply replaces the ListView that
* ListFragment creates with a new PullToRefreshListView. This means that
* ListFragment still works 100% (e.g. <code>setListShown(...)</code>).
*
* A sample implementation of how to use {@link PullToRefreshListView} with
* {@link ListFragment}. This implementation simply replaces the ListView that
* {@code ListFragment} creates with a new PullToRefreshListView. This means
* that ListFragment still works 100% (e.g. <code>setListShown(...)</code> ).
* <p/>
* The new PullToRefreshListView is created in the method
* <code>onCreatePullToRefreshListView()</code>. If you wish to customise the
* PullToRefreshListView then override this method and return your customised
* instance.
* {@link #onCreatePullToRefreshListView(LayoutInflater, Bundle)}. If you wish
* to customise the {@code PullToRefreshListView} then override this method and
* return your customised instance.
*
* @author Chris Banes
*
*/
public class PullToRefreshListFragment extends ListFragment {

private PullToRefreshListView mPullToRefreshListView;

@Override
public final View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View layout = super.onCreateView(inflater, container, savedInstanceState);

ListView lv = (ListView) layout.findViewById(android.R.id.list);
ViewGroup parent = (ViewGroup) lv.getParent();

//Remove ListView and add PullToRefreshListView in its place
int lvIndex = parent.indexOfChild(lv);
parent.removeViewAt(lvIndex);
mPullToRefreshListView = onCreatePullToRefreshListView(inflater, savedInstanceState);
parent.addView(mPullToRefreshListView, lvIndex, lv.getLayoutParams());

return layout;
}

/**
* @return The {@link PullToRefreshListView} attached to this ListFragment.
*/
public final PullToRefreshListView getPullToRefreshListView() {
return mPullToRefreshListView;
}
public class PullToRefreshListFragment extends PullToRefreshBaseListFragment<PullToRefreshListView> {

/**
* Returns the {@link PullToRefreshListView} which will replace the ListView
* created from ListFragment. You should override this method if you wish to
* customise the {@link PullToRefreshListView} from the default.
*
* @param inflater
* - LayoutInflater which can be used to inflate from XML.
* @param savedInstanceState
* - Bundle passed through from
* {@link ListFragment#onCreateView(LayoutInflater, ViewGroup, Bundle)
* onCreateView(...)}
* @return The {@link PullToRefreshListView} which will replace the
* ListView.
*/
protected PullToRefreshListView onCreatePullToRefreshListView(LayoutInflater inflater, Bundle savedInstanceState) {
return new PullToRefreshListView(getActivity());
}
Expand Down
4 changes: 2 additions & 2 deletions extras/PullToRefreshViewPager/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.handmark.pulltorefresh.extras.viewpager"
android:versionCode="2100"
android:versionName="2.1" >
android:versionCode="2110"
android:versionName="2.1.1" >

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

Expand Down
2 changes: 1 addition & 1 deletion extras/PullToRefreshViewPager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.github.chrisbanes.pulltorefresh</groupId>
<artifactId>extras</artifactId>
<version>2.1</version>
<version>2.1.1</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion extras/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.github.chrisbanes.pulltorefresh</groupId>
<artifactId>parent</artifactId>
<version>2.1</version>
<version>2.1.1</version>
</parent>

<modules>
Expand Down
4 changes: 2 additions & 2 deletions library/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.handmark.pulltorefresh.library"
android:versionCode="2100"
android:versionName="2.1" >
android:versionCode="2110"
android:versionName="2.1.1" >

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

Expand Down
2 changes: 1 addition & 1 deletion library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.github.chrisbanes.pulltorefresh</groupId>
<artifactId>parent</artifactId>
<version>2.1</version>
<version>2.1.1</version>
</parent>

<dependencies>
Expand Down
34 changes: 22 additions & 12 deletions library/res/layout/pull_to_refresh_header_horizontal.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" >

<ImageView
android:id="@+id/pull_to_refresh_image"
<FrameLayout
android:id="@+id/fl_inner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
android:layout_height="fill_parent"
android:paddingBottom="@dimen/header_footer_top_bottom_padding"
android:paddingLeft="@dimen/header_footer_left_right_padding"
android:paddingRight="@dimen/header_footer_left_right_padding"
android:paddingTop="@dimen/header_footer_top_bottom_padding" >

<ProgressBar
android:id="@+id/pull_to_refresh_progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminate="true"
android:visibility="gone" />
<ImageView
android:id="@+id/pull_to_refresh_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />

<ProgressBar
android:id="@+id/pull_to_refresh_progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminate="true"
android:visibility="gone" />
</FrameLayout>

</merge>
76 changes: 43 additions & 33 deletions library/res/layout/pull_to_refresh_header_vertical.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,58 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android" >

<FrameLayout
android:layout_width="wrap_content"
android:id="@+id/fl_inner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical" >
android:paddingBottom="@dimen/header_footer_top_bottom_padding"
android:paddingLeft="@dimen/header_footer_left_right_padding"
android:paddingRight="@dimen/header_footer_left_right_padding"
android:paddingTop="@dimen/header_footer_top_bottom_padding" >

<ImageView
android:id="@+id/pull_to_refresh_image"
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
android:layout_gravity="left|center_vertical" >

<ProgressBar
android:id="@+id/pull_to_refresh_progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminate="true"
android:visibility="gone" />
</FrameLayout>
<ImageView
android:id="@+id/pull_to_refresh_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:orientation="vertical" >
<ProgressBar
android:id="@+id/pull_to_refresh_progress"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminate="true"
android:visibility="gone" />
</FrameLayout>

<TextView
android:id="@+id/pull_to_refresh_text"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearance"
android:textStyle="bold" />
android:layout_gravity="center"
android:gravity="center_horizontal"
android:orientation="vertical" >

<TextView
android:id="@+id/pull_to_refresh_sub_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="gone" />
</LinearLayout>
<TextView
android:id="@+id/pull_to_refresh_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearance"
android:textStyle="bold" />

<TextView
android:id="@+id/pull_to_refresh_sub_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="gone" />
</LinearLayout>
</FrameLayout>

</merge>
Loading

0 comments on commit 12ebe85

Please sign in to comment.