Skip to content

Commit e5311f5

Browse files
fix: changes according PR review feedback
1 parent 0519fa9 commit e5311f5

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

core/src/main/java/org/openedx/core/utils/PreviewHelper.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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

course/src/main/java/org/openedx/course/presentation/contenttab/ContentTabEmptyState.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ import androidx.compose.ui.res.painterResource
2323
import androidx.compose.ui.res.stringResource
2424
import androidx.compose.ui.text.font.FontWeight
2525
import androidx.compose.ui.text.style.TextAlign
26+
import androidx.compose.ui.tooling.preview.Preview
2627
import androidx.compose.ui.unit.dp
2728
import org.openedx.core.ui.IconText
2829
import org.openedx.core.ui.OpenEdXButton
30+
import org.openedx.core.ui.theme.OpenEdXTheme
2931
import org.openedx.core.ui.theme.appColors
3032
import org.openedx.core.ui.theme.appTypography
3133
import 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+
}

0 commit comments

Comments
 (0)