${CMAKE_CURRENT_SOURCE_DIR}/../service/smart_voice/smart_voice_service/interfaces/innerkits/native_c/include
${CMAKE_CURRENT_SOURCE_DIR}/../service/smart_voice/voice_engine_hal/interfaces/innerkits/native_c/include
${CMAKE_CURRENT_SOURCE_DIR}/../ohos_deps
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../battery
${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits
${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include
#include "components/ui_box_progress.h"
#include "components/ui_image_view.h"
#include "components/ui_label.h"
+#include "battery.h"
+extern uint8_t battery_get_voltage(float *voltage);
namespace OHOS {
static constexpr int16_t SEC_TO_MILLI = 1000;
static constexpr int16_t USEC_TO_MILLI = 1000;
~ProgressCallback() {}
virtual void Callback(UIView *view)
{
- int value = std::rand() % 101; // 生成一个介于 0 和 100 之间的随机数
+ //int value = std::rand() % 101; // 生成一个介于 0 和 100 之间的随机数
+ float voltage = 0.0F ;
+ // battery_get_voltage_by_channel(&voltage,channel);
+ uint8_t value = battery_get_voltage(&voltage);
char* progress1ForeImageSrc = nullptr;
char* progress1BackImageSrc = nullptr;
if (value <= 10) {
#include "common/image_cache_manager.h"
#include <time.h>
+
+
namespace OHOS {
static MainClockView *g_pMainClockView = nullptr;
if (progress == nullptr) {
progress = new UIBoxProgress();
}
- progress->SetPosition(182, 58); // widget's left position and top position
+ progress->SetPosition(180, 58); // widget's left position and top position
progress->Resize(31, 19); // widget's width and height
progress->SetViewId("progress1");// Set style
progress->SetStyle(STYLE_BACKGROUND_OPA, 0xff);