miomin / shswiperefreshlayout Goto Github PK
View Code? Open in Web Editor NEWAndroid 升级版 SwipeRefreshLayout,支持RecyclerView、ScrollView等大部分组件,下拉刷新(Refresh)和上拉加载(Loadmore),支持自定义HeaderView和FooterView
License: MIT License
Android 升级版 SwipeRefreshLayout,支持RecyclerView、ScrollView等大部分组件,下拉刷新(Refresh)和上拉加载(Loadmore),支持自定义HeaderView和FooterView
License: MIT License
点击按钮或第一次进入界面调用onRefresh 没有下拉刷新的动作。请问如何调用。谢谢。
下拉刷新的时候会触发点击效果,然后进行跳转,如何在下拉的时候屏蔽点击效果?
咱们的这个是可以的。
大神,能不能放个依赖啊啊啊
如果刷新时间比较久,而又不能滑动屏幕,很影响使用。
希望能改进下
这个SHSwipeRefreshLayout很简洁,赞
用的是ShareScrollView,子view有点击事件,没有办法下拉刷新,不是全部手机,部分手机不能下拉
支持自动加载更多吗
RecyclerView 换成 list ,上拉 下拉 无反应
下拉后马上往上滑,加载动画没有随列表上升而消失,一直在转,除非再次下拉
比如可以设置禁用下拉功能,不要有任何显示效果,只留上拉功能吗
ExpandableListView 貌似不起作用,上拉刷新和下拉加载都没有效果
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:4471)
at android.view.ViewGroup.addView(ViewGroup.java:4312)
at android.view.ViewGroup.addView(ViewGroup.java:4284)
at com.scu.miomin.shswiperefresh.core.SHSwipeRefreshLayout.setGuidanceView(SHSwipeRefreshLayout.java:217)
at com.scu.miomin.shswiperefresh.core.SHSwipeRefreshLayout.onAttachedToWindow(SHSwipeRefreshLayout.java:202)
@OverRide
public void onRefreshPulStateChange(float percent, int state) {
switch (state) {
case SHSwipeRefreshLayout.NOT_OVER_TRIGGER_POINT:
swipeRefreshLayout.setLoaderViewText("下拉刷新");
break;
case SHSwipeRefreshLayout.OVER_TRIGGER_POINT:
swipeRefreshLayout.setLoaderViewText("松开刷新");
break;
case SHSwipeRefreshLayout.START:
swipeRefreshLayout.setLoaderViewText("正在刷新");
break;
}
}
其中setLoaderViewText应该改成setRefreshViewText
The specified child already has a parent. You must call removeView() on the child's parent first.
at com.scu.miomin.shswiperefresh.core.SHSwipeRefreshLayout.setGuidanceView(SHSwipeRefreshLayout.java:217)
at com.scu.miomin.shswiperefresh.core.SHSwipeRefreshLayout.onAttachedToWindow(SHSwipeRefreshLayout.java:202)
我用途是一个tablayout+viewpager+recyclerview 做的联动下拉刷新,在viewpager二次滑动时(既首次滑动某到某viewpager是没问题,例如从pager1滑动到pager2,pager2滑动到pager1),会出现这个问题。
因为首次滑动正常排除了我布局的问题,感觉是不是说在销毁的时候,没有移除父view;;
private void setGuidanceView() {
// SetUp HeaderView
LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, 0);
if (headerView.getParent()==null)
{
headerView.setStartEndTrim(0, 0.75f);
headerView.setText(mRefreshDefaulText);
headerView.setTextColor(mGuidanceViewTextColor);
headerView.setBackgroundColor(mGuidanceViewBgColor);
headerView.setProgressBgColor(mProgressBgColor);
headerView.setProgressColor(mProgressColor);
addView(headerView, lp);
}
// SetUp FooterView
if (footerView.getParent()==null)
{
lp = new LayoutParams(LayoutParams.MATCH_PARENT, 0);
lp.gravity = Gravity.BOTTOM;
footerView.setStartEndTrim(0.5f, 1.25f);
footerView.setText(mLoadDefaulText);
footerView.setTextColor(mGuidanceViewTextColor);
footerView.setBackgroundColor(mGuidanceViewBgColor);
footerView.setProgressBgColor(mProgressBgColor);
footerView.setProgressColor(mProgressColor);
addView(footerView, lp);
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.