Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert NeonIndication to data class #193

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
Loading