twitter-archive / twitter-kit-android

Twitter Kit for Android
https://dev.twitter.com/twitterkit/android/overview
Apache License 2.0
831 stars 341 forks source link

OutOfMemoryErrors triggered by animated transition on ToggleImageButton "Like" button #48

Open mstevens83 opened 8 years ago

mstevens83 commented 8 years ago

I work on an app in which we use TweetViews in a RecyclerView. We have repeatedly observed the following crash: http://crashes.to/s/abe498ca58c

The crash is caused by an OutOfMemoryError which seems to occur when the 60 drawables for the animated transition on the "Like" button are loaded as part of the layout inflation of the ToggleImageButton. This probably only happens when memory pressure is already quite high, but weirdly we haven't seen other OutOfMemoryError crashes in this app.

Ironically (and frustratingly) our app does not even enable the tweet actions (i.e. tweetActionsEnabled in BaseTweetView always remains false), so this "Like" button with its fancy 60fps (total overkill if you ask me) animation is never even shown!

I think there must be way to achieve a similar animated transition using less memory-hungry means (animated vector drawables perhaps?). Also, would it be possible to offer a more lightweight (as in, non-animated, no hidden action bar views, etc.)?

Some more info:

Thanks in advance.

YudizRutvik commented 7 years ago

Facing same problem OutOfMemoryErrors while using TweetView in RecyclerView. Please provide any solution @efrohnhoefer