|
|
@ -65,18 +65,15 @@ class PageView(context: Context) : FrameLayout(context) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun getBitmap(): Bitmap? { |
|
|
|
fun getBitmap(): Bitmap? { |
|
|
|
synchronized(this) { |
|
|
|
|
|
|
|
return bitmap?.copy(Bitmap.Config.ARGB_8888, false) |
|
|
|
return bitmap?.copy(Bitmap.Config.ARGB_8888, false) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun upBitmap() { |
|
|
|
private fun upBitmap() { |
|
|
|
Coroutine.async { |
|
|
|
Coroutine.async { |
|
|
|
val screenshot = screenshot() |
|
|
|
screenshot() |
|
|
|
|
|
|
|
}.onSuccess { |
|
|
|
val tmp = bitmap |
|
|
|
val tmp = bitmap |
|
|
|
synchronized(this@PageView) { |
|
|
|
bitmap = it |
|
|
|
bitmap = screenshot |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
tmp?.recycle() |
|
|
|
tmp?.recycle() |
|
|
|
}.onError { |
|
|
|
}.onError { |
|
|
|
AppLog.put("更新PageView图片出错", it) |
|
|
|
AppLog.put("更新PageView图片出错", it) |
|
|
|