Merge "Fixed warning: 'invalidate(Int, Int, Int, Int): Unit' is deprecated. Deprecated in Java" am: 8182984a50 am: e78953922e am: 39be74ae48 am: b0679736f5 am: 93c670e266

Original change: https://android-review.googlesource.com/c/platform/packages/apps/DeskClock/+/2157476

Change-Id: Ie992d25655980b95a556c21af9576dc9d980c12f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/src/com/android/deskclock/widget/CircleView.kt b/src/com/android/deskclock/widget/CircleView.kt
index 062a284..e6239fc 100644
--- a/src/com/android/deskclock/widget/CircleView.kt
+++ b/src/com/android/deskclock/widget/CircleView.kt
@@ -132,7 +132,7 @@
             mCirclePaint.color = color
 
             // invalidate the current area
-            invalidate(mCenterX, mCenterY, radius)
+            invalidate()
         }
         return this
     }
@@ -150,8 +150,7 @@
             mCenterX = centerX
 
             // invalidate the old/new areas
-            invalidate(oldCenterX, mCenterY, radius)
-            invalidate(centerX, mCenterY, radius)
+            invalidate()
         }
 
         // clear the horizontal gravity flags
@@ -173,8 +172,7 @@
             mCenterY = centerY
 
             // invalidate the old/new areas
-            invalidate(mCenterX, oldCenterY, radius)
-            invalidate(mCenterX, centerY, radius)
+            invalidate()
         }
 
         // clear the vertical gravity flags
@@ -196,10 +194,7 @@
             this.radius = radius
 
             // invalidate the old/new areas
-            invalidate(mCenterX, mCenterY, oldRadius)
-            if (radius > oldRadius) {
-                invalidate(mCenterX, mCenterY, radius)
-            }
+            invalidate()
         }
 
         // clear the fill gravity flags
@@ -214,15 +209,6 @@
     }
 
     /**
-     * Invalidates the rectangular area that circumscribes the circle defined by `centerX`,
-     * `centerY`, and `radius`.
-     */
-    private fun invalidate(centerX: Float, centerY: Float, radius: Float) {
-        invalidate((centerX - radius - 0.5f).toInt(), (centerY - radius - 0.5f).toInt(),
-                (centerX + radius + 0.5f).toInt(), (centerY + radius + 0.5f).toInt())
-    }
-
-    /**
      * Applies the specified `gravity` and `layoutDirection`, adjusting the alignment
      * and size of the circle depending on the resolved [Gravity] flags. Also invalidates the
      * affected area if necessary.
@@ -257,8 +243,7 @@
         }
 
         if (oldCenterX != mCenterX || oldCenterY != mCenterY || oldRadius != radius) {
-            invalidate(oldCenterX, oldCenterY, oldRadius)
-            invalidate(mCenterX, mCenterY, radius)
+            invalidate()
         }
     }