优化导航栏

pull/487/head^2
gedoor 4 years ago
parent c558d64f3a
commit 926f7dfedb
  1. 5
      app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt
  2. 4
      app/src/main/java/io/legado/app/utils/ActivityExtensions.kt

@ -51,6 +51,11 @@ class ContentView(context: Context) : FrameLayout(context) {
}
}
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
super.onSizeChanged(w, h, oldw, oldh)
upStyle()
}
fun upStyle() {
ReadBookConfig.apply {
bv_header_left.typeface = ChapterProvider.typeface

@ -22,6 +22,10 @@ fun Activity.getSize(): DisplayMetrics {
return displayMetrics
}
/**
* 该方法需要在View完全被绘制出来之后调用否则判断不了
* 在比如 onWindowFocusChanged方法中可以得到正确的结果
*/
val Activity.navigationBarHeight: Int
get() {
if (SystemUtils.isNavigationBarExist(this)) {

Loading…
Cancel
Save