All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.peanuuutz.fork.ui.foundation.input.ContentDragMode.kt Maven / Gradle / Ivy

The newest version!
package net.peanuuutz.fork.ui.foundation.input

import androidx.compose.runtime.Immutable
import androidx.compose.runtime.Stable

@Immutable
class ContentDragMode(
    val movementModifier: Float = 1.0f,
    val velocityModifier: Float = 1.0f,
    val flingBehavior: FlingBehavior = FlingBehavior.Stop
) {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is ContentDragMode) return false
        if (movementModifier != other.movementModifier) return false
        if (velocityModifier != other.velocityModifier) return false
        if (flingBehavior != other.flingBehavior) return false
        return true
    }

    override fun hashCode(): Int {
        var result = movementModifier.hashCode()
        result = 31 * result + velocityModifier.hashCode()
        result = 31 * result + flingBehavior.hashCode()
        return result
    }

    override fun toString(): String {
        return "ContentDragMode(movementModifier=$movementModifier, " +
                "velocityModifier=$velocityModifier, " +
                "flingBehavior=$flingBehavior)"
    }

    companion object {
        @Stable
        val Default: ContentDragMode = ContentDragMode()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy