From 35871a1a1d1018f590d96acf0915d737c8a2dafb Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Wed, 5 Mar 2025 09:45:08 +0800 Subject: [PATCH] =?utf8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E7=95=8C=E9=9D=A2UI?= =?utf8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../include/AlipayList/AlipayListItem.h | 2 +- .../include/AlipayList/AlipayListItemView.h | 1 + .../include/AlipayList/AlipayListView.h | 5 +- .../nativeui/alipay/include/AlipayPresenter.h | 10 +-- .../nativeui/alipay/include/AlipaySetting.h | 8 +- .../nativeui/alipay/src/AlipayExitBind.cpp | 12 +-- .../src/AlipayList/AlipayListAdapter.cpp | 6 +- .../src/AlipayList/AlipayListItemView.cpp | 81 ++++++++++++++----- .../alipay/src/AlipayList/AlipayListView.cpp | 33 ++++++-- .../nativeui/alipay/src/AlipaySetting.cpp | 52 ++++++------ .../src/AlipayTrans/AlipayTransTips.cpp | 30 +++---- .../nativeui/alipay/src/AlipayUnbind.cpp | 3 +- .../alipay/src/AlipayUnbindFinish.cpp | 34 ++++---- 13 files changed, 174 insertions(+), 103 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListItem.h b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListItem.h index a9d5d3dda..4782ae033 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListItem.h +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListItem.h @@ -15,7 +15,7 @@ namespace OHOS { /* * alipayList id. */ -#define SUPPORT_ALIPAY_TRANS 0 +#define SUPPORT_ALIPAY_TRANS 1 typedef enum : uint16_t { // alipayList item index ALIPAY_LIST_ITEM_PAY, diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListItemView.h b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListItemView.h index 02cd06f9b..45424739b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListItemView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListItemView.h @@ -29,6 +29,7 @@ private: UIImageView sIcon; UILabel sLabel; UIImageView sNextImage; + UIImageView back; AlipayListItem sItemInfo; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListView.h b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListView.h index 075df439d..769ada767 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListView.h @@ -17,7 +17,8 @@ #include "components/ui_scroll_view.h" #include "components/ui_list.h" #include "components/icon_adapter.h" -#include "AlipayPresenter.h" +// #include "AlipayPresenter.h" +#include "alipay/include/AlipayPresenter.h" #include "AppViewIDs.h" #include"ui_resource_string.h" #include "UiConfig.h" @@ -39,7 +40,7 @@ private: AlipayPresenter *presenter_; AlipayListAdapter *listAdapter { nullptr }; UIList *contentList { nullptr }; - AlipayListItem alipayLists[ALIPAY_LIST_ITEM_MAX]; + AlipayListItem alipayLists[ALIPAY_LIST_ITEM_MAX + 1] = {ALIPAY_LIST_ITEM_MAX,nullptr,nullptr,nullptr,false}; //加1是为了给标题一个位置(UI优化) }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayPresenter.h index 9690a02a0..46b90bad1 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayPresenter.h @@ -84,11 +84,11 @@ typedef enum { } alipayInterfacesId; typedef enum { - ALIPAY_TRANS_TIPS_UNKNOW = 0, - ALIPAY_TRANS_TIPS_TO_MUCH, - ALIPAY_TRANS_TIPS_SECURE, - ALIPAY_TRANS_TIPS_LIST_UNKNOW, - ALIPAY_TRANS_TIPS_NOT_SUPPORT, + ALIPAY_TRANS_TIPS_UNKNOW = 0, //未知错误_具体错误码,请联系设备厂商解决 + ALIPAY_TRANS_TIPS_TO_MUCH, //开通的乘车码数量太多,清在手机支付宝-出行-管理中,管理后再用 + ALIPAY_TRANS_TIPS_SECURE, //存在安全风险,12小时内不可用,请切换到手机侧使用 + ALIPAY_TRANS_TIPS_LIST_UNKNOW, //未知错误_具体错误码,请联系设备厂商解决 + ALIPAY_TRANS_TIPS_NOT_SUPPORT, //暂不支持,请切换到手机侧使用 } alipayTransTipsId; typedef enum { diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipaySetting.h b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipaySetting.h index a734661ff..3d2c0bfe6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipaySetting.h +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipaySetting.h @@ -26,10 +26,10 @@ private: bool AlipayInitButton(); bool AlipayInitLabel(void); AlipayPresenter *presenter_; - UILabel *labelTitle { nullptr }; - UILabel *labelName { nullptr }; - UILabel *labelId { nullptr }; - UILabelButton *buttonSetting { nullptr }; + UILabel *labelTitle { nullptr }; // 标题:设置 + UILabel *labelName { nullptr }; // 用户名称 + UILabel *labelId { nullptr }; + UILabelButton *buttonSetting { nullptr }; // 解除绑定按钮 }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayExitBind.cpp b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayExitBind.cpp index 2f9bf47d9..c24d18441 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayExitBind.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayExitBind.cpp @@ -13,18 +13,18 @@ namespace OHOS { -static const int16 EXIT_LABEL_X_FIRST = 83; -static const int16 EXIT_LABEL_X_SEC = 53; - static const int16 EXIT_LABEL_WIDTH_FIRST = 300; +static const int16 EXIT_LABEL_WIDTH_SEC = 360; + static const int16 EXIT_LABEL_HEIGHT_FIRST = 35; +static const int16 EXIT_LABEL_HEIGHT_SEC = 70; + +static const int16 EXIT_LABEL_X_FIRST = (HORIZONTAL_RESOLUTION - EXIT_LABEL_WIDTH_FIRST) / 2; +static const int16 EXIT_LABEL_X_SEC = (HORIZONTAL_RESOLUTION - EXIT_LABEL_WIDTH_SEC) / 2; static const int16 EXIT_LABEL_Y_FIRST = 50; static const int16 EXIT_LABEL_Y_SECOND = 222; -static const int16 EXIT_LABEL_WIDTH_SEC = 360; -static const int16 EXIT_LABEL_HEIGHT_SEC = 70; - static const int16 EXIT_LABEL_FONT_FIRST = 30; static const int16 EXIT_LABEL_FONT_SEC = 30; diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayList/AlipayListAdapter.cpp b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayList/AlipayListAdapter.cpp index bf6e90b10..3cc6fdde0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayList/AlipayListAdapter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayList/AlipayListAdapter.cpp @@ -6,8 +6,10 @@ * Create: */ -#include "AlipayListAdapter.h" -#include "AlipayListItemView.h" +// #include "AlipayListAdapter.h" +// #include "AlipayListItemView.h" +#include "alipay/include/AlipayList/AlipayListAdapter.h" +#include "alipay/include/AlipayList/AlipayListItemView.h" namespace OHOS { AlipayListAdapter::AlipayListAdapter() diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayList/AlipayListItemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayList/AlipayListItemView.cpp index 4cd238d8a..63d7316ea 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayList/AlipayListItemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayList/AlipayListItemView.cpp @@ -6,19 +6,28 @@ */ #include "wearable_log.h" -#include "AlipayListItemView.h" +// #include "AlipayListItemView.h" +#include "alipay/include/AlipayList/AlipayListItemView.h" namespace OHOS { -static constexpr int16 ALIPAY_LIST_ICON_X = 20; -static constexpr int16 NUM_22 = 22; -static constexpr int16_t ALIPAY_LIST_ICON_WIDTH = 64; -static constexpr int16_t ALIPAY_LIST_ICON_HEIGHT = 64; -static constexpr int16_t ALIPAY_LIST_ITEM_BUTTON_HEIGHT = 100; -static constexpr int16_t ALIPAY_LIST_ITEM_LABEL_WIDTH = 122; -static constexpr int16_t ALIPAY_LIST_ITEM_LABEL_HEIGHT = 100; -static constexpr int16_t ALIPAY_LIST_ITEM_FONT_SIZE = 40; -static constexpr int16_t ALIPAY_LISTS_RESIZE_SIZE = 100; -static constexpr int16_t ALIPAY_LIST_SICON_Y = 15; +static constexpr int16_t ALIPAY_LIST_ITEM_BUTTON_HEIGHT = 120; + +static constexpr int16 ALIPAY_LIST_BACK_X = 43; +static constexpr int16 ALIPAY_LIST_BACK_Y = 0; +static constexpr int16_t ALIPAY_LIST_BACK_WIDTH = 380; +static constexpr int16_t ALIPAY_LIST_BACK_HEIGHT = 100; + +static constexpr int16 ALIPAY_LIST_ICON_X = 19 + ALIPAY_LIST_BACK_X; +static constexpr int16 ALIPAY_LIST_ICON_Y = 19; +static constexpr int16_t ALIPAY_LIST_ICON_WIDTH = 62; +static constexpr int16_t ALIPAY_LIST_ICON_HEIGHT = 62; + +static constexpr int16_t ALIPAY_LIST_ITEM_LABEL_X = 115 + ALIPAY_LIST_BACK_X; +static constexpr int16_t ALIPAY_LIST_ITEM_LABEL_Y = 33; +static constexpr int16_t ALIPAY_LIST_ITEM_LABEL_WIDTH = 180; +static constexpr int16_t ALIPAY_LIST_ITEM_LABEL_HEIGHT = 35; +static constexpr int16_t ALIPAY_LIST_ITEM_FONT_SIZE = 30; + static constexpr int16 NUMS_2 = 2; static constexpr int16 NUMS_50 = 50; @@ -31,6 +40,7 @@ AlipayListItemView::AlipayListItemView() SetTouchable(true); SetUpChild(); + Add(&back); Add(&sIcon); Add(&sLabel); Add(&sNextImage); @@ -38,6 +48,7 @@ AlipayListItemView::AlipayListItemView() AlipayListItemView::~AlipayListItemView() { + Remove(&back); Remove(&sIcon); Remove(&sLabel); Remove(&sNextImage); @@ -50,30 +61,60 @@ void AlipayListItemView::SetItemInfo(const AlipayListItem &itemInfo) sIcon.SetSrc(itemInfo.icon); sLabel.SetText(itemInfo.label); sNextImage.SetVisible(itemInfo.hasSecondMenu); + if(!sItemInfo.hasSecondMenu) + { + back.SetVisible(false); + sIcon.SetVisible(false); + sNextImage.SetVisible(false); + sLabel.SetPosition((HORIZONTAL_RESOLUTION - ALIPAY_LIST_ITEM_LABEL_WIDTH) / NUMS_2, ALIPAY_LIST_ITEM_LABEL_Y + 17); + sLabel.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + SetHeight(120); + } + else + { + back.SetVisible(true); + sIcon.SetVisible(true); + sNextImage.SetVisible(true); + sLabel.SetPosition(ALIPAY_LIST_ITEM_LABEL_X, ALIPAY_LIST_ITEM_LABEL_Y); + sLabel.SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_CENTER); + if(sItemInfo.index == ALIPAY_LIST_ITEM_HELP) + { + SetHeight(180); + } + else + { + SetHeight(120); + } + } } void AlipayListItemView::SetUpChild() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayListItemView::SetUpChild()"); - sIcon.SetPosition(ALIPAY_LIST_ICON_X, ALIPAY_LIST_SICON_Y); + sIcon.SetPosition(ALIPAY_LIST_ICON_X, ALIPAY_LIST_ICON_Y); sIcon.Resize(ALIPAY_LIST_ICON_WIDTH, ALIPAY_LIST_ICON_HEIGHT); - sIcon.SetAutoEnable(false); - sIcon.SetResizeMode(UIImageView::FILL); + sIcon.SetResizeMode(UIImageView::CENTER); sIcon.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); - sLabel.SetPosition(ALIPAY_LIST_ITEM_LABEL_WIDTH, 0); + sLabel.SetPosition(ALIPAY_LIST_ITEM_LABEL_X, ALIPAY_LIST_ITEM_LABEL_Y); sLabel.Resize(ALIPAY_LIST_ITEM_LABEL_WIDTH, ALIPAY_LIST_ITEM_LABEL_HEIGHT); sLabel.SetFont(DEFAULT_VECTOR_FONT_FILENAME, ALIPAY_LIST_ITEM_FONT_SIZE); - sLabel.SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); - sLabel.SetStyle(STYLE_TEXT_OPA, OPA_OPAQUE); - sLabel.SetStyle(STYLE_TEXT_COLOR, Color::White().full); - sLabel.SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); - sLabel.SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); + sLabel.SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_CENTER); + sLabel.SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); + // sLabel.SetStyle(STYLE_TEXT_OPA, OPA_OPAQUE); + // sLabel.SetStyle(STYLE_TEXT_COLOR, Color::White().full); + // sLabel.SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); + // sLabel.SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); sNextImage.SetSrc(PNG_SETTING_NEXT_IMAGE); sNextImage.SetPosition(LA_HORIZONTAL_RESOLUTION - NUMS_50, (SETTING_ITEM_HEIGHT - sNextImage.GetHeight()) / NUMS_2); sNextImage.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); + + back.SetPosition(ALIPAY_LIST_BACK_X, ALIPAY_LIST_BACK_Y, ALIPAY_LIST_BACK_WIDTH, ALIPAY_LIST_BACK_HEIGHT); + back.SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + back.SetStyle(STYLE_BACKGROUND_OPA, 0xff); + back.SetStyle(STYLE_BORDER_RADIUS, 100); } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayList/AlipayListView.cpp b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayList/AlipayListView.cpp index 0a2f65fd2..91be991f2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayList/AlipayListView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayList/AlipayListView.cpp @@ -6,8 +6,10 @@ */ #include -#include "AlipayListView.h" -#include "AlipayListItem.h" +// #include "AlipayListView.h" +// #include "AlipayListItem.h" +#include "alipay/include/AlipayList/AlipayListView.h" +#include "alipay/include/AlipayList/AlipayListItem.h" #include "cmsis_os2.h" namespace OHOS { @@ -53,9 +55,11 @@ bool AlipayList::AlipayInitList() WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayList::OnStart::contentList is nullptr"); return false; } - contentList->SetPosition(ALIPAY_LIST_POSITION_X, ALIPAY_LIST_POSITION_Y); - contentList->Resize(HORIZONTAL_RESOLUTION - ALIPAY_LIST_POSITION_X, VERTICAL_RESOLUTION - ALIPAY_LIST_POSITION_Y); - contentList->SetScrollBlankSize(ALIPAY_LIST_SCROLLBLANKSIZE); + // contentList->SetPosition(ALIPAY_LIST_POSITION_X, ALIPAY_LIST_POSITION_Y); + // contentList->Resize(HORIZONTAL_RESOLUTION - ALIPAY_LIST_POSITION_X, VERTICAL_RESOLUTION - ALIPAY_LIST_POSITION_Y); + contentList->SetPosition(0, 0); + contentList->Resize(HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION); + // contentList->SetScrollBlankSize(ALIPAY_LIST_SCROLLBLANKSIZE); contentList->SetSelectPosition(ALIPAY_LIST_POSITION_Y); contentList->SetDraggable(true); contentList->SetThrowDrag(false); @@ -70,6 +74,7 @@ bool AlipayList::AlipayInitList() void AlipayList::InitAlipayListItem() { +#if 0 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayListModel::InitAlipayListItem()"); alipayLists[0] = {ALIPAY_LIST_ITEM_PAY, ALIPAY_LIST_PAY_BUTTON, PNG_ALIPAY_LIST_PAY, "付款码", true}; #if SUPPORT_ALIPAY_TRANS @@ -80,6 +85,22 @@ void AlipayList::InitAlipayListItem() alipayLists[1] = {ALIPAY_LIST_ITEM_SETTING, ALIPAY_LIST_SETTING_BUTTON, PNG_ALIPAY_LIST_SETTING, "设置", true}; alipayLists[2] = {ALIPAY_LIST_ITEM_HELP, ALIPAY_LIST_HELP_BUTTON, PNG_ALIPAY_LIST_HELP, "帮助", true}; #endif +#else + /* -------------------------------------------------------------------------- */ + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayListModel::InitAlipayListItem()"); + alipayLists[0] = {ALIPAY_LIST_ITEM_MAX, nullptr, nullptr, "支付宝", false}; + alipayLists[1] = {ALIPAY_LIST_ITEM_PAY, ALIPAY_LIST_PAY_BUTTON, PNG_ALIPAY_LIST_PAY, "付款码", true}; + #if SUPPORT_ALIPAY_TRANS + alipayLists[2] = {ALIPAY_LIST_ITEM_TRANS, ALIPAY_LIST_TRANS_BUTTON, PNG_ALIPAY_LIST_TRANS, "乘车码", true}; + alipayLists[3] = {ALIPAY_LIST_ITEM_SETTING, ALIPAY_LIST_SETTING_BUTTON, PNG_ALIPAY_LIST_SETTING, "设置", true}; + alipayLists[4] = {ALIPAY_LIST_ITEM_HELP, ALIPAY_LIST_HELP_BUTTON, PNG_ALIPAY_LIST_HELP, "帮助", true}; + #else + alipayLists[2] = {ALIPAY_LIST_ITEM_SETTING, ALIPAY_LIST_SETTING_BUTTON, PNG_ALIPAY_LIST_SETTING, "设置", true}; + alipayLists[3] = {ALIPAY_LIST_ITEM_HELP, ALIPAY_LIST_HELP_BUTTON, PNG_ALIPAY_LIST_HELP, "帮助", true}; + #endif + /* -------------------------------------------------------------------------- */ + +#endif } bool AlipayList::InitListView() @@ -102,7 +123,7 @@ bool AlipayList::InitListView() void AlipayList::AddAlipayListItemToList(void) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlipayList::AddAlipayListItemToList"); - for (uint8_t i = 0; i < ALIPAY_LIST_ITEM_MAX; i++) { + for (uint8_t i = 0; i < ALIPAY_LIST_ITEM_MAX + 1; i++) { listAdapter->AddListItem(alipayLists[i]); } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipaySetting.cpp b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipaySetting.cpp index 18ebe11cd..1431015d9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipaySetting.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipaySetting.cpp @@ -8,37 +8,39 @@ #include "UiConfig.h" #include #include "cmsis_os.h" -#include "AlipaySetting.h" -#include "AlipayModel.h" +// #include "AlipaySetting.h" +// #include "AlipayModel.h" +#include "alipay/include/AlipaySetting.h" +#include "alipay/include/AlipayModel.h" #include "uicomponents/UIComponents.h" namespace OHOS { -static const char *SETTING_TITLE = (char *)"设置"; -static const char *SETTING_BUTTON = (char *)"解除绑定"; +static const char *SETTING_TITLE = (char *)"设置"; +static const char *SETTING_BUTTON = (char *)"解除绑定"; -static const int16 SETTING_TITLE_FONT = 38; -static const int16 SETTING_TITLE_X = 0; -static const int16 SETTING_TITLE_Y = 35; -static const int16 SETTING_TITLE_WIDTH = 454; -static const int16 SETTING_TITLE_HEIGHT = 53; +static const int16 SETTING_TITLE_FONT = 30; +static const int16 SETTING_TITLE_X = (HORIZONTAL_RESOLUTION - 300) / 2; +static const int16 SETTING_TITLE_Y = 50; +static const int16 SETTING_TITLE_WIDTH = 300; +static const int16 SETTING_TITLE_HEIGHT = 35; -static const int16 SETTING_NAME_FONT = 38; -static const int16 SETTING_NAME_X = 0; -static const int16 SETTING_NAME_Y = 142; -static const int16 SETTING_NAME_WIDTH = 454; -static const int16 SETTING_NAME_HEIGHT = 53; +static const int16 SETTING_NAME_FONT = 30; +static const int16 SETTING_NAME_X = (HORIZONTAL_RESOLUTION - 360) / 2; +static const int16 SETTING_NAME_Y = 155; +static const int16 SETTING_NAME_WIDTH = 360; +static const int16 SETTING_NAME_HEIGHT = 35; static const int16 SETTING_ID_FONT = 30; -static const int16 SETTING_ID_X = 0; -static const int16 SETTING_ID_Y = 198; -static const int16 SETTING_ID_WIDTH = 454; -static const int16 SETTING_ID_HEIGHT = 109; +static const int16 SETTING_ID_X = (HORIZONTAL_RESOLUTION - 360) / 2; +static const int16 SETTING_ID_Y = 210; +static const int16 SETTING_ID_WIDTH = 360; +static const int16 SETTING_ID_HEIGHT = 35; -static const int16 SETTING_BUTTON_X = 121; -static const int16 SETTING_BUTTON_Y = 320; -static const int16 SETTING_BUTTON_WIDTH = 212; -static const int16 SETTING_BUTTON_HEIGHT = 73; -static const int16 SETTING_BUTTON_FONT = 38; +static const int16 SETTING_BUTTON_X = (HORIZONTAL_RESOLUTION - 280) / 2; +static const int16 SETTING_BUTTON_Y = 315; +static const int16 SETTING_BUTTON_WIDTH = 280; +static const int16 SETTING_BUTTON_HEIGHT = 90; +static const int16 SETTING_BUTTON_FONT = 30; AlipaySetting::AlipaySetting(AlipayPresenter *presenter) { @@ -118,7 +120,7 @@ bool AlipaySetting::AlipayInitLabel(void) labelName->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, SETTING_NAME_FONT); labelName->SetPosition(SETTING_NAME_X, SETTING_NAME_Y, SETTING_NAME_WIDTH, SETTING_NAME_HEIGHT); - labelName->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + labelName->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); labelName->SetStyle(STYLE_TEXT_FONT, SETTING_NAME_FONT); labelName->SetAlign(TEXT_ALIGNMENT_CENTER); labelName->SetRollSpeed(23); @@ -136,7 +138,7 @@ bool AlipaySetting::AlipayInitLabel(void) labelId->SetText((const char *)strID); labelId->SetFont(DEFAULT_VECTOR_FONT_FILENAME, SETTING_ID_FONT); labelId->SetPosition(SETTING_ID_X, SETTING_ID_Y, SETTING_ID_WIDTH, SETTING_ID_HEIGHT); - labelId->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + labelId->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION); labelId->SetTextColor(Color::GetColorFromRGBA(0x99, 0x99, 0x99, 0xff)); labelId->SetStyle(STYLE_TEXT_FONT, SETTING_ID_FONT); labelId->SetAlign(TEXT_ALIGNMENT_CENTER); diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayTrans/AlipayTransTips.cpp b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayTrans/AlipayTransTips.cpp index 11706660a..79ffdd814 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayTrans/AlipayTransTips.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayTrans/AlipayTransTips.cpp @@ -10,14 +10,16 @@ #include "font/ui_font.h" #include #include "cmsis_os.h" -#include "AlipayTransTips.h" -#include "AlipayModel.h" +// #include "AlipayTransTips.h" +// #include "AlipayModel.h" +#include "alipay/include/AlipayTrans/AlipayTransTips.h" +#include "alipay/include/AlipayModel.h" namespace OHOS { -static const int16 TIPS_LABEL_X_FIRST = 38; -static const int16 TIPS_LABEL_Y_FIRST = 179; -static const int16 TIPS_LABEL_WIDTH_FIRST = 378; -static const int16 TIPS_LABEL_HEIGHT_FIRST = 84; +static const int16 TIPS_LABEL_X_FIRST = (HORIZONTAL_RESOLUTION - 360) / 2; +static const int16 TIPS_LABEL_Y_FIRST = 180; +static const int16 TIPS_LABEL_WIDTH_FIRST = 360; +static const int16 TIPS_LABEL_HEIGHT_FIRST = 70; static const int16 TIPS_LABEL_FONT_FIRST = 30; static const char *TIPS_LABEL_TEXT_1 = (char *)"未知错误_具体错误码,请联系设备厂商解决"; @@ -26,17 +28,17 @@ static const char *TIPS_LABEL_TEXT_3 = (char *)"存在安全风险,12小时内 static const char *TIPS_LABEL_TEXT_4 = (char *)"未知错误_具体错误码,请联系设备厂商解决"; static const char *TIPS_LABEL_TEXT_5 = (char *)"暂不支持,请切换到手机侧使用"; -static const int16 RES_IMAGE_X = 170; -static const int16 RES_IMAGE_Y = 55; +static const int16 RES_IMAGE_X = (HORIZONTAL_RESOLUTION - 112) / 2; +static const int16 RES_IMAGE_Y = 50; static const int16 RES_IMAGE_WIDTH = 112; static const int16 RES_IMAGE_HEIGHT = 112; static const char *RECOGNIZE_BUTTON = (char *)"确定"; -static const int16 RECOGNIZE_BUTTON_FONT = 38; -static const int16 RECOGNIZE_BUTTON_X = 120; -static const int16 RECOGNIZE_BUTTON_Y = 320; -static const int16 RECOGNIZE_BUTTON_WIDTH = 212; -static const int16 RECOGNIZE_BUTTON_HEIGHT = 73; +static const int16 RECOGNIZE_BUTTON_FONT = 30; +static const int16 RECOGNIZE_BUTTON_X = (HORIZONTAL_RESOLUTION - 280) / 2; +static const int16 RECOGNIZE_BUTTON_Y = 315; +static const int16 RECOGNIZE_BUTTON_WIDTH = 280; +static const int16 RECOGNIZE_BUTTON_HEIGHT = 90; typedef struct AlipayTransTipsInfo { const char *str; @@ -120,7 +122,7 @@ bool AlipayTransTips::AlipayInitImage(const char *imageSrc) // Set additional property alipayImage->SetAutoEnable(false); - alipayImage->SetResizeMode(UIImageView::FILL); + alipayImage->SetResizeMode(UIImageView::CENTER); Add(alipayImage); return true; diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayUnbind.cpp b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayUnbind.cpp index 19f6b8921..0107e26cf 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayUnbind.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayUnbind.cpp @@ -10,7 +10,8 @@ #include "font/ui_font.h" #include #include "cmsis_os.h" -#include "AlipayUnbind.h" +// #include "AlipayUnbind.h" +#include "alipay/include/AlipayUnbind.h" namespace OHOS { static const int16 EXIT_LABEL_X_FIRST = 83; diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayUnbindFinish.cpp b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayUnbindFinish.cpp index 2bbfe63d0..9a3c629c4 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayUnbindFinish.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipayUnbindFinish.cpp @@ -8,8 +8,8 @@ #include "UiConfig.h" #include #include "cmsis_os.h" -#include "AlipayUnbindFinish.h" - +// #include "AlipayUnbindFinish.h" +#include "alipay/include/AlipayUnbindFinish.h" namespace OHOS { static AlipayUnbindFinish *g_alipayUnbindFinish = nullptr; @@ -19,23 +19,23 @@ static const char *UNBIND_FINISH_TEXT = static const char *UNBIND_FINISH_BUTTON = (char *)"确认"; -static const int16 UNBIND_FINISH_TITLE_FONT = 38; -static const int16 UNBIND_FINISH_TITLE_X = 0; -static const int16 UNBIND_FINISH_TITLE_Y = 35; -static const int16 UNBIND_FINISH_TITLE_WIDTH = 454; -static const int16 UNBIND_FINISH_TITLE_HEIGHT = 53; +static const int16 UNBIND_FINISH_TITLE_FONT = 30; +static const int16 UNBIND_FINISH_TITLE_X = (HORIZONTAL_RESOLUTION - 300) / 2; +static const int16 UNBIND_FINISH_TITLE_Y = 50; +static const int16 UNBIND_FINISH_TITLE_WIDTH = 300; +static const int16 UNBIND_FINISH_TITLE_HEIGHT = 35; static const int16 UNBIND_FINISH_TEXT_FONT = 30; -static const int16 UNBIND_FINISH_TEXT_X = 38; -static const int16 UNBIND_FINISH_TEXT_Y = 126; -static const int16 UNBIND_FINISH_TEXT_WIDTH = 380; -static const int16 UNBIND_FINISH_TEXT_HEIGHT = 166; +static const int16 UNBIND_FINISH_TEXT_X = (HORIZONTAL_RESOLUTION - 360) / 2 ; +static const int16 UNBIND_FINISH_TEXT_Y = 130; +static const int16 UNBIND_FINISH_TEXT_WIDTH = 360; +static const int16 UNBIND_FINISH_TEXT_HEIGHT = 140; -static const int16 UNBIND_FINISH_BUTTON_FONT = 38; -static const int16 UNBIND_FINISH_BUTTON_X = 120; -static const int16 UNBIND_FINISH_BUTTON_Y = 320; -static const int16 UNBIND_FINISH_BUTTON_WIDTH = 212; -static const int16 UNBIND_FINISH_BUTTON_HEIGHT = 73; +static const int16 UNBIND_FINISH_BUTTON_FONT = 30; +static const int16 UNBIND_FINISH_BUTTON_X = (HORIZONTAL_RESOLUTION - 280) / 2; +static const int16 UNBIND_FINISH_BUTTON_Y = 315; +static const int16 UNBIND_FINISH_BUTTON_WIDTH = 280; +static const int16 UNBIND_FINISH_BUTTON_HEIGHT = 90; AlipayUnbindFinish::AlipayUnbindFinish(AlipayPresenter *presenter) { @@ -90,7 +90,7 @@ bool AlipayUnbindFinish::AlipayInitLabel(void) UNBIND_FINISH_TEXT_HEIGHT); textUnbind->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); textUnbind->SetStyle(STYLE_TEXT_FONT, UNBIND_FINISH_TEXT_FONT); - textUnbind->SetStyle(STYLE_LINE_SPACE, 6); + // textUnbind->SetStyle(STYLE_LINE_SPACE, 6); textUnbind->SetTextColor(Color::GetColorFromRGBA(0xAA, 0xAA, 0xAA, 0xFF)); textUnbind->SetAlign(TEXT_ALIGNMENT_CENTER); Add(textUnbind); -- 2.17.1