Giter Site home page Giter Site logo

Comments (17)

Studentessa avatar Studentessa commented on June 28, 2024 13

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!

from expandabletextview.

deeps2 avatar deeps2 commented on June 28, 2024 4

@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
  
    ...
}

from expandabletextview.

monikagupta94 avatar monikagupta94 commented on June 28, 2024 4

@Studentessa Thank you. It worked but also need to change animation 0 if content is enough long.

from expandabletextview.

469277027 avatar 469277027 commented on June 28, 2024 1

@Studentessa Thanks,it works very good

from expandabletextview.

nangsan avatar nangsan commented on June 28, 2024 1

@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.

from expandabletextview.

jymycc avatar jymycc commented on June 28, 2024

have you fixed that ? i got the same problem: (

from expandabletextview.

kukreja-vikramaditya avatar kukreja-vikramaditya commented on June 28, 2024

Yes same here. Can you create a expand() and collapse() method?

from expandabletextview.

billionbucks avatar billionbucks commented on June 28, 2024

@kukreja-vikramaditya @jymycc @haonan1 seems like setting the visibility gone and then Visible at OnBindViewHolder will fix it , (working for me)

from expandabletextview.

HolenZhou avatar HolenZhou commented on June 28, 2024

same here. How to solve it?

from expandabletextview.

Manabu-GT avatar Manabu-GT commented on June 28, 2024

If anyone can share sample code which reproduces what you are experiencing, I can take a look this weekend.

Thank you.

from expandabletextview.

kukreja-vikramaditya avatar kukreja-vikramaditya commented on June 28, 2024

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

from expandabletextview.

BzCoder avatar BzCoder commented on June 28, 2024

@Studentessa thanks a lot,you solve my problem!

from expandabletextview.

aiynmm avatar aiynmm commented on June 28, 2024

@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!

from expandabletextview.

Studentessa avatar Studentessa commented on June 28, 2024

@aiynmm what your'asking was refered by @monikagupta94 , maybe he can answer you. =D

from expandabletextview.

aiynmm avatar aiynmm commented on June 28, 2024

@aiynmm what your'asking was refered by @monikagupta94 , maybe he can answer you. =D

I'm sorry, I misread it! @Studentessa

from expandabletextview.

aiynmm avatar aiynmm commented on June 28, 2024

@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!

from expandabletextview.

dongxingrong avatar dongxingrong commented on June 28, 2024

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.

from expandabletextview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.