pub struct FillElement { /* private fields */ }Expand description
Element that fills a fraction of the room on an axis: a plain element, which a chain keeps as words.
Matches Kotlin: FillElement in foundation-layout/src/commonMain/kotlin/androidx/compose/foundation/layout/Size.kt
Implementations§
Source§impl FillElement
impl FillElement
Sourcepub fn width(fraction: f32) -> Self
pub fn width(fraction: f32) -> Self
Creates an element that fills fraction of the available width.
Sourcepub fn height(fraction: f32) -> Self
pub fn height(fraction: f32) -> Self
Creates an element that fills fraction of the available height.
Sourcepub fn size(fraction: f32) -> Self
pub fn size(fraction: f32) -> Self
Creates an element that fills fraction of the available width and height.
Sourcepub fn direction(&self) -> FillDirection
pub fn direction(&self) -> FillDirection
Returns the axis or axes the element fills.
Trait Implementations§
Source§impl Clone for FillElement
impl Clone for FillElement
Source§impl Debug for FillElement
impl Debug for FillElement
Source§impl PartialEq for FillElement
impl PartialEq for FillElement
Source§impl PlainElement for FillElement
impl PlainElement for FillElement
Source§const WORDS: usize = 2
const WORDS: usize = 2
How many words the value takes: at most
PLAIN_WORDS_MAX.Source§const CAPABILITIES: NodeCapabilities
const CAPABILITIES: NodeCapabilities
What the element takes part in: layout, draw or both.
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§const UPDATE_INVALIDATION: Option<InvalidationKind> = None
const UPDATE_INVALIDATION: Option<InvalidationKind> = None
The one pipeline stage a changed value invalidates, or
None to
invalidate every stage of Self::CAPABILITIES.Source§fn inspector_name(&self) -> &'static str
fn inspector_name(&self) -> &'static str
Human readable name surfaced to inspector tooling.
Source§impl PlainLayout for FillElement
impl PlainLayout for FillElement
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 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.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.impl StructuralPartialEq for FillElement
Auto Trait Implementations§
impl Forget for FillElement
impl Freeze for FillElement
impl Move for FillElement
impl RefUnwindSafe for FillElement
impl Send for FillElement
impl Sync for FillElement
impl Unpin for FillElement
impl UnsafeUnpin for FillElement
impl UnwindSafe for FillElement
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