Skip to content

Commit

Permalink
SeekerDefaults: use kotlin-derived equals
Browse files Browse the repository at this point in the history
  • Loading branch information
Profpatsch committed Nov 29, 2024
1 parent 23f88e0 commit aa0242e
Showing 1 changed file with 0 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,30 +234,6 @@ internal class DefaultSeekerDimensions(
override fun thumbRadius(): State<Dp> {
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
Expand Down Expand Up @@ -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
}
}

0 comments on commit aa0242e

Please sign in to comment.