-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
현위치에서 키워드로 재검색, 검색 시 필터 초기화 #89
Merged
jeeminimini
merged 10 commits into
develop
from
feature/re-search-by-keyword-button(#82)
Feb 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4baa0b3
layout : 현재 키워드로 재검색 버튼 layout 구현
s6m1n abd5858
chore : searchText 위치 MainScreen으로 변경
s6m1n 60c8d53
feat : 검색 스크린, 맵 스크린 간 이동 시 Filter 초기화 구현
s6m1n 56a6ffe
refactor : filter 관련 변수 및 메소드를 FilterViewModel로 분리
s6m1n 0cccf07
fix : SearchScreen 뒤로가기 에러 수정
jeeminimini 3e8258c
fix : SearchScreen 뒤로가기 사용시 Main 화면 SearchComponent 초기화 안되는 문제 해결
jeeminimini ceec413
refactor : 코드 리뷰 반영
s6m1n 7bec4d6
layout : ReSearchButton 로딩시 애니메이션 구현
s6m1n f3c83d4
fix : SearchComponent 클릭 시 키워드 업데이트 안 되는 버그 수정
s6m1n a3bb0db
feat : SearchScreen의 최근 검색어 클릭 시 해당 검색어로 Api 통신 구현
s6m1n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
presentation/src/main/java/com/example/presentation/ui/map/filter/FilterViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.example.presentation.ui.map.filter | ||
|
||
import android.util.Log | ||
import androidx.lifecycle.ViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import kotlinx.coroutines.flow.MutableStateFlow | ||
import kotlinx.coroutines.flow.StateFlow | ||
import javax.inject.Inject | ||
|
||
|
||
@HiltViewModel | ||
class FilterViewModel @Inject constructor() : ViewModel() { | ||
|
||
private val _isKindFilterClicked = MutableStateFlow(false) | ||
val isKindFilterClicked: StateFlow<Boolean> get() = _isKindFilterClicked | ||
|
||
private val _isGreatFilterClicked = MutableStateFlow(false) | ||
val isGreatFilterClicked: StateFlow<Boolean> get() = _isGreatFilterClicked | ||
|
||
private val _isSafeFilterClicked = MutableStateFlow(false) | ||
val isSafeFilterClicked: StateFlow<Boolean> get() = _isSafeFilterClicked | ||
|
||
fun updateKindFilterClicked() { | ||
_isKindFilterClicked.value = _isKindFilterClicked.value.not() | ||
} | ||
|
||
fun updateGreatFilterClicked() { | ||
_isGreatFilterClicked.value = _isGreatFilterClicked.value.not() | ||
} | ||
|
||
fun updateSafeFilterClicked() { | ||
_isSafeFilterClicked.value = _isSafeFilterClicked.value.not() | ||
} | ||
|
||
fun updateAllFilterUnClicked() { | ||
_isKindFilterClicked.value = false | ||
_isGreatFilterClicked.value = false | ||
_isSafeFilterClicked.value = false | ||
Log.d("테스트","${_isKindFilterClicked.value}") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이걸 여기에도 추가한 이유가 있나요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MapScreenType.SEARCH에서 BackHandler를 통해 SearchScreen으로 갔다가 다른 키워드를 검색해 MapScreenType.SEARCH으로 넘어가는 경우, 필터 초기화를 해주기 위함입니다! 만약 이 때 필터 초기화가 안 된다면 새로운 키워드에 대한 결과 마커가 필터로 모두 가려졌을 때 사용자에게 혼란을 줄 수 있다고 생각했습니다.