2024年2月8日发(作者:)
} //展开按钮 ImageView imageView = (ImageView) (this).inflate(_search_history_img, mZFlowLayout, false); geResource(_close); lickListener(v -> {
initIvOpen(twoLineViewCount, expandLineViewCount); }); (imageView); ldren(mViewList); wTreeObserver().addOnGlobalLayoutListener(new alLayoutListener() {
@Override public void onGlobalLayout() {
wTreeObserver().removeOnGlobalLayoutListener(this); int lineCount = eCount(); int twoLineViewCount = LineViewCount(); if (lineCount > 2) {
initIvClose(twoLineViewCount - 1, andLineViewCount()); } } }); } private void initIvOpen(int twoLineViewCount, int expandLineViewCount) {
(); /*for (int i = 0; i < (); i++) { TextView textView = (TextView) (this).inflate(_search_history, mZFlowLayout, false); t((i)); (textView); }*/ for (int i = 0; i < expandLineViewCount; i++) {
TextView textView = (TextView) (this).inflate(_search_history, mZFlowLayout, false); t((i)); (textView); } //收起按钮 ImageView imageView = (ImageView) (this).inflate(_search_history_img, mZFlowLayout, false); geResource(_open); lickListener(v -> initIvClose(twoLineViewCount, expandLineViewCount)); (imageView); //不需要的话可以不添加 ldren(mViewList); } private void loadData() {
mDatas = new ArrayList<>(); for (int i = 0; i < 30; i++) {
if (i % 2 == 0) {
("数据" + i); } else {
("数据数据数据" + i); }
本文发布于:2024-02-08 19:19:57,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170739119768315.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |