Merge pull request #1572 from Xwite/master

搜索结果界面:按返回键关闭搜索界面
pull/1578/head
kunfei 3 years ago committed by GitHub
commit 1192654d43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 5
      app/src/main/java/io/legado/app/ui/book/read/SearchMenu.kt

@ -382,6 +382,12 @@ class ReadBookActivity : BaseReadBookActivity(),
binding.readView.pageDelegate?.keyTurnPage(PageDirection.NEXT)
return true
}
keyCode == KeyEvent.KEYCODE_BACK -> {
if (isShowingSearchResult) {
exitSearchMenu()
return true
}
}
}
return super.onKeyDown(keyCode, event)
}
@ -807,6 +813,7 @@ class ReadBookActivity : BaseReadBookActivity(),
if (isShowingSearchResult) {
isShowingSearchResult = false
binding.searchMenu.invalidate()
binding.searchMenu.invisible()
}
}

@ -119,7 +119,7 @@ class SearchMenu @JvmOverloads constructor(
}
private fun bindEvent() = binding.run {
//搜索结果
llSearchResults.setOnClickListener {
runMenuOut {
callBack.openSearchActivity(selectedSearchResult?.query)
@ -134,11 +134,10 @@ class SearchMenu @JvmOverloads constructor(
}
}
//目录
//退出
llSearchExit.setOnClickListener {
runMenuOut {
callBack.exitSearchMenu()
this@SearchMenu.invisible()
}
}

Loading…
Cancel
Save