(&self)
| 139 | } |
| 140 | |
| 141 | fn animation_progress(&self) -> f32 { |
| 142 | if self.message.is_none() { |
| 143 | return 0.0; |
| 144 | } |
| 145 | |
| 146 | match self.phase { |
| 147 | ToastPhase::Entering => progress_ratio(self.phase_elapsed_ms, TRANSITION_MS), |
| 148 | ToastPhase::Visible => 1.0, |
| 149 | ToastPhase::Exiting => 1.0 - progress_ratio(self.phase_elapsed_ms, TRANSITION_MS), |
| 150 | } |
| 151 | .clamp(0.0, 1.0) |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | impl Default for Toast { |
no test coverage detected