pub struct ClampingScrollSimulation { /* private fields */ }Expand description
Android’s fling curve — the SplineOverScroller deceleration a
clamping scroll surface runs after a release, which decays to a hard stop
at a known duration and distance rather than an asymptote.
Implementations§
Source§impl ClampingScrollSimulation
impl ClampingScrollSimulation
Sourcepub const DEFAULT_FRICTION: f64 = 0.015
pub const DEFAULT_FRICTION: f64 = 0.015
Android ViewConfiguration’s default scroll friction.
Sourcepub const INFLEXION: f64 = 0.35
pub const INFLEXION: f64 = 0.35
Android SplineOverScroller.INFLEXION, where the fling spline’s two
tension segments cross, and the velocity scale in the deceleration term
below.
Sourcepub const PHYSICAL_COEFF: f64
pub const PHYSICAL_COEFF: f64
Android’s mPhysicalCoeff: gravity (m/s²) × inches per meter × dpi ×
an empirical tuning factor. The dpi term is fixed at 160 — one Android
density-independent pixel, which is what this crate’s logical pixel is.
Sourcepub fn deceleration_rate() -> f64
pub fn deceleration_rate() -> f64
Android’s SplineOverScroller.DECELERATION_RATE (≈ 2.358202).
Computed from Android’s own expression rather than transcribed as a
decimal; a function rather than a const because f64::ln is not
const.