mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
搜索结果界面:按返回键关闭搜索界面
This commit is contained in:
parent
b68cc7b4d9
commit
ab913a304c
@ -382,6 +382,12 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|||||||
binding.readView.pageDelegate?.keyTurnPage(PageDirection.NEXT)
|
binding.readView.pageDelegate?.keyTurnPage(PageDirection.NEXT)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
keyCode == KeyEvent.KEYCODE_BACK -> {
|
||||||
|
if (isShowingSearchResult) {
|
||||||
|
exitSearchMenu()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return super.onKeyDown(keyCode, event)
|
return super.onKeyDown(keyCode, event)
|
||||||
}
|
}
|
||||||
@ -807,6 +813,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|||||||
if (isShowingSearchResult) {
|
if (isShowingSearchResult) {
|
||||||
isShowingSearchResult = false
|
isShowingSearchResult = false
|
||||||
binding.searchMenu.invalidate()
|
binding.searchMenu.invalidate()
|
||||||
|
binding.searchMenu.invisible()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ class SearchMenu @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun bindEvent() = binding.run {
|
private fun bindEvent() = binding.run {
|
||||||
|
//搜索结果
|
||||||
llSearchResults.setOnClickListener {
|
llSearchResults.setOnClickListener {
|
||||||
runMenuOut {
|
runMenuOut {
|
||||||
callBack.openSearchActivity(selectedSearchResult?.query)
|
callBack.openSearchActivity(selectedSearchResult?.query)
|
||||||
@ -134,11 +134,10 @@ class SearchMenu @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//目录
|
//退出
|
||||||
llSearchExit.setOnClickListener {
|
llSearchExit.setOnClickListener {
|
||||||
runMenuOut {
|
runMenuOut {
|
||||||
callBack.exitSearchMenu()
|
callBack.exitSearchMenu()
|
||||||
this@SearchMenu.invisible()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user