跳转至

ui/core/token/motion/cfmaterial_motion_token_literals.h

Material Design 3 Motion Token String Literals. More...

Namespaces

Name
cf
cf::ui
cf::ui::core
cf::ui::core::token
cf::ui::core::token::literals

Detailed Description

Material Design 3 Motion Token String Literals.

Author: Charliechen114514 (chengh1922@mails.jlu.edu.cn)

Version: 0.1

Date: 2026-02-26

Copyright: Copyright © 2026

Compile-time string constants for Material Design 3 motion tokens. These literals are used throughout the motion system to ensure consistency and avoid string duplication.

Source code

#pragma once

#include <cstdint>

namespace cf::ui::core::token::literals {

// =============================================================================
// Motion Duration Token Literals
// =============================================================================

inline constexpr const char MOTION_SHORT_ENTER_DURATION[] = "md.motion.shortEnter.duration";

inline constexpr const char MOTION_SHORT_EXIT_DURATION[] = "md.motion.shortExit.duration";

inline constexpr const char MOTION_MEDIUM_ENTER_DURATION[] = "md.motion.mediumEnter.duration";

inline constexpr const char MOTION_MEDIUM_EXIT_DURATION[] = "md.motion.mediumExit.duration";

inline constexpr const char MOTION_LONG_ENTER_DURATION[] = "md.motion.longEnter.duration";

inline constexpr const char MOTION_LONG_EXIT_DURATION[] = "md.motion.longExit.duration";

inline constexpr const char MOTION_STATE_CHANGE_DURATION[] = "md.motion.stateChange.duration";

inline constexpr const char MOTION_RIPPLE_EXPAND_DURATION[] = "md.motion.rippleExpand.duration";

inline constexpr const char MOTION_RIPPLE_FADE_DURATION[] = "md.motion.rippleFade.duration";

// =============================================================================
// Motion Easing Token Literals
// =============================================================================

inline constexpr const char MOTION_SHORT_ENTER_EASING[] = "md.motion.shortEnter.easing";

inline constexpr const char MOTION_SHORT_EXIT_EASING[] = "md.motion.shortExit.easing";

inline constexpr const char MOTION_MEDIUM_ENTER_EASING[] = "md.motion.mediumEnter.easing";

inline constexpr const char MOTION_MEDIUM_EXIT_EASING[] = "md.motion.mediumExit.easing";

inline constexpr const char MOTION_LONG_ENTER_EASING[] = "md.motion.longEnter.easing";

inline constexpr const char MOTION_LONG_EXIT_EASING[] = "md.motion.longExit.easing";

inline constexpr const char MOTION_STATE_CHANGE_EASING[] = "md.motion.stateChange.easing";

inline constexpr const char MOTION_RIPPLE_EXPAND_EASING[] = "md.motion.rippleExpand.easing";

inline constexpr const char MOTION_RIPPLE_FADE_EASING[] = "md.motion.rippleFade.easing";

// =============================================================================
// All Motion Tokens Array (for iteration)
// =============================================================================

inline constexpr const char* const ALL_MOTION_TOKENS[] = {
    // Durations
    MOTION_SHORT_ENTER_DURATION, MOTION_SHORT_EXIT_DURATION, MOTION_MEDIUM_ENTER_DURATION,
    MOTION_MEDIUM_EXIT_DURATION, MOTION_LONG_ENTER_DURATION, MOTION_LONG_EXIT_DURATION,
    MOTION_STATE_CHANGE_DURATION, MOTION_RIPPLE_EXPAND_DURATION, MOTION_RIPPLE_FADE_DURATION,
    // Easing
    MOTION_SHORT_ENTER_EASING, MOTION_SHORT_EXIT_EASING, MOTION_MEDIUM_ENTER_EASING,
    MOTION_MEDIUM_EXIT_EASING, MOTION_LONG_ENTER_EASING, MOTION_LONG_EXIT_EASING,
    MOTION_STATE_CHANGE_EASING, MOTION_RIPPLE_EXPAND_EASING, MOTION_RIPPLE_FADE_EASING};

inline constexpr size_t MOTION_TOKEN_COUNT = 18;

} // namespace cf::ui::core::token::literals

Updated on 2026-03-09 at 10:14:01 +0000