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

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

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

@ -298,7 +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"
textInputLayout.hint = "file name js"
editView.setText(AppConfig.bookExportFileName)
}
customView { alertBinding.root }
@ -318,7 +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"
textInputLayout.hint = "charset name"
editView.setFilterValues(charsets)
editView.setText(AppConfig.exportCharset)
}

@ -15,7 +15,7 @@ object GroupEdit {
fun show(context: Context, layoutInflater: LayoutInflater, bookGroup: BookGroup) = context.run {
alert(title = getString(R.string.group_edit)) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.setHint(R.string.group_name)
textInputLayout.setHint(R.string.group_name)
editView.setText(bookGroup.groupName)
}
if (bookGroup.groupId >= 0) {

@ -103,7 +103,7 @@ class GroupManageDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
private fun addGroup() {
alert(title = getString(R.string.add_group)) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.setHint(R.string.group_name)
textInputLayout.setHint(R.string.group_name)
}
customView { alertBinding.root }
yesButton {

@ -125,7 +125,7 @@ class GroupSelectDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
private fun addGroup() {
alert(title = getString(R.string.add_group)) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.setHint(R.string.group_name)
textInputLayout.setHint(R.string.group_name)
}
customView { alertBinding.root }
yesButton {
@ -143,7 +143,7 @@ class GroupSelectDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
private fun editGroup(bookGroup: BookGroup) {
alert(title = getString(R.string.group_edit)) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.setHint(R.string.group_name)
textInputLayout.setHint(R.string.group_name)
editView.setText(bookGroup.groupName)
}
customView { alertBinding.root }

@ -280,7 +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"
textInputLayout.hint = "js"
editView.setText(AppConfig.bookImportFileName)
}
customView { alertBinding.root }

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

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

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

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

@ -327,7 +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"
textInputLayout.hint = "search word"
editView.setText(CheckSource.keyword)
}
customView { alertBinding.root }
@ -347,7 +347,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
private fun selectionAddToGroups() {
alert(titleResource = R.string.add_group) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.setHint(R.string.group_name)
textInputLayout.setHint(R.string.group_name)
editView.setFilterValues(groups.toList())
editView.dropDownHeight = 180.dp
}
@ -367,7 +367,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
private fun selectionRemoveFromGroups() {
alert(titleResource = R.string.remove_group) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.setHint(R.string.group_name)
textInputLayout.setHint(R.string.group_name)
editView.setFilterValues(groups.toList())
editView.dropDownHeight = 180.dp
}
@ -401,7 +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"
textInputLayout.hint = "url"
editView.setFilterValues(cacheUrls)
editView.delCallBack = {
cacheUrls.remove(it)

@ -88,7 +88,7 @@ class GroupManageDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
private fun addGroup() {
alert(title = getString(R.string.add_group)) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.setHint(R.string.group_name)
textInputLayout.setHint(R.string.group_name)
}
customView { alertBinding.root }
yesButton {
@ -105,9 +105,10 @@ class GroupManageDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
@SuppressLint("InflateParams")
private fun editGroup(group: String) {
alert(title = getString(R.string.group_edit)) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater)
alertBinding.editView.setHint(R.string.group_name)
alertBinding.editView.setText(group)
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
textInputLayout.setHint(R.string.group_name)
editView.setText(group)
}
customView { alertBinding.root }
yesButton {
viewModel.upGroup(group, alertBinding.editView.text?.toString())

@ -145,7 +145,7 @@ class OtherConfigFragment : BasePreferenceFragment(),
private fun showUserAgentDialog() {
alert("UserAgent") {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "UserAgent"
textInputLayout.hint = "UserAgent"
editView.setText(AppConfig.userAgent)
}
customView { alertBinding.root }

@ -214,7 +214,7 @@ class ThemeConfigFragment : BasePreferenceFragment(),
private fun saveThemeAlert(key: String) {
alert(R.string.theme_name) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "name"
textInputLayout.hint = "name"
}
customView { alertBinding.root }
okButton {

@ -66,7 +66,7 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment<BookshelfVi
fun addBookByUrl() {
alert(titleResource = R.string.add_book_url) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "url"
textInputLayout.hint = "url"
}
customView { alertBinding.root }
okButton {
@ -124,7 +124,7 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment<BookshelfVi
private fun importBookshelfAlert(groupId: Long) {
alert(titleResource = R.string.import_bookshelf) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.hint = "url/json"
textInputLayout.hint = "url/json"
}
customView { alertBinding.root }
okButton {

@ -89,7 +89,7 @@ class GroupManageDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
private fun addGroup() {
alert(title = getString(R.string.add_group)) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.setHint(R.string.group_name)
textInputLayout.setHint(R.string.group_name)
}
customView { alertBinding.root }
yesButton {
@ -107,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.setHint(R.string.group_name)
textInputLayout.setHint(R.string.group_name)
editView.setText(group)
}
customView { alertBinding.root }

@ -255,7 +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"
textInputLayout.hint = "url"
editView.setFilterValues(cacheUrls)
editView.delCallBack = {
cacheUrls.remove(it)

@ -90,7 +90,7 @@ class GroupManageDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener
private fun addGroup() {
alert(title = getString(R.string.add_group)) {
val alertBinding = DialogEditTextBinding.inflate(layoutInflater).apply {
editView.setHint(R.string.group_name)
textInputLayout.setHint(R.string.group_name)
}
customView { alertBinding.root }
yesButton {
@ -108,7 +108,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.setHint(R.string.group_name)
textInputLayout.setHint(R.string.group_name)
editView.setText(group)
}
customView { alertBinding.root }

@ -263,7 +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"
textInputLayout.hint = "url"
editView.setFilterValues(cacheUrls)
editView.delCallBack = {
cacheUrls.remove(it)

@ -1,20 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="48dp"
android:layout_marginBottom="48dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="12dp"
android:overScrollMode="ifContentScrolls">
<io.legado.app.ui.widget.text.AutoCompleteTextView
android:id="@+id/edit_view"
<io.legado.app.ui.widget.text.TextInputLayout
android:id="@+id/text_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginLeft="20dp"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
android:layout_height="wrap_content">
</ScrollView>
<io.legado.app.ui.widget.text.AutoCompleteTextView
android:id="@+id/edit_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
</io.legado.app.ui.widget.text.TextInputLayout>
</androidx.core.widget.NestedScrollView>
Loading…
Cancel
Save