![JAR search and dependency download from the Maven repository](/logo.png)
net.peanuuutz.fork.ui.foundation.input.ContentScrollMode.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fork-ui Show documentation
Show all versions of fork-ui Show documentation
Comprehensive API designed for Minecraft modders
The newest version!
package net.peanuuutz.fork.ui.foundation.input
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.Stable
import net.peanuuutz.fork.ui.animation.spec.decay.DefaultFloatDecayAnimationSpec
import net.peanuuutz.fork.ui.animation.spec.decay.composite.DecayAnimationSpec
@Immutable
sealed class ContentScrollMode {
@Immutable
class Smooth(
val velocityModifier: Float = 200.0f,
val velocityDecayAnimationSpec: DecayAnimationSpec = DefaultFloatDecayAnimationSpec
) : ContentScrollMode() {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is Smooth) return false
if (velocityModifier != other.velocityModifier) return false
if (velocityDecayAnimationSpec != other.velocityDecayAnimationSpec) return false
return true
}
override fun hashCode(): Int {
var result = velocityModifier.hashCode()
result = 31 * result + velocityDecayAnimationSpec.hashCode()
return result
}
override fun toString(): String {
return "ContentScrollMode.Smooth(velocityModifier=$velocityModifier, " +
"velocityDecayAnimationSpec=$velocityDecayAnimationSpec)"
}
}
@Immutable
class Snap(
val amountModifier: Float = 10.0f
) : ContentScrollMode() {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is Snap) return false
if (amountModifier != other.amountModifier) return false
return true
}
override fun hashCode(): Int {
return amountModifier.hashCode()
}
override fun toString(): String {
return "ContentScrollMode.Snap(amountModifier=$amountModifier)"
}
}
companion object {
@Stable
val Default: ContentScrollMode = Smooth()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy