griddivideritemdecoration's People
Forkers
golicen hsf25737 horiozny hezihaog lxtao369 perseusyang zhixingren qizfeng sxf-ignite guangzai2015 anaelwu ysj40540 blackflagbin congwiny komoriwu yijianhong michael007js ymqq xiaohan445336816 lyongfly a434413631 mdxz xiaokang1991 wangchang163 lpzahd harryjoker zhaoyan93 woshiouxi subuhui anyzhouhui hanshaokai wgl656544 wangjing-hw cccfly-bake dc7878 heart2009 aminoc tantaiqiguan seven123456 hengqiaqia syg5201314 donalddu wanliang527 o0teamo0o liulei9385 daifalin fengjinneng aaronsu tianminggh lkkkkk x930073498 githulining dochuangys zhukaifeng gebi355 chenjinna hacjy wiser-wong krislyy dong1024 gangoogle songwenbiao it212 naiheanaihe lisz1991 15817209487 robert-law-gz chensuyu fojin2016 hc617 lsy1992 bestming8 chaozhung zivxia guodonghuang jingmeng liqikun1989 tracyly huihui4045 lfclfc xumingrong zzy1147 andrewlwd xiangyao0906 somnuswu alaricnorris tyf1946griddivideritemdecoration's Issues
建议不以屏幕宽为基准来测量
private int getMaxDividerWidth(View view, RecyclerView parent) {
int itemWidth = view.getLayoutParams().width;
int itemHeight = view.getLayoutParams().height;
// int screenWidth = mContext.getResources().getDisplayMetrics().widthPixels > mContext.getResources().getDisplayMetrics().heightPixels
// ? mContext.getResources().getDisplayMetrics().heightPixels : mContext.getResources().getDisplayMetrics().widthPixels;
int screenWidth = parent.getWidth();
int maxDividerWidth = screenWidth - itemWidth * spanCount;
if (itemHeight < 0 || itemWidth < 0 || (isNeedSpace && maxDividerWidth <= (spanCount - 1) * mDividerWidth)) {
view.getLayoutParams().width = getAttachCloumnWidth(parent);
view.getLayoutParams().height = getAttachCloumnWidth(parent);
maxDividerWidth = screenWidth - view.getLayoutParams().width * spanCount;
}
return maxDividerWidth;
}
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.