进入支付宝添加最大亮度设备,乘车码界面修改 1744/2
authorluozheng <1732036298@qq.com>
Mon, 12 May 2025 03:08:47 +0000 (11:08 +0800)
committerluozheng <1732036298@qq.com>
Mon, 12 May 2025 03:08:47 +0000 (11:08 +0800)
code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayModel.cpp
code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayTrans/AlipayTransListView.cpp

index d7f70e5..5144ac3 100644 (file)
@@ -14,6 +14,7 @@
 #include "power_display_service.h"\r
 #include "custom_utils.h"\r
 #include "bleService.h"\r
+#include "ConfigModel.h"\r
 namespace OHOS {\r
 AlipayModel::AlipayModel() : alipayApi(alipay_svr_get_api())\r
 {\r
@@ -709,11 +710,13 @@ void AlipayModel::AlipayScreenControl(bool turnOnFlag)
         // //当设置的值是-1 的时候,设置屏幕常亮\r
         // display_api->set_screen_set_keepon_timeout(-1);\r
         ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON);\r
+        uapi_setScreenBrightness(MAX_BRIGHTNESS); //最高亮度\r
     }\r
     else\r
     {\r
         // display_api->set_screen_set_keepon_timeout(0);\r
         ScreenAlwaysOnCtr(CANCEL_SCREEN_ALWAYS_ON);\r
+        uapi_setScreenBrightness(ConfigModel::GetInstance()->GetBrightness());//退出APP将亮度恢复到ConfigModel中设置的亮度值\r
     }\r
 }\r
 \r
index c1ca6ed..b5307c5 100644 (file)
@@ -21,10 +21,10 @@ static constexpr int16 LIST_POS = 20;
 static constexpr int16 SNUM_2 = 2;
 
 static const int16 REFRESH_BUTTON_FONT = 38;
-static const int16 REFRESH_BUTTON_X = 189;
+static const int16 REFRESH_BUTTON_X = 133;
 static const int16 REFRESH_BUTTON_Y = 400;
-static const int16 REFRESH_BUTTON_WIDTH = 76;
-static const int16 REFRESH_BUTTON_HEIGHT = 53;
+static const int16 REFRESH_BUTTON_WIDTH = 200;
+static const int16 REFRESH_BUTTON_HEIGHT = 60;
 static const char *REFRESH_BUTTON = (char *)"刷新";
 
 AlipayTransList::AlipayTransList(AlipayPresenter *presenter)
@@ -67,14 +67,15 @@ bool AlipayTransList::AlipayInitList()
         return false;
     }
     contentList->SetPosition(ALIPAY_TRANS_LIST_POSITION_X, ALIPAY_TRANS_LIST_POSITION_Y);
-    contentList->Resize(380, 340);
-    contentList->SetScrollBlankSize(ALIPAY_TRANS_LIST_SCROLLBLANKSIZE);
+    contentList->Resize(380, 300);
+    // contentList->SetScrollBlankSize(ALIPAY_TRANS_LIST_SCROLLBLANKSIZE);
+    contentList->SetReboundSize(15);
     contentList->SetSelectPosition(HORIZONTAL_RESOLUTION / SNUM_2); // middle position
     contentList->SetDraggable(true);
     contentList->SetThrowDrag(false);
     contentList->EnableAutoAlign(true);
     contentList->SetMaxScrollDistance(MAX_SCR_DIS);
-    contentList->SetYScrollBarVisible(true);
+    contentList->SetYScrollBarVisible(false);
     AddAlipayTransListItemToList();
     Add(contentList);
     contentList->SetAdapter(listAdapter);
@@ -108,7 +109,9 @@ bool AlipayTransList::AlipayInitButton()
 
     buttonRefresh->SetTextColor(Color::Blue());
     buttonRefresh->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
+    buttonRefresh->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
     buttonRefresh->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
+    buttonRefresh->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED);
 
     buttonRefresh->SetOnClickListener(presenter_);
     Add(buttonRefresh);
@@ -136,6 +139,19 @@ bool AlipayTransList::InitListView()
         return false;
     }
 
+    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "cardCount = %d", listLen);
+    if(listLen > 3)
+    {
+        contentList->SetHeight(300);
+        int16_t y = contentList->GetY() + contentList->GetHeight() + 10;
+        buttonRefresh->SetY(y);
+    }
+    else
+    {
+        contentList->SetHeight(listLen * 100);
+        buttonRefresh->SetY(REFRESH_BUTTON_Y);
+    }
+
     return true;
 }