pub struct TimePickerView<State: 'static> { /* private fields */ }Expand description
A declarative M3E time picker dialog. See the module docs.
Implementations§
Source§impl<State: 'static> TimePickerView<State>
impl<State: 'static> TimePickerView<State>
Sourcepub fn value(self, value: TimeOfDay) -> Self
pub fn value(self, value: TimeOfDay) -> Self
The time the dial shows and the confirm action reports (controlled).
Sourcepub fn entry(self, entry: TimeEntry) -> Self
pub fn entry(self, entry: TimeEntry) -> Self
The entry form’s raw text (controlled). Unset, the form re-seeds from
value every pass — see the module docs.
Sourcepub fn entry_mode(self, entry_mode: TimePickerEntryMode) -> Self
pub fn entry_mode(self, entry_mode: TimePickerEntryMode) -> Self
Which face to show, and whether to offer the mode toggle
(initialEntryMode, controlled here rather than seeded).
Sourcepub fn orientation(self, orientation: TimePickerOrientation) -> Self
pub fn orientation(self, orientation: TimePickerOrientation) -> Self
The panel arrangement (orientation) — see the module docs.
Sourcepub fn use_24_hour(self, use_24_hour: bool) -> Self
pub fn use_24_hour(self, use_24_hour: bool) -> Self
Use the 24-hour ring/validation and drop the AM/PM selector
(alwaysUse24HourFormat).
Sourcepub fn autovalidate(self, autovalidate: bool) -> Self
pub fn autovalidate(self, autovalidate: bool) -> Self
Show the entry form’s error lines — set this from
on_confirm’s None arm, the reference’s own
AutovalidateMode.always flip.
Sourcepub fn strings(self, strings: TimePickerStrings) -> Self
pub fn strings(self, strings: TimePickerStrings) -> Self
Replace every user-visible string (see the module docs).
Sourcepub fn on_change<F: Fn(&mut State, TimeOfDay) + 'static>(
self,
on_change: F,
) -> Self
pub fn on_change<F: Fn(&mut State, TimeOfDay) + 'static>( self, on_change: F, ) -> Self
Observe a dial edit — the requested time, clamped and complete.
Sourcepub fn on_entry_change<F: Fn(&mut State, TimeEntry) + 'static>(
self,
on_change: F,
) -> Self
pub fn on_entry_change<F: Fn(&mut State, TimeEntry) + 'static>( self, on_change: F, ) -> Self
Sourcepub fn on_entry_mode_change<F: Fn(&mut State, TimePickerEntryMode) + 'static>(
self,
on_change: F,
) -> Self
pub fn on_entry_mode_change<F: Fn(&mut State, TimePickerEntryMode) + 'static>( self, on_change: F, ) -> Self
Observe a mode-toggle press — the requested TimePickerEntryMode.
Sourcepub fn on_confirm<F: Fn(&mut State, Option<TimeOfDay>) + 'static>(
self,
on_confirm: F,
) -> Self
pub fn on_confirm<F: Fn(&mut State, Option<TimeOfDay>) + 'static>( self, on_confirm: F, ) -> Self
Observe the confirm action. Some(time) is the confirmed value —
value on the dial, the parsed entry in input mode. None is the
reference’s failed-validation branch (_handleOk’s early return): the
typed entry does not spell a time, so the caller flips
autovalidate on instead of popping.
Sourcepub fn on_cancel<F: Fn(&mut State) + 'static>(self, on_cancel: F) -> Self
pub fn on_cancel<F: Fn(&mut State) + 'static>(self, on_cancel: F) -> Self
Observe the cancel action (_handleCancel).
Sourcepub fn dismissable(self, dismissable: bool) -> Self
pub fn dismissable(self, dismissable: bool) -> Self
Whether a scrim tap, Escape or Android back may dismiss the dialog —
see crate::overlay::modal::OverlayModalView::dismissable.
Sourcepub fn on_dismiss<F: Fn(&mut State) + 'static>(self, on_dismiss: F) -> Self
pub fn on_dismiss<F: Fn(&mut State) + 'static>(self, on_dismiss: F) -> Self
Observe a scrim-tap/Escape/back dismissal (show_time_picker
already wires the pop).
Sourcepub fn dismiss_handle(self, dismiss: ModalDismiss) -> Self
pub fn dismiss_handle(self, dismiss: ModalDismiss) -> Self
Install the app-triggered staged-dismiss handle, so the OK/Cancel
callbacks can close the dialog through the host’s exit ramp
(ModalDismiss::dismiss_with / ModalDismiss::dismiss) instead of
popping the navigator themselves, which skips the ramp entirely.
Unlike crate::show_date_picker, this family leaves both actions to
the caller (the module docs’ worked example), so the handle is the
caller’s to mint and wire — outside show_time_picker’s page builder.
Trait Implementations§
Source§impl<State: 'static> OverlayModalContent<State> for TimePickerView<State>
impl<State: 'static> OverlayModalContent<State> for TimePickerView<State>
Source§fn on_modal_dismiss(self, on_dismiss: Rc<dyn Fn(&mut State)>) -> Self
fn on_modal_dismiss(self, on_dismiss: Rc<dyn Fn(&mut State)>) -> Self
Source§fn modal_dismissable(&self) -> bool
fn modal_dismissable(&self) -> bool
BackPolicy.Source§impl<State: 'static> View<State> for TimePickerView<State>
impl<State: 'static> View<State> for TimePickerView<State>
Source§type Element = OverlayModalWidget
type Element = OverlayModalWidget
Source§fn build(&self, ctx: &mut BuildCtx<'_>) -> OverlayModalWidget
fn build(&self, ctx: &mut BuildCtx<'_>) -> OverlayModalWidget
Source§fn rebuild(
&self,
prev: &Self,
element: &mut OverlayModalWidget,
ctx: &mut BuildCtx<'_>,
) -> ChangeFlags
fn rebuild( &self, prev: &Self, element: &mut OverlayModalWidget, ctx: &mut BuildCtx<'_>, ) -> ChangeFlags
prev (the previous view of the same type) against the live
element, mutating it in place and reporting what changed.Auto Trait Implementations§
impl<State> !RefUnwindSafe for TimePickerView<State>
impl<State> !Send for TimePickerView<State>
impl<State> !Sync for TimePickerView<State>
impl<State> !UnwindSafe for TimePickerView<State>
impl<State> Freeze for TimePickerView<State>where
Option<Rc<dyn Fn(&mut State, TimeOfDay)>>: Freeze,
Option<Rc<dyn Fn(&mut State, TimeEntry)>>: Freeze,
Option<Rc<dyn Fn(&mut State, TimePickerEntryMode)>>: Freeze,
Option<Rc<dyn Fn(&mut State, Option<TimeOfDay>)>>: Freeze,
Option<Rc<dyn Fn(&mut State)>>: Freeze,
impl<State> Unpin for TimePickerView<State>where
Option<Rc<dyn Fn(&mut State, TimeOfDay)>>: Unpin,
Option<Rc<dyn Fn(&mut State, TimeEntry)>>: Unpin,
Option<Rc<dyn Fn(&mut State, TimePickerEntryMode)>>: Unpin,
Option<Rc<dyn Fn(&mut State, Option<TimeOfDay>)>>: Unpin,
Option<Rc<dyn Fn(&mut State)>>: Unpin,
impl<State> UnsafeUnpin for TimePickerView<State>where
Option<Rc<dyn Fn(&mut State, TimeOfDay)>>: UnsafeUnpin,
Option<Rc<dyn Fn(&mut State, TimeEntry)>>: UnsafeUnpin,
Option<Rc<dyn Fn(&mut State, TimePickerEntryMode)>>: UnsafeUnpin,
Option<Rc<dyn Fn(&mut State, Option<TimeOfDay>)>>: UnsafeUnpin,
Option<Rc<dyn Fn(&mut State)>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.