Skip to content

Conversation

@AudasViator
Copy link

@AudasViator AudasViator commented Jul 31, 2016

Готово
Коллаж делается каждые 1, 4, 9, 16... картинок
Так сложнее и интереснее
Для уменьшения мерцания стоит .filter() на 1 секунду

В CriticalSectionsHandlerImpl после каждого таска проверяется, запущена ли критическая секция

public void stopSection(int id) {
mSectionArray.delete(id);
if (mSectionArray.size() == 0) {
while (!mTaskQueue.isEmpty()) {
Copy link
Collaborator

@kotiknorm kotiknorm Aug 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У меня скопилось 10 тасков
Критическая секция прошла, ты все закидываешь в хендлер и до исполнения всех 10 тасков опять начинается критическая секция, они помешают.

@kotiknorm
Copy link
Collaborator

Не знаю от чего, но при начале скролла какое-то затормаживание все-таки есть


@Override
public void stopSections() {
mSectionArray.clear();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А запустить таски из очереди?

@kotiknorm
Copy link
Collaborator

Это фича, что картинки по мере загрузки сетятся во вью?) выглядит как ненкжное мелькание


@Override
public void loadCollage(List<String> urls, ImageView imageView, CollageStrategy collageStrategy) {
int imageViewId = imageView.hashCode();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Следующий метод до боли похож на этот.
95 процентов кода по моему
Можно из ImageView создавать реализацию ImageTarget

WeakReference<ImageTarget> imageTargetRef = new WeakReference<>(imageTarget);
int imageTargetId = imageTarget.hashCode();
int imageTargetId;
if (imageTarget instanceof ImageTargetWithId) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему нельзя в обоих случаях hashCode брать?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пока писал объяснение, всё понял...
Сейчас поправлю, так оставлять это нельзя

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants