Since we did many image operations in UI thread, for example creating the drawable reference from file or URL and resizing the image after it's loaded, the Table View with remote images was very slow (
TIMOB-11282). To fix that, we moved some of those operations to non-UI threads and tried to run them in parallel using multiple threads. But this fix introduces several other issues: (see the comments in TIMOB-11282 for more info)
1. The RejectedExecutionException can happen when workqueue in the ThreadPoolExecutor is full and the Executor cannot accept more tasks.
2. Even when the image is in the cache, it is not fetched/used correctly.
3. Since rows with the same className are reused, when the table is scrolled, rows will first render the old images, then update with the correct content.
Need to clean up the code in the image view and fix the above issues.