Skip to content

Commit c609b3f

Browse files
committed
update
1 parent 82db21d commit c609b3f

File tree

1 file changed

+4
-2
lines changed
  • adapterDSL/src/main/java/com/glimmer/dsl/adapter/ext

1 file changed

+4
-2
lines changed

adapterDSL/src/main/java/com/glimmer/dsl/adapter/ext/AdapterExt.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.glimmer.dsl.adapter.ext
22

33
import android.content.Context
4-
import androidx.recyclerview.widget.DiffUtil
54
import androidx.recyclerview.widget.GridLayoutManager
65
import androidx.recyclerview.widget.LinearLayoutManager
76
import androidx.recyclerview.widget.RecyclerView
@@ -50,7 +49,10 @@ class AdapterSetup internal constructor(private val recyclerView: RecyclerView)
5049

5150
fun RecyclerView.submitDataSource(items: List<Any>, append: Boolean = false) {
5251
val list: List<Any> = if (append) {
53-
val list: ArrayList<Any> = (adapter as? CommonListAdapterDsl)?.currentList as ArrayList<Any>
52+
val list: ArrayList<Any> = arrayListOf()
53+
(adapter as? CommonListAdapterDsl)?.currentList?.apply {
54+
list.addAll(this)
55+
}
5456
list.addAll(items)
5557
list
5658
} else {

0 commit comments

Comments
 (0)