Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.text.style.TextOverflow
Expand Down Expand Up @@ -563,6 +564,11 @@ fun VideoSubtitles(
} else {
MaterialTheme.appColors.textFieldBorder
}
val fontWeight = if (currentIndex == index) {
FontWeight.SemiBold
} else {
FontWeight.Normal
}
Text(
modifier = Modifier
.fillMaxWidth()
Expand All @@ -571,7 +577,8 @@ fun VideoSubtitles(
},
text = Jsoup.parse(item.content).text(),
color = textColor,
style = MaterialTheme.appTypography.bodyMedium
style = MaterialTheme.appTypography.bodyMedium,
fontWeight = fontWeight,
)
Spacer(Modifier.height(16.dp))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class VideoUnitFragment : Fragment(R.layout.fragment_video_unit) {
viewModel.isDownloaded = getBoolean(ARG_DOWNLOADED)
}
viewModel.downloadSubtitles()
handler.removeCallbacks(videoTimeRunnable)
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ open class VideoUnitViewModel(


open fun markBlockCompleted(blockId: String, medium: String) {
logLoadedCompletedEvent(videoUrl, false, getCurrentVideoTime(), medium)
if (!isBlockAlreadyCompleted) {
logLoadedCompletedEvent(videoUrl, false, getCurrentVideoTime(), medium)
viewModelScope.launch {
try {
isBlockAlreadyCompleted = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class VideoViewModel(
}

fun markBlockCompleted(blockId: String, medium: String) {
logLoadedCompletedEvent(videoUrl, false, currentVideoTime, medium)
if (!isBlockAlreadyCompleted) {
logLoadedCompletedEvent(videoUrl, false, currentVideoTime, medium)
viewModelScope.launch {
try {
isBlockAlreadyCompleted = true
Expand Down