-
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
[BUG] #117 : 탐색 화면의 검색 조건이 초기화되는 이슈 수정 #118
base: dev
Are you sure you want to change the base?
The head ref may contain hidden characters: "fix/#117-\uAC80\uC0C9\uC870\uAC74-\uCD08\uAE30\uD654"
Conversation
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.
고생 많으셨습니다~~!:sunglasses::sunglasses: 이제 편의점에서 수월하게 사용 가능하겠군요!
궁금한 부분 코멘트 남겼습니당 혹시 주석 처리하신 부분은 사용 안 되는 부분이 맞을까요~?
override fun bindingFactory(): ActivityExploreActivityBinding = ActivityExploreActivityBinding.inflate(layoutInflater) | ||
|
||
override fun initViews() { | ||
println(exploreViewModel) | ||
productViewModel |
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.
이렇게 ViewModel 하나만 있어도 괜찮나요~?.?
private val productViewModel: ProductViewModel by viewModels { ProductViewModel.ProductViewModelFactory(productRepository) } | ||
private val mainViewModel: MainViewModel by viewModels { MainViewModel.MainViewModelFactory() } |
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.
궁금한게 있읍니다 ㅎㅎ by viewModels()
로 하면 해당부분 ViewModelFactory
필요한 부분 일까요?.?
interface PageActivity { | ||
fun moveToEvaluatePage() | ||
} |
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.
요거 navigator 이용하면 되지 않나욤?
// private fun observeKeyword() { | ||
// viewLifecycleOwner.lifecycleScope.launch { | ||
// viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { | ||
// exploreViewModel.productSearchCondition.collect { | ||
// productViewModel.setProductSearchCondition(it) | ||
// } | ||
// } | ||
// } | ||
// } |
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.
주석은 지워도 될 듯!
moveToConditionExplore = productSearchableViewModel::changeSortType, | ||
moveToStoreExplore = productSearchableViewModel::changeStoreType | ||
moveToConditionExplore = { | ||
(requireActivity() as? PageActivity)?.moveToEvaluatePage() |
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.
as?
로 체크할거면 activity
쓰는게 안전할 것 같아요~
@@ -38,6 +44,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() { | |||
|
|||
override fun initViews() { | |||
binding.rvHome.adapter = homeAdapter | |||
// productSearchableViewModel |
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.
요기도 주석 지워주세요~
|
||
override fun initViews() { | ||
productViewModel |
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.
요거는 어떤 코드일까요?
📌 내용
🛠 해결 방법
[기존]
[수정]
MainActivity, ExploreActivity
)에서 주입받고 ProductFragment에서는 이러한 ViewModel을 가져다 사용하도록 수정