ExpandableTextView icon indicating copy to clipboard operation
ExpandableTextView copied to clipboard

In the recyclerview, the expansion does not display the entire content correctly.

Open qinxianyuzou opened this issue 6 years ago • 4 comments

According to debug, I think that the number of rows that get the textview is incorrect. The number of rows obtained before the super.onMeasure() method is correct (may be 0), but the number of rows obtained after this is less. Up ------------------------------Above from Google Translate, the following is the original---------------------- 根据debug,我认为是获取textview的行数不正确导致的,在super.onMeasure()方法之前获取到的行数是正确的(也可能是0),但是在这之后获取到的行数变少了

qinxianyuzou avatar Dec 26 '18 11:12 qinxianyuzou

I see a problem, because mRelayout this switch affect the execution of onMeasure, this switch will only limit the re-measurement at the time the text changes, and in recyclerView in, setText time may not accurately measure the width and height, needs The measurement is accurate after the complete itemView is drawn, so just let the onMeasure perform the measurement smoothly after the view is drawn to solve the problem. My current solution is to remove the mRelayout condition. I don't know what it will do now,maybe it affects performance? ------------------------------Above from Google Translate, the following is the original---------------------- 我发现了问题所在,是因为mRelayout这个开关影响了onMeasure的执行,这个开关限制了只有在文本变化的时候才会重新测量,而在recyclerView中,setText的时候可能并不能测量准确的宽高,需要在完整的itemView绘制之后测量才准确,因此只要让onMeasure在view绘制之后也能顺利往下执行测量就能解决问题。我目前的解决办法是把mRelayout这个条件去掉,目前不知道这样会有什么影响,也许是影响性能?

qinxianyuzou avatar Dec 26 '18 13:12 qinxianyuzou

Yes, you are right. I have same problem. I see just half of my text when I do expand. Any solution out there for this? Thank you.

eniz1806 avatar May 09 '19 14:05 eniz1806

Yes, you are right. I have same problem. I see just half of my text when I do expand. Any solution out there for this? Thank you.

Please see my reply above. if (!mRelayout || getVisibility() == View.GONE) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); return; } to if (getVisibility() == View.GONE) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); return; }

qinxianyuzou avatar May 10 '19 01:05 qinxianyuzou

Yes, you are right. I have same problem. I see just half of my text when I do expand. Any solution out there for this? Thank you.

Please see my reply above. if (!mRelayout || getVisibility() == View.GONE) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); return; } to if (getVisibility() == View.GONE) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); return; }

In my case, remove mRelayout may cause shrink when click the textview first, so I also change the Animation reference #55

taichushouwang avatar Aug 04 '21 07:08 taichushouwang