do not make FilterThumbnailsManager static

This commit is contained in:
tibbi 2018-07-20 11:47:41 +02:00
parent efa93ef1a3
commit 0e7eac1650
2 changed files with 5 additions and 4 deletions

View file

@ -254,14 +254,15 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
val size = resources.getDimension(R.dimen.bottom_filters_thumbnail_height).toInt() val size = resources.getDimension(R.dimen.bottom_filters_thumbnail_height).toInt()
val bitmap = Glide.with(this).asBitmap().load(uri).submit(size, size).get() val bitmap = Glide.with(this).asBitmap().load(uri).submit(size, size).get()
runOnUiThread { runOnUiThread {
FilterThumbnailsManager.clearThumbs() val filterThumbnailsManager = FilterThumbnailsManager()
filterThumbnailsManager.clearThumbs()
FilterPack.getFilterPack(this).forEach { FilterPack.getFilterPack(this).forEach {
val filterItem = FilterItem(bitmap, it) val filterItem = FilterItem(bitmap, it)
FilterThumbnailsManager.addThumb(filterItem) filterThumbnailsManager.addThumb(filterItem)
} }
val filterItems = FilterThumbnailsManager.processThumbs() val filterItems = filterThumbnailsManager.processThumbs()
val adapter = FiltersAdapter(filterItems) { val adapter = FiltersAdapter(filterItems) {
} }

View file

@ -4,7 +4,7 @@ import android.graphics.Bitmap
import com.simplemobiletools.gallery.models.FilterItem import com.simplemobiletools.gallery.models.FilterItem
import java.util.* import java.util.*
object FilterThumbnailsManager { class FilterThumbnailsManager {
private var filterThumbnails = ArrayList<FilterItem>(10) private var filterThumbnails = ArrayList<FilterItem>(10)
private var processedThumbnails = ArrayList<FilterItem>(10) private var processedThumbnails = ArrayList<FilterItem>(10)