diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/arch/ViewModelFactory.kt b/app/apk/src/main/java/com/topjohnwu/magisk/arch/ViewModelFactory.kt index 8860f5c55..5da9deddf 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/arch/ViewModelFactory.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/arch/ViewModelFactory.kt @@ -17,7 +17,7 @@ object VMFactory : ViewModelProvider.Factory { LogViewModel::class.java -> LogViewModel(ServiceLocator.logRepo) SuperuserViewModel::class.java -> SuperuserViewModel(ServiceLocator.policyDB) InstallViewModel::class.java -> - InstallViewModel(ServiceLocator.networkService, ServiceLocator.markwon) + InstallViewModel(ServiceLocator.networkService) SuRequestViewModel::class.java -> SuRequestViewModel(ServiceLocator.policyDB, ServiceLocator.timeoutPrefs) else -> modelClass.newInstance() diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/HomeScreen.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/HomeScreen.kt index f61d848af..f58dd83b3 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/HomeScreen.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/home/HomeScreen.kt @@ -67,6 +67,7 @@ import com.topjohnwu.magisk.core.tasks.MagiskInstaller import com.topjohnwu.magisk.ui.MainActivity import com.topjohnwu.magisk.ui.component.ConfirmResult import com.topjohnwu.magisk.ui.component.LoadingDialogHandle +import com.topjohnwu.magisk.ui.component.MarkdownText import com.topjohnwu.magisk.ui.component.MarkdownTextAsync import com.topjohnwu.magisk.ui.component.rememberConfirmDialog import com.topjohnwu.magisk.ui.component.rememberLoadingDialog @@ -819,12 +820,9 @@ private fun InstallBottomSheet( ) { Column(modifier = Modifier.padding(bottom = 16.dp)) { if (installUiState.notes.isNotEmpty()) { - Text( - text = installUiState.notes, - style = MiuixTheme.textStyles.body2, - color = MiuixTheme.colorScheme.onSurfaceVariantSummary, - modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp) - ) + Box(modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp)) { + MarkdownText(installUiState.notes) + } HorizontalDivider(thickness = 0.75.dp) } diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt index fa141a943..ee58dca38 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt @@ -12,7 +12,6 @@ import com.topjohnwu.magisk.core.ktx.toast import com.topjohnwu.magisk.core.repository.NetworkService import com.topjohnwu.magisk.core.Const import com.topjohnwu.magisk.ui.navigation.Route -import io.noties.markwon.Markwon import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow @@ -25,7 +24,7 @@ import java.io.File import java.io.IOException import com.topjohnwu.magisk.core.R as CoreR -class InstallViewModel(svc: NetworkService, markwon: Markwon) : BaseViewModel() { +class InstallViewModel(svc: NetworkService) : BaseViewModel() { enum class Method { NONE, PATCH, DIRECT, INACTIVE_SLOT } @@ -58,9 +57,8 @@ class InstallViewModel(svc: NetworkService, markwon: Markwon) : BaseViewModel() note } } - val spanned = markwon.toMarkdown(noteText) withContext(Dispatchers.Main) { - _uiState.update { it.copy(notes = spanned.toString()) } + _uiState.update { it.copy(notes = noteText) } } } catch (e: IOException) { Timber.e(e)