From f062bb127bffb250cb0be9366eb5a64bfa55a4ff Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Mon, 1 Jul 2024 10:11:07 +0800 Subject: [PATCH] =?utf8?q?LCD=E8=A1=A5=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/producttest/src/testLCD.cpp | 46 ++++++++++++++++--- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp index f6b885d97..ea29e3b82 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp @@ -76,17 +76,18 @@ namespace OHOS testLCDScrollView=nullptr; } } - + uint8_t LCD_TEST_FALG=0; void colorTimerCallBack(int data) { testLCDView* t= testLCDView::GetInstance(); if(t!=NULL) - t->set_LCD_color(); + t->set_LCD_color(LCD_TEST_FALG); + LCD_TEST_FALG++; } - uint8_t LCD_TEST_FALG=0; - void testLCDView :: set_LCD_color(void) + + void testLCDView :: set_LCD_color(int color) { - switch (LCD_TEST_FALG) + switch (color) { case 0: testLCDScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Green().full); @@ -97,11 +98,20 @@ namespace OHOS case 2: testLCDScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Yellow().full); break; + case 3: + testLCDScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); + break; + case 4: + testLCDScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::White().full); + break; + case 5: + testLCDScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); + break; default: break; } RootView::GetInstance()->Invalidate(); - LCD_TEST_FALG++; + //LCD_TEST_FALG++; } @@ -147,7 +157,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::draglistener can not be nullptr!"); return false; } - testLCDScrollView->SetOnDragListener(draglistener); + testLCDScrollView->SetOnDragListener(draglistener); testLCDScrollView->SetTouchable(true); testLCDScrollView->SetDraggable(true); @@ -174,4 +184,26 @@ namespace OHOS } return testLCDScrollView; } + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif /* __cplusplus */ +#endif /* __cplusplus */ + + void ble_factorytest_set_LCD_color(int color) + { + testLCDView* t= testLCDView::GetInstance(); + + if(t!=NULL) + t->set_LCD_color(color); + } + + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ } \ No newline at end of file -- 2.17.1