1 /* 2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_CALENDAR_CALENDAR_THEME_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_CALENDAR_CALENDAR_THEME_H 18 19 #include "base/geometry/dimension.h" 20 #include "core/components/common/properties/color.h" 21 #include "core/components/common/properties/decoration.h" 22 #include "core/components/theme/theme.h" 23 #include "core/components/theme/theme_constants.h" 24 #include "core/components/theme/theme_constants_defines.h" 25 26 namespace OHOS::Ace { 27 namespace { 28 29 constexpr Color DEFAULT_DAY_COLOR = Color(0xE1181819); 30 constexpr Color DEFAULT_NON_CURRENT_MONTH_DAY_COLOR = Color(0x4B181819); 31 constexpr Color DEFAULT_WEEKEND_DAY_COLOR = Color(0x7D181819); 32 constexpr Color DEFAULT_WEEKEND_LUNAR_COLOR = Color(0x7D181819); 33 constexpr Color DEFAULT_NON_CURRENT_MONTH_LUNAR_COLOR = Color(0x75181819); 34 constexpr Color DEFAULT_LUNAR_COLOR = Color(0x96181819); 35 constexpr Color DEFAULT_CALENDAR_WEEK_COLOR = Color(0xffa0a1a5); 36 constexpr Color DEFAULT_CALENDAR_DAY_COLOR = Color(0xffeaebed); 37 constexpr Color DEFAULT_CALENDAR_LUNAR_COLOR = Color(0xffa0a1a5); 38 constexpr Color DEFAULT_CALENDAR_WEEKEND_DAY_COLOR = Color(0xff808080); 39 constexpr Color DEFAULT_CALENDAR_WEEKEND_LUNAR_COLOR = Color(0xff808080); 40 constexpr Color DEFAULT_CALENDAR_TODAY_DAY_FOCUS_COLOR = Color(0xffffffff); 41 constexpr Color DEFAULT_CALENDAR_TODAY_LUNAR_FOCUS_COLOR = Color(0xffffffff); 42 constexpr Color DEFAULT_CALENDAR_TODAY_DAY_UNFOCUS_COLOR = Color(0xff0a59f7); 43 constexpr Color DEFAULT_CALENDAR_TODAY_LUNAR_UNFOCUS_COLOR = Color(0xff0a59f7); 44 constexpr Color DEFAULT_CALENDAR_WORK_MARK_COLOR = Color(0xffe84026); 45 constexpr Color DEFAULT_CALENDAR_OFF_MARK_COLOR = Color(0xff0a59f7); 46 constexpr Color DEFAULT_CALENDAR_NONCURRENT_MONTH_WORK_MARK_COLOR = Color(0x33e84026); 47 constexpr Color DEFAULT_CALENDAR_NONCURRENT_MONTH_OFF_MARK_COLOR = Color(0x330a59f7); 48 constexpr Color DEFAULT_CALENDAR_NONCURRENT_MONTH_DAY_COLOR = Color(0xff555e6b); 49 constexpr Color DEFAULT_CALENDAR_NONCURRENT_MONTH_LUNAR_COLOR = Color(0xff555e6b); 50 constexpr Color DEFAULT_CALENDAR_FOCUS_AREA_BACKGROUND_COLOR = Color(0xff5ea1ff); 51 constexpr Color DEFAULT_CALENDAR_BLUR_AREA_BACKGROUND_COLOR = Color(0xffffffff); 52 constexpr float DEFAULT_CALENDAR_DISABLED_OPACITY = 0.4f; 53 } // namespace 54 55 struct CalendarThemeStructure { 56 std::string dayFontWeight = "500"; 57 std::string lunarDayFontWeight = "500"; 58 std::string workStateFontWeight = "500"; 59 std::string monday; 60 std::string tuesday; 61 std::string wednesday; 62 std::string thursday; 63 std::string friday; 64 std::string saturday; 65 std::string sunday; 66 std::string nextYear; 67 std::string nextMonth; 68 std::string preYear; 69 std::string preMonth; 70 Color weekColor; 71 Color dayColor; 72 Color lunarColor; 73 Color weekendDayColor; 74 Color weekendLunarColor; 75 Color todayColor; 76 Color todayLunarColor; 77 Color nonCurrentMonthDayColor; 78 Color nonCurrentMonthLunarColor; 79 Color workDayMarkColor; 80 Color offDayMarkColor; 81 Color nonCurrentMonthWorkDayMarkColor; 82 Color nonCurrentMonthOffDayMarkColor; 83 Color focusedDayColor; 84 Color focusedLunarColor; 85 Color focusedAreaBackgroundColor; 86 Color blurAreaBackgroundColor; 87 Color titleTextColor; 88 Color touchColor; 89 Color markLunarColor; 90 Color clickEffectColor; 91 Color simpleWorkTextColor; 92 Color simpleOffTextColor; 93 Dimension weekFontSize; 94 Dimension dayFontSize; 95 Dimension lunarDayFontSize; 96 Dimension workDayMarkSize; 97 Dimension offDayMarkSize; 98 Dimension focusedAreaRadius; 99 Dimension topPadding; 100 Dimension workStateWidth; 101 Dimension workStateHorizontalMovingDistance; 102 Dimension workStateVerticalMovingDistance; 103 Dimension colSpace; 104 Dimension weekHeight; 105 Dimension dayHeight; 106 Dimension weekWidth; 107 Dimension dayWidth; 108 Dimension weekAndDayRowSpace; 109 Dimension dailyFiveRowSpace; 110 Dimension dailySixRowSpace; 111 Dimension gregorianCalendarHeight; 112 Dimension lunarHeight; 113 Dimension arrowHeight; 114 Dimension arrowWidth; 115 Dimension buttonWidth; 116 Dimension buttonHeight; 117 Dimension titleFontSize; 118 Dimension workStateOffset; 119 Dimension dayYAxisOffset; 120 Dimension lunarDayYAxisOffset; 121 Dimension underscoreXAxisOffset; 122 Dimension underscoreYAxisOffset; 123 Dimension scheduleMarkerXAxisOffset; 124 Dimension scheduleMarkerYAxisOffset; 125 Dimension underscoreWidth; 126 Dimension underscoreLength; 127 Dimension scheduleMarkerRadius; 128 Dimension touchCircleStrokeWidth; 129 Dimension boundaryRowOffset; 130 Dimension boundaryColOffset; 131 }; 132 133 class CalendarTheme : public virtual Theme { 134 DECLARE_ACE_TYPE(CalendarTheme, Theme); 135 136 public: 137 ~CalendarTheme() override = default; 138 class Builder { 139 public: 140 Builder() = default; 141 ~Builder() = default; 142 Build(const RefPtr<ThemeConstants> & themeConstants)143 RefPtr<CalendarTheme> Build(const RefPtr<ThemeConstants>& themeConstants) const 144 { 145 RefPtr<CalendarTheme> theme = AceType::Claim(new CalendarTheme()); 146 if (!themeConstants) { 147 return theme; 148 } 149 theme = AceType::Claim(new CalendarTheme()); 150 ParseNewPattern(themeConstants, theme); 151 ParsePattern(themeConstants, theme); 152 return theme; 153 } 154 private: ParseCardTheme(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)155 void ParseCardTheme(const RefPtr<ThemeConstants>& themeConstants, const RefPtr<CalendarTheme>& theme) const 156 { 157 RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR); 158 if (!pattern) { 159 LOGW("find pattern of calendar fail"); 160 return; 161 } 162 // Card theme 163 theme->cardCalendarTheme_.focusedAreaBackgroundColor = 164 pattern->GetAttr<Color>("card_area_bg_color_focused", Color::BLUE); 165 theme->cardCalendarTheme_.dayColor = 166 pattern->GetAttr<Color>("card_day_color", DEFAULT_DAY_COLOR); 167 theme->cardCalendarTheme_.weekColor = 168 pattern->GetAttr<Color>("card_week_color", Color::BLACK); 169 theme->cardCalendarTheme_.nonCurrentMonthDayColor = 170 pattern->GetAttr<Color>("card_uncurrent_month_day_color", DEFAULT_NON_CURRENT_MONTH_DAY_COLOR); 171 theme->cardCalendarTheme_.weekendDayColor = 172 pattern->GetAttr<Color>("card_weekend_color", DEFAULT_WEEKEND_DAY_COLOR); 173 theme->cardCalendarTheme_.weekendLunarColor = 174 pattern->GetAttr<Color>("card_weekend_lunar_color", DEFAULT_WEEKEND_LUNAR_COLOR); 175 theme->cardCalendarTheme_.nonCurrentMonthLunarColor = 176 pattern->GetAttr<Color>("card_uncurrent_month_lunar_color", DEFAULT_NON_CURRENT_MONTH_LUNAR_COLOR); 177 theme->cardCalendarTheme_.todayColor = 178 pattern->GetAttr<Color>("card_today_color", Color::WHITE); 179 theme->cardCalendarTheme_.todayLunarColor = 180 pattern->GetAttr<Color>("card_today_lunar_color", Color::WHITE); 181 theme->cardCalendarTheme_.lunarColor = 182 pattern->GetAttr<Color>("card_lunar_color", DEFAULT_LUNAR_COLOR); 183 theme->cardCalendarTheme_.markLunarColor = 184 pattern->GetAttr<Color>("card_mark_lunar_color", Color::BLUE); 185 theme->cardCalendarTheme_.titleTextColor = 186 pattern->GetAttr<Color>("card_title_text_color", Color::BLACK); 187 theme->cardCalendarTheme_.clickEffectColor = 188 pattern->GetAttr<Color>("card_switch_button_bg_color_clicked", Color::TRANSPARENT); 189 } 190 ParseNormalTheme(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)191 void ParseNormalTheme(const RefPtr<ThemeConstants>& themeConstants, const RefPtr<CalendarTheme>& theme) const 192 { 193 RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR); 194 if (!pattern) { 195 LOGW("find pattern of calendar fail"); 196 return; 197 } 198 // Normal theme 199 theme->calendarTheme_.dayColor = pattern->GetAttr<Color>(CALENDAR_DAY_COLOR, DEFAULT_CALENDAR_DAY_COLOR); 200 theme->calendarTheme_.weekColor = pattern->GetAttr<Color>(CALENDAR_WEEK_COLOR, DEFAULT_CALENDAR_WEEK_COLOR); 201 theme->calendarTheme_.lunarColor = 202 pattern->GetAttr<Color>(CALENDAR_LUNAR_COLOR, DEFAULT_CALENDAR_LUNAR_COLOR); 203 theme->calendarTheme_.weekendDayColor = 204 pattern->GetAttr<Color>(CALENDAR_WEEKEND_DAY_COLOR, DEFAULT_CALENDAR_WEEKEND_DAY_COLOR); 205 theme->calendarTheme_.weekendLunarColor = 206 pattern->GetAttr<Color>(CALENDAR_WEEKEND_LUNAR_COLOR, DEFAULT_CALENDAR_WEEKEND_LUNAR_COLOR); 207 theme->calendarTheme_.focusedDayColor = 208 pattern->GetAttr<Color>(CALENDAR_TODAY_DAY_FOCUS_COLOR, DEFAULT_CALENDAR_TODAY_DAY_FOCUS_COLOR); 209 theme->calendarTheme_.focusedLunarColor = 210 pattern->GetAttr<Color>(CALENDAR_TODAY_LUNAR_FOCUS_COLOR, DEFAULT_CALENDAR_TODAY_LUNAR_FOCUS_COLOR); 211 theme->calendarTheme_.todayColor = 212 pattern->GetAttr<Color>(CALENDAR_TODAY_DAY_UNFOCUS_COLOR, DEFAULT_CALENDAR_TODAY_DAY_UNFOCUS_COLOR); 213 theme->calendarTheme_.todayLunarColor = 214 pattern->GetAttr<Color>(CALENDAR_TODAY_LUNAR_UNFOCUS_COLOR, DEFAULT_CALENDAR_TODAY_LUNAR_UNFOCUS_COLOR); 215 theme->calendarTheme_.workDayMarkColor = 216 pattern->GetAttr<Color>(CALENDAR_WORK_MARK_COLOR, DEFAULT_CALENDAR_WORK_MARK_COLOR); 217 theme->calendarTheme_.offDayMarkColor = 218 pattern->GetAttr<Color>(CALENDAR_OFF_MARK_COLOR, DEFAULT_CALENDAR_OFF_MARK_COLOR); 219 theme->calendarTheme_.nonCurrentMonthWorkDayMarkColor = pattern->GetAttr<Color>( 220 CALENDAR_NONCURRENT_MONTH_WORK_MARK_COLOR, DEFAULT_CALENDAR_NONCURRENT_MONTH_WORK_MARK_COLOR); 221 theme->calendarTheme_.nonCurrentMonthOffDayMarkColor = pattern->GetAttr<Color>( 222 CALENDAR_NONCURRENT_MONTH_OFF_MARK_COLOR, DEFAULT_CALENDAR_NONCURRENT_MONTH_OFF_MARK_COLOR); 223 theme->calendarTheme_.nonCurrentMonthDayColor = pattern->GetAttr<Color>( 224 CALENDAR_NONCURRENT_MONTH_DAY_COLOR, DEFAULT_CALENDAR_NONCURRENT_MONTH_DAY_COLOR); 225 theme->calendarTheme_.nonCurrentMonthLunarColor = pattern->GetAttr<Color>( 226 CALENDAR_NONCURRENT_MONTH_LUNAR_COLOR, DEFAULT_CALENDAR_NONCURRENT_MONTH_LUNAR_COLOR); 227 theme->calendarTheme_.focusedAreaBackgroundColor = pattern->GetAttr<Color>( 228 CALENDAR_FOCUS_AREA_BACKGROUND_COLOR, DEFAULT_CALENDAR_FOCUS_AREA_BACKGROUND_COLOR); 229 theme->calendarTheme_.blurAreaBackgroundColor = pattern->GetAttr<Color>( 230 CALENDAR_BLUR_AREA_BACKGROUND_COLOR, DEFAULT_CALENDAR_BLUR_AREA_BACKGROUND_COLOR); 231 theme->calendarTheme_.monday = pattern->GetAttr<std::string>("calendar_picker_mon", ""); 232 theme->calendarTheme_.tuesday = pattern->GetAttr<std::string>("calendar_picker_tue", ""); 233 theme->calendarTheme_.wednesday = pattern->GetAttr<std::string>("calendar_picker_wed", ""); 234 theme->calendarTheme_.thursday = pattern->GetAttr<std::string>("calendar_picker_thu", ""); 235 theme->calendarTheme_.friday = pattern->GetAttr<std::string>("calendar_picker_fri", ""); 236 theme->calendarTheme_.saturday = pattern->GetAttr<std::string>("calendar_picker_sat", ""); 237 theme->calendarTheme_.sunday = pattern->GetAttr<std::string>("calendar_picker_sun", ""); 238 theme->calendarTheme_.nextYear = pattern->GetAttr<std::string>("general_next_year", ""); 239 theme->calendarTheme_.nextMonth = pattern->GetAttr<std::string>("general_next_month", ""); 240 theme->calendarTheme_.preYear = pattern->GetAttr<std::string>("general_pre_year", ""); 241 theme->calendarTheme_.preMonth = pattern->GetAttr<std::string>("general_pre_month", ""); 242 } 243 ParseCalenderPickerFirstPart(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)244 void ParseCalenderPickerFirstPart(const RefPtr<ThemeConstants>& themeConstants, 245 const RefPtr<CalendarTheme>& theme) const 246 { 247 RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR); 248 if (!pattern) { 249 LOGW("find pattern of calendar fail"); 250 return; 251 } 252 theme->entryBorderColor_ = pattern->GetAttr<Color>("calendar_picker_entry_border_color", Color()); 253 theme->entryArrowColor_ = pattern->GetAttr<Color>("calendar_picker_entry_arrow_color", Color()); 254 theme->selectBackgroundColor_ = pattern->GetAttr<Color>( 255 "calendar_picker_select_background_color", Color()); 256 theme->dialogBackgroundColor_ = pattern->GetAttr<Color>( 257 "calendar_picker_dialog_background_color", Color()); 258 theme->calendarTitleFontColor_ = pattern->GetAttr<Color>("calendar_picker_title_font_color", Color()); 259 Color currentMonthColor = pattern->GetAttr<Color>("calendar_picker_title_font_color", Color()); 260 theme->textCurrentMonthColor_ = currentMonthColor.BlendOpacity( 261 pattern->GetAttr<double>("calendar_picker_attribute_alpha_content_primary", 0.0)); 262 theme->textNonCurrentMonthColor_ = currentMonthColor.BlendOpacity( 263 pattern->GetAttr<double>("calendar_picker_attribute_alpha_content_tertiary", 0.0)); 264 Color textSelectedDayColor = pattern->GetAttr<Color>("calendar_picker_text_selected_day_color", Color()); 265 theme->textSelectedDayColor_ = textSelectedDayColor; 266 theme->textNonCurrentMonthTodayColor_ = textSelectedDayColor.BlendOpacity( 267 pattern->GetAttr<double>("interactive_disable", DEFAULT_CALENDAR_DISABLED_OPACITY)); 268 theme->textCurrentDayColor_ = pattern->GetAttr<Color>("calendar_picker_text_current_day_color", Color()); 269 theme->backgroundKeyFocusedColor_ = pattern->GetAttr<Color>( 270 "calendar_picker_background_key_focused_color", Color()); 271 Color backgroundSelectedTodayColor = pattern->GetAttr<Color>( 272 "calendar_picker_background_selected_focused_color", Color()); 273 theme->dialogButtonBackgroundColor_ = pattern->GetAttr<Color>( 274 "calendar_picker_dialog_button_bg_color", Color()); 275 theme->backgroundSelectedTodayColor_ = backgroundSelectedTodayColor; 276 theme->backgroundDisabledMarkTodayColor_ = backgroundSelectedTodayColor.BlendOpacity( 277 pattern->GetAttr<double>("interactive_disable", DEFAULT_CALENDAR_DISABLED_OPACITY)); 278 theme->backgroundSelectedNotTodayColor_ = backgroundSelectedTodayColor.BlendOpacity( 279 pattern->GetAttr<double>("calendar_picker_attribute_alpha_highlight_bg", 0.0)); 280 theme->backgroundHoverColor_ = pattern->GetAttr<Color>("calendar_picker_background_hover_color", Color()); 281 theme->backgroundPressColor_ = pattern->GetAttr<Color>("calendar_picker_background_press_color", Color()); 282 theme->entryFontColor_ = pattern->GetAttr<Color>("calendar_picker_entry_font_color", Color()); 283 theme->dialogDividerColor_ = pattern->GetAttr<Color>("calendar_picker_dialog_divider_color", Color()); 284 theme->entryHeight_ = pattern->GetAttr<Dimension>("calendar_picker_entry_height", 0.0_vp); 285 theme->entryBorderWidth_ = pattern->GetAttr<Dimension>("calendar_picker_entry_border_width", 0.0_vp); 286 theme->entryBorderRadius_ = pattern->GetAttr<Dimension>("calendar_picker_entry_border_radius", 0.0_vp); 287 theme->entryButtonWidth_ = pattern->GetAttr<Dimension>("calendar_picker_entry_button_width", 0.0_vp); 288 theme->entryArrowHeight_ = pattern->GetAttr<Dimension>("calendar_picker_entry_arrow_height", 0.0_vp); 289 theme->entryArrowwidth_ = pattern->GetAttr<Dimension>("calendar_picker_entry_arrow_width", 0.0_vp); 290 } ParseCalenderPickerSecondPart(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)291 void ParseCalenderPickerSecondPart(const RefPtr<ThemeConstants>& themeConstants, 292 const RefPtr<CalendarTheme>& theme) const 293 { 294 RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR); 295 if (!pattern) { 296 LOGW("find pattern of calendar fail"); 297 return; 298 } 299 theme->entryDateLeftRightMargin_ = pattern->GetAttr<Dimension>( 300 "calendar_picker_entry_date_left_right_margin", 0.0_vp); 301 theme->entryDateTopBottomMargin_ = pattern->GetAttr<Dimension>( 302 "calendar_picker_entry_date_top_bottom_margin", 0.0_vp); 303 theme->dialogMargin_ = pattern->GetAttr<Dimension>("calendar_picker_dialog_margin", 0.0_vp); 304 theme->calendarPickerDayWidthOrHeight_ = pattern->GetAttr<Dimension>( 305 "calendar_picker_day_width_height", 0.0_vp); 306 theme->calendarPickerDayLargeWidthOrHeight_ = 307 pattern->GetAttr<Dimension>("calendar_picker_day_large_width_height", 40.0_vp); 308 theme->calendarDayFontSize_ = pattern->GetAttr<Dimension>("calendar_picker_day_font_size", 0.0_vp); 309 theme->calendarSmallWeekFontSize_ = 310 pattern->GetAttr<Dimension>("calendar_picker_small_day_font_size", 14.0_vp); 311 theme->distanceBetweenContainterAndDate_ = pattern->GetAttr<Dimension>( 312 "calendar_picker_distance_between_container_and_date", 0.0_vp); 313 theme->distanceBetweenTitleAndDate_ = pattern->GetAttr<Dimension>( 314 "calendar_picker_distance_between_title_and_date", 0.0_vp); 315 theme->dalendarContainerHeight_ = pattern->GetAttr<Dimension>("calendar_picker_container_height", 0.0_vp); 316 theme->calendarLargeContainerHeight_ = 317 pattern->GetAttr<Dimension>("calendar_picker_large_container_height", 316.0_vp); 318 theme->calendarLargerContainerHeight_ = 319 pattern->GetAttr<Dimension>("calendar_picker_larger_container_height", 337.0_vp); 320 theme->calendarTitleFontSize_ = pattern->GetAttr<Dimension>("calendar_picker_title_font_size", 0.0_vp); 321 theme->calendarTitleRowHeight_ = pattern->GetAttr<Dimension>("calendar_picker_title_row_height", 0.0_vp); 322 theme->calendarTitleLargeRowHeight_ = 323 pattern->GetAttr<Dimension>("calendar_picker_title_large_row_height", 94.0_vp); 324 theme->calendarTitleLargerRowHeight_ = 325 pattern->GetAttr<Dimension>("calendar_picker_title_larger_row_height", 106.0_vp); 326 } 327 ParseCalenderPickerThirdPart(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)328 void ParseCalenderPickerThirdPart(const RefPtr<ThemeConstants>& themeConstants, 329 const RefPtr<CalendarTheme>& theme) const 330 { 331 RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR); 332 if (!pattern) { 333 LOGW("find pattern of calendar fail"); 334 return; 335 } 336 theme->calendarTitleRowTopPadding_ = pattern->GetAttr<Dimension>( 337 "calendar_picker_title_row_top_padding", 0.0_vp); 338 theme->calendarTitleRowLeftRightPadding_ = pattern->GetAttr<Dimension>( 339 "calendar_picker_title_row_left_right_padding", 0.0_vp); 340 theme->calendarTitleTextPadding_ = pattern->GetAttr<Dimension>( 341 "calendar_picker_title_text_padding", 0.0_vp); 342 theme->calendarTitleImagePadding_ = pattern->GetAttr<Dimension>( 343 "calendar_picker_title_image_padding", 0.0_vp); 344 theme->calendarImageWidthHeight_ = pattern->GetAttr<Dimension>( 345 "calendar_picker_image_width_height", 0.0_vp); 346 theme->calendarActionRowTopPadding_ = pattern->GetAttr<Dimension>( 347 "calendar_picker_action_row_top_padding", 0.0_vp); 348 theme->calendarActionRowBottomLeftRightPadding_ = pattern->GetAttr<Dimension>( 349 "calendar_picker_action_row_bottom_left_right_padding", 0.0_vp); 350 theme->calendarActionRowHeight_ = pattern->GetAttr<Dimension>("calendar_picker_action_row_height", 0.0_vp); 351 theme->calendarActionLargeRowHeight_ = 352 pattern->GetAttr<Dimension>("calendar_picker_action_large_row_height", 48.0_vp); 353 theme->calendarDayRadius_ = pattern->GetAttr<Dimension>("calendar_picker_day_radius", 0.0_vp); 354 theme->calendarDayKeyFocusedWidth_ = pattern->GetAttr<Dimension>("calendar_day_key_focused_width", 0.0_vp); 355 theme->calendarLargeDayKeyFocusedWidth_ = 356 pattern->GetAttr<Dimension>("calendar_large_day_key_focused_width", 44.0_vp); 357 theme->calendarDayKeyFocusedPenWidth_ = pattern->GetAttr<Dimension>( 358 "calendar_day_key_focused_pen_width", 0.0_vp); 359 theme->entryFontSize_ = pattern->GetAttr<Dimension>("calendar_picker_entry_font_size", 0.0_fp); 360 theme->dialogBorderRadius_ = pattern->GetAttr<Dimension>("calendar_picker_dialog_border_radius", 0.0_vp); 361 theme->calendarPickerDialogBlurStyle_ = pattern->GetAttr<int>( 362 "calendar_picker_dialog_background_blur_style", static_cast<int>(BlurStyle::COMPONENT_ULTRA_THICK)); 363 } 364 ParsePattern(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)365 void ParsePattern(const RefPtr<ThemeConstants>& themeConstants, const RefPtr<CalendarTheme>& theme) const 366 { 367 RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR); 368 if (!pattern) { 369 LOGW("find pattern of calendar fail"); 370 return; 371 } 372 // Card theme 373 ParseCardTheme(themeConstants, theme); 374 // Normal theme 375 ParseNormalTheme(themeConstants, theme); 376 // calendar picker 377 ParseCalenderPickerFirstPart(themeConstants, theme); 378 ParseCalenderPickerSecondPart(themeConstants, theme); 379 ParseCalenderPickerThirdPart(themeConstants, theme); 380 } 381 ParseCalendarThemePattern(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)382 void ParseCalendarThemePattern(const RefPtr<ThemeConstants>& themeConstants, 383 const RefPtr<CalendarTheme>& theme) const 384 { 385 RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR); 386 CHECK_NULL_VOID(pattern); 387 theme->calendarTheme_.weekFontSize = pattern->GetAttr<Dimension>("calendar_week_font_size", 14.0_fp); 388 theme->calendarTheme_.dayFontSize = pattern->GetAttr<Dimension>("calendar_day_font_size", 18.0_fp); 389 theme->calendarTheme_.lunarDayFontSize = pattern->GetAttr<Dimension>("calendar_lunar_font_size", 12.0_fp); 390 theme->calendarTheme_.workDayMarkSize = 391 pattern->GetAttr<Dimension>("calendar_work_day_mark_font_size", 10.0_fp); 392 theme->calendarTheme_.offDayMarkSize = 393 pattern->GetAttr<Dimension>("calendar_off_day_mark_font_size", 10.0_fp); 394 theme->calendarTheme_.focusedAreaRadius = 395 pattern->GetAttr<Dimension>("calendar_focused_area_radius", 24.0_vp); 396 theme->calendarTheme_.topPadding = pattern->GetAttr<Dimension>("top_padding", 16.0_vp); 397 theme->calendarTheme_.workStateWidth = pattern->GetAttr<Dimension>("work_state_width", 16.0_vp); 398 theme->calendarTheme_.workStateHorizontalMovingDistance = 399 pattern->GetAttr<Dimension>("work_state_horizontal_moving_distance", 2.0_vp); 400 theme->calendarTheme_.workStateVerticalMovingDistance = 401 pattern->GetAttr<Dimension>("work_state_vertical_moving_distance", 16.0_vp); 402 theme->calendarTheme_.colSpace = pattern->GetAttr<Dimension>("column_space", 39.0_vp); 403 theme->calendarTheme_.weekHeight = pattern->GetAttr<Dimension>("week_height", 19.0_vp); 404 theme->calendarTheme_.dayHeight = pattern->GetAttr<Dimension>("day_height", 41.0_vp); 405 theme->calendarTheme_.weekWidth = pattern->GetAttr<Dimension>("week_width", 48.0_vp); 406 theme->calendarTheme_.dayWidth = pattern->GetAttr<Dimension>("day_width", 48.0_vp); 407 theme->calendarTheme_.weekAndDayRowSpace = pattern->GetAttr<Dimension>("week_and_day_space", 12.0_vp); 408 theme->calendarTheme_.dailyFiveRowSpace = pattern->GetAttr<Dimension>("five_row_space", 20.0_vp); 409 theme->calendarTheme_.dailySixRowSpace = pattern->GetAttr<Dimension>("six_row_space", 10.0_vp); 410 theme->calendarTheme_.gregorianCalendarHeight = pattern->GetAttr<Dimension>("gregorian_height", 25.0_vp); 411 theme->calendarTheme_.dayFontWeight = pattern->GetAttr<std::string>("day_font_weight", "500"); 412 theme->calendarTheme_.lunarDayFontWeight = pattern->GetAttr<std::string>("lunar_day_font_weight", "500"); 413 theme->calendarTheme_.workStateFontWeight = pattern->GetAttr<std::string>("work_state_font_weight", "400"); 414 theme->calendarTheme_.workStateOffset = 415 pattern->GetAttr<Dimension>("work_state_center_adjustment", 0.0_vp); 416 theme->calendarTheme_.dayYAxisOffset = pattern->GetAttr<Dimension>("day_yaxis_offset", 4.0_vp); 417 theme->calendarTheme_.lunarDayYAxisOffset = pattern->GetAttr<Dimension>("lunar_day_yaxis_offset", 23.0_vp); 418 theme->calendarTheme_.underscoreXAxisOffset = 419 pattern->GetAttr<Dimension>("underscore_xaxis_offset", 12.0_vp); 420 theme->calendarTheme_.underscoreYAxisOffset = 421 pattern->GetAttr<Dimension>("underscore_yaxis_offset", 36.0_vp); 422 theme->calendarTheme_.scheduleMarkerXAxisOffset = 423 pattern->GetAttr<Dimension>("schedule_marker_xaxis_offset", 22.0_vp); 424 theme->calendarTheme_.scheduleMarkerYAxisOffset = 425 pattern->GetAttr<Dimension>("schedule_marker_yaxis_offset", 40.0_vp); 426 theme->calendarTheme_.touchCircleStrokeWidth = 427 pattern->GetAttr<Dimension>("touch_circle_stroke_width", 1.0_vp); 428 theme->calendarTheme_.lunarHeight = pattern->GetAttr<Dimension>("lunar_height", 14.0_vp); 429 theme->calendarTheme_.underscoreWidth = pattern->GetAttr<Dimension>("underscore_width", 1.0_vp); 430 theme->calendarTheme_.underscoreLength = pattern->GetAttr<Dimension>("underscore_length", 20.0_vp); 431 theme->calendarTheme_.scheduleMarkerRadius = 432 pattern->GetAttr<Dimension>("schedule_marker_radius", 2.0_vp); 433 } 434 ParseCardCalendarThemePattern(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)435 void ParseCardCalendarThemePattern(const RefPtr<ThemeConstants>& themeConstants, 436 const RefPtr<CalendarTheme>& theme) const 437 { 438 RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR); 439 CHECK_NULL_VOID(pattern); 440 theme->cardCalendarTheme_.arrowHeight = pattern->GetAttr<Dimension>("arrow_height", 16.0_vp); 441 theme->cardCalendarTheme_.arrowWidth = pattern->GetAttr<Dimension>("arrow_width", 16.0_vp); 442 theme->cardCalendarTheme_.buttonHeight = 443 pattern->GetAttr<Dimension>("card_calendar_button_height", 32.0_vp); 444 theme->cardCalendarTheme_.buttonWidth = 445 pattern->GetAttr<Dimension>("card_calendar_button_width", 32.0_vp); 446 theme->cardCalendarTheme_.titleFontSize = 447 pattern->GetAttr<Dimension>("card_calendar_title_font_size", 16.0_vp); 448 theme->cardCalendarTheme_.focusedDayColor = 449 pattern->GetAttr<Color>("today_day_focus_color", Color(0xFFFFFFFF)); 450 theme->cardCalendarTheme_.touchColor = pattern->GetAttr<Color>("calendar_touch_color", Color(0x320A59F7)); 451 theme->cardCalendarTheme_.topPadding = pattern->GetAttr<Dimension>("card_calendar_top_padding", 0.0_vp); 452 theme->cardCalendarTheme_.weekHeight = pattern->GetAttr<Dimension>("card_calendar_week_height", 14.0_vp); 453 theme->cardCalendarTheme_.dayHeight = pattern->GetAttr<Dimension>("card_calendar_day_height", 44.0_vp); 454 theme->cardCalendarTheme_.weekWidth = pattern->GetAttr<Dimension>("card_calendar_week_width", 44.0_vp); 455 theme->cardCalendarTheme_.dayWidth = pattern->GetAttr<Dimension>("card_calendar_day_width", 44.0_vp); 456 theme->cardCalendarTheme_.focusedAreaRadius = 457 pattern->GetAttr<Dimension>("card_calendar_focus_area_radius", 22.0_vp); 458 theme->cardCalendarTheme_.weekFontSize = 459 pattern->GetAttr<Dimension>("card_calendar_week_font_size", 10.0_fp); 460 theme->cardCalendarTheme_.dayFontSize = 461 pattern->GetAttr<Dimension>("card_calendar_day_font_size", 16.0_vp); 462 theme->cardCalendarTheme_.gregorianCalendarHeight = 463 pattern->GetAttr<Dimension>("card_calendar_gregorian_height", 24.0_vp); 464 theme->cardCalendarTheme_.lunarDayFontSize = 465 pattern->GetAttr<Dimension>("card_calendar_lunar_font_size", 10.0_vp); 466 theme->cardCalendarTheme_.workDayMarkColor = pattern->GetAttr<Color>("work_mark_color", Color(0xffe83f26)); 467 theme->cardCalendarTheme_.weekAndDayRowSpace = 468 pattern->GetAttr<Dimension>("card_calendar_week_day_row_space", 4.0_vp); 469 theme->cardCalendarTheme_.dailyFiveRowSpace = 470 pattern->GetAttr<Dimension>("card_calendar_daily_five_row_space", 10.0_vp); 471 theme->cardCalendarTheme_.dayYAxisOffset = pattern->GetAttr<Dimension>("day_yaxis_offset", 4.0_vp); 472 theme->cardCalendarTheme_.lunarDayYAxisOffset = 473 pattern->GetAttr<Dimension>("lunar_day_yaxis_offset", 23.0_vp); 474 theme->cardCalendarTheme_.underscoreXAxisOffset = 475 pattern->GetAttr<Dimension>("underscore_xaxis_offset", 12.0_vp); 476 theme->cardCalendarTheme_.underscoreYAxisOffset = 477 pattern->GetAttr<Dimension>("underscore_yaxis_offset", 36.0_vp); 478 theme->cardCalendarTheme_.scheduleMarkerXAxisOffset = 479 pattern->GetAttr<Dimension>("schedule_marker_xaxis_offset", 22.0_vp); 480 theme->cardCalendarTheme_.scheduleMarkerYAxisOffset = 481 pattern->GetAttr<Dimension>("schedule_marker_yaxis_offset", 40.0_vp); 482 } 483 ParseNewPattern(const RefPtr<ThemeConstants> & themeConstants,const RefPtr<CalendarTheme> & theme)484 void ParseNewPattern(const RefPtr<ThemeConstants>& themeConstants, const RefPtr<CalendarTheme>& theme) const 485 { 486 RefPtr<ThemeStyle> pattern = themeConstants->GetPatternByName(THEME_PATTERN_CALENDAR); 487 if (!pattern) { 488 LOGW("find pattern of calendar fail"); 489 return; 490 } 491 ParseCalendarThemePattern(themeConstants, theme); 492 ParseCardCalendarThemePattern(themeConstants, theme); 493 theme->cardCalendarTheme_.lunarHeight = pattern->GetAttr<Dimension>("lunar_height", 14.0_vp); 494 theme->cardCalendarTheme_.underscoreWidth = pattern->GetAttr<Dimension>("underscore_width", 1.0_vp); 495 theme->cardCalendarTheme_.underscoreLength = pattern->GetAttr<Dimension>("underscore_length", 20.0_vp); 496 theme->cardCalendarTheme_.scheduleMarkerRadius = 497 pattern->GetAttr<Dimension>("schedule_marker_radius", 2.0_vp); 498 theme->cardCalendarTheme_.boundaryColOffset = 499 pattern->GetAttr<Dimension>("boundary_col_offset", 50.0_vp); 500 std::string isButtonTransparent = 501 pattern->GetAttr<std::string>("calendar_picker_dialog_button_transparent", "true"); 502 theme->isButtonTransparent_ = (isButtonTransparent == "true"); 503 std::string isDividerTransparent = 504 pattern->GetAttr<std::string>("calendar_picker_dialog_divider_transparent", "false"); 505 theme->isDividerTransparent_ = (isDividerTransparent == "true"); 506 theme->calendarPickerLargeScale_ = pattern->GetAttr<double>("calendar_picker_large_scale", 1.75); 507 theme->calendarPickerLargerScale_ = pattern->GetAttr<double>("calendar_picker_larger_scale", 2.0); 508 } 509 }; 510 GetCalendarTheme()511 CalendarThemeStructure& GetCalendarTheme() 512 { 513 return calendarTheme_; 514 } 515 GetCardCalendarTheme()516 CalendarThemeStructure& GetCardCalendarTheme() 517 { 518 return cardCalendarTheme_; 519 } 520 GetEntryHeight()521 const Dimension& GetEntryHeight() const 522 { 523 return entryHeight_; 524 } 525 GetEntryBorderWidth()526 const Dimension& GetEntryBorderWidth() const 527 { 528 return entryBorderWidth_; 529 } 530 GetEntryBorderColor()531 const Color& GetEntryBorderColor() const 532 { 533 return entryBorderColor_; 534 } 535 GetEntryBorderRadius()536 const Dimension& GetEntryBorderRadius() const 537 { 538 return entryBorderRadius_; 539 } 540 GetEntryButtonWidth()541 const Dimension& GetEntryButtonWidth() const 542 { 543 return entryButtonWidth_; 544 } 545 GetEntryDateTopBottomMargin()546 const Dimension& GetEntryDateTopBottomMargin() const 547 { 548 return entryDateTopBottomMargin_; 549 } 550 GetEntryDateLeftRightMargin()551 const Dimension& GetEntryDateLeftRightMargin() const 552 { 553 return entryDateLeftRightMargin_; 554 } 555 GetEntryArrowWidth()556 const Dimension& GetEntryArrowWidth() const 557 { 558 return entryArrowwidth_; 559 } 560 GetEntryArrowHeight()561 const Dimension& GetEntryArrowHeight() const 562 { 563 return entryArrowHeight_; 564 } 565 GetEntryArrowColor()566 const Color& GetEntryArrowColor() const 567 { 568 return entryArrowColor_; 569 } 570 GetDialogMargin()571 const Dimension& GetDialogMargin() const 572 { 573 return dialogMargin_; 574 } 575 GetSelectBackgroundColor()576 const Color& GetSelectBackgroundColor() const 577 { 578 return selectBackgroundColor_; 579 } 580 GetCalendarPickerDayWidthOrHeight()581 const Dimension& GetCalendarPickerDayWidthOrHeight() const 582 { 583 return calendarPickerDayWidthOrHeight_; 584 } 585 GetCalendarPickerDayLargeWidthOrHeight()586 const Dimension& GetCalendarPickerDayLargeWidthOrHeight() const 587 { 588 return calendarPickerDayLargeWidthOrHeight_; 589 } 590 GetCalendarDayFontSize()591 const Dimension& GetCalendarDayFontSize() const 592 { 593 return calendarDayFontSize_; 594 } 595 GetCalendarSmallDayFontSize()596 const Dimension& GetCalendarSmallDayFontSize() const 597 { 598 return calendarSmallWeekFontSize_; 599 } 600 GetDistanceBetweenContainterAndDate()601 const Dimension& GetDistanceBetweenContainterAndDate() const 602 { 603 return distanceBetweenContainterAndDate_; 604 } 605 GetDistanceBetweenTitleAndDate()606 const Dimension& GetDistanceBetweenTitleAndDate() const 607 { 608 return distanceBetweenTitleAndDate_; 609 } 610 GetCalendarContainerHeight()611 const Dimension& GetCalendarContainerHeight() const 612 { 613 return dalendarContainerHeight_; 614 } 615 GetCalendarLargeContainerHeight()616 const Dimension& GetCalendarLargeContainerHeight() const 617 { 618 return calendarLargeContainerHeight_; 619 } 620 GetCalendarLargerContainerHeight()621 const Dimension& GetCalendarLargerContainerHeight() const 622 { 623 return calendarLargerContainerHeight_; 624 } 625 GetCalendarTitleFontSize()626 const Dimension& GetCalendarTitleFontSize() const 627 { 628 return calendarTitleFontSize_; 629 } 630 GetCalendarTitleRowHeight()631 const Dimension& GetCalendarTitleRowHeight() const 632 { 633 return calendarTitleRowHeight_; 634 } 635 GetCalendarTitleLargeRowHeight()636 const Dimension& GetCalendarTitleLargeRowHeight() const 637 { 638 return calendarTitleLargeRowHeight_; 639 } 640 GetCalendarTitleLargerRowHeight()641 const Dimension& GetCalendarTitleLargerRowHeight() const 642 { 643 return calendarTitleLargerRowHeight_; 644 } 645 GetCalendarTitleRowTopPadding()646 const Dimension& GetCalendarTitleRowTopPadding() const 647 { 648 return calendarTitleRowTopPadding_; 649 } 650 GetCalendarTitleRowLeftRightPadding()651 const Dimension& GetCalendarTitleRowLeftRightPadding() const 652 { 653 return calendarTitleRowLeftRightPadding_; 654 } 655 GetCalendarTitleTextPadding()656 const Dimension& GetCalendarTitleTextPadding() const 657 { 658 return calendarTitleTextPadding_; 659 } 660 GetCalendarTitleImagePadding()661 const Dimension& GetCalendarTitleImagePadding() const 662 { 663 return calendarTitleImagePadding_; 664 } 665 GetCalendarImageWidthHeight()666 const Dimension& GetCalendarImageWidthHeight() const 667 { 668 return calendarImageWidthHeight_; 669 } 670 GetCalendarActionRowTopPadding()671 const Dimension& GetCalendarActionRowTopPadding() const 672 { 673 return calendarActionRowTopPadding_; 674 } 675 GetCalendarActionRowBottomLeftRightPadding()676 const Dimension& GetCalendarActionRowBottomLeftRightPadding() const 677 { 678 return calendarActionRowBottomLeftRightPadding_; 679 } 680 GetCalendarActionRowHeight()681 const Dimension& GetCalendarActionRowHeight() const 682 { 683 return calendarActionRowHeight_; 684 } 685 GetCalendarActionLargeRowHeight()686 const Dimension& GetCalendarActionLargeRowHeight() const 687 { 688 return calendarActionLargeRowHeight_; 689 } 690 GetCalendarDayRadius()691 const Dimension& GetCalendarDayRadius() const 692 { 693 return calendarDayRadius_; 694 } 695 GetCalendarDayKeyFocusedWidth()696 const Dimension& GetCalendarDayKeyFocusedWidth() const 697 { 698 return calendarDayKeyFocusedWidth_; 699 } 700 GetCalendarLargeDayKeyFocusedWidth()701 const Dimension& GetCalendarLargeDayKeyFocusedWidth() const 702 { 703 return calendarLargeDayKeyFocusedWidth_; 704 } 705 GetCalendarDayKeyFocusedPenWidth()706 const Dimension& GetCalendarDayKeyFocusedPenWidth() const 707 { 708 return calendarDayKeyFocusedPenWidth_; 709 } 710 GetEntryFontSize()711 const Dimension& GetEntryFontSize() const 712 { 713 return entryFontSize_; 714 } 715 GetDialogBorderRadius()716 const Dimension& GetDialogBorderRadius() const 717 { 718 return dialogBorderRadius_; 719 } 720 GetDialogBackgroundColor()721 const Color& GetDialogBackgroundColor() const 722 { 723 return dialogBackgroundColor_; 724 } 725 GetCalendarTitleFontColor()726 const Color& GetCalendarTitleFontColor() const 727 { 728 return calendarTitleFontColor_; 729 } 730 GetTextCurrentMonthColor()731 const Color& GetTextCurrentMonthColor() const 732 { 733 return textCurrentMonthColor_; 734 } 735 GetTextNonCurrentMonthColor()736 const Color& GetTextNonCurrentMonthColor() const 737 { 738 return textNonCurrentMonthColor_; 739 } 740 GetTextNonCurrentMonthTodayColor()741 const Color& GetTextNonCurrentMonthTodayColor() const 742 { 743 return textNonCurrentMonthTodayColor_; 744 } 745 GetTextSelectedDayColor()746 const Color& GetTextSelectedDayColor() const 747 { 748 return textSelectedDayColor_; 749 } 750 GetTextCurrentDayColor()751 const Color& GetTextCurrentDayColor() const 752 { 753 return textCurrentDayColor_; 754 } 755 GetBackgroundKeyFocusedColor()756 const Color& GetBackgroundKeyFocusedColor() const 757 { 758 return backgroundKeyFocusedColor_; 759 } 760 GetBackgroundSelectedTodayColor()761 const Color& GetBackgroundSelectedTodayColor() const 762 { 763 return backgroundSelectedTodayColor_; 764 } 765 GetBackgroundDisabledMarkTodayColor()766 const Color& GetBackgroundDisabledMarkTodayColor() const 767 { 768 return backgroundDisabledMarkTodayColor_; 769 } 770 GetBackgroundSelectedNotTodayColor()771 const Color& GetBackgroundSelectedNotTodayColor() const 772 { 773 return backgroundSelectedNotTodayColor_; 774 } 775 GetBackgroundHoverColor()776 const Color& GetBackgroundHoverColor() const 777 { 778 return backgroundHoverColor_; 779 } 780 GetBackgroundPressColor()781 const Color& GetBackgroundPressColor() const 782 { 783 return backgroundPressColor_; 784 } 785 GetEntryFontColor()786 const Color& GetEntryFontColor() const 787 { 788 return entryFontColor_; 789 } 790 GetDialogDividerColor()791 const Color& GetDialogDividerColor() const 792 { 793 return dialogDividerColor_; 794 } 795 GetDialogButtonBackgroundColor()796 const Color& GetDialogButtonBackgroundColor() const 797 { 798 return dialogButtonBackgroundColor_; 799 } 800 GetIsButtonTransparent()801 bool GetIsButtonTransparent() const 802 { 803 return isButtonTransparent_; 804 } 805 GetIsDividerTransparent()806 bool GetIsDividerTransparent() const 807 { 808 return isDividerTransparent_; 809 } 810 GetCalendarPickerLargeScale()811 double GetCalendarPickerLargeScale() const 812 { 813 return calendarPickerLargeScale_; 814 } 815 GetCalendarPickerLargerScale()816 double GetCalendarPickerLargerScale() const 817 { 818 return calendarPickerLargerScale_; 819 } 820 GetCalendarPickerDialogBlurStyle()821 int GetCalendarPickerDialogBlurStyle() const 822 { 823 return calendarPickerDialogBlurStyle_; 824 } 825 826 protected: 827 CalendarTheme() = default; 828 829 private: 830 CalendarThemeStructure calendarTheme_; 831 CalendarThemeStructure cardCalendarTheme_; 832 Color entryBorderColor_; 833 Color entryArrowColor_; 834 Color selectBackgroundColor_; 835 Color dialogBackgroundColor_; 836 Color calendarTitleFontColor_; 837 Color textCurrentMonthColor_; 838 Color textNonCurrentMonthColor_; 839 Color textNonCurrentMonthTodayColor_; 840 Color textSelectedDayColor_; 841 Color textCurrentDayColor_; 842 Color backgroundKeyFocusedColor_; 843 Color backgroundSelectedTodayColor_; 844 Color backgroundDisabledMarkTodayColor_; 845 Color backgroundSelectedNotTodayColor_; 846 Color backgroundHoverColor_; 847 Color backgroundPressColor_; 848 Color entryFontColor_; 849 Color dialogDividerColor_; 850 Color dialogButtonBackgroundColor_; 851 Dimension entryHeight_; 852 Dimension entryBorderWidth_; 853 Dimension entryBorderRadius_; 854 Dimension entryButtonWidth_; 855 Dimension entryArrowHeight_; 856 Dimension entryArrowwidth_; 857 Dimension entryDateLeftRightMargin_; 858 Dimension entryDateTopBottomMargin_; 859 Dimension dialogMargin_; 860 Dimension calendarPickerDayWidthOrHeight_; 861 Dimension calendarPickerDayLargeWidthOrHeight_; 862 Dimension calendarDayFontSize_; 863 Dimension calendarSmallWeekFontSize_; 864 Dimension distanceBetweenContainterAndDate_; 865 Dimension distanceBetweenTitleAndDate_; 866 Dimension dalendarContainerHeight_; 867 Dimension calendarLargeContainerHeight_; 868 Dimension calendarLargerContainerHeight_; 869 Dimension calendarTitleFontSize_; 870 Dimension calendarTitleRowHeight_; 871 Dimension calendarTitleLargeRowHeight_; 872 Dimension calendarTitleLargerRowHeight_; 873 Dimension calendarTitleRowTopPadding_; 874 Dimension calendarTitleRowLeftRightPadding_; 875 Dimension calendarTitleTextPadding_; 876 Dimension calendarTitleImagePadding_; 877 Dimension calendarImageWidthHeight_; 878 Dimension calendarActionRowTopPadding_; 879 Dimension calendarActionRowBottomLeftRightPadding_; 880 Dimension calendarActionRowHeight_; 881 Dimension calendarActionLargeRowHeight_; 882 Dimension calendarDayRadius_; 883 Dimension calendarDayKeyFocusedWidth_; 884 Dimension calendarLargeDayKeyFocusedWidth_; 885 Dimension calendarDayKeyFocusedPenWidth_; 886 Dimension entryFontSize_; 887 Dimension dialogBorderRadius_; 888 bool isButtonTransparent_ = true; 889 bool isDividerTransparent_ = false; 890 double calendarPickerLargeScale_ = 0.0; 891 double calendarPickerLargerScale_ = 0.0; 892 int calendarPickerDialogBlurStyle_ = static_cast<int>(BlurStyle::COMPONENT_ULTRA_THICK); 893 }; 894 895 } // namespace OHOS::Ace 896 897 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_CALENDAR_CALENDAR_THEME_H 898