File tree Expand file tree Collapse file tree 4 files changed +5
-2
lines changed
data/src/main/java/com/stop/data/local/model
java/com/stop/ui/placesearch Expand file tree Collapse file tree 4 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import com.stop.data.model.nearplace.PlaceRepositoryItem
7
7
@Entity
8
8
data class RecentPlaceSearchEntity (
9
9
@PrimaryKey(autoGenerate = true )
10
- val id : Long = - 1 ,
10
+ val id : Long = 0 ,
11
11
val name : String ,
12
12
val radius : String ,
13
13
val fullAddressRoad : String ,
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ class PlaceSearchFragment : Fragment() {
61
61
nearPlaceAdapter.onItemClick = {
62
62
placeSearchViewModel.setClickPlace(it)
63
63
placeSearchViewModel.setNearPlacesEmpty()
64
-
64
+ placeSearchViewModel.insertRecentSearchPlace(it)
65
65
66
66
binding.root.findNavController().navigate(R .id.action_placeSearchFragment_to_mapFragment)
67
67
}
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ class PlaceSearchViewModel @Inject constructor(
101
101
102
102
fun setNearPlacesEmpty () {
103
103
_nearPlaces .value = emptyList()
104
+ _searchKeyword .value = " "
104
105
_isNearPlacesNotEmpty .value = false
105
106
}
106
107
Original file line number Diff line number Diff line change 29
29
30
30
<androidx .recyclerview.widget.RecyclerView
31
31
android : id =" @+id/recycler_view_recent_search"
32
+ items =" @{viewModel.recentPlaceSearch}"
32
33
android : layout_width =" 0dp"
33
34
android : layout_height =" 0dp"
34
35
android : layout_marginVertical =" 12dp"
43
44
android : layout_width =" 0dp"
44
45
android : layout_height =" wrap_content"
45
46
android : layout_marginBottom =" 12dp"
47
+ android : onClick =" @{() -> viewModel.deleteRecentSearchPlace()}"
46
48
android : text =" @string/delete_recent_search_text"
47
49
android : textColor =" @color/black"
48
50
android : textSize =" 24sp"
You can’t perform that action at this time.
0 commit comments