From cd2775417bd5cc128049795b5c181374cde98005 Mon Sep 17 00:00:00 2001 From: Omer Habib <30689349+omerhabib26@users.noreply.github.com> Date: Tue, 12 Dec 2023 16:59:07 +0500 Subject: [PATCH] fix: Update resume course navigation (#151) * fix: Update resume course navigation - Update navigation for resume component - Code improvement & optimisation fix: LEARNER-9703 * fix: handle video block for resume navigation * fix: Address PR comment and code improvements * fix: Address PR comments-2 --- .../main/java/org/openedx/app/AppRouter.kt | 35 +++++++++++---- .../core/domain/model/CourseStructure.kt | 11 +---- .../org/openedx/core/extension/ListExt.kt | 11 +++++ .../course/presentation/CourseRouter.kt | 13 +++--- .../presentation/dates/CourseDatesFragment.kt | 8 ++-- .../dates/CourseDatesViewModel.kt | 7 ++- .../outline/CourseOutlineFragment.kt | 32 +++++++------ .../outline/CourseOutlineUIState.kt | 2 +- .../outline/CourseOutlineViewModel.kt | 18 ++++---- .../section/CourseSectionFragment.kt | 34 +++++++------- .../container/CourseUnitContainerFragment.kt | 45 +++++++++++++------ .../container/CourseUnitContainerViewModel.kt | 17 ++++--- .../videos/CourseVideosFragment.kt | 4 +- 13 files changed, 147 insertions(+), 90 deletions(-) diff --git a/app/src/main/java/org/openedx/app/AppRouter.kt b/app/src/main/java/org/openedx/app/AppRouter.kt index 90e2610f1..27f43e28f 100644 --- a/app/src/main/java/org/openedx/app/AppRouter.kt +++ b/app/src/main/java/org/openedx/app/AppRouter.kt @@ -127,37 +127,56 @@ class AppRouter : AuthRouter, DiscoveryRouter, DashboardRouter, CourseRouter, Di override fun navigateToCourseSubsections( fm: FragmentManager, courseId: String, - blockId: String, - mode: CourseViewMode, - descendantId: String? + subSectionId: String, + unitId: String, + componentId: String, + mode: CourseViewMode ) { replaceFragmentWithBackStack( fm, - CourseSectionFragment.newInstance(courseId, blockId, mode, descendantId) + CourseSectionFragment.newInstance( + courseId = courseId, + subSectionId = subSectionId, + unitId = unitId, + componentId = componentId, + mode = mode + ) ) } override fun navigateToCourseContainer( fm: FragmentManager, - blockId: String, courseId: String, + unitId: String, + componentId: String, mode: CourseViewMode ) { replaceFragmentWithBackStack( fm, - CourseUnitContainerFragment.newInstance(blockId, courseId, mode) + CourseUnitContainerFragment.newInstance( + courseId = courseId, + unitId = unitId, + componentId = componentId, + mode = mode + ) ) } override fun replaceCourseContainer( fm: FragmentManager, - blockId: String, courseId: String, + unitId: String, + componentId: String, mode: CourseViewMode ) { replaceFragment( fm, - CourseUnitContainerFragment.newInstance(blockId, courseId, mode), + CourseUnitContainerFragment.newInstance( + courseId = courseId, + unitId = unitId, + componentId = componentId, + mode = mode + ), FragmentTransaction.TRANSIT_FRAGMENT_FADE ) } diff --git a/core/src/main/java/org/openedx/core/domain/model/CourseStructure.kt b/core/src/main/java/org/openedx/core/domain/model/CourseStructure.kt index cad96b780..b3c1004fc 100644 --- a/core/src/main/java/org/openedx/core/domain/model/CourseStructure.kt +++ b/core/src/main/java/org/openedx/core/domain/model/CourseStructure.kt @@ -1,6 +1,5 @@ package org.openedx.core.domain.model -import org.openedx.core.BlockType import java.util.Date data class CourseStructure( @@ -18,12 +17,4 @@ data class CourseStructure( val media: Media?, val certificate: Certificate?, val isSelfPaced: Boolean -) { - fun getVerticalBlocks(): List { - return blockData.filter { it.type == BlockType.VERTICAL } - } - - fun getSequentialBlocks(): List { - return blockData.filter { it.type == BlockType.SEQUENTIAL } - } -} +) diff --git a/core/src/main/java/org/openedx/core/extension/ListExt.kt b/core/src/main/java/org/openedx/core/extension/ListExt.kt index 2831f917a..6f20fc271 100644 --- a/core/src/main/java/org/openedx/core/extension/ListExt.kt +++ b/core/src/main/java/org/openedx/core/extension/ListExt.kt @@ -1,5 +1,8 @@ package org.openedx.core.extension +import org.openedx.core.BlockType +import org.openedx.core.domain.model.Block + inline fun List.indexOfFirstFromIndex(startIndex: Int, predicate: (T) -> Boolean): Int { var index = 0 for ((i, item) in this.withIndex()) { @@ -23,3 +26,11 @@ fun MutableList.clearAndAddAll(collection: Collection): MutableList this.addAll(collection) return this } + +fun List.getVerticalBlocks(): List { + return this.filter { it.type == BlockType.VERTICAL } +} + +fun List.getSequentialBlocks(): List { + return this.filter { it.type == BlockType.SEQUENTIAL } +} diff --git a/course/src/main/java/org/openedx/course/presentation/CourseRouter.kt b/course/src/main/java/org/openedx/course/presentation/CourseRouter.kt index 4d9ed6775..40312a634 100644 --- a/course/src/main/java/org/openedx/course/presentation/CourseRouter.kt +++ b/course/src/main/java/org/openedx/course/presentation/CourseRouter.kt @@ -24,22 +24,25 @@ interface CourseRouter { fun navigateToCourseSubsections( fm: FragmentManager, courseId: String, - blockId: String, - mode: CourseViewMode, - descendantId: String? = "" + subSectionId: String, + unitId: String = "", + componentId: String = "", + mode: CourseViewMode ) fun navigateToCourseContainer( fm: FragmentManager, - blockId: String, courseId: String, + unitId: String, + componentId: String = "", mode: CourseViewMode ) fun replaceCourseContainer( fm: FragmentManager, - blockId: String, courseId: String, + unitId: String, + componentId: String = "", mode: CourseViewMode ) diff --git a/course/src/main/java/org/openedx/course/presentation/dates/CourseDatesFragment.kt b/course/src/main/java/org/openedx/course/presentation/dates/CourseDatesFragment.kt index 1f23b5d1b..1f90b4da6 100644 --- a/course/src/main/java/org/openedx/course/presentation/dates/CourseDatesFragment.kt +++ b/course/src/main/java/org/openedx/course/presentation/dates/CourseDatesFragment.kt @@ -148,11 +148,11 @@ class CourseDatesFragment : Fragment() { viewModel.getSequentialBlock(verticalBlock.id) ?.let { sequentialBlock -> router.navigateToCourseSubsections( - requireActivity().supportFragmentManager, - blockId = sequentialBlock.id, + fm = requireActivity().supportFragmentManager, + subSectionId = sequentialBlock.id, courseId = viewModel.courseId, - mode = CourseViewMode.FULL, - descendantId = verticalBlock.id + unitId = verticalBlock.id, + mode = CourseViewMode.FULL ) } } diff --git a/course/src/main/java/org/openedx/course/presentation/dates/CourseDatesViewModel.kt b/course/src/main/java/org/openedx/course/presentation/dates/CourseDatesViewModel.kt index 414cf9d3e..4e6d2b6c4 100644 --- a/course/src/main/java/org/openedx/course/presentation/dates/CourseDatesViewModel.kt +++ b/course/src/main/java/org/openedx/course/presentation/dates/CourseDatesViewModel.kt @@ -9,6 +9,8 @@ import org.openedx.core.R import org.openedx.core.SingleEventLiveData import org.openedx.core.UIMessage import org.openedx.core.domain.model.Block +import org.openedx.core.extension.getSequentialBlocks +import org.openedx.core.extension.getVerticalBlocks import org.openedx.core.extension.isInternetError import org.openedx.core.system.ResourceManager import org.openedx.core.system.connection.NetworkConnection @@ -73,7 +75,7 @@ class CourseDatesViewModel( fun getVerticalBlock(blockId: String): Block? { return try { val courseStructure = interactor.getCourseStructureFromCache() - courseStructure.getVerticalBlocks().find { it.descendants.contains(blockId) } + courseStructure.blockData.getVerticalBlocks().find { it.descendants.contains(blockId) } } catch (e: Exception) { null } @@ -82,7 +84,8 @@ class CourseDatesViewModel( fun getSequentialBlock(blockId: String): Block? { return try { val courseStructure = interactor.getCourseStructureFromCache() - courseStructure.getSequentialBlocks().find { it.descendants.contains(blockId) } + courseStructure.blockData.getSequentialBlocks() + .find { it.descendants.contains(blockId) } } catch (e: Exception) { null } diff --git a/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineFragment.kt b/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineFragment.kt index 0deda4d3f..31912bc53 100644 --- a/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineFragment.kt +++ b/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineFragment.kt @@ -97,21 +97,25 @@ class CourseOutlineFragment : Fragment() { onItemClick = { block -> viewModel.sequentialClickedEvent(block.blockId, block.displayName) router.navigateToCourseSubsections( - requireActivity().supportFragmentManager, + fm = requireActivity().supportFragmentManager, courseId = viewModel.courseId, - blockId = block.id, + subSectionId = block.id, mode = CourseViewMode.FULL ) }, - onResumeClick = { blockId -> - viewModel.resumeSectionBlock?.let { sequential -> - viewModel.resumeCourseTappedEvent(sequential.blockId) - router.navigateToCourseSubsections( - requireActivity().supportFragmentManager, - viewModel.courseId, - sequential.id, - CourseViewMode.FULL - ) + onResumeClick = { componentId -> + viewModel.resumeSectionBlock?.let { subSection -> + viewModel.resumeCourseTappedEvent(subSection.id) + viewModel.resumeVerticalBlock?.let { unit -> + router.navigateToCourseSubsections( + requireActivity().supportFragmentManager, + courseId = viewModel.courseId, + subSectionId = subSection.id, + mode = CourseViewMode.FULL, + unitId = unit.id, + componentId = componentId + ) + } } }, onBackClick = { @@ -290,18 +294,18 @@ internal fun CourseOutlineScreen( courseName = uiState.courseStructure.name ) } - if (uiState.resumeBlock != null) { + if (uiState.resumeComponent != null) { item { Spacer(Modifier.height(28.dp)) Box(listPadding) { if (windowSize.isTablet) { ResumeCourseTablet( - block = uiState.resumeBlock, + block = uiState.resumeComponent, onResumeClick = onResumeClick ) } else { ResumeCourse( - block = uiState.resumeBlock, + block = uiState.resumeComponent, onResumeClick = onResumeClick ) } diff --git a/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineUIState.kt b/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineUIState.kt index 6d8c545e5..77f31f06c 100644 --- a/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineUIState.kt +++ b/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineUIState.kt @@ -8,7 +8,7 @@ sealed class CourseOutlineUIState { data class CourseData( val courseStructure: CourseStructure, val downloadedState: Map, - val resumeBlock: Block? + val resumeComponent: Block? ) : CourseOutlineUIState() object Loading : CourseOutlineUIState() diff --git a/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineViewModel.kt b/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineViewModel.kt index f4cae861d..1f50530c0 100644 --- a/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineViewModel.kt +++ b/course/src/main/java/org/openedx/course/presentation/outline/CourseOutlineViewModel.kt @@ -13,6 +13,8 @@ import org.openedx.core.config.Config import org.openedx.core.data.storage.CorePreferences import org.openedx.core.domain.model.Block import org.openedx.core.domain.model.CourseComponentStatus +import org.openedx.core.extension.getSequentialBlocks +import org.openedx.core.extension.getVerticalBlocks import org.openedx.core.extension.isInternetError import org.openedx.core.module.DownloadWorkerController import org.openedx.core.module.db.DownloadDao @@ -81,7 +83,7 @@ class CourseOutlineViewModel( _uiState.value = CourseOutlineUIState.CourseData( courseStructure = state.courseStructure, downloadedState = it.toMap(), - resumeBlock = state.resumeBlock + resumeComponent = state.resumeComponent ) } } @@ -137,7 +139,7 @@ class CourseOutlineViewModel( _uiState.value = CourseOutlineUIState.CourseData( courseStructure = courseStructure, downloadedState = getDownloadModelsStatus(), - resumeBlock = getResumeBlock(blocks, courseStatus.lastVisitedBlockId) + resumeComponent = getResumeBlock(blocks, courseStatus.lastVisitedBlockId) ) } catch (e: Exception) { if (e.isInternetError()) { @@ -176,13 +178,11 @@ class CourseOutlineViewModel( continueBlockId: String ): Block? { val resumeBlock = blocks.firstOrNull { it.id == continueBlockId } - resumeVerticalBlock = blocks.find { - it.descendants.contains(resumeBlock?.id) && it.type == BlockType.VERTICAL - } - resumeSectionBlock = blocks.find { - it.descendants.contains(resumeVerticalBlock?.id) && it.type == BlockType.SEQUENTIAL - } - return resumeVerticalBlock + resumeVerticalBlock = + blocks.getVerticalBlocks().find { it.descendants.contains(resumeBlock?.id) } + resumeSectionBlock = + blocks.getSequentialBlocks().find { it.descendants.contains(resumeVerticalBlock?.id) } + return resumeBlock } fun resumeCourseTappedEvent(blockId: String) { diff --git a/course/src/main/java/org/openedx/course/presentation/section/CourseSectionFragment.kt b/course/src/main/java/org/openedx/course/presentation/section/CourseSectionFragment.kt index 06f2f848d..685cb3d34 100644 --- a/course/src/main/java/org/openedx/course/presentation/section/CourseSectionFragment.kt +++ b/course/src/main/java/org/openedx/course/presentation/section/CourseSectionFragment.kt @@ -93,9 +93,9 @@ class CourseSectionFragment : Fragment() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) lifecycle.addObserver(viewModel) - val blockId = requireArguments().getString(ARG_BLOCK_ID, "") + val subSectionId = requireArguments().getString(ARG_SUBSECTION_ID, "") viewModel.mode = requireArguments().serializable(ARG_MODE)!! - viewModel.getBlocks(blockId, viewModel.mode) + viewModel.getBlocks(subSectionId, viewModel.mode) } override fun onCreateView( @@ -121,9 +121,9 @@ class CourseSectionFragment : Fragment() { if (block.descendants.isNotEmpty()) { viewModel.verticalClickedEvent(block.blockId, block.displayName) router.navigateToCourseContainer( - requireActivity().supportFragmentManager, - block.id, + fm = requireActivity().supportFragmentManager, courseId = viewModel.courseId, + unitId = block.id, mode = viewModel.mode ) } @@ -146,15 +146,16 @@ class CourseSectionFragment : Fragment() { ) LaunchedEffect(rememberSaveable { true }) { - val descendantId = requireArguments().getString(ARG_DESCENDANT_ID, "") - if (descendantId.isNotEmpty()) { + val unitId = requireArguments().getString(ARG_UNIT_ID, "") + if (unitId.isNotEmpty()) { router.navigateToCourseContainer( - requireActivity().supportFragmentManager, - descendantId, + fm = requireActivity().supportFragmentManager, courseId = viewModel.courseId, + unitId = unitId, + componentId = requireArguments().getString(ARG_COMPONENT_ID, ""), mode = viewModel.mode ) - requireArguments().putString(ARG_DESCENDANT_ID, "") + requireArguments().putString(ARG_UNIT_ID, "") } } } @@ -163,20 +164,23 @@ class CourseSectionFragment : Fragment() { companion object { private const val ARG_COURSE_ID = "courseId" - private const val ARG_BLOCK_ID = "blockId" - private const val ARG_DESCENDANT_ID = "descendantId" + private const val ARG_SUBSECTION_ID = "subSectionId" + private const val ARG_UNIT_ID = "unitId" + private const val ARG_COMPONENT_ID = "componentId" private const val ARG_MODE = "mode" fun newInstance( courseId: String, - blockId: String, + subSectionId: String, + unitId: String?, + componentId: String?, mode: CourseViewMode, - descendantId: String?, ): CourseSectionFragment { val fragment = CourseSectionFragment() fragment.arguments = bundleOf( ARG_COURSE_ID to courseId, - ARG_BLOCK_ID to blockId, - ARG_DESCENDANT_ID to descendantId, + ARG_SUBSECTION_ID to subSectionId, + ARG_UNIT_ID to unitId, + ARG_COMPONENT_ID to componentId, ARG_MODE to mode ) return fragment diff --git a/course/src/main/java/org/openedx/course/presentation/unit/container/CourseUnitContainerFragment.kt b/course/src/main/java/org/openedx/course/presentation/unit/container/CourseUnitContainerFragment.kt index 50825a41d..fd1e82127 100644 --- a/course/src/main/java/org/openedx/course/presentation/unit/container/CourseUnitContainerFragment.kt +++ b/course/src/main/java/org/openedx/course/presentation/unit/container/CourseUnitContainerFragment.kt @@ -5,8 +5,8 @@ import android.os.Bundle import android.os.SystemClock import android.view.LayoutInflater import android.view.View -import androidx.compose.foundation.layout.statusBarsPadding import android.view.ViewGroup +import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.layout.width import androidx.compose.material.MaterialTheme import androidx.compose.runtime.getValue @@ -20,8 +20,11 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.os.bundleOf import androidx.core.view.isVisible import androidx.fragment.app.Fragment +import androidx.lifecycle.lifecycleScope import androidx.viewpager2.widget.ViewPager2 import com.google.android.gms.cast.framework.CastButtonFactory +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch import org.koin.android.ext.android.inject import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.core.parameter.parametersOf @@ -42,6 +45,7 @@ import org.openedx.course.presentation.ui.NavigationUnitsButtons import org.openedx.course.presentation.ui.VerticalPageIndicator import org.openedx.course.presentation.ui.VideoTitle + class CourseUnitContainerFragment : Fragment(R.layout.fragment_course_unit_container) { private val binding: FragmentCourseUnitContainerBinding @@ -54,7 +58,8 @@ class CourseUnitContainerFragment : Fragment(R.layout.fragment_course_unit_conta private val router by inject() - private var blockId: String = "" + private var unitId: String = "" + private var componentId: String = "" private lateinit var adapter: CourseUnitContainerAdapter @@ -76,9 +81,10 @@ class CourseUnitContainerFragment : Fragment(R.layout.fragment_course_unit_conta override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) lifecycle.addObserver(viewModel) - blockId = requireArguments().getString(ARG_BLOCK_ID, "") + unitId = requireArguments().getString(UNIT_ID, "") + componentId = requireArguments().getString(ARG_COMPONENT_ID, "") viewModel.loadBlocks(requireArguments().serializable(ARG_MODE)!!) - viewModel.setupCurrentIndex(blockId) + viewModel.setupCurrentIndex(unitId, componentId) } override fun onCreateView( @@ -108,7 +114,7 @@ class CourseUnitContainerFragment : Fragment(R.layout.fragment_course_unit_conta CastButtonFactory.setUpMediaRouteButton(requireContext(), binding.mediaRouteButton) initViewPager() - if (savedInstanceState == null) { + if (savedInstanceState == null && componentId.isEmpty()) { val currentBlockIndex = viewModel.getUnitBlocks().indexOfFirst { viewModel.getCurrentBlock().id == it.id } @@ -116,6 +122,15 @@ class CourseUnitContainerFragment : Fragment(R.layout.fragment_course_unit_conta binding.viewPager.currentItem = currentBlockIndex } } + if (componentId.isEmpty().not()) { + lifecycleScope.launch(Dispatchers.Main) { + viewModel.indexInContainer.value?.let { index -> + binding.viewPager.setCurrentItem(index, true) + } + } + requireArguments().putString(ARG_COMPONENT_ID, "") + componentId = "" + } binding.cvVideoTitle?.setContent { OpenEdXTheme { @@ -290,10 +305,10 @@ class CourseUnitContainerFragment : Fragment(R.layout.fragment_course_unit_conta ) if (it.type.isContainer()) { router.replaceCourseContainer( - requireActivity().supportFragmentManager, - it.id, - viewModel.courseId, - requireArguments().serializable(ARG_MODE)!! + fm = requireActivity().supportFragmentManager, + courseId = viewModel.courseId, + unitId = it.id, + mode = requireArguments().serializable(ARG_MODE)!! ) } } @@ -313,23 +328,25 @@ class CourseUnitContainerFragment : Fragment(R.layout.fragment_course_unit_conta companion object { - private const val ARG_BLOCK_ID = "blockId" private const val ARG_COURSE_ID = "courseId" + private const val UNIT_ID = "unitId" + private const val ARG_COMPONENT_ID = "componentId" private const val ARG_MODE = "mode" fun newInstance( - blockId: String, courseId: String, + unitId: String, + componentId: String?, mode: CourseViewMode, ): CourseUnitContainerFragment { val fragment = CourseUnitContainerFragment() fragment.arguments = bundleOf( - ARG_BLOCK_ID to blockId, ARG_COURSE_ID to courseId, + UNIT_ID to unitId, + ARG_COMPONENT_ID to componentId, ARG_MODE to mode ) return fragment } } - -} \ No newline at end of file +} diff --git a/course/src/main/java/org/openedx/course/presentation/unit/container/CourseUnitContainerViewModel.kt b/course/src/main/java/org/openedx/course/presentation/unit/container/CourseUnitContainerViewModel.kt index e4c671617..4336f8ce5 100644 --- a/course/src/main/java/org/openedx/course/presentation/unit/container/CourseUnitContainerViewModel.kt +++ b/course/src/main/java/org/openedx/course/presentation/unit/container/CourseUnitContainerViewModel.kt @@ -3,6 +3,10 @@ package org.openedx.course.presentation.unit.container import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.viewModelScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.first +import kotlinx.coroutines.launch +import kotlinx.coroutines.runBlocking import org.openedx.core.BaseViewModel import org.openedx.core.BlockType import org.openedx.core.domain.model.Block @@ -15,10 +19,6 @@ import org.openedx.core.system.notifier.CourseNotifier import org.openedx.core.system.notifier.CourseSectionChanged import org.openedx.course.domain.interactor.CourseInteractor import org.openedx.course.presentation.CourseAnalytics -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.flow.first -import kotlinx.coroutines.launch -import kotlinx.coroutines.runBlocking class CourseUnitContainerViewModel( private val interactor: CourseInteractor, @@ -79,12 +79,12 @@ class CourseUnitContainerViewModel( _indexInContainer.value = 0 } - fun setupCurrentIndex(blockId: String) { + fun setupCurrentIndex(unitId: String, componentId: String = "") { if (currentSectionIndex != -1) { return } blocks.forEachIndexed { index, block -> - if (block.id == blockId) { + if (block.id == unitId) { currentVerticalIndex = index currentSectionIndex = blocks.indexOfFirst { it.descendants.contains(blocks[currentVerticalIndex].id) @@ -100,6 +100,11 @@ class CourseUnitContainerViewModel( if (block.descendants.isNotEmpty()) { _currentBlock.value = blocks.first { it.id == block.descendants.first() } } + if (componentId.isNotEmpty()) { + _currentBlock.value = blocks.first { it.id == componentId } + _indexInContainer.value = descendants.indexOf(componentId) + currentIndex = descendants.indexOf(componentId) + } return } } diff --git a/course/src/main/java/org/openedx/course/presentation/videos/CourseVideosFragment.kt b/course/src/main/java/org/openedx/course/presentation/videos/CourseVideosFragment.kt index 4db67477c..1048b130c 100644 --- a/course/src/main/java/org/openedx/course/presentation/videos/CourseVideosFragment.kt +++ b/course/src/main/java/org/openedx/course/presentation/videos/CourseVideosFragment.kt @@ -94,9 +94,9 @@ class CourseVideosFragment : Fragment() { }, onItemClick = { block -> router.navigateToCourseSubsections( - requireActivity().supportFragmentManager, + fm = requireActivity().supportFragmentManager, courseId = viewModel.courseId, - blockId = block.id, + subSectionId = block.id, mode = CourseViewMode.VIDEOS ) },