|
|
@ -8,7 +8,6 @@ import android.view.View.VISIBLE |
|
|
|
import androidx.appcompat.widget.SearchView |
|
|
|
import androidx.appcompat.widget.SearchView |
|
|
|
import androidx.lifecycle.LiveData |
|
|
|
import androidx.lifecycle.LiveData |
|
|
|
import androidx.lifecycle.Observer |
|
|
|
import androidx.lifecycle.Observer |
|
|
|
import androidx.recyclerview.widget.DiffUtil |
|
|
|
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
import androidx.recyclerview.widget.RecyclerView |
|
|
|
import androidx.recyclerview.widget.RecyclerView |
|
|
|
import com.google.android.flexbox.FlexboxLayoutManager |
|
|
|
import com.google.android.flexbox.FlexboxLayoutManager |
|
|
@ -283,10 +282,7 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_book_se |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Synchronized |
|
|
|
@Synchronized |
|
|
|
private fun upSearchItems(items: List<SearchBook>) { |
|
|
|
private fun upSearchItems(items: List<SearchBook>) { |
|
|
|
val searchItems = ArrayList(items) |
|
|
|
adapter.setItems(items) |
|
|
|
val diffResult = |
|
|
|
|
|
|
|
DiffUtil.calculateDiff(DiffCallBack(adapter.getItems(), searchItems)) |
|
|
|
|
|
|
|
adapter.setItems(searchItems, diffResult) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|