You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: loader.rs
    path of file: ./repos/trezor-firmware/core/embed/rust/src/ui/model_tr/component
    
    the code of the file until where you have to start completion: use crate::{
    strutil::{StringType, TString},
    time::{Duration, Instant},
    ui::{
        animation::Animation,
        component::{Child, Component, Event, EventCtx},
        constant,
        display::{self, Color, Font, LOADER_MAX},
        geometry::{Offset, Rect},
        util::animation_disabled,
    },
};

use super::{theme, Progress};

pub const DEFAULT_DURATION_MS: u32 = 1000;
pub const SHRINKING_DURATION_MS: u32 = 500;

pub enum LoaderMsg {
    GrownCompletely,
 
    
    fn event(&mut self, ctx: &mut EventCtx, event: Event) -> Option<Self::Msg> {
        if let Event::Timer(EventCtx::ANIM_FRAME_TIMER) = event {
            if self.is_animating() {
                let now = Instant::now();
                if self.is_completely_grown(now) {
                    self.state = State::Grown;
                    ctx.request_paint();
                    return Some(LoaderMsg::GrownCompletely);
                } else if self.is_completely_shrunk(now) {
                    self.state = State::Initial;
                    ctx.request_paint();
                    return Some(LoaderMsg::ShrunkCompletely);
                } else {
                    // There is further progress in the animation, request an animation frame event.
                    ctx.request_anim_frame();
                    // We have something to paint, so request to be painted in the next pass.
                    if !animation_disabled() {
                        ctx.request_paint();
                    }
                }
            }
        }
        None
    }