hhroc / yellr-android

YellR Android App
GNU General Public License v2.0
2 stars 5 forks source link

Images redraw every time in post feed #162

Closed thequbit closed 9 years ago

thequbit commented 9 years ago

https://github.com/thequbit/yellr-android/blob/dev/app/src/main/java/yellr/net/yellr_android/fragments/LocalPostsFragment.java#L229

Every time you scroll, the images re-draw themselves. I believe this can be fixed quickly, however i can not figure out why.

We have a ArrayAdapter just like in the assignments feed, however here the items being displayed is bigger.. The ImageView is here:

https://github.com/thequbit/yellr-android/blob/dev/app/src/main/res/layout/fragment_local_post_row.xml#L116

@reustonium if you have any insight that would be awesome.

thequbit commented 9 years ago

So one possible solution here is to make a background service that downloads all of the images and makes them available to the fragment. This would result in the images being re-drawn, however hey would not be re-download.

If @reustonium can figure out a solution, I suspect his is the solution that I'll implement for v0.1.2.

The twitter app has, obviously, solved this solution... So it definitely is doable.

Additionally, I think I'll need to create yet another image size on the server for the preview image. The p.jpg preview file looks to still be a bit too big. I'll fiddle with compression ratios as well on the server to see what I can do.

thequbit commented 9 years ago

Good news: I got it working.

Bad news: i hate Android now, ha.

the whole convertView reuse thing really threw me for a loop. Got it working though, and added a hashmap so images aren't downloaded more than once.

Closing.