-
Notifications
You must be signed in to change notification settings - Fork 3
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
[AN] 비회원 관리 #595
[AN] 비회원 관리 #595
Changes from all commits
31c7262
5be4d77
6ac28dc
585a18b
a9ca2ab
351c169
c93028c
7e93f14
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ import com.created.team201.presentation.main.MainViewModel | |
import com.created.team201.presentation.studyDetail.StudyDetailActivity | ||
import com.created.team201.presentation.studyList.adapter.StudyListAdapter | ||
import com.created.team201.presentation.studyList.model.StudyListFilter | ||
import com.created.team201.presentation.studyList.model.StudyListFilter.Companion.isGuestOnly | ||
import com.created.team201.util.FirebaseLogUtil | ||
import com.created.team201.util.FirebaseLogUtil.SCREEN_STUDY_LIST | ||
import com.google.android.material.chip.ChipGroup | ||
|
@@ -39,6 +40,7 @@ class StudyListFragment : | |
private val studyListAdapter: StudyListAdapter by lazy { | ||
StudyListAdapter(studyListClickListener()) | ||
} | ||
private val loginBottomSheetFragment: LoginBottomSheetFragment = LoginBottomSheetFragment() | ||
|
||
override fun onResume() { | ||
super.onResume() | ||
|
@@ -179,7 +181,7 @@ class StudyListFragment : | |
|
||
private fun showLoginBottomSheetDialog() { | ||
removeAllFragment() | ||
LoginBottomSheetFragment().show( | ||
loginBottomSheetFragment.show( | ||
childFragmentManager, | ||
LoginBottomSheetFragment.TAG_LOGIN_BOTTOM_SHEET, | ||
) | ||
|
@@ -235,9 +237,6 @@ class StudyListFragment : | |
|
||
private fun setupStudyList() { | ||
studyListViewModel.initPage() | ||
binding.tvGuestInformation.setOnClickListener { | ||
showLoginBottomSheetDialog() | ||
} | ||
} | ||
|
||
private fun studyListClickListener() = object : StudyListClickListener { | ||
|
@@ -256,6 +255,9 @@ class StudyListFragment : | |
studyListViewModel.updateIsGuest(mainViewModel.isGuest) | ||
val filter = getStudyListFilter(group) | ||
studyListViewModel.loadFilteredPage(filter) | ||
if (mainViewModel.isGuest and filter.isGuestOnly()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오 ㅋ and 연산자쓰는사람 처음봄 mz하네요 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. 요즘 python 많이 썻더니.. |
||
showLoginBottomSheetDialog() | ||
} | ||
} | ||
|
||
private fun getStudyListFilter(group: ChipGroup): StudyListFilter { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
package com.created.team201.presentation.studyList.model | ||
|
||
enum class StudyListFilter { | ||
ALL, RECRUITING, PROCESSING, WAITING_APPLICANT, WAITING_MEMBER | ||
ALL, RECRUITING, PROCESSING, WAITING_APPLICANT, WAITING_MEMBER; | ||
|
||
companion object { | ||
fun StudyListFilter.isGuestOnly(): Boolean { | ||
return this == WAITING_MEMBER || this == WAITING_APPLICANT | ||
} | ||
} | ||
} |
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.
엇 그렇네요.
굳이 안해줘도 되네요.
인스턴스 한번만 생성하게 바꿨습니다 ~