pull/1211/head
gedoor 3 years ago
parent 154c8695c2
commit 6df0ab1eae
  1. 1
      app/src/main/java/io/legado/app/ui/association/ImportBookSourceDialog.kt
  2. 1
      app/src/main/java/io/legado/app/ui/association/ImportRssSourceDialog.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/cache/CacheActivity.kt
  4. 1
      app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt
  5. 1
      app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt
  6. 1
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt
  7. 1
      app/src/main/java/io/legado/app/ui/book/read/config/SpeakEngineDialog.kt
  8. 4
      app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt
  9. 2
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt
  10. 5
      app/src/main/java/io/legado/app/ui/book/source/manage/GroupManageDialog.kt
  11. 6
      app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt
  12. 4
      app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt
  13. 4
      app/src/main/java/io/legado/app/ui/main/bookshelf/BaseBookshelfFragment.kt
  14. 10
      app/src/main/java/io/legado/app/ui/replace/GroupManageDialog.kt
  15. 1
      app/src/main/java/io/legado/app/ui/replace/ReplaceRuleActivity.kt
  16. 18
      app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt
  17. 1
      app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt
  18. 3
      app/src/main/res/layout/dialog_edit_text.xml

@ -176,6 +176,7 @@ class ImportBookSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickList
appDb.bookSourceDao.allGroup.forEach { group ->
groups.addAll(group.splitNotBlank(AppPattern.splitGroupRegex))
}
editView.setHint(R.string.group_name)
editView.setFilterValues(groups.toList())
editView.dropDownHeight = 180.dp
}

@ -172,6 +172,7 @@ class ImportRssSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListe
appDb.rssSourceDao.allGroup.forEach { group ->
groups.addAll(group.splitNotBlank(AppPattern.splitGroupRegex))
}
editView.setHint(R.string.group_name)
editView.setFilterValues(groups.toList())
editView.dropDownHeight = 180.dp
}

@ -298,6 +298,7 @@ class CacheActivity : VMBaseActivity<ActivityCacheBookBinding, CacheViewModel>()
private fun alertExportFileName() {
alert(R.string.export_file_name) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "file name js"
editView.setText(AppConfig.bookExportFileName)
}
customView { alertBinding.root }
@ -317,6 +318,7 @@ class CacheActivity : VMBaseActivity<ActivityCacheBookBinding, CacheViewModel>()
private fun showCharsetConfig() {
alert(R.string.set_charset) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "charset name"
editView.setFilterValues(charsets)
editView.setText(AppConfig.exportCharset)
}

@ -280,6 +280,7 @@ class ImportBookActivity : VMBaseActivity<ActivityImportBookBinding, ImportBookV
private fun alertImportFileName() {
alert(R.string.import_file_name) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "js"
editView.setText(AppConfig.bookImportFileName)
}
customView { alertBinding.root }

@ -202,6 +202,7 @@ abstract class ReadBookBaseActivity :
fun showCharsetConfig() {
alert(R.string.set_charset) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "charset"
editView.setFilterValues(charsets)
editView.setText(ReadBook.book?.charset)
}

@ -142,6 +142,7 @@ class BgTextConfigDialog : BaseDialogFragment() {
binding.ivEdit.setOnClickListener {
alert(R.string.style_name) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "name"
editView.setText(ReadBookConfig.durConfig.name)
}
customView { alertBinding.root }

@ -134,6 +134,7 @@ class SpeakEngineDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
?.toMutableList() ?: mutableListOf()
alert(R.string.import_on_line) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "url"
editView.setFilterValues(cacheUrls)
editView.delCallBack = {
cacheUrls.remove(it)

@ -135,8 +135,8 @@ class TocRegexDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener {
cacheUrls.add(0, defaultUrl)
}
requireContext().alert(titleResource = R.string.import_on_line) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater)
alertBinding.apply {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "url"
editView.setFilterValues(cacheUrls)
editView.delCallBack = {
cacheUrls.remove(it)

@ -327,6 +327,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
private fun checkSource() {
alert(titleResource = R.string.search_book_key) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "search word"
editView.setText(CheckSource.keyword)
}
customView { alertBinding.root }
@ -400,6 +401,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
?.toMutableList() ?: mutableListOf()
alert(titleResource = R.string.import_on_line) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "url"
editView.setFilterValues(cacheUrls)
editView.delCallBack = {
cacheUrls.remove(it)

@ -87,8 +87,9 @@ class GroupManageDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
@SuppressLint("InflateParams")
private fun addGroup() {
alert(title = getString(R.string.add_group)) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater)
alertBinding.editView.setHint(R.string.group_name)
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.setHint(R.string.group_name)
}
customView { alertBinding.root }
yesButton {
alertBinding.editView.text?.toString()?.let {

@ -144,8 +144,10 @@ class OtherConfigFragment : BasePreferenceFragment(),
@SuppressLint("InflateParams")
private fun showUserAgentDialog() {
alert("UserAgent") {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater)
alertBinding.editView.setText(AppConfig.userAgent)
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "UserAgent"
editView.setText(AppConfig.userAgent)
}
customView { alertBinding.root }
okButton {
val userAgent = alertBinding.editView.text?.toString()

@ -213,7 +213,9 @@ class ThemeConfigFragment : BasePreferenceFragment(),
@SuppressLint("InflateParams")
private fun saveThemeAlert(key: String) {
alert(R.string.theme_name) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater)
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "name"
}
customView { alertBinding.root }
okButton {
alertBinding.editView.text?.toString()?.let { themeName ->

@ -65,7 +65,9 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment<BookshelfVi
@SuppressLint("InflateParams")
fun addBookByUrl() {
alert(titleResource = R.string.add_book_url) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater)
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "url"
}
customView { alertBinding.root }
okButton {
alertBinding.editView.text?.toString()?.let {

@ -88,12 +88,10 @@ class GroupManageDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
@SuppressLint("InflateParams")
private fun addGroup() {
alert(title = getString(R.string.add_group)) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater)
customView {
alertBinding.apply {
editView.hint = "分组名称"
}.root
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.setHint(R.string.group_name)
}
customView { alertBinding.root }
yesButton {
alertBinding.editView.text?.toString()?.let {
if (it.isNotBlank()) {
@ -109,7 +107,7 @@ class GroupManageDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
private fun editGroup(group: String) {
alert(title = getString(R.string.group_edit)) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "分组名称"
editView.setHint(R.string.group_name)
editView.setText(group)
}
customView { alertBinding.root }

@ -255,6 +255,7 @@ class ReplaceRuleActivity : VMBaseActivity<ActivityReplaceRuleBinding, ReplaceRu
?.toMutableList() ?: mutableListOf()
alert(titleResource = R.string.import_replace_rule_on_line) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "url"
editView.setFilterValues(cacheUrls)
editView.delCallBack = {
cacheUrls.remove(it)

@ -89,12 +89,10 @@ class GroupManageDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
@SuppressLint("InflateParams")
private fun addGroup() {
alert(title = getString(R.string.add_group)) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater)
customView {
alertBinding.apply {
editView.setHint(R.string.group_name)
}.root
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.setHint(R.string.group_name)
}
customView { alertBinding.root }
yesButton {
alertBinding.editView.text?.toString()?.let {
if (it.isNotBlank()) {
@ -109,13 +107,11 @@ class GroupManageDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
@SuppressLint("InflateParams")
private fun editGroup(group: String) {
alert(title = getString(R.string.group_edit)) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater)
customView {
alertBinding.apply {
editView.setHint(R.string.group_name)
editView.setText(group)
}.root
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.setHint(R.string.group_name)
editView.setText(group)
}
customView { alertBinding.root }
yesButton {
viewModel.upGroup(group, alertBinding.editView.text?.toString())
}

@ -263,6 +263,7 @@ class RssSourceActivity : VMBaseActivity<ActivityRssSourceBinding, RssSourceView
?.toMutableList() ?: mutableListOf()
alert(titleResource = R.string.import_on_line) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "url"
editView.setFilterValues(cacheUrls)
editView.delCallBack = {
cacheUrls.remove(it)

@ -15,5 +15,6 @@
android:layout_marginLeft="20dp"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
tools:ignore="SpeakableTextPresentCheck" />
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
</ScrollView>
Loading…
Cancel
Save