优化
This commit is contained in:
@@ -85,7 +85,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
|
|||||||
|
|
||||||
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
||||||
super.onSizeChanged(w, h, oldw, oldh)
|
super.onSizeChanged(w, h, oldw, oldh)
|
||||||
ChapterProvider.upViewSize(w, h, isMainView)
|
ChapterProvider.upViewSize(w, h)
|
||||||
textPage.format()
|
textPage.format()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -850,12 +850,12 @@ object ChapterProvider {
|
|||||||
/**
|
/**
|
||||||
* 更新View尺寸
|
* 更新View尺寸
|
||||||
*/
|
*/
|
||||||
fun upViewSize(width: Int, height: Int, postEvent: Boolean) {
|
fun upViewSize(width: Int, height: Int) {
|
||||||
if (width > 0 && height > 0 && (width != viewWidth || height != viewHeight)) {
|
if (width > 0 && height > 0 && (width != viewWidth || height != viewHeight)) {
|
||||||
viewWidth = width
|
viewWidth = width
|
||||||
viewHeight = height
|
viewHeight = height
|
||||||
upLayout()
|
upLayout()
|
||||||
if (postEvent) postEvent(EventBus.UP_CONFIG, arrayOf(2))
|
postEvent(EventBus.UP_CONFIG, arrayOf(5))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user