pub struct Clamping { /* private fields */ }Expand description
Android’s scroll feel — Flutter’s ClampingScrollPhysics: a drag never
leaves the range (the excess is rejected outright, for the surface to show
as a stretch or a glow instead), and a release runs Android’s own
SplineOverScroller deceleration to a hard stop.
See the module docs for why nothing here clamps that curve itself.
Implementations§
Trait Implementations§
Source§impl ScrollPhysics for Clamping
impl ScrollPhysics for Clamping
Source§fn apply_boundary_conditions(&self, metrics: &ScrollMetrics, value: f64) -> f64
fn apply_boundary_conditions(&self, metrics: &ScrollMetrics, value: f64) -> f64
The whole of any past-extent excess is rejected, so the position itself
never leaves [min, max]. The caller still learns how far the proposal
went — that rejected distance is what a stretch or glow effect reads
(this module’s parent’s design ruling).
Source§fn create_ballistic_simulation(
&self,
metrics: &ScrollMetrics,
velocity: f64,
) -> Option<Box<dyn Simulation>>
fn create_ballistic_simulation( &self, metrics: &ScrollMetrics, velocity: f64, ) -> Option<Box<dyn Simulation>>
Android’s fling curve for a release with room to travel, and — as a safety arm this physics’ own boundary rule makes unreachable — a spring back to the nearest extent for a position that starts out of range.
Source§fn parent(&self) -> Option<&dyn ScrollPhysics>
fn parent(&self) -> Option<&dyn ScrollPhysics>
chain(...).
None for a physics built standalone (the chain’s root).Source§fn apply_physics_to_user_offset(
&self,
metrics: &ScrollMetrics,
offset: f64,
) -> f64
fn apply_physics_to_user_offset( &self, metrics: &ScrollMetrics, offset: f64, ) -> f64
Source§fn should_accept_user_offset(&self, metrics: &ScrollMetrics) -> bool
fn should_accept_user_offset(&self, metrics: &ScrollMetrics) -> bool
Source§fn carried_momentum(&self, existing_velocity: f64) -> f64
fn carried_momentum(&self, existing_velocity: f64) -> f64
Source§fn min_fling_velocity(&self) -> f64
fn min_fling_velocity(&self) -> f64
Source§fn max_fling_velocity(&self) -> f64
fn max_fling_velocity(&self) -> f64
Source§fn tolerance_for(&self, metrics: &ScrollMetrics) -> Tolerance
fn tolerance_for(&self, metrics: &ScrollMetrics) -> Tolerance
Source§fn spring(&self) -> SpringDescription
fn spring(&self) -> SpringDescription
Auto Trait Implementations§
impl !RefUnwindSafe for Clamping
impl !Send for Clamping
impl !Sync for Clamping
impl !UnwindSafe for Clamping
impl Freeze for Clamping
impl Unpin for Clamping
impl UnsafeUnpin for Clamping
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.