Skip to content

Commit

Permalink
[MOD] #258 함수 매개변수 기본값 지정
Browse files Browse the repository at this point in the history
  • Loading branch information
unam98 committed Nov 16, 2023
1 parent ebe7eb6 commit 363283f
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,28 +178,26 @@ class SearchActivity :
}
}

private fun setDeparture(mode: String, item: SearchResultEntity) {
private fun navigateToCourseDrawScreen(mode: String, searchResult: SearchResultEntity? = null) {
startActivity(
Intent(this, DrawActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)
putExtra(EXTRA_SEARCH_RESULT, item)
putExtra(EXTRA_SEARCH_RESULT, searchResult)
putExtra(EXTRA_DEPARTURE_SET_MODE, mode)
}
)
}

override fun startSearchLocation(item: SearchResultEntity) {
setDeparture("searchLocation", item)
override fun startSearchLocation(data: SearchResultEntity) {
navigateToCourseDrawScreen(mode = "searchLocation", searchResult = data)
}

private fun startCurrentLocation() {
val emptyItem = SearchResultEntity(fullAddress = "", name = "", locationLatLng = null)
setDeparture("currentLocation", emptyItem)
navigateToCourseDrawScreen(mode = "currentLocation")
}

private fun startCustomLocation() {
val emptyItem = SearchResultEntity(fullAddress = "", name = "", locationLatLng = null)
setDeparture("customLocation", emptyItem)
navigateToCourseDrawScreen(mode = "customLocation")
}

//키보드 밖 터치 시, 키보드 내림
Expand Down

0 comments on commit 363283f

Please sign in to comment.