mcxtzhang / suspensionindexbar Goto Github PK
View Code? Open in Web Editor NEW仿美团选择城市、微信通讯录、饿了么点餐列表的导航悬停分组索引列表。
Home Page: http://blog.csdn.net/zxt0601/article/details/52355199
仿美团选择城市、微信通讯录、饿了么点餐列表的导航悬停分组索引列表。
Home Page: http://blog.csdn.net/zxt0601/article/details/52355199
/**
* 绘制Title区域背景和文字的方法
*
* @param c
* @param left
* @param right
* @param child
* @param params
* @param position
/
private void drawTitleArea(Canvas c, int left, int right, View child, RecyclerView.LayoutParams params, int position) {//最先调用,绘制在最下层
mPaint.setColor(COLOR_TITLE_BG);
//这里是top的坐标是往上走的,因此这里是在child的top基础上减去mTitleHeight
c.drawRect(left, child.getTop() - params.topMargin - mTitleHeight, right, child.getTop() - params.topMargin, mPaint);
mPaint.setColor(COLOR_TITLE_FONT);
/
Paint.FontMetricsInt fontMetrics = mPaint.getFontMetricsInt();
int baseline = (getMeasuredHeight() - fontMetrics.bottom + fontMetrics.top) / 2 - fontMetrics.top;*/
mPaint.getTextBounds(mDatas.get(position).getSuspensionTag(), 0, mDatas.get(position).getSuspensionTag().length(), mBounds);
//算左下角的坐标?
c.drawText(mDatas.get(position).getSuspensionTag(), child.getPaddingLeft(), child.getTop() - params.topMargin - (mTitleHeight / 2 - mBounds.height() / 2), mPaint);
// c.drawText(mDatas.get(position).getSuspensionTag(), child.getPaddingLeft(), child.getTop() - params.topMargin - (mTitleHeight / 2 - mBounds.height() / 2), mPaint);
// c.drawText(mDatas.get(position).getSuspensionTag(), child.getPaddingLeft(), child.getTop() - params.topMargin, mPaint);
}
你这里算文字的坐标的时候,是左下角的?
设置IndexBar的高度为wrap_content的时候,就不显示了。
城市列表里的长春和重庆排序是Z!
indexbar的拼音能搞成居中么,在有限的几个拼音种类下,显得分隔太空,靠着居中显示怎么弄?
能识别常州市,不能识别长沙市,长春市,还有其他个别的也是这样!大神 ,应该怎么改呀,谢谢~
其实,不用区分屏幕的横竖,都能正确的绘制分割线,反而区分后横屏的时候绘制的是垂直于屏幕最长边的分割线;而且,方向不应该使用LinearLayoutManager.HORIZONTAL这种方式指定,应该根据系统屏幕方向设置,更灵活
IndexBarDataHelperImpl#getSortedIndexDatas
<item>wa</item>
<item>wa</item>
<item>wa</item>
MeituanSelectCityActivity的mHeaderAdapter
<@linearlayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="15dp">
<android.support.v7.widget.RecyclerView
android:id="@+id/rvCity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingRight="15dp"
android:paddingTop="5dp"/>
<@/LinearLayout>
现有的title的paddingLeft是在根布局LinearLayout里面设置的,
如上LinearLayout的paddingLeft会应用于title,也会影响RecyclerView item。请教如何分别设置?
这个类中 new 的匿名 CommonAdapter,更新数据,notify mHeaderAdapter不刷新是什么情况
目前字体颜色是纯黑的,可以增加一个设置字体颜色的方法吗?我就偷个懒,不把整个工程弄下来做依赖了~
怎么添加footer
貌似没考虑SuspensionDecoration的文字和左侧间隔啊,没有这个的设置方法
Error:(26, 13) Failed to resolve: com.github.mcxtzhang:SwipeDelMenuLayout:V1.2.2
Show in File
Show in Project Structure dialog
右边字母定位,无效,通常会由于什么原因照成
您好,,请问该项目怎么样混淆呀
求解决方案
下拉刷新事件冲突怎么解决
网络请求成功后,indexBar显示不出来,找不到是什么原因
还差一个搜索
为什么不留个邮箱什么的联系方式呢,键盘弹出会直接被挤压,有注意到吗?
compile 'com.github.mcxtzhang:SuspensionIndexBar:V1.0.0' 这个不能同步什么情况上传了吗
Process: tts.project.orange.meike, PID: 23132
java.lang.ArithmeticException: divide by zero
at tts.project.slidelib.IndexBar.widget.IndexBar.onSizeChanged(IndexBar.java:232)
求解
能否使索引下面的item项目grid排列而不是 线性垂直的
当还有数据很多的情况,用户来突然按返回结束这个页面会崩溃
怎么去掉悬停呀,把TitleItemDecoration的onDrawOver方法删掉以后,每次title滑动到顶部时,会变成白色,把头部标题遮盖掉?
如果通讯录有英文的大小写被区分感觉不太好
01-04 12:13:01.062 19960 19960 E CrashManager: force stop
01-04 12:13:01.063 19960 19960 E AndroidRuntime: FATAL EXCEPTION: main
01-04 12:13:01.063 19960 19960 E AndroidRuntime: Process: com.sina.weibolite, PID: 19960
01-04 12:13:01.063 19960 19960 E AndroidRuntime: java.lang.IllegalArgumentException: Comparison method violates its general contract!
01-04 12:13:01.063 19960 19960 E AndroidRuntime: at java.util.TimSort.mergeLo(TimSort.java:761)
01-04 12:13:01.063 19960 19960 E AndroidRuntime: at java.util.TimSort.mergeAt(TimSort.java:497)
01-04 12:13:01.063 19960 19960 E AndroidRuntime: at java.util.TimSort.mergeCollapse(TimSort.java:421)
01-04 12:13:01.063 19960 19960 E AndroidRuntime: at java.util.TimSort.sort(TimSort.java:210)
01-04 12:13:01.063 19960 19960 E AndroidRuntime: at java.util.Arrays.sort(Arrays.java:1998)
01-04 12:13:01.063 19960 19960 E AndroidRuntime: at java.util.Collections.sort(Collections.java:1900)
01-04 12:13:01.063 19960 19960 E AndroidRuntime: at com.mcxtzhang.indexlib.IndexBar.b.b.c(IndexBarDataHelperImpl.java:92)
01-04 12:13:01.063 19960 19960 E AndroidRuntime: at com.mcxtzhang.indexlib.IndexBar.widget.IndexBar.b(IndexBar.java:360)
01-04 12:13:01.063 19960 19960 E AndroidRuntime: at com.mcxtzhang.indexlib.IndexBar.widget.IndexBar.a(IndexBar.java:343)
我一直在用的库:https://github.com/truizlop/SectionedRecyclerView
因为也一直没用到悬停的功能和需求,但想想,今天看到这个库很是喜欢,但又不舍原来的库,如果能直接把头部定制,尾部定制,悬停,搜索及IndexBar全集成一个那不完美了,当然我也是一个喜欢在Git上找库不愿花时间去自己造轮子的人,发个美好愿景,最后再次感谢作者的奉献精神,你的滑动删除库太好用我无法用语言来诉说。
可以让Indexbar默认展示所有英文字母吗
什么时候可以支持自定义悬停title
每次点击更新数据源之后顶部那4个都会发生顺序的变化,没找到问题在哪
还有比如把A下面的数据全部删掉后右侧的索引没有删掉
这两个问题解决了,要是再加个侧滑出来删除按钮的话那就完美了
差个搜索
美团那个有个问题,如果热门城市很多的话,从热门这个item往下或者从下往上滑动到都会卡顿一下
发现一个bug,通讯录数据更新,布局会乱
城市列表点击更新数据源之后再往下拉,拉到D分类的某一个位置就不能再往下滑了,但是点击右边的分类索引之后就回复正常了
RT,我项目中要实现类似微信联系人那种有悬浮头列表的功能,但是悬浮头的标题内容不是单一的拼音字母,涉及到不同颜色的字体,还有一些动态的数据。再此请教博主,有什么好的实现方法么
错误信息:
java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeLo(TimSort.java:743)
at java.util.TimSort.mergeAt(TimSort.java:479)
at java.util.TimSort.mergeCollapse(TimSort.java:406)
at java.util.TimSort.sort(TimSort.java:210)
at java.util.TimSort.sort(TimSort.java:169)
at java.util.Arrays.sort(Arrays.java:2010)
at java.util.Collections.sort(Collections.java:1883)
报错位置:
IndexBarDataHelperImpl.java 93行
Collections.sort(datas, new Comparator() {
@OverRide
public int compare(BaseIndexPinyinBean lhs, BaseIndexPinyinBean rhs) {
if (!lhs.isNeedToPinyin()) {
return 0;
} else if (!rhs.isNeedToPinyin()) {
return 0;
} else if (lhs.getBaseIndexTag().equals("#")) {
return 1;
} else if (rhs.getBaseIndexTag().equals("#")) {
return -1;
} else {
return lhs.getBaseIndexPinyin().compareTo(rhs.getBaseIndexPinyin());
}
}
});
这是我获取手机通讯录,之后调用 mIndexBar.getDataHelper().sortSourceDatas(); 的时候报的错误
IndexBar 设置wrap_content时 bar的高度为0
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.