diff options
Diffstat (limited to 'graphics/java/android/graphics/drawable/shapes/ArcShape.java')
-rw-r--r-- | graphics/java/android/graphics/drawable/shapes/ArcShape.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/drawable/shapes/ArcShape.java b/graphics/java/android/graphics/drawable/shapes/ArcShape.java index 85ba0a9e9f6f..90d07bce2617 100644 --- a/graphics/java/android/graphics/drawable/shapes/ArcShape.java +++ b/graphics/java/android/graphics/drawable/shapes/ArcShape.java @@ -20,6 +20,8 @@ import android.graphics.Canvas; import android.graphics.Outline; import android.graphics.Paint; +import java.util.Objects; + /** * Creates an arc shape. The arc shape starts at a specified angle and sweeps * clockwise, drawing slices of pie. @@ -74,5 +76,26 @@ public class ArcShape extends RectShape { public ArcShape clone() throws CloneNotSupportedException { return (ArcShape) super.clone(); } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + ArcShape arcShape = (ArcShape) o; + return Float.compare(arcShape.mStartAngle, mStartAngle) == 0 + && Float.compare(arcShape.mSweepAngle, mSweepAngle) == 0; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), mStartAngle, mSweepAngle); + } } |