diff --git a/apps/student/src/main/java/com/instructure/student/navigation/StudentWebViewRouter.kt b/apps/student/src/main/java/com/instructure/student/navigation/StudentWebViewRouter.kt index 6eb681b270..7ae5299c74 100644 --- a/apps/student/src/main/java/com/instructure/student/navigation/StudentWebViewRouter.kt +++ b/apps/student/src/main/java/com/instructure/student/navigation/StudentWebViewRouter.kt @@ -19,6 +19,7 @@ package com.instructure.student.navigation import androidx.fragment.app.FragmentActivity import com.instructure.canvasapi2.utils.ApiPrefs import com.instructure.pandautils.navigation.WebViewRouter +import com.instructure.student.fragment.InternalWebviewFragment import com.instructure.student.router.RouteMatcher class StudentWebViewRouter(val activity: FragmentActivity) : WebViewRouter { @@ -34,4 +35,8 @@ class StudentWebViewRouter(val activity: FragmentActivity) : WebViewRouter { override fun openMedia(url: String) { RouteMatcher.openMedia(activity, url) } + + override fun routeExternally(url: String) { + RouteMatcher.route(activity, InternalWebviewFragment.makeRoute(url, url, false, "")) + } } \ No newline at end of file diff --git a/apps/teacher/src/main/java/com/instructure/teacher/navigation/TeacherWebViewRouter.kt b/apps/teacher/src/main/java/com/instructure/teacher/navigation/TeacherWebViewRouter.kt index 2f457b39c3..07c508bb48 100644 --- a/apps/teacher/src/main/java/com/instructure/teacher/navigation/TeacherWebViewRouter.kt +++ b/apps/teacher/src/main/java/com/instructure/teacher/navigation/TeacherWebViewRouter.kt @@ -17,8 +17,12 @@ package com.instructure.teacher.navigation import androidx.fragment.app.FragmentActivity +import com.instructure.canvasapi2.models.CanvasContext import com.instructure.canvasapi2.utils.ApiPrefs +import com.instructure.interactions.router.Route import com.instructure.pandautils.navigation.WebViewRouter +import com.instructure.teacher.fragments.FullscreenInternalWebViewFragment +import com.instructure.teacher.fragments.InternalWebViewFragment import com.instructure.teacher.router.RouteMatcher class TeacherWebViewRouter(val activity: FragmentActivity) : WebViewRouter { @@ -34,4 +38,14 @@ class TeacherWebViewRouter(val activity: FragmentActivity) : WebViewRouter { override fun openMedia(url: String) { RouteMatcher.openMedia(activity, url) } + + override fun routeExternally(url: String) { + val bundle = InternalWebViewFragment.makeBundle(url, url, false, "") + RouteMatcher.route( + activity, Route( + FullscreenInternalWebViewFragment::class.java, + CanvasContext.emptyUserContext(), bundle + ) + ) + } } \ No newline at end of file diff --git a/libs/pandautils/src/main/java/com/instructure/pandautils/features/discussion/details/DiscussionDetailsWebViewFragment.kt b/libs/pandautils/src/main/java/com/instructure/pandautils/features/discussion/details/DiscussionDetailsWebViewFragment.kt index 3d706811c4..c402282c08 100644 --- a/libs/pandautils/src/main/java/com/instructure/pandautils/features/discussion/details/DiscussionDetailsWebViewFragment.kt +++ b/libs/pandautils/src/main/java/com/instructure/pandautils/features/discussion/details/DiscussionDetailsWebViewFragment.kt @@ -96,7 +96,7 @@ class DiscussionDetailsWebViewFragment : Fragment() { override fun routeInternallyCallback(url: String) { if (!webViewRouter.canRouteInternally(url, routeIfPossible = true)) { - webViewRouter.routeInternally(url) + webViewRouter.routeExternally(url) } } diff --git a/libs/pandautils/src/main/java/com/instructure/pandautils/navigation/WebViewRouter.kt b/libs/pandautils/src/main/java/com/instructure/pandautils/navigation/WebViewRouter.kt index 2816a16f53..f577adddc1 100644 --- a/libs/pandautils/src/main/java/com/instructure/pandautils/navigation/WebViewRouter.kt +++ b/libs/pandautils/src/main/java/com/instructure/pandautils/navigation/WebViewRouter.kt @@ -23,4 +23,6 @@ interface WebViewRouter { fun routeInternally(url: String) fun openMedia(url: String) + + fun routeExternally(url: String) } \ No newline at end of file