summaryrefslogtreecommitdiff
path: root/emulator
diff options
context:
space:
mode:
authorSergey Prigogin <sprigogin@google.com>2022-02-09 09:47:40 -0800
committerSergey Prigogin <sprigogin@google.com>2022-02-09 19:05:37 +0000
commitaec42b53e7b1906295fe33bcbe190f0dad215f62 (patch)
tree0058e6d6466c38be09d973eb2720fcf7b6908c7b /emulator
parentb88ca86a8bf430b55bb79dee144533480fa8d3f6 (diff)
downloadidea-aec42b53e7b1906295fe33bcbe190f0dad215f62.tar.gz
Minor code cleanup
Test: existing Bug: N/A Change-Id: I1a891898648117ee361677c0be585752d919c8ed
Diffstat (limited to 'emulator')
-rw-r--r--emulator/src/com/android/tools/idea/emulator/SkinDefinition.kt20
1 files changed, 8 insertions, 12 deletions
diff --git a/emulator/src/com/android/tools/idea/emulator/SkinDefinition.kt b/emulator/src/com/android/tools/idea/emulator/SkinDefinition.kt
index 9cf69b35370..405538d30a7 100644
--- a/emulator/src/com/android/tools/idea/emulator/SkinDefinition.kt
+++ b/emulator/src/com/android/tools/idea/emulator/SkinDefinition.kt
@@ -235,9 +235,8 @@ class SkinDefinition private constructor(val layout: SkinLayout) {
}
@JvmStatic
- private fun isTransparentNearCenterOfDisplay(image: BufferedImage, displaySize: Dimension, frameRectangle: Rectangle): Boolean {
- return isTransparentPixel(image, displaySize.width / 2 - frameRectangle.x, displaySize.height / 2 - frameRectangle.y)
- }
+ private fun isTransparentNearCenterOfDisplay(image: BufferedImage, displaySize: Dimension, frameRectangle: Rectangle): Boolean =
+ isTransparentPixel(image, displaySize.width / 2 - frameRectangle.x, displaySize.height / 2 - frameRectangle.y)
/**
* Crops the background image and breaks it into 8 pieces, 4 for sides and 4 for corners of the frame.
@@ -387,9 +386,8 @@ class SkinDefinition private constructor(val layout: SkinLayout) {
}
@JvmStatic
- private fun isTransparentPixel(image: BufferedImage, x: Int, y: Int): Boolean {
- return image.getRGB(x, y) and ALPHA_MASK == 0
- }
+ private fun isTransparentPixel(image: BufferedImage, x: Int, y: Int): Boolean =
+ image.getRGB(x, y) and ALPHA_MASK == 0
@JvmStatic
private fun createAnchoredImage(mask: BufferedImage, cropBounds: Rectangle, displaySize: Dimension): AnchoredImage {
@@ -430,14 +428,12 @@ class SkinDefinition private constructor(val layout: SkinLayout) {
}
@JvmStatic
- private fun BufferedImage.cropped(cropBounds: Rectangle): BufferedImage {
- return getCroppedImage(this, cropBounds, -1)
- }
+ private fun BufferedImage.cropped(cropBounds: Rectangle): BufferedImage =
+ getCroppedImage(this, cropBounds, -1)
@JvmStatic
- private fun getCropBounds(image: BufferedImage, initialCrop: Rectangle?): Rectangle? {
- return getCropBounds(image, TRANSPARENCY_FILTER, initialCrop)
- }
+ private fun getCropBounds(image: BufferedImage, initialCrop: Rectangle?): Rectangle? =
+ getCropBounds(image, TRANSPARENCY_FILTER, initialCrop)
@JvmStatic
private val Rectangle.right