-
Notifications
You must be signed in to change notification settings - Fork 27
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
fix: Update resume course navigation #151
fix: Update resume course navigation #151
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.
Minor nits only.
fun List<Block>.getVerticalBlocks(): List<Block> { | ||
return this.filter { it.type == BlockType.VERTICAL } | ||
} | ||
|
||
fun List<Block>.getSequentialBlocks(): List<Block> { | ||
return this.filter { it.type == BlockType.SEQUENTIAL } |
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.
Maybe move it to ListExt
.
val currentBlockIndex = viewModel.getUnitBlocks().indexOfFirst { | ||
viewModel.getCurrentBlock().id == it.id | ||
} | ||
if (currentBlockIndex != -1) { | ||
binding.viewPager.currentItem = currentBlockIndex | ||
} | ||
} | ||
if (componentId.isEmpty().not()) { | ||
Handler(Looper.getMainLooper()).post { |
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.
Please use Coroutines instead.
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.
updated
0b7d556
to
4c6987f
Compare
- Update navigation for resume component - Code improvement & optimisation fix: LEARNER-9703
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.
LGTM, minor nits only
) { | ||
replaceFragmentWithBackStack( | ||
fm, | ||
CourseSectionFragment.newInstance(courseId, blockId, mode, descendantId) | ||
CourseSectionFragment.newInstance(courseId, subSectionId, mode, unitId, componentId) |
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.
Can you please use named arguments here, because there are a lot of arguments with the same type here:
CourseSectionFragment.newInstance(
courseId = courseId,
subSectionId = subSectionId,
mode = mode,
unitId = unitId,
componentId = componentId,
)
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.
updated for the all the methods
mode: CourseViewMode, | ||
descendantId: String? = "" | ||
subSectionId: String, | ||
unitId: String? = "", |
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.
Not very clear why there is nullable argument with the default empty string value.
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.
removed nullable
Description:
subSection
screen.Prev_resume_course.mp4
Resume_course.mp4