Replace material-dialogs with Material Components' SY

This commit is contained in:
Jobobby04
2021-07-18 20:17:58 -04:00
parent d4993d1b71
commit cf54851342
40 changed files with 822 additions and 733 deletions
@@ -5,7 +5,7 @@ import android.app.Activity
import android.util.Log
import androidx.core.text.HtmlCompat
import androidx.preference.PreferenceScreen
import com.afollestad.materialdialogs.MaterialDialog
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import eu.kanade.tachiyomi.ui.setting.SettingsController
import eu.kanade.tachiyomi.util.preference.defaultValue
import eu.kanade.tachiyomi.util.preference.onClick
@@ -36,23 +36,13 @@ class SettingsDebugController : SettingsController() {
try {
val result = it.call(DebugFunctions)
val text = "Function returned result:\n\n$result"
MaterialDialog(context)
.title(text = title.toString())
.message(text = text) {
messageTextView.apply {
setHorizontallyScrolling(true)
setTextIsSelectable(true)
}
}
MaterialAlertDialogBuilder(context)
.setTitle(title.toString())
.setMessage(text)
} catch (t: Throwable) {
val text = "Function threw exception:\n\n${Log.getStackTraceString(t)}"
MaterialDialog(context)
.message(text = text) {
messageTextView.apply {
setHorizontallyScrolling(true)
setTextIsSelectable(true)
}
}
MaterialAlertDialogBuilder(context)
.setMessage(text)
}.show()
}
}