File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
java/com/stop/bindingadapter Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 1
1
package com.stop.bindingadapter
2
2
3
3
import androidx.databinding.BindingAdapter
4
+ import androidx.recyclerview.widget.ListAdapter
4
5
import androidx.recyclerview.widget.RecyclerView
5
- import com.stop.domain.model.nearplace.Place
6
- import com.stop.ui.placesearch.NearPlaceAdapter
7
6
8
- @BindingAdapter(" places" )
9
- fun RecyclerView.setPlaces (places : List <Place >? ) {
10
- this .adapter?.run {
11
- if (this is NearPlaceAdapter ){
12
- this .submitList(places)
13
- }
7
+ @BindingAdapter(" items" )
8
+ fun <T > RecyclerView.submitItems (items : List <T >? ) {
9
+ if (this .adapter is ListAdapter <* , * >) {
10
+ (this .adapter as ListAdapter <T , * >).submitList(items)
14
11
}
15
12
}
Original file line number Diff line number Diff line change 102
102
app : layout_constraintEnd_toEndOf =" @id/guide_line_end"
103
103
app : layout_constraintStart_toStartOf =" @id/guide_line_start"
104
104
app : layout_constraintTop_toBottomOf =" @id/text_view_current_location"
105
- app : places =" @{viewModel.nearPlaceList}" />
105
+ app : items =" @{viewModel.nearPlaceList}" />
106
106
107
107
108
108
</androidx .constraintlayout.widget.ConstraintLayout>
You can’t perform that action at this time.
0 commit comments