chore: cleanup pt 3
This commit is contained in:
parent
390ce9a022
commit
fdb7f45a3d
10 changed files with 257 additions and 93 deletions
|
@ -24,6 +24,7 @@ import ani.dantotsu.settings.saving.PrefManager
|
|||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.statusBarHeight
|
||||
import ani.dantotsu.themes.ThemeManager
|
||||
import ani.dantotsu.util.customAlertDialog
|
||||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.tachiyomi.extension.anime.AnimeExtensionManager
|
||||
import eu.kanade.tachiyomi.extension.manga.MangaExtensionManager
|
||||
|
@ -169,27 +170,27 @@ class SettingsExtensionsActivity : AppCompatActivity() {
|
|||
val editText = dialogView.userAgentTextBox.apply {
|
||||
hint = getString(R.string.anime_add_repository)
|
||||
}
|
||||
val alertDialog = AlertDialog.Builder(context, R.style.MyPopup)
|
||||
.setTitle(R.string.anime_add_repository).setView(dialogView.root)
|
||||
.setPositiveButton(getString(R.string.ok)) { dialog, _ ->
|
||||
context.customAlertDialog().apply {
|
||||
setTitle(R.string.anime_add_repository)
|
||||
setCustomView(dialogView.root)
|
||||
setPosButton(getString(R.string.ok)) {
|
||||
if (!editText.text.isNullOrBlank()) processUserInput(
|
||||
editText.text.toString(),
|
||||
MediaType.ANIME,
|
||||
it.attachView
|
||||
)
|
||||
dialog.dismiss()
|
||||
}.setNegativeButton(getString(R.string.cancel)) { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
}.create()
|
||||
|
||||
processEditorAction(
|
||||
alertDialog,
|
||||
editText,
|
||||
MediaType.ANIME,
|
||||
it.attachView
|
||||
)
|
||||
alertDialog.show()
|
||||
alertDialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
setNegButton(getString(R.string.cancel))
|
||||
attach { dialog ->
|
||||
processEditorAction(
|
||||
dialog,
|
||||
editText,
|
||||
MediaType.ANIME,
|
||||
it.attachView
|
||||
)
|
||||
}
|
||||
show()
|
||||
}
|
||||
},
|
||||
attach = {
|
||||
setExtensionOutput(it.attachView, MediaType.ANIME)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue