ClickableSurfaceShape.kt 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) Milan Jurkulák 2024.
  3. * Contact:
  4. * e: mimoccc@gmail.com
  5. * e: mj@mjdev.org
  6. * w: https://mjdev.org
  7. */
  8. package eu.mjdev.desktop.components.surface.base
  9. import androidx.compose.runtime.Immutable
  10. import androidx.compose.ui.graphics.Shape
  11. @Immutable
  12. class ClickableSurfaceShape
  13. internal constructor(
  14. internal val shape: Shape,
  15. internal val focusedShape: Shape,
  16. internal val pressedShape: Shape,
  17. internal val disabledShape: Shape,
  18. internal val focusedDisabledShape: Shape
  19. ) {
  20. override fun equals(other: Any?): Boolean {
  21. if (this === other) return true
  22. if (other == null || this::class != other::class) return false
  23. other as ClickableSurfaceShape
  24. if (shape != other.shape) return false
  25. if (focusedShape != other.focusedShape) return false
  26. if (pressedShape != other.pressedShape) return false
  27. if (disabledShape != other.disabledShape) return false
  28. if (focusedDisabledShape != other.focusedDisabledShape) return false
  29. return true
  30. }
  31. override fun hashCode(): Int {
  32. var result = shape.hashCode()
  33. result = 31 * result + focusedShape.hashCode()
  34. result = 31 * result + pressedShape.hashCode()
  35. result = 31 * result + disabledShape.hashCode()
  36. result = 31 * result + focusedDisabledShape.hashCode()
  37. return result
  38. }
  39. override fun toString(): String {
  40. return "ClickableSurfaceShape(shape=$shape, focusedShape=$focusedShape, " +
  41. "pressedShape=$pressedShape, disabledShape=$disabledShape, " +
  42. "focusedDisabledShape=$focusedDisabledShape)"
  43. }
  44. }