pub struct ThumbLength { /* private fields */ }Expand description
The thumb’s length, and the fact that Wear only measures it once.
ScalingLazyColumnStateAdapter holds currentSizeFraction and recomputes
it only when totalItemsCount changes, guarded by previousItemsCount.
That is not a cache in the sense of an optimisation, it is the behaviour:
the thumb keeps the length it was given by the list’s first layout and does
not breathe as rows of different heights scroll past. Recomputing it every
frame gives a thumb that grows and shrinks while you turn the crown, which
the shipping build does not do.
One of these belongs to one list. Give a screen its own, and drop it (or
call ThumbLength::forget) when the screen goes away, the way Wear drops
the adapter with the ScreenScaffold that made it.
Implementations§
Source§impl ThumbLength
impl ThumbLength
Trait Implementations§
Source§impl Clone for ThumbLength
impl Clone for ThumbLength
Source§fn clone(&self) -> ThumbLength
fn clone(&self) -> ThumbLength
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ThumbLength
Source§impl Debug for ThumbLength
impl Debug for ThumbLength
Source§impl Default for ThumbLength
impl Default for ThumbLength
Source§fn default() -> ThumbLength
fn default() -> ThumbLength
Returns the “default value” for a type. Read more
Source§impl PartialEq for ThumbLength
impl PartialEq for ThumbLength
impl StructuralPartialEq for ThumbLength
Auto Trait Implementations§
impl Freeze for ThumbLength
impl RefUnwindSafe for ThumbLength
impl Send for ThumbLength
impl Sync for ThumbLength
impl Unpin for ThumbLength
impl UnsafeUnpin for ThumbLength
impl UnwindSafe for ThumbLength
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
Mutably borrows from an owned value. Read more