pub struct SwitchButtonSpec {Show 16 fields
pub colors: WearColors,
pub label_style: WearTextStyle,
pub secondary_style: WearTextStyle,
pub min_height: f32,
pub corner_radius: f32,
pub padding_horizontal: f32,
pub padding_vertical: f32,
pub switch_width: f32,
pub switch_slot_height: f32,
pub switch_height: f32,
pub track_border_width: f32,
pub thumb_radius_unchecked: f32,
pub thumb_radius_checked: f32,
pub control_spacing: f32,
pub label_spacing: f32,
pub progress: f32,
}Expand description
SwitchButtonDefaults plus ToggleButton’s layout constants.
Fields§
§colors: WearColorsColors of the container, the labels and the switch.
label_style: WearTextStyleText style of the main label.
secondary_style: WearTextStyleText style of the secondary label.
min_height: f32Minimum height of the button, in dp.
corner_radius: f32Corner radius of the container, in dp.
padding_horizontal: f32Space between the container edge and the content on both horizontal sides, in dp.
padding_vertical: f32Space between the container edge and the content at the top and the bottom, in dp.
switch_width: f32SWITCH_WIDTH.
switch_slot_height: f32SWITCH_OUTER_HEIGHT — the slot the graphic is placed in.
switch_height: f32SWITCH_INNER_HEIGHT — what the graphic actually draws.
track_border_width: f32SWITCH_TRACK_WIDTH — the unchecked state’s border stroke.
thumb_radius_unchecked: f32Radius of the thumb when the switch is off, in dp.
thumb_radius_checked: f32Radius of the thumb when the switch is on, in dp.
control_spacing: f32TOGGLE_CONTROL_SPACING.
label_spacing: f32LabelSpacerSize.
progress: f32How far the thumb has travelled, 0.0 unchecked and 1.0 checked.
A caller animating the transition drives this; a caller that does not
passes the checked state itself. Wear animates it with
motionScheme.fastEffectsSpec(), a critically damped spring of
stiffness 1400.
Implementations§
Trait Implementations§
Source§impl Clone for SwitchButtonSpec
impl Clone for SwitchButtonSpec
impl Copy for SwitchButtonSpec
Source§impl Debug for SwitchButtonSpec
impl Debug for SwitchButtonSpec
Source§impl Default for SwitchButtonSpec
impl Default for SwitchButtonSpec
Source§impl PartialEq for SwitchButtonSpec
impl PartialEq for SwitchButtonSpec
impl StructuralPartialEq for SwitchButtonSpec
Auto Trait Implementations§
impl Freeze for SwitchButtonSpec
impl RefUnwindSafe for SwitchButtonSpec
impl Send for SwitchButtonSpec
impl Sync for SwitchButtonSpec
impl Unpin for SwitchButtonSpec
impl UnsafeUnpin for SwitchButtonSpec
impl UnwindSafe for SwitchButtonSpec
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