Skip to content

Commit

Permalink
Convert NeonIndication to data class.
Browse files Browse the repository at this point in the history
  • Loading branch information
arriolac committed Jan 24, 2024
1 parent d71778c commit 5022b95
Showing 1 changed file with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ private class NeonNode(
// [END android_compose_interactions_neon_node]

// [START android_compose_interactions_neon_indication]
class NeonIndication(private val shape: Shape, private val borderWidth: Dp) : IndicationNodeFactory {
data class NeonIndication(private val shape: Shape, private val borderWidth: Dp) : IndicationNodeFactory {

override fun create(interactionSource: InteractionSource): DelegatableNode {
return NeonNode(
Expand All @@ -639,23 +639,5 @@ class NeonIndication(private val shape: Shape, private val borderWidth: Dp) : In
interactionSource
)
}

override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false

other as NeonIndication

if (shape != other.shape) return false
if (borderWidth != other.borderWidth) return false

return true
}

override fun hashCode(): Int {
var result = shape.hashCode()
result = 31 * result + borderWidth.hashCode()
return result
}
}
// [END android_compose_interactions_neon_indication]

0 comments on commit 5022b95

Please sign in to comment.