|
|
@ -126,13 +126,17 @@ fun View.visible(visible: Boolean) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun View.screenshot(): Bitmap { |
|
|
|
fun View.screenshot(): Bitmap? { |
|
|
|
val screenshot = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) |
|
|
|
return if (width > 0 && height > 0) { |
|
|
|
val c = Canvas(screenshot) |
|
|
|
val screenshot = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) |
|
|
|
c.translate(-scrollX.toFloat(), -scrollY.toFloat()) |
|
|
|
val c = Canvas(screenshot) |
|
|
|
this.draw(c) |
|
|
|
c.translate(-scrollX.toFloat(), -scrollY.toFloat()) |
|
|
|
c.setBitmap(null) |
|
|
|
this.draw(c) |
|
|
|
return screenshot |
|
|
|
c.setBitmap(null) |
|
|
|
|
|
|
|
screenshot |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
null |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun SeekBar.progressAdd(int: Int) { |
|
|
|
fun SeekBar.progressAdd(int: Int) { |
|
|
|