diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index a438dd1a7..86a6c3fdc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -254,14 +254,15 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener val size = resources.getDimension(R.dimen.bottom_filters_thumbnail_height).toInt() val bitmap = Glide.with(this).asBitmap().load(uri).submit(size, size).get() runOnUiThread { - FilterThumbnailsManager.clearThumbs() + val filterThumbnailsManager = FilterThumbnailsManager() + filterThumbnailsManager.clearThumbs() FilterPack.getFilterPack(this).forEach { val filterItem = FilterItem(bitmap, it) - FilterThumbnailsManager.addThumb(filterItem) + filterThumbnailsManager.addThumb(filterItem) } - val filterItems = FilterThumbnailsManager.processThumbs() + val filterItems = filterThumbnailsManager.processThumbs() val adapter = FiltersAdapter(filterItems) { } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/FilterThumbnailsManager.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/FilterThumbnailsManager.kt index 6ee92ae44..204f54f3b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/FilterThumbnailsManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/FilterThumbnailsManager.kt @@ -4,7 +4,7 @@ import android.graphics.Bitmap import com.simplemobiletools.gallery.models.FilterItem import java.util.* -object FilterThumbnailsManager { +class FilterThumbnailsManager { private var filterThumbnails = ArrayList(10) private var processedThumbnails = ArrayList(10)