mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -65,6 +65,7 @@ class BookSourceEditActivity :
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
softKeyboardTool.attachToWindow(window)
|
||||
initView()
|
||||
viewModel.initData(intent) {
|
||||
upRecyclerView()
|
||||
@@ -135,7 +136,6 @@ class BookSourceEditActivity :
|
||||
|
||||
private fun initView() {
|
||||
binding.recyclerView.setEdgeEffectColor(primaryColor)
|
||||
window.decorView.viewTreeObserver.addOnGlobalLayoutListener(softKeyboardTool)
|
||||
binding.recyclerView.layoutManager = LinearLayoutManager(this)
|
||||
binding.recyclerView.adapter = adapter
|
||||
binding.tabLayout.setBackgroundColor(backgroundColor)
|
||||
|
||||
@@ -52,7 +52,7 @@ class ReplaceEditActivity :
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
window.decorView.viewTreeObserver.addOnGlobalLayoutListener(softKeyboardTool)
|
||||
softKeyboardTool.attachToWindow(window)
|
||||
viewModel.initData(intent) {
|
||||
upReplaceView(it)
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ class RssSourceEditActivity :
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
softKeyboardTool.attachToWindow(window)
|
||||
initView()
|
||||
viewModel.initData(intent) {
|
||||
upRecyclerView()
|
||||
@@ -136,7 +137,6 @@ class RssSourceEditActivity :
|
||||
|
||||
private fun initView() {
|
||||
binding.recyclerView.setEdgeEffectColor(primaryColor)
|
||||
window.decorView.viewTreeObserver.addOnGlobalLayoutListener(softKeyboardTool)
|
||||
binding.recyclerView.adapter = adapter
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,10 @@ class KeyboardToolPop(
|
||||
upAdapterData()
|
||||
}
|
||||
|
||||
fun attachToWindow(window: Window) {
|
||||
window.decorView.viewTreeObserver.addOnGlobalLayoutListener(this)
|
||||
}
|
||||
|
||||
override fun onGlobalLayout() {
|
||||
val rect = Rect()
|
||||
// 获取当前页面窗口的显示范围
|
||||
|
||||
Reference in New Issue
Block a user