pull/83/head
kunfei 5 years ago
parent 5407cd5f3b
commit 09bbad40ed
  1. 4
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt
  2. 4
      app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt
  3. 3
      app/src/main/java/io/legado/app/utils/FileUtils.kt

@ -98,8 +98,8 @@ class BookInfoActivity :
return super.onCompatOptionsItemSelected(item)
}
override fun onMenuOpened(featureId: Int, menu: Menu?): Boolean {
menu?.findItem(R.id.menu_can_update)?.isChecked =
override fun onMenuOpened(featureId: Int, menu: Menu): Boolean {
menu.findItem(R.id.menu_can_update)?.isChecked =
viewModel.bookData.value?.canUpdate ?: true
return super.onMenuOpened(featureId, menu)
}

@ -76,7 +76,7 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_book_se
!getPrefBoolean(PreferKey.precisionSearch)
)
precisionSearchMenuItem?.isChecked = getPrefBoolean(PreferKey.precisionSearch)
search_view.query.toString().trim()?.let {
search_view.query?.toString()?.trim()?.let {
search_view.setQuery(it, true)
}
}
@ -88,7 +88,7 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_book_se
} else {
putPrefString("searchGroup", item.title.toString())
}
search_view.query.toString().trim()?.let {
search_view.query?.toString()?.trim()?.let {
search_view.setQuery(it, true)
}
}

@ -86,6 +86,7 @@ object FileUtils {
val type = split[0]
if ("primary".equals(type, ignoreCase = true)) {
@Suppress("DEPRECATION")
return Environment.getExternalStorageDirectory().toString() + "/" + split[1]
}
@ -135,7 +136,7 @@ object FileUtils {
private fun getDataColumn(
context: Context, uri: Uri, selection: String?,
selectionArgs: kotlin.Array<String>?
selectionArgs: Array<String>?
): String? {
val column = "_data"

Loading…
Cancel
Save