pub struct VirtualList { /* private fields */ }Expand description
Virtualized list state
Implementations§
Source§impl VirtualList
impl VirtualList
pub fn new(config: VirtualListConfig) -> Self
Sourcepub fn set_item_count(&mut self, count: usize)
pub fn set_item_count(&mut self, count: usize)
Set total item count
Sourcepub fn item_count(&self) -> usize
pub fn item_count(&self) -> usize
Get total item count
Sourcepub fn set_viewport_height(&mut self, height: f32)
pub fn set_viewport_height(&mut self, height: f32)
Set viewport height
Sourcepub fn viewport_height(&self) -> f32
pub fn viewport_height(&self) -> f32
Get viewport height
Sourcepub fn set_scroll_position(&mut self, position: f32)
pub fn set_scroll_position(&mut self, position: f32)
Set scroll position
Sourcepub fn scroll_position(&self) -> f32
pub fn scroll_position(&self) -> f32
Get current scroll position
Sourcepub fn max_scroll(&self) -> f32
pub fn max_scroll(&self) -> f32
Get maximum scroll position
Sourcepub fn scroll_to_item(&mut self, index: usize, align: ScrollAlign)
pub fn scroll_to_item(&mut self, index: usize, align: ScrollAlign)
Scroll to specific item
Sourcepub fn set_item_height(&mut self, index: usize, height: f32)
pub fn set_item_height(&mut self, index: usize, height: f32)
Set height for a specific item
Sourcepub fn get_item_height(&self, index: usize) -> f32
pub fn get_item_height(&self, index: usize) -> f32
Get height for a specific item
Sourcepub fn get_item_position(&self, index: usize) -> f32
pub fn get_item_position(&self, index: usize) -> f32
Get position for a specific item
Sourcepub fn get_item_layout(&self, index: usize) -> ItemLayout
pub fn get_item_layout(&self, index: usize) -> ItemLayout
Get layout for a specific item
Sourcepub fn content_height(&self) -> f32
pub fn content_height(&self) -> f32
Get total content height
Sourcepub fn visible_range(&self) -> Option<&VisibleRange>
pub fn visible_range(&self) -> Option<&VisibleRange>
Get currently visible range
Sourcepub fn is_near_end(&self) -> bool
pub fn is_near_end(&self) -> bool
Check if we’re near the end (for infinite scroll)
Sourcepub fn is_near_start(&self) -> bool
pub fn is_near_start(&self) -> bool
Check if we’re near the start