Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1836 from openedx/hamza/LEARNER-9659
Browse files Browse the repository at this point in the history
Prevent Deep Link Activation on Orientation Change
  • Loading branch information
HamzaIsrar12 authored Nov 8, 2023
2 parents c4e2dba + e09ce0a commit 2f85d15
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/androidTestSuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
fail_ci_if_error: false
verbose: true

# TODO: Re-enable this job when the Instrument Test functionality is restored - Remove 'if: false'
android_screenshot:
name: Android Instrumented Tests
# The macOS VM provided by GitHub Actions has HAXM installed so we are able to create a new AVD
Expand All @@ -62,6 +63,7 @@ jobs:
# Includes Screenshot Tests
# Ref: https://github.com/marketplace/actions/android-emulator-runner
runs-on: macos-11
if: false

steps:
# Checkouts the current branch for processing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ class CourseHomeTabFragment : OfflineSupportBaseFragment(), CourseHomeAdapter.On
false
)
courseUnitDetailLauncher.launch(courseUnitDetailIntent)
arguments?.putString(Router.EXTRA_SCREEN_NAME, null)
screenName = null
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,28 +130,7 @@ class CourseTabsDashboardFragment : BaseFragment() {
private val fullscreenLoader: FullscreenLoaderDialogFragment?
get() = getRetainedInstance(childFragmentManager)

private val courseTabItems: List<FragmentItemModel>
get() {
val screenName = arguments?.getString(Router.EXTRA_SCREEN_NAME)
val items = mutableListOf<FragmentItemModel>()

items.add(createCourseOutlineItem(screenName))
if (environment.config.isCourseVideosEnabled) {
items.add(createVideosItem())
}
if (environment.config.isDiscussionsEnabled &&
courseData.course.discussionUrl?.isNotEmpty() == true
) {
items.add(createDiscussionsItem())
}
if (environment.config.isCourseDatesEnabled) {
items.add(createDatesItem())
}
items.add(createHandoutsItem())
items.add(createAnnouncementsItem())

return items
}
private lateinit var courseTabItems: List<FragmentItemModel>

private val onBackPressedCallback: OnBackPressedCallback =
object : OnBackPressedCallback(true) {
Expand Down Expand Up @@ -191,6 +170,7 @@ class CourseTabsDashboardFragment : BaseFragment() {
binding = FragmentCourseTabsDashboardBinding.inflate(inflater, container, false)
courseData =
arguments?.serializableOrThrow(Router.EXTRA_COURSE_DATA) as EnrolledCoursesResponse
courseTabItems = getCourseTabItems()

setHasOptionsMenu(courseData.course.coursewareAccess.hasAccess())

Expand Down Expand Up @@ -788,6 +768,28 @@ class CourseTabsDashboardFragment : BaseFragment() {
})
}

private fun getCourseTabItems(): List<FragmentItemModel> {
val screenName = arguments?.getString(Router.EXTRA_SCREEN_NAME)
val items = mutableListOf<FragmentItemModel>()

items.add(createCourseOutlineItem(screenName))
if (environment.config.isCourseVideosEnabled) {
items.add(createVideosItem())
}
if (environment.config.isDiscussionsEnabled &&
courseData.course.discussionUrl?.isNotEmpty() == true
) {
items.add(createDiscussionsItem())
}
if (environment.config.isCourseDatesEnabled) {
items.add(createDatesItem())
}
items.add(createHandoutsItem())
items.add(createAnnouncementsItem())

return items
}

private fun createCourseOutlineItem(screenName: String?): FragmentItemModel {
return FragmentItemModel(
CourseHomeTabFragment::class.java,
Expand Down
7 changes: 7 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Configuration for GitHub-Codecov Checks
# Inspiration: https://docs.codecov.com/docs/github-checks#yaml-configuration-for-github-checks-and-codecov

coverage:
status:
patch: false
project: false

0 comments on commit 2f85d15

Please sign in to comment.