File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
core/src/main/java/org/openedx/core/utils
course/src/main/java/org/openedx/course/presentation/contenttab Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -45,14 +45,14 @@ object PreviewHelper {
4545 if (isOnline || isLocalFile(videoUrl)) {
4646 // Check cache first
4747 val cacheFile = getCacheFile(context, videoUrl)
48- if (cacheFile.exists()) {
48+ result = if (cacheFile.exists()) {
4949 try {
50- result = BitmapFactory .decodeFile(cacheFile.absolutePath)
51- } catch (e : Exception ) {
52- e.printStackTrace( )
50+ BitmapFactory .decodeFile(cacheFile.absolutePath)
51+ } catch (_ : Exception ) {
52+ extractBitmapFromVideo(videoUrl, context )
5353 }
5454 } else {
55- result = extractBitmapFromVideo(videoUrl, context)
55+ extractBitmapFromVideo(videoUrl, context)
5656 }
5757 }
5858 return result
Original file line number Diff line number Diff line change @@ -23,9 +23,11 @@ import androidx.compose.ui.res.painterResource
2323import androidx.compose.ui.res.stringResource
2424import androidx.compose.ui.text.font.FontWeight
2525import androidx.compose.ui.text.style.TextAlign
26+ import androidx.compose.ui.tooling.preview.Preview
2627import androidx.compose.ui.unit.dp
2728import org.openedx.core.ui.IconText
2829import org.openedx.core.ui.OpenEdXButton
30+ import org.openedx.core.ui.theme.OpenEdXTheme
2931import org.openedx.core.ui.theme.appColors
3032import org.openedx.core.ui.theme.appTypography
3133import org.openedx.course.R
@@ -109,4 +111,12 @@ fun CourseContentAssignmentEmptyState(
109111 message = stringResource(id = org.openedx.core.R .string.core_no_assignments),
110112 onReturnToCourseClick = onReturnToCourseClick
111113 )
112- }
114+ }
115+
116+ @Preview
117+ @Composable
118+ private fun CourseContentAllEmptyStatePreview () {
119+ OpenEdXTheme {
120+ CourseContentAllEmptyState ({})
121+ }
122+ }
You can’t perform that action at this time.
0 commit comments