Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

滑动冲突 #126

Open
wants to merge 124 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
cde543b
optimize
Jun 7, 2016
26172b8
optimize
Jun 8, 2016
04d1174
optimize
Jun 8, 2016
92fc4b5
optimize
Jun 8, 2016
4be2a27
去掉XRefreshViewFooter中onStateReady中的show(true)
Jun 8, 2016
c6e7a31
解决xrefreshview加padding布局有瑕疵的问题
huxq17 Jun 9, 2016
6d8ff2a
Merge branch 'master' of github.com:huxq17/XRefreshView
huxq17 Jun 9, 2016
bbbfada
optimize
huxq17 Jun 9, 2016
8440d9e
解决在XRefreshView的布局中设置padding时布局显示不正确的问题
Jun 13, 2016
1afea6f
添加QQ群
Jun 15, 2016
66aa215
Update README.md
huxq17 Jun 15, 2016
05ee094
更换效果图的地址
Jun 17, 2016
5d8d73d
解决issue #25
Jun 20, 2016
c1afb03
增加在禁用上拉加载时,可选禁止界面被上拉的功能
Jun 24, 2016
22214da
修改demo中展示的效果
Jun 24, 2016
ad30177
去除多余的log
Jul 8, 2016
8ab31ac
开启demo中gridview的上拉加载更多功能
Jul 8, 2016
c6a402b
解决在viewpager中从第二个页面开始,footerview的progressbar布局位置不正确的问题
Jul 8, 2016
767c9c8
update
Jul 8, 2016
b4dd609
添加Recyclerview非自动加载更多时,松开加载更多的功能
Jul 11, 2016
7b7c2d2
optimize
Jul 12, 2016
da3299a
optimize
Jul 13, 2016
a79c83f
optimize
Jul 14, 2016
0fb20f0
优化
Jul 14, 2016
9e9f36a
添加防拉钩的Recyclerview松开加载更多的功能,并解决了若干bug
Jul 15, 2016
a2a557c
版本升级到3.2.0
Jul 15, 2016
8ef942c
update
huxq17 Jul 15, 2016
05c65fb
update readme.md
huxq17 Jul 15, 2016
2d40a3a
update readme.md
huxq17 Jul 15, 2016
93023f6
merge
huxq17 Jul 26, 2016
dc4b986
optimize
huxq17 Jul 26, 2016
3b41106
优化一些操作和修改若干bug,版本升级到3.3.0
huxq17 Jul 27, 2016
5cff7a3
提交下拉刷新数据加载失败的处理
huxq17 Aug 3, 2016
794fc88
更新demo
huxq17 Aug 3, 2016
0413742
完善自定义view的上拉下拉判断条件的设定
huxq17 Aug 3, 2016
ddae9bf
optimize
huxq17 Aug 4, 2016
4cfe104
添加下拉刷新,数据接受失败的ui处理
huxq17 Aug 8, 2016
0d47d28
添加下拉刷新,数据接受失败的ui处理
huxq17 Aug 8, 2016
ab63d92
解决下拉刷新,在刷新状态下把headerview完全隐藏掉,在刷新结束以后下拉和上拉都不可用的问题
huxq17 Aug 8, 2016
4d0ee7f
optimize
huxq17 Aug 12, 2016
a0fd1d0
optimize
huxq17 Aug 15, 2016
5d846ef
优化headerview从普通状态到准备状态的ui效果
huxq17 Aug 15, 2016
4f570db
支持任何时候设置自定义headerview和footerview
huxq17 Aug 15, 2016
74cfa5a
解决调用startRefresh方法不起作用的问题
huxq17 Aug 16, 2016
84027aa
解决不设置footerview会报空的问题
huxq17 Aug 16, 2016
bf2cea3
添加空布局
huxq17 Aug 16, 2016
68be80e
正在开发空布局的功能
huxq17 Aug 17, 2016
4c71056
完善emptyview
huxq17 Aug 18, 2016
3e4481d
解决调用startRefresh方法后,刷新时headerview有时会不显示的问题
huxq17 Aug 18, 2016
4e1b0bc
release 3.5.0 version
huxq17 Aug 19, 2016
6c5bcfa
format
huxq17 Aug 19, 2016
51af21b
优化demo
huxq17 Aug 23, 2016
0980c75
optimize
huxq17 Aug 23, 2016
d061cff
optimize
huxq17 Aug 23, 2016
72aa7d7
optimize
huxq17 Aug 23, 2016
5bca799
optimize
huxq17 Aug 24, 2016
3d6ec6f
optimize
huxq17 Aug 26, 2016
1841d16
添加笑脸刷新
huxq17 Aug 29, 2016
badbf07
调整readme样式
huxq17 Aug 29, 2016
bc786c8
修改错误拼写
huxq17 Aug 29, 2016
d74be64
optimize
huxq17 Sep 5, 2016
7ab8cec
fix issues #36
huxq17 Sep 6, 2016
5d94115
Update README.md
huxq17 Sep 6, 2016
b175e8b
update README.md
huxq17 Sep 6, 2016
7bc5c0b
optimize
huxq17 Sep 8, 2016
6c72062
添加xscrollview的滑动监听
huxq17 Sep 28, 2016
565a788
Update README.md
huxq17 Oct 14, 2016
9f0f7a1
Update README.md
huxq17 Nov 21, 2016
dbecb85
Update README.md
huxq17 Nov 23, 2016
7e5c725
升级到3.5.6,支持AbsListView加载更多数据完成之后露出新加载的数据。
huxq17 Dec 14, 2016
8655f01
Merge branch 'master' of github.com:huxq17/XRefreshView
huxq17 Dec 14, 2016
b343715
修改依赖
huxq17 Dec 14, 2016
744ac35
优化demo
huxq17 Dec 14, 2016
33b2248
Update GridViewActivity.java
huxq17 Dec 14, 2016
7cd1dbd
优化上拉加载完成以后回弹的效果
huxq17 Dec 15, 2016
9172458
resolve conflict
huxq17 Dec 15, 2016
071b66d
Update README.md
huxq17 Dec 29, 2016
3b47f82
解决AbsListview数据不满一屏的时候,会重复加载更多的问题。
huxq17 Jan 4, 2017
fa24287
Merge branch 'master' of github.com:huxq17/XRefreshView
huxq17 Jan 4, 2017
41b3917
fix bug #49
huxq17 Jan 6, 2017
46163dd
升级到3.5.8
huxq17 Jan 6, 2017
19fa544
Update README.md
huxq17 Jan 11, 2017
278c416
解决Recyclerview使用StaggeredGridLayoutManager时,添加的headerview不能使用全部宽度的问题(…
huxq17 Jan 13, 2017
763d970
t push origin masterMerge branch 'master' of github.com:huxq17/XRefre…
huxq17 Jan 13, 2017
d2e61af
fix issue #58
huxq17 Feb 16, 2017
f15442a
update readme.md
huxq17 Feb 16, 2017
fd04458
添加onRefresh(boolean isPullDown)回调
huxq17 Feb 17, 2017
2a2498a
详见更新日志
huxq17 Mar 27, 2017
faa4e1a
Update README.md
huxq17 Mar 27, 2017
e8b521d
详见更新日志2017-3-28
huxq17 Mar 28, 2017
88a04b8
详见更新日志2017-3-28
huxq17 Mar 28, 2017
f6513a8
解决冲突
huxq17 Mar 28, 2017
a2facb7
Update README.md
huxq17 Mar 29, 2017
d1d4767
Update README.md
huxq17 Mar 29, 2017
f2180f4
见更新日志2017-4-14
huxq17 Apr 14, 2017
500262e
见更新日志2017-4-14
huxq17 Apr 14, 2017
3698f64
Merge branch 'master' of github.com:huxq17/XRefreshView
huxq17 Apr 14, 2017
00634ed
Update README.md
huxq17 Apr 14, 2017
7c5d863
Update README.md
huxq17 Apr 14, 2017
d817396
Update README.md
huxq17 Apr 14, 2017
fb47765
详见更新日志2017-4-25
huxq17 Apr 25, 2017
231f7c2
update readme
huxq17 Apr 25, 2017
46f9fec
解决xrefreshview不满屏的时候footerview正常状态下出现在屏幕上的问题
huxq17 May 3, 2017
9c42335
fix issue #78
huxq17 May 4, 2017
3b2d529
optimize
huxq17 May 16, 2017
12dae50
添加酒杯刷新
Sep 27, 2017
428ca15
fix bug #118
Sep 27, 2017
131e5de
添加京东快递图片
Sep 27, 2017
aa23b59
添加京东刷新
Sep 28, 2017
aeda0ac
京东刷新
Sep 28, 2017
6be5962
添加淘宝demo页面
Sep 28, 2017
d5bff0d
更新md
Sep 28, 2017
cf50272
吃豆豆
Sep 28, 2017
833d0c9
Update README.md
huxq17 Jun 25, 2018
ba32db3
Update README.md
huxq17 Jun 25, 2018
b8d02eb
添加新方式
Oct 2, 2018
cb6723a
Update README.md
huxq17 Oct 29, 2018
8396e0f
Author: fanyafeng
fanyafeng Jun 13, 2020
eeb3742
Author: fanyafeng
fanyafeng Jun 13, 2020
ce43532
Merge branch 'fanyafeng'
fanyafeng Jun 13, 2020
979cc06
Author: fanyafeng
fanyafeng Jun 13, 2020
2a37a6e
Author: fanyafeng
fanyafeng Jun 13, 2020
ac1d6aa
Author: fanyafeng
fanyafeng Jun 13, 2020
c5caf3b
Author: fanyafeng
fanyafeng Jun 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
117 changes: 96 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,113 @@
# XRefreshView

###Usage
### Usage
----

#### Gradle

```groovy
dependencies {
compile 'com.huxq17.xrefreshview:xrefreshview:3.0.0'
compile 'com.huxq17.xrefreshview:xrefreshview:3.6.9'
//依赖下面的库
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
}
```

##最新的使用说明请移步[我的博客](http://blog.csdn.net/footballclub/article/details/46982115 "description")
##效果图
###带Banner的Recyclerview
![带Banner的Recyclerview](http://img.my.csdn.net/uploads/201602/15/1455502311_5774.gif)
###LinearLayout样式的Recyclerview
![LinearLayout样式的Recyclerview](http://img.my.csdn.net/uploads/201602/03/1454495499_9614.gif)
###GridLayout样式的Recyclerview
![GridLayout样式的Recyclerview](http://img.my.csdn.net/uploads/201602/03/1454495517_6621.gif)
###Staggered样式的Recyclerview
![Staggered样式的Recyclerview](http://img.my.csdn.net/uploads/201602/03/1454495499_9854.gif)
###GridView
![自带的头部](http://img.my.csdn.net/uploads/201508/25/1440465457_8215.gif)
###自定义View
![自定义头部](http://img.my.csdn.net/uploads/201508/25/1440465306_9400.gif)

还有listview,scrollview,webview等其他的view就不一一截图了。
## 最新的使用说明请移步[我的博客](http://blog.csdn.net/footballclub/article/details/46982115 "description")

## 效果图

|松开加载更多的Recyclerview|带Banner的Recyclerview| LinearLayout样式的Recyclerview|
|:-----|:-----|:-----|
| <img src="gif/xrefresh_releasetoloadmore.gif" width="280" height="475" /> | <img src="gif/xrefresh_banner.gif" width="280" height="475" /> | <img src="gif/xrefresh_linearlayout.gif" width="280" height="475" /> |

|GridLayout样式的Recyclerview|Staggered样式的Recyclerview|
|:-----|:-----|
| <img src="gif/xrefresh_gridlayout.gif" width="280" height="475" />| <img src="gif/xrefresh_staggeredlayout.gif" width="280" height="475" />|

|GridView|自定义View|笑脸刷新|
|:-----|:-----|:-----|
| <img src="gif/xrefresh_gridview.gif" width="280" height="475" />| <img src="gif/xrefresh_customview.gif" width="280" height="475" />|<img src="gif/xrefresh_smile.gif" width="280" height="475" />|

|自定义刷新|仿京东刷新|自定义刷新|
|:-----|:-----|:-----|
| <img src="gif/wine_refresh.gif" width="280" height="475" />| <img src="gif/jd_refresh.gif" width="280" height="475" />| <img src="gif/car_refresh.gif" width="280" height="475" />|


还有listview,scrollview,webview等其他的view就不一一截图了。**建议把此项目下载下来,然后跑到手机上看效果,例子都在app module里。**

### 更新日志:<br/>

2020-6-13:
1.更新android平台到androidx


2017-5-4:
1.解决已无更多数据显示不出来的问题,fix issue[#78](https://github.com/huxq17/XRefreshView/issues/78)
2.升级到3.6.9版本

2017-5-3:
1.解决xrefreshview不满屏的时候footerview正常状态下出现在屏幕上的问题,fix issue[#75](https://github.com/huxq17/XRefreshView/issues/75)
2.升级到3.6.8版本

2017-4-25:
1.通过使用XWebView,解决在三星c5、小米5等机型在webview上加XRefreshView,会出现加载更多没有效果的现象,详见issue[#72](https://github.com/huxq17/XRefreshView/issues/72)
2.升级到3.6.7版本

2017-4-14:
1.解决Recyclerview频繁上拉加载时会出现footerview位置异常的问题
2.给setSilenceLoadMore方法添加boolean参数,可以启用和禁用静默加载模式
3.升级到3.6.6版本

2017-3-28:
1.不再强制Recyclerview使用BaseRecyclerAdapter,当不使用BaseRecyclerAdapter时,RecyclerView会被当成普通view
上拉加载等操作和普通view相同,空布局等功能的使用方式也和普通view相同
2.解决ListView的子项目不足一屏时,上拉时再下拉会出现布局突然缩回的问题
3.升级到3.6.5版本

2017-3-27:
1.解决事先setPullRefreshEnable(false),再setPullRefreshEnable(true)和startRefresh()时,headerview无法显示的问题
2.升级到3.6.3版本

2017-2-17:
1.添加下拉刷新时的回调onRefresh(boolean isPullDown),其中isPullDown用来判断此次下拉刷新是不是由下拉手势触发的,true则代表是,
反之则是自动刷新或者是调用XRefreshView#startRefresh()}触发的刷新
2.升级到3.6.2版本

2017-2-16:
1.解决issue[#58](https://github.com/huxq17/XRefreshView/issues/58)

2017-1-13:
1.解决Recyclerview使用StaggeredGridLayoutManager时,添加的headerview不能使用全部宽度的问题(headview layout won't use all span area)

2017-1-6:
1.解决issue[#49](https://github.com/huxq17/XRefreshView/issues/49)

2017-1-4:
1.解决AbsListview数据不满一屏的时候,会重复加载更多的问题

2016-12-15:
1.优化非RecyclerView上拉加载回弹的效果,同时支持AbsListView(ListView、GridView)加载更多数据完成之后露出新加载的数据

2016-9-28:
1.添加xscrollview的滑动监听

2016-9-6:
1.解决issue[#36](https://github.com/huxq17/XRefreshView/issues/36)

2016-8-19:
1.添加没有数据时显示空布局的支持
2.解决6.0以下的手机,在调用startRefresh()方法后,刷新时headerview有时会不显示的问题
3.其他一些优化

2016-8-8:
1.添加下拉刷新,数据接收失败的ui处理
2.解决下拉刷新,在刷新状态下把headerview完全隐藏掉,在刷新结束以后下拉和上拉都不可用的问题


### 关于我
QQ:1491359569 邮箱:huxq17@163.com
邮箱:huxq17@163.com fanyafeng@live.cn
   ps:有问题联系我的话请不要问我在不在,直接说问题,谢谢。

### License

Expand Down
27 changes: 16 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion 29
buildToolsVersion "29.0.3"

defaultConfig {
applicationId "com.andview.example"
minSdkVersion 11
targetSdkVersion 23
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
Expand All @@ -21,13 +22,17 @@ android {
abortOnError false
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':library')
// compile 'com.huxq17.xrefreshview:xrefreshview:3.2.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':library')
// compile 'com.huxq17.xrefreshview:xrefreshview:3.6.9'
//依赖下面的库
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:cardview-v7:23.1.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation "androidx.core:core-ktx:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()
}
33 changes: 26 additions & 7 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package="com.andview.example">

<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
Expand All @@ -21,17 +22,35 @@
<activity android:name=".activity.GridViewActivity" />
<activity android:name=".activity.ListViewActivity" />
<activity android:name=".activity.WebViewActivity" />
<activity android:name=".activity.LinearRecyclerViewActivity" />
<activity android:name=".activity.BannerRecyclerViewActivity" />
<activity android:name=".activity.recyclerview.LinearRecyclerViewActivity" />
<activity android:name=".activity.recyclerview.BannerRecyclerViewActivity" />
<activity android:name=".activity.ScrollViewActivity" />
<activity android:name=".activity.HeadAdActivity" />
<activity android:name=".activity.RainDropActivity" />
<activity android:name=".activity.RecyclerViewsActivity" />
<activity android:name=".activity.GridRecyclerViewActivity" />
<activity android:name=".activity.StaggeredRecyclerViewActivity" />
<activity android:name=".activity.SilenceRecyclerViewActivity" />
<activity android:name=".activity.recyclerview.GridRecyclerViewActivity" />
<activity android:name=".activity.recyclerview.StaggeredRecyclerViewActivity" />
<activity android:name=".activity.recyclerview.SilenceRecyclerViewActivity" />
<activity android:name=".activity.NotFullScreenActivity" />
<activity android:name=".activity.MultiItemRecyclerViewActivity" />
<activity android:name=".activity.EmptyViewActivity" />
<activity android:name=".activity.recyclerview.MultiItemRecyclerViewActivity" />
<activity android:name=".activity.recyclerview.ShowFooterWhenNoMoreDataRecyclerViewActivity" />
<activity android:name=".activity.NotFullScreenWithoutFooterActivity" />
<activity android:name=".activity.SmileViewActivity" />
<activity android:name=".activity.recyclerview.WithoutBaseAdapterRecyclerViewActivity" />
<activity
android:name=".activity.WineActivity"
android:label="@string/title_activity_wine" />
<activity
android:name=".activity.JDActivity"
android:label="@string/title_activity_jd" />
<activity
android:name=".activity.TaoBaoActivity"
android:label="@string/title_activity_tao_bao" />
<activity
android:name=".activity.PluseActivity"
android:label="@string/title_activity_pluse" />
<activity android:name=".activity.CarCrmActivity"></activity>
</application>

</manifest>
</manifest>
8 changes: 4 additions & 4 deletions app/src/main/java/com/andview/example/IndexPageAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import android.content.Context;
import android.os.Parcelable;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;

import androidx.viewpager.widget.PagerAdapter;

public class IndexPageAdapter extends PagerAdapter {

private int[] images;
Expand All @@ -24,7 +24,7 @@ public IndexPageAdapter(Context context, int[] images) {

@Override
public void destroyItem(ViewGroup container, int position, Object object) {
((ViewPager) container).removeView((View) object);
container.removeView((View) object);
}

@Override
Expand All @@ -45,7 +45,7 @@ public Object instantiateItem(ViewGroup view, int position) {
final int index = position % images.length;
imageView.setBackgroundResource(images[index]);

((ViewPager) view).addView(imageLayout, 0);
view.addView(imageLayout, 0);

return imageLayout;
}
Expand Down
114 changes: 114 additions & 0 deletions app/src/main/java/com/andview/example/ScrollAdapter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
package com.andview.example;

import android.content.Context;
import android.os.Parcelable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

import androidx.viewpager.widget.PagerAdapter;

import com.andview.example.ui.raindrop.CustomerFooter;
import com.andview.refreshview.XRefreshView;
import com.andview.refreshview.XScrollView;

public class ScrollAdapter extends PagerAdapter {

private int[] images;
private Context mContext;
private LayoutInflater mInflater;

public ScrollAdapter(Context context) {
this.mContext = context;
mInflater = LayoutInflater.from(mContext);
}

@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((View) object);
}

@Override
public void finishUpdate(View container) {
}

@Override
public int getCount() {
return Integer.MAX_VALUE;
}

@Override
public Object instantiateItem(ViewGroup view, int position) {
final View imageLayout = mInflater.inflate(R.layout.adapter_scrollview, view, false);
final XRefreshView outView = (XRefreshView) imageLayout.findViewById(R.id.custom_view);
final XScrollView scrollView = (XScrollView) imageLayout.findViewById(R.id.xscrollview);
scrollView.setOnScrollListener(new XScrollView.OnScrollListener() {
@Override
public void onScrollStateChanged(ScrollView view, int scrollState, boolean arriveBottom) {
}

@Override
public void onScroll(int l, int t, int oldl, int oldt) {
}
});
outView.setAutoRefresh(false);
outView.setPullLoadEnable(true);
outView.setPinnedTime(1000);
outView.setAutoLoadMore(false);
// outView.setSilenceLoadMore();
outView.setXRefreshViewListener(new XRefreshView.SimpleXRefreshListener() {
@Override
public void onLoadMore(boolean isSilence) {
imageLayout.postDelayed(new Runnable() {
@Override
public void run() {
outView.stopLoadMore();
}
}, 2000);
}

@Override
public void onRefresh(boolean isPullDown) {
imageLayout.postDelayed(new Runnable() {
@Override
public void run() {
outView.stopRefresh();
}
}, 2000);
}
});
outView.setCustomFooterView(new CustomerFooter(mContext));
LinearLayout ll = (LinearLayout) imageLayout.findViewById(R.id.ll);
for (int i = 0; i < 50; i++) {
TextView tv = new TextView(mContext);
tv.setTextIsSelectable(true);
tv.setText("数据" + i);
ll.addView(tv);
}
view.addView(imageLayout, 0);

return imageLayout;
}

@Override
public boolean isViewFromObject(View view, Object object) {
return view.equals(object);
}

@Override
public void restoreState(Parcelable state, ClassLoader loader) {
}

@Override
public Parcelable saveState() {
return null;
}

@Override
public void startUpdate(View container) {
}

}