-
Notifications
You must be signed in to change notification settings - Fork 20
Valentin Postnov (@valpostnov), hw #7
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
base: master
Are you sure you want to change the base?
Conversation
…был хотя бы один null
|
Быстрый скролл в середину, затем остановить и медленно в течении пары секунд медленно двигать в рамках экрана, остановить - элементы не подгружаются |
| int threadsCount = urls.size() < DEF_THREAD_COUNT ? 1 : DEF_THREAD_COUNT; | ||
| CountDownLatch cdl = new CountDownLatch(threadsCount); | ||
| List<Bitmap> bitmaps = Collections.synchronizedList(new ArrayList<>()); | ||
| ExecutorService downloadExecutor = Executors.newFixedThreadPool(threadsCount); |
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.
На каждый onBindViewHolder ты создаешь экзекьютор и кидаешь в него задачи, которые полюбому выполнятся, даже если идет быстрый скролл и элемент уже ушел с экрана? что будет с CollageConsumer если задачу отменили?
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.
CollageConsumer теперь добавляется в executor с загрузчиками и в случае когда элемент ушел с экрана будет вызываться shutdownNow для старых executor ' ов
Первое задание
Клик
Второе задание
Убрал велик с группировкой тасок по критическим секциям.
Клак