Skip to content

Commit

Permalink
feat(CompetitionFragment): RecyclerViewPreloader 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
ki960213 committed Feb 7, 2024
1 parent 5935669 commit 92e2432
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import com.emmsale.presentation.common.extension.getSerializableExtraCompat
import com.emmsale.presentation.common.views.FilterTag
import com.emmsale.presentation.common.views.filterChipOf
import com.emmsale.presentation.ui.competitionFilter.CompetitionFilterActivity
import com.emmsale.presentation.ui.competitionList.recyclerView.CompetitionRecyclerViewAdapter
import com.emmsale.presentation.ui.competitionList.uiState.CompetitionSelectedFilteringDateOptionUiState
import com.emmsale.presentation.ui.competitionList.uiState.CompetitionSelectedFilteringOptionUiState
import com.emmsale.presentation.ui.conferenceList.recyclerView.EventRecyclerViewAdapter
import com.emmsale.presentation.ui.eventDetail.EventDetailActivity
import dagger.hilt.android.AndroidEntryPoint
import java.time.LocalDate
Expand All @@ -26,8 +26,12 @@ class CompetitionFragment :
BaseFragment<FragmentCompetitionBinding>(R.layout.fragment_competition) {

private val viewModel: CompetitionViewModel by viewModels()
private val eventAdapter: CompetitionRecyclerViewAdapter by lazy {
CompetitionRecyclerViewAdapter(::navigateToEventDetail)
private val eventAdapter: EventRecyclerViewAdapter by lazy {
EventRecyclerViewAdapter(
fragment = this,
onClickConference = ::navigateToEventDetail,
onPreloaderReady = { binding.rvEvents.addOnScrollListener(it) },
)
}
private val filterActivityLauncher =
registerForActivityResult(StartActivityForResult()) { result ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import java.time.LocalDate
class ConferenceFragment : BaseFragment<FragmentConferenceBinding>(R.layout.fragment_conference) {

private val viewModel: ConferenceViewModel by viewModels()
private val eventAdapter by lazy {
private val eventAdapter: EventRecyclerViewAdapter by lazy {
EventRecyclerViewAdapter(
fragment = this,
onClickConference = ::navigateToEventDetail,
Expand Down

0 comments on commit 92e2432

Please sign in to comment.