From aa0242e7f81c2a86a1a056a90b451a00eb18fc8a Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Fri, 29 Nov 2024 15:16:17 +0100 Subject: [PATCH] SeekerDefaults: use kotlin-derived equals --- .../newplayer/ui/seeker/SeekerDefaults.kt | 54 ------------------- 1 file changed, 54 deletions(-) diff --git a/new-player/src/main/java/net/newpipe/newplayer/ui/seeker/SeekerDefaults.kt b/new-player/src/main/java/net/newpipe/newplayer/ui/seeker/SeekerDefaults.kt index 4feac15..0371e23 100644 --- a/new-player/src/main/java/net/newpipe/newplayer/ui/seeker/SeekerDefaults.kt +++ b/new-player/src/main/java/net/newpipe/newplayer/ui/seeker/SeekerDefaults.kt @@ -234,30 +234,6 @@ internal class DefaultSeekerDimensions( override fun thumbRadius(): State { return rememberUpdatedState(thumbRadius) } - - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other == null || this::class != other::class) return false - - other as DefaultSeekerDimensions - - if (trackHeight != other.trackHeight) return false - if (progressHeight != other.progressHeight) return false - if (gap != other.gap) return false - if (thumbRadius != other.thumbRadius) return false - - return true - } - - override fun hashCode(): Int { - var result = trackHeight.hashCode() - - result = 31 * result + progressHeight.hashCode() - result = 31 * result + gap.hashCode() - result = 31 * result + thumbRadius.hashCode() - - return result - } } @Immutable @@ -299,34 +275,4 @@ internal class DefaultSeekerColor( readAheadColor ) } - - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other == null || this::class != other::class) return false - - other as DefaultSeekerColor - - if (progressColor != other.progressColor) return false - if (trackColor != other.trackColor) return false - if (disabledTrackColor != other.disabledTrackColor) return false - if (disabledProgressColor != other.disabledProgressColor) return false - if (thumbColor != other.thumbColor) return false - if (disabledThumbColor != other.disabledThumbColor) return false - if (readAheadColor != other.readAheadColor) return false - - return true - } - - override fun hashCode(): Int { - var result = progressColor.hashCode() - - result = 31 * result + trackColor.hashCode() - result = 31 * result + disabledTrackColor.hashCode() - result = 31 * result + disabledProgressColor.hashCode() - result = 31 * result + thumbColor.hashCode() - result = 31 * result + disabledThumbColor.hashCode() - result = 31 * result + readAheadColor.hashCode() - - return result - } } \ No newline at end of file