fun create(thisSize: String): ImageReuseInfo? { val list = ArrayList<String>() var canBeReused = false for (i in 0 until mSizeList.length) { val size: String = mSizeList.get(i) if (!canBeReused && thisSize == size) { canBeReused = true continue } if (canBeReused && thisSize != size) { list.add(size) } } return if (list.size() === 0) { ImageReuseInfo(thisSize, null) } else { val sizeList = arrayOfNulls<String>(list.size()) list.toArray(sizeList) ImageReuseInfo(thisSize, sizeList) } }
Find out the size list can be re-sued .