New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-11282] Android TableView with remote images is very slow #3395
Conversation
I think there is something wrong. The images only start appearing if I scroll down and back up again. For example: run the code on an Android 2.2 emulator with this branch. When the application loads in the emulator, don't do anything -- just stare at the first section. If I do that, images never come in. Later, if I then scroll down a whole screen and then back up again, the images start coming in. |
OK the changes are ready for review. |
I just left more fixes to block "old" images on a fast |
} | ||
} | ||
|
||
final class BackgroundImageTask extends AsyncTask<ImageArgs, Void, Bitmap> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this class has a lot of whitespace formatting problems. Please convert the spaces to tabs.
I agree that
In that sequence,
I think there are definitely some opportunities for getting those calls down. Also, I'm worried that maybe the code is a little complicated. Wouldn't it have been enough to kinda just keep everything the way it was except adding the async task to gather up the bitmap after |
OK I submitted changes to address the formatting issues mentioned above, There is a lot more room for performance improvements here, including the The following could be of benefit in the future: I agree that the code is complicated. Just resizing an image after download from the internet |
Those are some good points (specifically about the raw bytes in the cache already but needing to be scaled.) I have a better understanding of why it's somewhat complicated. So I'm doing what might well be the final review. More later. |
I was just about to say unit test and KS testing succeeded... but one (and only one) of the KS Image View tests fails, the one called "Image File". So in KitchenSink it's at Base UI -> Views -> Image Views -> Image File. Please have a look at that. All UI-related Anvil tests passed. |
BTW, I confirmed that the failure mentioned above does not happen on the master branch. It's an NPE in BackgroundImageTask.postExecute. |
OK, I fixed the bug that was introduced for images from files. |
CR/FR accepted. KS image view tests fine. UI-related Anvil tests fine. |
[TIMOB-11282] Android TableView with remote images is very slow
I just downloaded the latest 3.0.2 release from http://builds.appcelerator.com.s3.amazonaws.com/index.html that I assume includes these fixes. Scrolling speed is a lot better but when I reach towards the bottom of my 25 row tableview it's not refreshing the images correctly. I am getting images from previous rows. |
Move image handling into an AsyncTask so it doesn't tie up the UI thread.