pull/32/head
GKF 6 years ago
parent abe3f2b1a4
commit c0a1a56eec
  1. 2
      app/src/main/java/io/legado/app/base/BaseActivity.kt
  2. 2
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt
  3. 7
      app/src/main/java/io/legado/app/utils/ViewExtensions.kt

@ -11,6 +11,7 @@ import androidx.lifecycle.ViewModel
import io.legado.app.R import io.legado.app.R
import io.legado.app.lib.theme.ColorUtils import io.legado.app.lib.theme.ColorUtils
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
import io.legado.app.utils.disableAutoFill
import io.legado.app.utils.getCompatColor import io.legado.app.utils.getCompatColor
import io.legado.app.utils.getPrefBoolean import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.setIconColor import io.legado.app.utils.setIconColor
@ -23,6 +24,7 @@ abstract class BaseActivity<VM : ViewModel> : AppCompatActivity() {
protected abstract val layoutID: Int protected abstract val layoutID: Int
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
window.decorView.disableAutoFill()
initTheme() initTheme()
setupSystemBar() setupSystemBar()
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)

@ -17,6 +17,7 @@ import io.legado.app.base.BaseFragment
import io.legado.app.data.entities.Book import io.legado.app.data.entities.Book
import io.legado.app.data.entities.BookGroup import io.legado.app.data.entities.BookGroup
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
import io.legado.app.utils.disableAutoFill
import kotlinx.android.synthetic.main.fragment_bookshelf.* import kotlinx.android.synthetic.main.fragment_bookshelf.*
import kotlinx.android.synthetic.main.view_title_bar.* import kotlinx.android.synthetic.main.view_title_bar.*
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
@ -51,6 +52,7 @@ class BookshelfFragment : BaseFragment(R.layout.fragment_bookshelf) {
when (groupId) { when (groupId) {
-10 -> context?.let { -10 -> context?.let {
MaterialDialog(it).show { MaterialDialog(it).show {
window?.decorView?.disableAutoFill()
title(text = "新建分组") title(text = "新建分组")
input(hint = "分组名称") { _, charSequence -> input(hint = "分组名称") { _, charSequence ->
run { run {

@ -1,6 +1,7 @@
package io.legado.app.utils package io.legado.app.utils
import android.content.Context import android.content.Context
import android.os.Build
import android.view.View import android.view.View
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import io.legado.app.App import io.legado.app.App
@ -11,3 +12,9 @@ fun View.hidehideSoftInput() = run {
imm.hideSoftInputFromWindow(this.windowToken, 0) imm.hideSoftInputFromWindow(this.windowToken, 0)
} }
} }
fun View.disableAutoFill() = run {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
this.importantForAutofill = View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS
}
}
Loading…
Cancel
Save