diff --git a/entry/src/main/ets/common/constants/CommonConstants.ets b/entry/src/main/ets/common/constants/CommonConstants.ets index 48d44b6030b7fa31e1ec57950779ea82a40d901c..0dd6124c7e9cb435920880fed3dee0851fe97998 100644 --- a/entry/src/main/ets/common/constants/CommonConstants.ets +++ b/entry/src/main/ets/common/constants/CommonConstants.ets @@ -81,5 +81,15 @@ export default class CommonConstants { * Mine tab index */ static readonly MINE_TAB_INDEX = 1; + + /** + * Default Max Lines + */ + static readonly DEFAULT_MAX_LINES = 1; + + /** + * Default Border Width + */ + static readonly DEFAULT_BORDER_WIDTH = 1; } diff --git a/entry/src/main/ets/pages/LoginPage.ets b/entry/src/main/ets/pages/LoginPage.ets index 947f8dd911e59dc95d7c1e68c3127fd8041fddae..5b387181604387cb4d53dcccd73572e91a813928 100644 --- a/entry/src/main/ets/pages/LoginPage.ets +++ b/entry/src/main/ets/pages/LoginPage.ets @@ -53,13 +53,24 @@ struct LoginPage { private timeOutId: number = -1; @Builder - imageButton(src: Resource) { - Button({ type: ButtonType.Circle, stateEffect: true }) { - Image(src) - } - .height($r('app.float.other_login_image_size')) - .width($r('app.float.other_login_image_size')) - .backgroundColor($r('app.color.background')) + textButton(src: Resource) { + Text(src) + .border({ + width: CommonConstants.DEFAULT_BORDER_WIDTH, + color: ($r('app.color.other_login_text_color')), + radius: ($r('app.float.other_login_image_size')) + }) + .fontColor(($r('app.color.other_login_text_color'))) + .height($r('app.float.other_login_image_size')) + .width($r('app.float.other_login_image_size')) + .minFontSize($r('app.float.text_button_min_size')) + .maxFontSize($r('app.float.text_button_max_size')) + .maxLines(CommonConstants.DEFAULT_MAX_LINES) + .textAlign(TextAlign.Center) + .padding({ + right: $r('app.float.text_button_padding'), + left: $r('app.float.text_button_padding') + }) } login(): void { @@ -155,9 +166,9 @@ struct LoginPage { .fontWeight(FontWeight.Medium) .margin({ top: $r('app.float.other_login_margin_top'), bottom: $r('app.float.other_login_margin_bottom') }) Row({ space: CommonConstants.LOGIN_METHODS_SPACE }) { - this.imageButton($r('app.media.login_method1')) - this.imageButton($r('app.media.login_method2')) - this.imageButton($r('app.media.login_method3')) + this.textButton($r('app.string.mode_one')) + this.textButton($r('app.string.mode_two')) + this.textButton($r('app.string.mode_three')) } } .backgroundColor($r('app.color.background')) diff --git a/entry/src/main/ets/pages/MainPage.ets b/entry/src/main/ets/pages/MainPage.ets index dfd1492bccdd3f724d394dad528a435a727480da..744230b3bc3ee957c82cf037e6d9348487e28228 100644 --- a/entry/src/main/ets/pages/MainPage.ets +++ b/entry/src/main/ets/pages/MainPage.ets @@ -26,7 +26,7 @@ struct MainPage { @State currentIndex: number = CommonConstants.HOME_TAB_INDEX; private tabsController: TabsController = new TabsController(); - @Builder TabBuilder(title: string, index: number, selectedImg: Resource, normalImg: Resource) { + @Builder TabBuilder(title: Resource, index: number, selectedImg: Resource, normalImg: Resource) { Column() { Image(this.currentIndex === index ? selectedImg : normalImg) .width($r('app.float.mainPage_baseTab_size')) @@ -55,7 +55,7 @@ struct MainPage { } .padding({ left: $r('app.float.mainPage_padding'), right: $r('app.float.mainPage_padding') }) .backgroundColor($r('app.color.mainPage_backgroundColor')) - .tabBar(this.TabBuilder(CommonConstants.HOME_TITLE, CommonConstants.HOME_TAB_INDEX, + .tabBar(this.TabBuilder($r('app.string.mainPage_tabTitles_home'), CommonConstants.HOME_TAB_INDEX, $r('app.media.home_selected'), $r('app.media.home_normal'))) TabContent() { @@ -63,7 +63,7 @@ struct MainPage { } .padding({ left: $r('app.float.mainPage_padding'), right: $r('app.float.mainPage_padding') }) .backgroundColor($r('app.color.mainPage_backgroundColor')) - .tabBar(this.TabBuilder(CommonConstants.MINE_TITLE, CommonConstants.MINE_TAB_INDEX, + .tabBar(this.TabBuilder($r('app.string.mainPage_tabTitles_mine'), CommonConstants.MINE_TAB_INDEX, $r('app.media.mine_selected'), $r('app.media.mine_normal'))) } .width(CommonConstants.FULL_PARENT) diff --git a/entry/src/main/resources/base/element/float.json b/entry/src/main/resources/base/element/float.json index 19ba0e188d1786b004c41f6ee067844629fe3502..0ab634216b24d23e3f6f0a5da5fa5534aa6fc12a 100644 --- a/entry/src/main/resources/base/element/float.json +++ b/entry/src/main/resources/base/element/float.json @@ -287,6 +287,18 @@ { "name": "setting_settingCell_right", "value": "22vp" + }, + { + "name": "text_button_min_size", + "value": "6fp" + }, + { + "name": "text_button_max_size", + "value": "18fp" + }, + { + "name": "text_button_padding", + "value": "4vp" } ] } \ No newline at end of file diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index b21fa8582a947fa1b776d4ba4089f731cc2d7482..29f3328a2e1e97fdb1f7e8c1f4f367ffe32a56a7 100644 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -198,11 +198,11 @@ }, { "name": "setting_list_about", - "value": "Clear Cache" + "value": "About Us" }, { "name": "setting_list_storage", - "value": "清除缓存" + "value": "Clear Cache" }, { "name": "setting_list_privacy", @@ -219,6 +219,18 @@ { "name": "setting_toggle", "value": "switch" + }, + { + "name": "mode_one", + "value": "Mode One" + }, + { + "name": "mode_two", + "value": "Mode Two" + }, + { + "name": "mode_three", + "value": "Mode Three" } ] } \ No newline at end of file diff --git a/entry/src/main/resources/base/media/login_method1.png b/entry/src/main/resources/base/media/login_method1.png deleted file mode 100644 index a7b47f2ea5723f81684506765ed437d6684f8184..0000000000000000000000000000000000000000 Binary files a/entry/src/main/resources/base/media/login_method1.png and /dev/null differ diff --git a/entry/src/main/resources/base/media/login_method2.png b/entry/src/main/resources/base/media/login_method2.png deleted file mode 100644 index 320e9a5038da6fb9bdc201ed7675d4d4ad1a0c99..0000000000000000000000000000000000000000 Binary files a/entry/src/main/resources/base/media/login_method2.png and /dev/null differ diff --git a/entry/src/main/resources/base/media/login_method3.png b/entry/src/main/resources/base/media/login_method3.png deleted file mode 100644 index 28ac6ec8669b5634df443b10a4ced8f9c7e8a5c7..0000000000000000000000000000000000000000 Binary files a/entry/src/main/resources/base/media/login_method3.png and /dev/null differ diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json index b21fa8582a947fa1b776d4ba4089f731cc2d7482..29f3328a2e1e97fdb1f7e8c1f4f367ffe32a56a7 100644 --- a/entry/src/main/resources/en_US/element/string.json +++ b/entry/src/main/resources/en_US/element/string.json @@ -198,11 +198,11 @@ }, { "name": "setting_list_about", - "value": "Clear Cache" + "value": "About Us" }, { "name": "setting_list_storage", - "value": "清除缓存" + "value": "Clear Cache" }, { "name": "setting_list_privacy", @@ -219,6 +219,18 @@ { "name": "setting_toggle", "value": "switch" + }, + { + "name": "mode_one", + "value": "Mode One" + }, + { + "name": "mode_two", + "value": "Mode Two" + }, + { + "name": "mode_three", + "value": "Mode Three" } ] } \ No newline at end of file diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json index b56fa76b2a891eed623b38efa95b835b6d49bc7b..079877ad3328522f359b090772d495c1ae442739 100644 --- a/entry/src/main/resources/zh_CN/element/string.json +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -219,6 +219,18 @@ { "name": "setting_toggle", "value": "开关" + }, + { + "name": "mode_one", + "value": "方式一" + }, + { + "name": "mode_two", + "value": "方式二" + }, + { + "name": "mode_three", + "value": "方式三" } ] } \ No newline at end of file