fix COURSE tab lateinit crash: guard refreshCurrentUi by module and loadRemoteVideo
This commit is contained in:
@@ -1678,6 +1678,7 @@ class MainActivity : Activity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun refreshCurrentUi() {
|
private fun refreshCurrentUi() {
|
||||||
|
if (activeModule != Module.TRAIN && activeModule != Module.TEST) return
|
||||||
if (!::lessonTitleText.isInitialized) return
|
if (!::lessonTitleText.isInitialized) return
|
||||||
val item = controller.currentTrainingItem()
|
val item = controller.currentTrainingItem()
|
||||||
lessonTitleText.text = item?.title ?: "未选择课程"
|
lessonTitleText.text = item?.title ?: "未选择课程"
|
||||||
@@ -1916,10 +1917,10 @@ class MainActivity : Activity() {
|
|||||||
|
|
||||||
private fun loadRemoteVideo(video: TrainingVideoSummary) {
|
private fun loadRemoteVideo(video: TrainingVideoSummary) {
|
||||||
activeItemId = video.videoHash
|
activeItemId = video.videoHash
|
||||||
lessonTitleText.text = video.title
|
if (::lessonTitleText.isInitialized) lessonTitleText.text = video.title
|
||||||
sentenceMetaText.text = "句子边界加载中"
|
if (::sentenceMetaText.isInitialized) sentenceMetaText.text = "句子边界加载中"
|
||||||
sentenceText.text = video.title
|
if (::sentenceText.isInitialized) sentenceText.text = video.title
|
||||||
statusText.text = "正在加载云端课程..."
|
if (::statusText.isInitialized) statusText.text = "正在加载云端课程..."
|
||||||
renderCatalog()
|
renderCatalog()
|
||||||
|
|
||||||
val loadingItem = video.toTrainingMediaItem()
|
val loadingItem = video.toTrainingMediaItem()
|
||||||
|
|||||||
Reference in New Issue
Block a user