pub struct ScrollAxisRange {
pub value: f32,
pub max_value: f32,
pub reverse: bool,
pub content_padding_start: f32,
pub content_padding_end: f32,
pub bring_into_view_spec: BringIntoViewSpec,
}Expand description
How far a container has scrolled along one axis and how far it can go.
This is Compose’s ScrollAxisRange (verticalScrollAxisRange,
horizontalScrollAxisRange). A lazy list has no whole extent to give, so
it reports the first visible item as the value and one more than that as
the end while it can still scroll; a reader only needs to know whether it
can page on.
content_padding_start and content_padding_end are the container’s
content padding at its top and bottom (or left and right) edges, in layout
pixels. Content scrolls under that padding, where a bar may cover it, so a
control a reader or the keyboard moves to is brought in past it.
bring_into_view_spec says where in the space between the paddings that
control comes to rest.
Fields§
§value: f32The current scroll position, in layout pixels. A lazy list reports the index of its first visible item.
max_value: f32The largest value that value reaches, in the same unit.
reverse: boolWhether the container scrolls in reverse, so content starts at the far end. Compose’s
reverseScrolling.
content_padding_start: f32The content padding at the start edge of the container, in layout pixels.
content_padding_end: f32The content padding at the end edge of the container, in layout pixels.
bring_into_view_spec: BringIntoViewSpecWhere the container puts a child that takes focus or that a reader moves to.
Implementations§
Source§impl ScrollAxisRange
impl ScrollAxisRange
Sourcepub fn new(value: f32, max_value: f32, reverse: bool) -> ScrollAxisRange
pub fn new(value: f32, max_value: f32, reverse: bool) -> ScrollAxisRange
Creates a range for a container at scroll offset value that reaches at most max_value,
with no content padding and the default BringIntoViewSpec.
Sourcepub fn with_content_padding(self, start: f32, end: f32) -> ScrollAxisRange
pub fn with_content_padding(self, start: f32, end: f32) -> ScrollAxisRange
The same range with the container’s content padding at its start and end edges, in layout pixels.
Sourcepub fn with_bring_into_view_spec(
self,
bring_into_view_spec: BringIntoViewSpec,
) -> ScrollAxisRange
pub fn with_bring_into_view_spec( self, bring_into_view_spec: BringIntoViewSpec, ) -> ScrollAxisRange
The same range with the container’s BringIntoViewSpec.
Sourcepub fn can_scroll_forward(&self) -> bool
pub fn can_scroll_forward(&self) -> bool
Whether the container can scroll further in the forward direction.
Sourcepub fn can_scroll_backward(&self) -> bool
pub fn can_scroll_backward(&self) -> bool
Whether the container can scroll further in the backward direction.
Trait Implementations§
Source§impl Clone for ScrollAxisRange
impl Clone for ScrollAxisRange
Source§fn clone(&self) -> ScrollAxisRange
fn clone(&self) -> ScrollAxisRange
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ScrollAxisRange
Source§impl Debug for ScrollAxisRange
impl Debug for ScrollAxisRange
Source§impl PartialEq for ScrollAxisRange
impl PartialEq for ScrollAxisRange
impl StructuralPartialEq for ScrollAxisRange
Auto Trait Implementations§
impl Forget for ScrollAxisRange
impl Freeze for ScrollAxisRange
impl Move for ScrollAxisRange
impl RefUnwindSafe for ScrollAxisRange
impl Send for ScrollAxisRange
impl Sync for ScrollAxisRange
impl Unpin for ScrollAxisRange
impl UnsafeUnpin for ScrollAxisRange
impl UnwindSafe for ScrollAxisRange
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
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> ⓘ
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> ⓘ
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