limedroid / arecyclerview Goto Github PK
View Code? Open in Web Editor NEW一个库搞定recyclerview
License: MIT License
一个库搞定recyclerview
License: MIT License
XSTATECONTROLER 的 animationState
因为动画设置了时常0.3 秒,动画开始时 进入view 显示 结束时出view隐藏
当加载时间过快,animationState连续调用两次,,从content状态转移到loading(A状态),在从loading状态 转换为 content状态(B状态)
动画开始 两个view 同时显示 ,再隔0.3秒动画完毕 出view 同时隐藏
然而exitview A状态下是loadingview B状态下是swiprefreshview,结束动画时,同时隐藏后啥都没了,都不显示白屏了。。。
xRecyclerContentLayout.setVerticalScrollBarEnabled(false); 没有效果
通过网络库里取得的包,覆写 public void onBindViewHolder( final ViewHolder holder, final int position, List payloads) 方法,不能生效。但是你们提供的demo里的本地libary就没有问题。请查原因。
/**
* 删除元素
*
* @param position
*/
public void removeElement(int position) {
if (data != null && data.size() > position) {
data.remove(position);
notifyItemRemoved(position);
notifyItemChanged(position);
}
}
现在好像只有线性的
public XRecyclerView noDivider() {
setItemAnimator(new DefaultItemAnimator());
setHasFixedSize(true);
return this;
}
public XRecyclerView horizontalDivider(@ColorRes int colorRes, @DimenRes int dimenRes) {
setItemAnimator(new DefaultItemAnimator());
setHasFixedSize(true);
addItemDecoration(new HorizontalDividerItemDecoration.Builder(getContext())
.colorResId(colorRes)
.size(getContext().getResources().getDimensionPixelSize(dimenRes))
.build()
);
return this;
}
public XRecyclerView verticalDivider(@ColorRes int colorRes, @DimenRes int dimenRes) {
setItemAnimator(new DefaultItemAnimator());
setHasFixedSize(true);
addItemDecoration(new VerticalDividerItemDecoration.Builder(getContext())
.colorResId(colorRes)
.size(getContext().getResources().getDimensionPixelSize(dimenRes))
.build()
);
return this;
}
lib中的AndroidManifest.xml中有label=“appname”,在自定义打包配置的时候会有影响,建议去掉
还有你是用记事本编辑过吗?好多文件带了BOM格式,只能清除BOM再保存才能编译
GridLayoutManager manager = new GridLayoutManager(getContext(), 2);
manager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@OverRide
public int getSpanSize(int position) {
Log.d(TAG, "getSpanSize: " + position);
Object object = items.get(position);
return object instanceof LiveBean.DataBean.PartitionsBean.LivesBean ? 2 : 0;
}
});
设置无效,谢谢亲
hello,在使用的时候,发现当条目的数量没有充满屏幕时,使用下拉刷新的时候会调用起onLoadMore
方法。不知道怎么解决,希望能帮助我一下。
mentioned in the title;
View loadView = LayoutInflater.from(this).inflate(R.layout.view_load_more,xRecyclerView,false);
xRecyclerView.loadMoreFooterView(loadView);
item的布局样式是有多种的,怎么弄?
代码中有长按事件接口 但是没有实现
XrecyclerviewContentLayout 禁用刷新后,再度下拉,又会触发recyclerview的滚动监听,在最下面又将setEnabale设为true 刷新禁用又变成了启用。这个问题很大。。。
Arecyclerview中,加载的时候会默认展示一个viewholder的布局,原版的recyclerview不会默认展示啊,这问题是出在了哪?
您好,非常感谢作者的开源这个控件我个人觉得非常好用,但是今天使用的时候发现一个问题,特来请求修复。
在XRecyclerView的代码344行中。
public void setGridSpanLookUp(GridLayoutManager layoutManager, final GridLayoutManager.SpanSizeLookup lookup) {
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@OverRide
public int getSpanSize(int position) {
if (adapter != null) {
if (adapter.isHeaderOrFooter(position)) return 1; //注意这里
return lookup.getSpanSize(position);
}
return GridLayoutManager.DEFAULT_SPAN_COUNT;
}
});
}
//中的
if (adapter.isHeaderOrFooter(position)) return 1;//不应该返回1
而是返回layoutManager.getSpanCount() ,返回1 导致GridLayout布局下底部占用为1个item无法占满。
应该是作者大大粗心了,因为第321行中的方法就没有写错。
场景:在adapter有一个尾布局时,删除最后一个item出现cause:Called attach on a child which is not detached: ViewHolder{6f3df28 position=2 id=-1, oldPos=-1, pLpos:-1} cn.droidlover.xrecyclerview.XRecyclerView{4c46441 VFED..... ......ID 0,0-1020,1520 #7f0900a1 app:id/add_device_recyclerview}, adapter:cn.droidlover.xrecyclerview.XRecyclerAdapter@970ade6, layout:android.support.v7.widget.LinearLayoutManager@fda4f27
用不了你的库
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.