pull/32/head
kunfei 5 years ago
parent c8b475bfa8
commit 479859d730
  1. 10
      app/src/main/java/io/legado/app/base/BaseActivity.kt
  2. 6
      app/src/main/java/io/legado/app/ui/sourcedebug/SourceDebugActivity.kt
  3. 2
      app/src/main/java/io/legado/app/utils/ViewExtensions.kt

@ -11,10 +11,7 @@ import androidx.lifecycle.ViewModel
import io.legado.app.R
import io.legado.app.lib.theme.ColorUtils
import io.legado.app.lib.theme.ThemeStore
import io.legado.app.utils.disableAutoFill
import io.legado.app.utils.getCompatColor
import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.setIconColor
import io.legado.app.utils.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.cancel
@ -97,4 +94,9 @@ abstract class BaseActivity<VM : ViewModel>(private val fullScreen: Boolean = tr
open fun observeLiveBus() {
}
override fun finish() {
currentFocus?.hideSoftInput()
super.finish()
}
}

@ -69,6 +69,7 @@ class SourceDebugActivity : BaseActivity<AndroidViewModel>(), SourceDebug.Callba
adapter.logList.clear()
adapter.notifyDataSetChanged()
bookSource?.let {
SourceDebug.debugSource = it.bookSourceUrl
rotate_loading.visibility = View.VISIBLE
if (key.isAbsUrl()) {
val book = Book()
@ -89,4 +90,9 @@ class SourceDebugActivity : BaseActivity<AndroidViewModel>(), SourceDebug.Callba
rotate_loading.visibility = View.GONE
}
}
override fun onDestroy() {
SourceDebug.debugSource = null
super.onDestroy()
}
}

@ -6,7 +6,7 @@ import android.view.View
import android.view.inputmethod.InputMethodManager
import io.legado.app.App
fun View.hidehideSoftInput() = run {
fun View.hideSoftInput() = run {
val imm = App.INSTANCE.getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager
imm?.let {
imm.hideSoftInputFromWindow(this.windowToken, 0)

Loading…
Cancel
Save