Skip to content

Commit 8e9f1c3

Browse files
committed
feat : 북마크 제거 및 뷰 깨짐 수정
1 parent e31965e commit 8e9f1c3

File tree

4 files changed

+47
-113
lines changed

4 files changed

+47
-113
lines changed

presentation/src/main/java/com/stop/ui/map/MapFragment.kt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class MapFragment : Fragment(), MapHandler {
5858
requestPermissionsLauncher.launch(PERMISSIONS)
5959

6060
tMap.initListener()
61-
addBookmarkMarker()
6261
observeClickPlace()
6362
observeClickCurrentLocation()
6463
}
@@ -108,12 +107,6 @@ class MapFragment : Fragment(), MapHandler {
108107
.navigate(R.id.action_mapFragment_to_placeSearchFragment)
109108
}
110109

111-
/*
112-
binding.layoutBookmark.setOnClickListener {
113-
binding.root.findNavController().navigate(R.id.action_mapFragment_to_bookMarkFragment)
114-
}
115-
*/
116-
117110
binding.layoutPanel.findViewById<View>(R.id.view_panel_start).setOnClickListener {
118111
val action = MapFragmentDirections.actionMapFragmentToRouteFragment().setStart(placeSearchViewModel.panelInfo)
119112
binding.root.findNavController().navigate(action)
@@ -159,16 +152,6 @@ class MapFragment : Fragment(), MapHandler {
159152
})
160153
}
161154

162-
private fun addBookmarkMarker() {
163-
placeSearchViewModel.bookmarks.forEachIndexed { index, location ->
164-
tMap.addMarker(
165-
index.toString(),
166-
Marker.BOOKMARK_MARKER_IMG,
167-
TMapPoint(location.latitude, location.longitude)
168-
)
169-
}
170-
}
171-
172155
private fun observeClickPlace() {
173156
placeSearchViewModel.clickPlaceUseCaseItem.observe(viewLifecycleOwner) { event ->
174157
event.getContentIfNotHandled()?.let { clickPlace ->
@@ -227,7 +210,6 @@ class MapFragment : Fragment(), MapHandler {
227210
layoutSearch.visibility = mapUIVisibility
228211
layoutCompass.visibility = mapUIVisibility
229212
layoutCurrent.visibility = mapUIVisibility
230-
layoutBookmark.visibility = mapUIVisibility
231213
}
232214
}
233215

presentation/src/main/java/com/stop/ui/placesearch/PlaceSearchViewModel.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ class PlaceSearchViewModel @Inject constructor(
4343
private val _isNearPlacesNotEmpty = MutableStateFlow(false)
4444
val isNearPlacesNotEmpty: StateFlow<Boolean> = _isNearPlacesNotEmpty
4545

46-
var bookmarks = mutableListOf(EXAMPLE_BOOKMARK_1, EXAMPLE_BOOKMARK_2, EXAMPLE_BOOKMARK_3)
47-
4846
private val errorMessageChannel = Channel<String>()
4947
val errorMessage = errorMessageChannel.receiveAsFlow()
5048

@@ -157,10 +155,4 @@ class PlaceSearchViewModel @Inject constructor(
157155
}
158156
}
159157

160-
companion object {
161-
private val EXAMPLE_BOOKMARK_1 = Location(37.3931010, 126.9781449)
162-
private val EXAMPLE_BOOKMARK_2 = Location(37.55063543842469, 127.07369927986392)
163-
private val EXAMPLE_BOOKMARK_3 = Location(37.48450549635376, 126.89324337770405)
164-
}
165-
166158
}

presentation/src/main/res/layout/fragment_map.xml

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
xmlns:bind="http://schemas.android.com/apk/res-auto">
55

66
<data>
7+
78
<variable
89
name="placeSearchViewModel"
910
type="com.stop.ui.placesearch.PlaceSearchViewModel" />
@@ -58,13 +59,13 @@
5859
android:id="@+id/layout_panel"
5960
android:layout_width="0dp"
6061
android:layout_height="170dp"
61-
android:layout_marginEnd="90dp"
6262
android:layout_marginTop="30dp"
63+
android:layout_marginEnd="90dp"
6364
android:elevation="15dp"
6465
android:visibility="@{placeSearchViewModel.panelVisibility}"
65-
app:layout_constraintStart_toStartOf="@id/guideline_start"
66+
app:layout_constraintBottom_toBottomOf="@id/guideline_bottom"
6667
app:layout_constraintEnd_toEndOf="parent"
67-
app:layout_constraintBottom_toBottomOf="@id/guideline_bottom">
68+
app:layout_constraintStart_toStartOf="@id/guideline_start">
6869

6970
<include
7071
android:id="@+id/home_panel"
@@ -77,10 +78,10 @@
7778
android:id="@+id/layout_search"
7879
android:layout_width="0dp"
7980
android:layout_height="52dp"
80-
android:elevation="15dp"
8181
android:background="@drawable/background_search"
82-
app:layout_constraintStart_toStartOf="@id/guideline_start"
82+
android:elevation="15dp"
8383
app:layout_constraintEnd_toStartOf="@id/guideline_end"
84+
app:layout_constraintStart_toStartOf="@id/guideline_start"
8485
app:layout_constraintTop_toTopOf="@id/guideline_top">
8586

8687
<TextView
@@ -91,17 +92,17 @@
9192
android:layout_marginBottom="1dp"
9293
android:gravity="center_vertical"
9394
android:text="@string/search_hint"
94-
android:textSize="17sp"
95-
android:textColor="#808590" />
95+
android:textColor="#808590"
96+
android:textSize="17sp" />
9697

9798
<ImageView
9899
android:id="@+id/image_view_search"
99100
android:layout_width="wrap_content"
100101
android:layout_height="wrap_content"
101102
android:layout_marginStart="15dp"
103+
app:layout_constraintBottom_toBottomOf="@id/layout_search"
102104
app:layout_constraintStart_toStartOf="@id/layout_search"
103105
app:layout_constraintTop_toTopOf="@id/layout_search"
104-
app:layout_constraintBottom_toBottomOf="@id/layout_search"
105106
app:srcCompat="@drawable/ic_search" />
106107

107108
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -111,20 +112,20 @@
111112
android:layout_width="60dp"
112113
android:layout_height="60dp"
113114
android:layout_marginBottom="10dp"
114-
android:elevation="15dp"
115115
android:background="@drawable/background_button"
116-
app:layout_constraintEnd_toEndOf="@id/guideline_end"
117-
app:layout_constraintBottom_toTopOf="@id/layout_current">
116+
android:elevation="15dp"
117+
app:layout_constraintBottom_toTopOf="@id/layout_current"
118+
app:layout_constraintEnd_toEndOf="@id/guideline_end">
118119

119120
<ImageView
120121
android:id="@+id/image_view_compass"
121122
android:layout_width="30dp"
122123
android:layout_height="30dp"
123124
android:elevation="15dp"
124-
app:layout_constraintStart_toStartOf="@id/layout_compass"
125+
app:layout_constraintBottom_toBottomOf="@id/layout_compass"
125126
app:layout_constraintEnd_toEndOf="@id/layout_compass"
127+
app:layout_constraintStart_toStartOf="@id/layout_compass"
126128
app:layout_constraintTop_toTopOf="@id/layout_compass"
127-
app:layout_constraintBottom_toBottomOf="@id/layout_compass"
128129
app:srcCompat="@drawable/ic_compass" />
129130

130131
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -134,46 +135,24 @@
134135
android:layout_width="60dp"
135136
android:layout_height="60dp"
136137
android:layout_marginBottom="10dp"
137-
android:elevation="15dp"
138138
android:background="@drawable/background_button"
139-
app:layout_constraintEnd_toEndOf="@id/guideline_end"
140-
app:layout_constraintBottom_toTopOf="@id/layout_bookmark">
139+
android:elevation="15dp"
140+
app:layout_constraintBottom_toBottomOf="@id/guideline_bottom"
141+
app:layout_constraintEnd_toEndOf="@id/guideline_end">
141142

142143
<ImageView
143144
android:id="@+id/image_view_current"
144145
android:layout_width="30dp"
145146
android:layout_height="30dp"
146147
android:elevation="15dp"
147-
app:layout_constraintStart_toStartOf="@id/layout_current"
148+
app:layout_constraintBottom_toBottomOf="@id/layout_current"
148149
app:layout_constraintEnd_toEndOf="@id/layout_current"
150+
app:layout_constraintStart_toStartOf="@id/layout_current"
149151
app:layout_constraintTop_toTopOf="@id/layout_current"
150-
app:layout_constraintBottom_toBottomOf="@id/layout_current"
151152
app:srcCompat="@drawable/ic_location" />
152153

153154
</androidx.constraintlayout.widget.ConstraintLayout>
154155

155-
<androidx.constraintlayout.widget.ConstraintLayout
156-
android:id="@+id/layout_bookmark"
157-
android:layout_width="60dp"
158-
android:layout_height="60dp"
159-
android:elevation="15dp"
160-
android:background="@drawable/background_button"
161-
app:layout_constraintEnd_toEndOf="@id/guideline_end"
162-
app:layout_constraintBottom_toBottomOf="@id/guideline_bottom">
163-
164-
<ImageView
165-
android:id="@+id/image_view_bookmark"
166-
android:layout_width="30dp"
167-
android:layout_height="30dp"
168-
android:elevation="15dp"
169-
app:layout_constraintStart_toStartOf="@id/layout_bookmark"
170-
app:layout_constraintEnd_toEndOf="@id/layout_bookmark"
171-
app:layout_constraintTop_toTopOf="@id/layout_bookmark"
172-
app:layout_constraintBottom_toBottomOf="@id/layout_bookmark"
173-
app:srcCompat="@drawable/ic_bookmark" />
174-
175-
</androidx.constraintlayout.widget.ConstraintLayout>
176-
177156
<androidx.coordinatorlayout.widget.CoordinatorLayout
178157
android:layout_width="match_parent"
179158
android:layout_height="match_parent"
@@ -183,9 +162,9 @@
183162
android:id="@+id/layout_home_bottom_sheet"
184163
android:layout_width="match_parent"
185164
android:layout_height="match_parent"
186-
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
165+
app:behavior_hideable="false"
187166
app:behavior_peekHeight="100dp"
188-
app:behavior_hideable="false">
167+
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
189168

190169
<include
191170
android:id="@+id/home_bottom_sheet"

presentation/src/main/res/layout/home_panel.xml

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
xmlns:tools="http://schemas.android.com/tools">
55

66
<data>
7+
78
<variable
89
name="placeSearchViewModel"
910
type="com.stop.ui.placesearch.PlaceSearchViewModel" />
@@ -28,55 +29,35 @@
2829
android:id="@+id/text_view_panel_title"
2930
android:layout_width="0dp"
3031
android:layout_height="30dp"
31-
android:layout_marginStart="10dp"
32-
android:layout_marginEnd="10dp"
32+
android:layout_marginStart="5dp"
3333
android:layout_marginTop="19dp"
34-
android:maxLines="1"
34+
android:layout_marginEnd="20dp"
3535
android:ellipsize="end"
36+
android:gravity="center_vertical"
37+
android:maxLines="1"
3638
android:text="@{placeSearchViewModel.geoLocation.title}"
37-
android:textSize="22sp"
3839
android:textColor="@color/white"
39-
android:gravity="center_vertical"
40+
android:textSize="22sp"
41+
app:layout_constraintEnd_toEndOf="parent"
4042
app:layout_constraintStart_toEndOf="@id/image_view_panel_place"
41-
app:layout_constraintEnd_toStartOf="@id/view_panel_bookmark"
4243
app:layout_constraintTop_toTopOf="parent"
4344
tools:text="성복역" />
4445

45-
<View
46-
android:id="@+id/view_panel_bookmark"
47-
android:layout_width="30dp"
48-
android:layout_height="30dp"
49-
android:layout_marginEnd="20dp"
50-
android:layout_marginTop="20dp"
51-
android:background="@drawable/background_button"
52-
app:layout_constraintEnd_toEndOf="parent"
53-
app:layout_constraintTop_toTopOf="parent" />
54-
55-
<ImageView
56-
android:id="@+id/image_view_panel_bookmark"
57-
android:layout_width="15dp"
58-
android:layout_height="15dp"
59-
app:layout_constraintStart_toStartOf="@id/view_panel_bookmark"
60-
app:layout_constraintEnd_toEndOf="@id/view_panel_bookmark"
61-
app:layout_constraintTop_toTopOf="@id/view_panel_bookmark"
62-
app:layout_constraintBottom_toBottomOf="@id/view_panel_bookmark"
63-
app:srcCompat="@drawable/ic_bookmark" />
64-
6546
<TextView
6647
android:id="@+id/text_view_panel_address"
6748
android:layout_width="0dp"
6849
android:layout_height="wrap_content"
6950
android:layout_marginStart="20dp"
7051
android:layout_marginEnd="20dp"
71-
android:maxLines="1"
7252
android:ellipsize="end"
53+
android:maxLines="1"
7354
android:text="@{placeSearchViewModel.geoLocation.roadAddress}"
74-
android:textSize="14sp"
7555
android:textColor="#808590"
56+
android:textSize="14sp"
57+
app:layout_constraintBottom_toTopOf="@id/view_panel_start"
7658
app:layout_constraintEnd_toEndOf="parent"
7759
app:layout_constraintStart_toStartOf="parent"
7860
app:layout_constraintTop_toBottomOf="@id/text_view_panel_title"
79-
app:layout_constraintBottom_toTopOf="@id/view_panel_start"
8061
tools:text="서울 구로구 디지털로31길 41" />
8162

8263
<TextView
@@ -86,11 +67,11 @@
8667
android:layout_marginStart="20dp"
8768
android:layout_marginBottom="16dp"
8869
android:text="@{placeSearchViewModel.distance.toString()}"
89-
android:textSize="40sp"
9070
android:textColor="@color/white"
71+
android:textSize="32sp"
9172
android:textStyle="bold"
92-
app:layout_constraintStart_toStartOf="parent"
9373
app:layout_constraintBottom_toBottomOf="parent"
74+
app:layout_constraintStart_toStartOf="parent"
9475
tools:text="1.6" />
9576

9677
<TextView
@@ -100,51 +81,51 @@
10081
android:layout_marginStart="10dp"
10182
android:layout_marginBottom="22dp"
10283
android:text="@string/km"
103-
android:textSize="20sp"
10484
android:textColor="@color/white"
85+
android:textSize="16sp"
10586
android:textStyle="bold"
106-
app:layout_constraintStart_toEndOf="@id/text_view_panel_distance"
10787
app:layout_constraintBottom_toBottomOf="parent"
88+
app:layout_constraintStart_toEndOf="@id/text_view_panel_distance"
10889
tools:text="km" />
10990

11091
<View
11192
android:id="@+id/view_panel_start"
112-
android:layout_width="50dp"
113-
android:layout_height="50dp"
93+
android:layout_width="40dp"
94+
android:layout_height="40dp"
11495
android:layout_marginEnd="10dp"
11596
android:layout_marginBottom="20dp"
11697
android:background="@drawable/background_button"
117-
app:layout_constraintEnd_toStartOf="@id/view_panel_end"
118-
app:layout_constraintBottom_toBottomOf="parent" />
98+
app:layout_constraintBottom_toBottomOf="parent"
99+
app:layout_constraintEnd_toStartOf="@id/view_panel_end" />
119100

120101
<ImageView
121102
android:id="@+id/image_view_panel_start"
122103
android:layout_width="25dp"
123104
android:layout_height="25dp"
124-
app:layout_constraintStart_toStartOf="@id/view_panel_start"
105+
app:layout_constraintBottom_toBottomOf="@id/view_panel_start"
125106
app:layout_constraintEnd_toEndOf="@id/view_panel_start"
107+
app:layout_constraintStart_toStartOf="@id/view_panel_start"
126108
app:layout_constraintTop_toTopOf="@id/view_panel_start"
127-
app:layout_constraintBottom_toBottomOf="@id/view_panel_start"
128109
app:srcCompat="@drawable/ic_start" />
129110

130111
<View
131112
android:id="@+id/view_panel_end"
132-
android:layout_width="50dp"
133-
android:layout_height="50dp"
113+
android:layout_width="40dp"
114+
android:layout_height="40dp"
134115
android:layout_marginEnd="20dp"
135116
android:layout_marginBottom="20dp"
136117
android:background="@drawable/background_button"
137-
app:layout_constraintEnd_toEndOf="parent"
138-
app:layout_constraintBottom_toBottomOf="parent" />
118+
app:layout_constraintBottom_toBottomOf="parent"
119+
app:layout_constraintEnd_toEndOf="parent" />
139120

140121
<ImageView
141122
android:id="@+id/image_view_panel_end"
142123
android:layout_width="25dp"
143124
android:layout_height="25dp"
144-
app:layout_constraintStart_toStartOf="@id/view_panel_end"
125+
app:layout_constraintBottom_toBottomOf="@id/view_panel_end"
145126
app:layout_constraintEnd_toEndOf="@id/view_panel_end"
127+
app:layout_constraintStart_toStartOf="@id/view_panel_end"
146128
app:layout_constraintTop_toTopOf="@id/view_panel_end"
147-
app:layout_constraintBottom_toBottomOf="@id/view_panel_end"
148129
app:srcCompat="@drawable/ic_end" />
149130
</androidx.constraintlayout.widget.ConstraintLayout>
150131
</layout>

0 commit comments

Comments
 (0)