Skip to content

Commit

Permalink
[Teacher][MBL-15115] Edit syllabus pull-to-refresh screen problem
Browse files Browse the repository at this point in the history
refs: MBL-15115
affects: Teacher
release note: -
  • Loading branch information
tamaskozmer authored Jan 14, 2021
1 parent 2957c20 commit 97a56d8
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ class SyllabusView(val canvasContext: CanvasContext, inflater: LayoutInflater, p
private fun renderLoadedState(state: SyllabusViewState.Loaded) {
swipeRefreshLayout.isRefreshing = false

if (syllabusPager.currentItem == SYLLABUS_TAB_POSITION) {
swipeRefreshLayout.setSwipeableChildren(R.id.syllabusWebView)
} else {
swipeRefreshLayout.setSwipeableChildren(R.id.syllabusEventsRecyclerView, R.id.syllabusEmptyView)
}

setEditVisibility(state.canEdit)
// We need to do this again after changing the edit button to visible to make it the correct color.
ViewStyler.themeToolbar(context as Activity, toolbar, canvasContext)
Expand All @@ -136,12 +142,6 @@ class SyllabusView(val canvasContext: CanvasContext, inflater: LayoutInflater, p
syllabusEventsRecyclerView?.setVisible(visibility.list)
}

if (syllabusPager.currentItem == SYLLABUS_TAB_POSITION) {
swipeRefreshLayout.setSwipeableChildren(R.id.syllabusWebView)
} else {
swipeRefreshLayout.setSwipeableChildren(R.id.syllabusEventsRecyclerView, R.id.syllabusEmptyView)
}

when (eventsState) {
EventsViewState.Error -> setupErrorView()
EventsViewState.Empty -> setupEmptyView()
Expand Down

0 comments on commit 97a56d8

Please sign in to comment.