@@ -26,7 +26,7 @@ class MapFragment : Fragment(), MapHandler {
26
26
private val placeSearchViewModel: PlaceSearchViewModel by activityViewModels()
27
27
28
28
private lateinit var tMap: MapTMap
29
- private var mapUIVisibility = false
29
+ private var mapUIVisibility = View . GONE // false
30
30
31
31
override fun onCreateView (
32
32
inflater : LayoutInflater ,
@@ -104,20 +104,12 @@ class MapFragment : Fragment(), MapHandler {
104
104
}
105
105
}
106
106
107
- private fun setMapUIVisibility () {
108
- if (mapUIVisibility) {
109
- setViewVisibility(View .VISIBLE )
110
- } else {
111
- setViewVisibility(View .GONE )
112
- }
113
- }
114
-
115
- private fun setViewVisibility (visibility : Int ) {
107
+ private fun setViewVisibility () {
116
108
with (binding) {
117
- textViewSearch.visibility = visibility
118
- imageViewCompassMode.visibility = visibility
119
- imageViewCurrentLocation.visibility = visibility
120
- imageViewBookmark.visibility = visibility
109
+ textViewSearch.visibility = mapUIVisibility
110
+ imageViewCompassMode.visibility = mapUIVisibility
111
+ imageViewCurrentLocation.visibility = mapUIVisibility
112
+ imageViewBookmark.visibility = mapUIVisibility
121
113
}
122
114
}
123
115
@@ -206,8 +198,8 @@ class MapFragment : Fragment(), MapHandler {
206
198
binding.layoutPanel.visibility = View .GONE
207
199
tMap.tMapView.removeTMapMarkerItem(MARKER )
208
200
} else {
209
- setMapUIVisibility ()
210
- mapUIVisibility = mapUIVisibility.not ( )
201
+ setViewVisibility ()
202
+ mapUIVisibility = mapUIVisibility.xor( View . GONE )
211
203
}
212
204
}
213
205
0 commit comments