pub trait ScrollActivity: Sized + 'static {
Show 18 methods
// Required methods
fn scroll_activity_data(
self: Handle<Self>,
app: &App,
) -> &ScrollActivityData;
fn scroll_activity_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut ScrollActivityData;
fn should_ignore_pointer(self: Handle<Self>, app: &App) -> bool;
fn is_scrolling(self: Handle<Self>, app: &App) -> bool;
fn velocity(self: Handle<Self>, app: &mut App) -> f64;
// Provided methods
fn delegate(self: Handle<Self>, app: &App) -> AnyScrollActivityDelegate { ... }
fn is_disposed(self: Handle<Self>, app: &App) -> bool { ... }
fn update_delegate(
self: Handle<Self>,
app: &mut App,
value: AnyScrollActivityDelegate,
) { ... }
fn reset_activity(self: Handle<Self>, app: &mut App) { ... }
fn dispatch_scroll_start_notification(
self: Handle<Self>,
app: &mut App,
metrics: Rc<dyn ScrollMetrics>,
context: Option<BuildContext>,
) { ... }
fn dispatch_scroll_update_notification(
self: Handle<Self>,
app: &mut App,
metrics: Rc<dyn ScrollMetrics>,
context: BuildContext,
scroll_delta: f64,
) { ... }
fn dispatch_overscroll_notification(
self: Handle<Self>,
app: &mut App,
metrics: Rc<dyn ScrollMetrics>,
context: BuildContext,
overscroll: f64,
) { ... }
fn dispatch_scroll_end_notification(
self: Handle<Self>,
app: &mut App,
metrics: Rc<dyn ScrollMetrics>,
context: BuildContext,
) { ... }
fn apply_new_dimensions(self: Handle<Self>, app: &mut App) { ... }
fn dispose(self: Handle<Self>, app: &mut App) { ... }
fn describe(self: Handle<Self>, app: &App) -> String { ... }
fn as_hold_controller(
self: Handle<Self>,
) -> Option<Rc<dyn ScrollHoldController>> { ... }
fn as_activity(self: Handle<Self>) -> AnyScrollActivity { ... }
}Expand description
Base trait for scrolling activities like dragging and flinging.
The shared bodies live on ScrollActivityBase, which an override calls where Dart
writes super.….
See also:
ScrollPosition, which usesScrollActivityobjects to manage theScrollPositionof aScrollable.
Required Methods§
Sourcefn scroll_activity_data(self: Handle<Self>, app: &App) -> &ScrollActivityData
fn scroll_activity_data(self: Handle<Self>, app: &App) -> &ScrollActivityData
Dart’s ScrollActivity fields, held under the field scroll_activity
(scroll_activity_accessors!).
Sourcefn scroll_activity_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut ScrollActivityData
fn scroll_activity_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut ScrollActivityData
See scroll_activity_data.
Sourcefn should_ignore_pointer(self: Handle<Self>, app: &App) -> bool
fn should_ignore_pointer(self: Handle<Self>, app: &App) -> bool
Whether the scroll view should ignore pointer events while performing this activity.
See also:
is_scrolling, which describes whether the activity is considered to represent user interaction or not.
Sourcefn is_scrolling(self: Handle<Self>, app: &App) -> bool
fn is_scrolling(self: Handle<Self>, app: &App) -> bool
Whether performing this activity constitutes scrolling.
Used, for example, to determine whether the user scroll
direction (see ScrollPosition::user_scroll_direction) is
waft_rendering::ScrollDirection::Idle.
See also:
should_ignore_pointer, which controls whether pointer events are allowed while the activity is live.crate::UserScrollNotification, which exposes this status.
Provided Methods§
Sourcefn delegate(self: Handle<Self>, app: &App) -> AnyScrollActivityDelegate
fn delegate(self: Handle<Self>, app: &App) -> AnyScrollActivityDelegate
The delegate that this activity will use to actuate the scroll view.
Sourcefn is_disposed(self: Handle<Self>, app: &App) -> bool
fn is_disposed(self: Handle<Self>, app: &App) -> bool
Whether dispose has run; Dart’s _isDisposed.
Sourcefn update_delegate(
self: Handle<Self>,
app: &mut App,
value: AnyScrollActivityDelegate,
)
fn update_delegate( self: Handle<Self>, app: &mut App, value: AnyScrollActivityDelegate, )
Updates the activity’s link to the ScrollActivityDelegate.
This should only be called when an activity is being moved from a defunct
(or about-to-be defunct) ScrollActivityDelegate object to a new one.
Sourcefn reset_activity(self: Handle<Self>, app: &mut App)
fn reset_activity(self: Handle<Self>, app: &mut App)
Called by the ScrollActivityDelegate when it has changed type (for
example, when changing from an Android-style scroll position to an
iOS-style scroll position). If this activity can differ between the two
modes, then it should tell the position to restart that activity
appropriately.
For example, BallisticScrollActivity’s implementation calls
ScrollActivityDelegate::go_ballistic.
Sourcefn dispatch_scroll_start_notification(
self: Handle<Self>,
app: &mut App,
metrics: Rc<dyn ScrollMetrics>,
context: Option<BuildContext>,
)
fn dispatch_scroll_start_notification( self: Handle<Self>, app: &mut App, metrics: Rc<dyn ScrollMetrics>, context: Option<BuildContext>, )
Dispatch a ScrollStartNotification with the given metrics.
Sourcefn dispatch_scroll_update_notification(
self: Handle<Self>,
app: &mut App,
metrics: Rc<dyn ScrollMetrics>,
context: BuildContext,
scroll_delta: f64,
)
fn dispatch_scroll_update_notification( self: Handle<Self>, app: &mut App, metrics: Rc<dyn ScrollMetrics>, context: BuildContext, scroll_delta: f64, )
Dispatch a ScrollUpdateNotification with the given metrics and scroll delta.
Sourcefn dispatch_overscroll_notification(
self: Handle<Self>,
app: &mut App,
metrics: Rc<dyn ScrollMetrics>,
context: BuildContext,
overscroll: f64,
)
fn dispatch_overscroll_notification( self: Handle<Self>, app: &mut App, metrics: Rc<dyn ScrollMetrics>, context: BuildContext, overscroll: f64, )
Dispatch an OverscrollNotification with the given metrics and overscroll.
Sourcefn dispatch_scroll_end_notification(
self: Handle<Self>,
app: &mut App,
metrics: Rc<dyn ScrollMetrics>,
context: BuildContext,
)
fn dispatch_scroll_end_notification( self: Handle<Self>, app: &mut App, metrics: Rc<dyn ScrollMetrics>, context: BuildContext, )
Dispatch a ScrollEndNotification with the given metrics and overscroll.
Sourcefn apply_new_dimensions(self: Handle<Self>, app: &mut App)
fn apply_new_dimensions(self: Handle<Self>, app: &mut App)
Called when the scroll view that is performing this activity changes its metrics.
Sourcefn dispose(self: Handle<Self>, app: &mut App)
fn dispose(self: Handle<Self>, app: &mut App)
Called when the scroll view stops performing this activity.
Sourcefn describe(self: Handle<Self>, app: &App) -> String
fn describe(self: Handle<Self>, app: &App) -> String
Dart’s toString, which reads the arena and so cannot be std::fmt::Debug.
Sourcefn as_hold_controller(
self: Handle<Self>,
) -> Option<Rc<dyn ScrollHoldController>>
fn as_hold_controller( self: Handle<Self>, ) -> Option<Rc<dyn ScrollHoldController>>
Dart’s activity is ScrollHoldController; None — the default — for every activity
but HoldScrollActivity.
Sourcefn as_activity(self: Handle<Self>) -> AnyScrollActivity
fn as_activity(self: Handle<Self>) -> AnyScrollActivity
This activity as the erased AnyScrollActivity — what to pass where a Dart API takes
a ScrollActivity.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".