Open haonan1 opened 8 years ago
have you fixed that ? i got the same problem: (
Yes same here. Can you create a expand() and collapse() method?
@kukreja-vikramaditya @jymycc @haonan1 seems like setting the visibility gone and then Visible at OnBindViewHolder
will fix it , (working for me)
same here. How to solve it?
If anyone can share sample code which reproduces what you are experiencing, I can take a look this weekend.
Thank you.
I don't think it is a problem with library, could you guys check if your 'position' or 'holder' has the keyword 'final' before it? @billionbucks @HolenZhou @Manabu-GT @jymycc @haonan1
hello every body! I'm getting the same problem, I have tried using @billionbucks trick but it doesn't work. I'm not using final variables @kukreja-vikramaditya ! thanks in advance!
EDIT
I was using the wrong method! setText(@Nullable CharSequence text)
Using this one: setText(@Nullable CharSequence text, @NonNull SparseBooleanArray collapsedStatus, int position)
works good!
please modify the wiky!
@Studentessa Thanks,it works very good
@Studentessa thanks, it works :-)
onBindViewHolder(ViewHolder holder, final int pos) {
....
SparseBooleanArray mTogglePositions = new SparseBooleanArray();
// setText(@Nullable CharSequence text, @NonNull SparseBooleanArray collapsedStatus, int pos)
holder.newsDescription.setText(listOfArticles.get(position).getDescription(), mTogglePositions , pos);
//where newsDescription is my TextView
...
}
@deeps2 your solution was right, but it has some flaw initialize the SparseBooleanArray while creating RecyclerView adapter and pass it to the setText method. That should do it.
@Studentessa Thank you. It worked but also need to change animation 0 if content is enough long.
@Studentessa thanks a lot,you solve my problem!
@Studentessa What's your mean about what you said that need to change animation 0 if content is enough long? I have a problem when collaping the text if content is enough long!
@aiynmm what your'asking was refered by @monikagupta94 , maybe he can answer you. =D
@aiynmm what your'asking was refered by @monikagupta94 , maybe he can answer you. =D
I'm sorry, I misread it! @Studentessa
@Studentessa Thank you. It worked but also need to change animation 0 if content is enough long.
@monikagupta94 Could you tell me what should I do to solve this problem!
Solution: while using in recyclerview, use SpareIntArray to record mMarginBetweenTxtAndBottom and mCollapsedHeight, and reuse them when ExpandableTextView's init value is 0. Reuse items in reycleview cause this problem.
In a RecyclerView i have other view, if the TextView is expanded and you scroll,the other view in some item has gone please give me some suggestion