1 需求
我们需要实现携带时间头的一系列照片如下显示,现在我们拿到了图片集合,肯定需要对图片根据实现进行分组显示
date
picture picture picture
picture picture picture
picture picture picturedate
picture picture picture
picture picture
2 代码实现
fun getImageTitleList(list : List<TrashImageBean>) : ArrayList<LocalTrashHasTitleModel> {var resultList = arrayListOf<LocalTrashHasTitleModel>()if (list.isNotEmpty()) {list.forEach {image ->var modifyTime = image.modifyTimeif (image.modifyTime != 0L) {var dayTime = CleanTimeUtil.getTodayTime(modifyTime)Log.i(TAG, "dayTime is:" + dayTime)resultList.find { titleModel->dayTime =