Skip to content

Commit 513c339

Browse files
authored
Merge pull request #6 from Forairaaaaa/adapt-new-screen
Adapt new screen
2 parents 077b312 + d079d04 commit 513c339

12 files changed

Lines changed: 2409 additions & 1482 deletions

File tree

app/apps/app_startup_anim/app_startup_anim.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ using namespace mooncake;
1313
using namespace smooth_ui_toolkit;
1414
using namespace smooth_ui_toolkit::lvgl_cpp;
1515

16+
#define FIRMWARE_VERSION "V0.2"
17+
1618
AppStartupAnim::AppStartupAnim()
1719
{
1820
// 配置 App 信息
@@ -43,6 +45,12 @@ void AppStartupAnim::onOpen()
4345
_logo_5->setSrc(&logo_5);
4446
_logo_5->setPos(700, 308);
4547

48+
_label_version = std::make_unique<Label>(lv_screen_active());
49+
_label_version->setTextColor(lv_color_hex(0xCCCCCC));
50+
_label_version->setTextFont(&lv_font_montserrat_24);
51+
_label_version->align(LV_ALIGN_CENTER, 580, 320);
52+
_label_version->setText(FIRMWARE_VERSION);
53+
4654
_anim_logo_tab_y.pause();
4755
_anim_logo_tab_y.teleport(785);
4856
_anim_logo_tab_y.springOptions().visualDuration = 0.6;
@@ -90,6 +98,7 @@ void AppStartupAnim::onRunning()
9098
}
9199
if (!_is_sfx_played) {
92100
if (_anim_logo_5_x.directValue() < 90) {
101+
GetHAL()->setSpeakerVolume(80);
93102
GetHAL()->playStartupSfx();
94103
_is_sfx_played = true;
95104
}
@@ -118,4 +127,7 @@ void AppStartupAnim::onClose()
118127

119128
_logo_tab.reset();
120129
_logo_5.reset();
130+
_label_version.reset();
131+
132+
GetHAL()->setSpeakerVolume(60);
121133
}

app/apps/app_startup_anim/app_startup_anim.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#pragma once
77
#include <mooncake.h>
88
#include <memory>
9+
#include "lvgl_cpp/label.h"
910
#include <smooth_ui_toolkit.h>
1011
#include <smooth_lvgl.h>
1112
#include <stdint.h>
@@ -35,6 +36,7 @@ class AppStartupAnim : public mooncake::AppAbility {
3536
AnimState_t _anime_state = AnimState_StartupDelay;
3637
std::unique_ptr<smooth_ui_toolkit::lvgl_cpp::Image> _logo_tab;
3738
std::unique_ptr<smooth_ui_toolkit::lvgl_cpp::Image> _logo_5;
39+
std::unique_ptr<smooth_ui_toolkit::lvgl_cpp::Label> _label_version;
3840
smooth_ui_toolkit::AnimateValue _anim_logo_tab_y;
3941
smooth_ui_toolkit::AnimateValue _anim_logo_tab_opa;
4042
smooth_ui_toolkit::AnimateValue _anim_logo_5_x;

platforms/tab5/components/m5stack_tab5/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
idf_component_register(
3-
SRCS "m5stack_tab5.c"
3+
SRCS "m5stack_tab5.c" "esp_lcd_st7123.c"
44
INCLUDE_DIRS "include"
55
INCLUDE_DIRS "include/bsp"
66
PRIV_INCLUDE_DIRS "priv_include"
@@ -10,5 +10,6 @@ idf_component_register(
1010
esp_codec_dev
1111
esp_lvgl_port
1212
esp_lcd_ili9881c
13+
esp_lcd_touch_st7123
1314
PRIV_REQUIRES usb spiffs fatfs
1415
)

0 commit comments

Comments
 (0)