pub struct FractionalOffsetElement { /* private fields */ }Expand description
Element that offsets its content by a fraction of its own measured size.
There is no direct Jetpack Compose modifier equivalent; Compose’s slide
transitions receive the measured size through a lambda instead. This
element backs slide_in_vertically / slide_out_vertically in
AnimatedVisibility, where the offset is expressed as a fraction of the
content height.
Implementations§
Trait Implementations§
Source§impl Clone for FractionalOffsetElement
impl Clone for FractionalOffsetElement
impl Copy for FractionalOffsetElement
Source§impl Debug for FractionalOffsetElement
impl Debug for FractionalOffsetElement
Source§impl PartialEq for FractionalOffsetElement
impl PartialEq for FractionalOffsetElement
Source§impl PlainElement for FractionalOffsetElement
impl PlainElement for FractionalOffsetElement
Source§const WORDS: usize = 2
const WORDS: usize = 2
How many words the value takes: at most
PLAIN_WORDS_MAX.Source§const CAPABILITIES: NodeCapabilities = NodeCapabilities::LAYOUT
const CAPABILITIES: NodeCapabilities = NodeCapabilities::LAYOUT
What the element takes part in: layout, draw or both.
Source§const UPDATE_INVALIDATION: Option<InvalidationKind>
const UPDATE_INVALIDATION: Option<InvalidationKind>
The one pipeline stage a changed value invalidates, or
None to
invalidate every stage of Self::CAPABILITIES.Source§const LAYOUT: Option<&'static PlainLayoutFns>
const LAYOUT: Option<&'static PlainLayoutFns>
How the element measures the content it wraps, for an element with
NodeCapabilities::LAYOUT: Some(&PlainLayoutFns::of::<Self>())
for a PlainLayout. None, the default, passes the content’s
measure through.Source§fn to_words(&self, words: &mut [u32])
fn to_words(&self, words: &mut [u32])
Writes the value into
words, which holds Self::WORDS words.Source§fn from_words(words: &[u32]) -> Self
fn from_words(words: &[u32]) -> Self
The value that
Self::to_words wrote into words.Source§fn inspector_name(&self) -> &'static str
fn inspector_name(&self) -> &'static str
Human readable name surfaced to inspector tooling.
Source§impl PlainLayout for FractionalOffsetElement
impl PlainLayout for FractionalOffsetElement
Source§fn measure_hold(
&self,
_density: f32,
_constraints: Constraints,
_size: Size,
wrapped: WrappedHold,
) -> Option<ConstraintsHold>
fn measure_hold( &self, _density: f32, _constraints: Constraints, _size: Size, wrapped: WrappedHold, ) -> Option<ConstraintsHold>
The incoming constraints the last measure, which gave
size under
constraints, holds for; see
super::super::LayoutModifierNode::measure_hold.Source§fn measure(
&self,
_context: &mut dyn ModifierNodeContext,
measurable: &dyn Measurable,
constraints: Constraints,
) -> LayoutModifierMeasureResult
fn measure( &self, _context: &mut dyn ModifierNodeContext, measurable: &dyn Measurable, constraints: Constraints, ) -> LayoutModifierMeasureResult
Measures the wrapped content under
constraints and returns the size
the element takes and where it places the content.Source§fn prepared(self, _at: PrepareAt) -> Self
fn prepared(self, _at: PrepareAt) -> Self
The element as a coordinator keeps it for the measures
at tells:
an element that rounds its values to device pixels, or mirrors them
for a layout direction, may do so here once, and measure from those
values. The default is the element itself.Source§const PREPARES: bool = false
const PREPARES: bool = false
Whether
Self::prepared changes the element: false, the
default, lets a coordinator copy the words as they are.Source§fn intrinsic(
&self,
measurable: &dyn Measurable,
kind: PlainIntrinsic,
_density: f32,
) -> f32
fn intrinsic( &self, measurable: &dyn Measurable, kind: PlainIntrinsic, _density: f32, ) -> f32
The intrinsic size
kind names: the wrapped content’s by default,
for an element that keeps the content’s size.impl StructuralPartialEq for FractionalOffsetElement
Auto Trait Implementations§
impl Forget for FractionalOffsetElement
impl Freeze for FractionalOffsetElement
impl Move for FractionalOffsetElement
impl RefUnwindSafe for FractionalOffsetElement
impl Send for FractionalOffsetElement
impl Sync for FractionalOffsetElement
impl Unpin for FractionalOffsetElement
impl UnsafeUnpin for FractionalOffsetElement
impl UnwindSafe for FractionalOffsetElement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more