From 303f863418a48c133fcda75c6ce83b32b98a1d64 Mon Sep 17 00:00:00 2001 From: wpp <58198665+879356503@users.noreply.github.com> Date: Tue, 1 Apr 2025 19:37:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/entryability/EntryAbility.ets | 14 ++------------ .../main/ets/pages/AdaptiveTabCenteringIndex.ets | 5 +---- .../ets/pages/DoubleTabAdaptiveCenteringIndex.ets | 5 +---- entry/src/main/ets/pages/Index.ets | 6 ++---- .../main/ets/pages/TableAdaptiveExtensionIndex.ets | 5 +---- entry/src/main/resources/base/element/string.json | 2 +- entry/src/main/resources/en_US/element/string.json | 2 +- entry/src/main/resources/zh_CN/element/string.json | 2 +- 8 files changed, 10 insertions(+), 31 deletions(-) diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 55a0220..205d431 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import { Configuration, ConfigurationConstant, UIAbility } from '@kit.AbilityKit'; +import { ConfigurationConstant, UIAbility } from '@kit.AbilityKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; import { display, window } from '@kit.ArkUI'; import { CommonConstants } from '../constants/CommonConstants'; @@ -28,15 +28,6 @@ export default class EntryAbility extends UIAbility { this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); } - onConfigurationUpdate(newConfig: Configuration): void { - let newColorMode: ConfigurationConstant.ColorMode = - newConfig.colorMode || ConfigurationConstant.ColorMode.COLOR_MODE_DARK; - let currentColorMode = AppStorage.get('systemColorMode'); - if (newColorMode !== currentColorMode) { - AppStorage.setOrCreate('systemColorMode', newColorMode); - } - } - onDestroy(): void { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); } @@ -44,7 +35,6 @@ export default class EntryAbility extends UIAbility { onWindowStageCreate(windowStage: window.WindowStage): void { // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - windowStage.getMainWindow().then((data: window.Window) => { let type = window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR; let avoidArea = data.getWindowAvoidArea(type); @@ -88,7 +78,7 @@ export default class EntryAbility extends UIAbility { } AppStorage.setOrCreate('breakPoint', curBp); } catch (exception) { - hilog.error(0x0000, 'testTag', `UpdateBreakpoint fail, error message${JSON.stringify(exception)}`); + hilog.error(0x0000, 'testTag', `UpdateBreakpoint fail, error code: ${(exception as BusinessError).code}`); } } diff --git a/entry/src/main/ets/pages/AdaptiveTabCenteringIndex.ets b/entry/src/main/ets/pages/AdaptiveTabCenteringIndex.ets index dd1235d..32947ec 100644 --- a/entry/src/main/ets/pages/AdaptiveTabCenteringIndex.ets +++ b/entry/src/main/ets/pages/AdaptiveTabCenteringIndex.ets @@ -22,10 +22,7 @@ export struct AdaptiveTabCenteringIndex { @StorageLink('breakPoint') breakPoint: string = CommonConstants.BREAK_POINT_SM; @Consume('pageInfos') pageInfos: NavPathStack; @State tabIndexSelected: number = 0; - @StorageProp('bottomRectHeight') - bottomRectHeight: number = 0; - @StorageProp('topRectHeight') - topRectHeight: number = 0; + @StorageProp('topRectHeight') topRectHeight: number = 0; build() { NavDestination() { diff --git a/entry/src/main/ets/pages/DoubleTabAdaptiveCenteringIndex.ets b/entry/src/main/ets/pages/DoubleTabAdaptiveCenteringIndex.ets index a7c8923..bbe918e 100644 --- a/entry/src/main/ets/pages/DoubleTabAdaptiveCenteringIndex.ets +++ b/entry/src/main/ets/pages/DoubleTabAdaptiveCenteringIndex.ets @@ -23,10 +23,7 @@ export struct DoubleTabAdaptiveCenteringIndex { @Consume('pageInfos') pageInfos: NavPathStack; @State tabIndexSelected: number = 0; @State tabIndexSelected2: number = 0; - @StorageProp('bottomRectHeight') - bottomRectHeight: number = 0; - @StorageProp('topRectHeight') - topRectHeight: number = 0; + @StorageProp('topRectHeight') topRectHeight: number = 0; build() { NavDestination() { diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index e222d39..5c0812e 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -31,10 +31,8 @@ class DirectoryItem { struct Index { @Provide('pageInfos') pageInfos: NavPathStack = new NavPathStack(); @StorageLink('breakPoint') breakPoint: string = CommonConstants.BREAK_POINT_SM; - @StorageProp('bottomRectHeight') - bottomRectHeight: number = 0; - @StorageProp('topRectHeight') - topRectHeight: number = 0; + @StorageProp('bottomRectHeight') bottomRectHeight: number = 0; + @StorageProp('topRectHeight') topRectHeight: number = 0; private title: string | Resource = $r('app.string.EntryAbility_label'); private directory: DirectoryItem[] = [ { diff --git a/entry/src/main/ets/pages/TableAdaptiveExtensionIndex.ets b/entry/src/main/ets/pages/TableAdaptiveExtensionIndex.ets index c2e8be8..098faab 100644 --- a/entry/src/main/ets/pages/TableAdaptiveExtensionIndex.ets +++ b/entry/src/main/ets/pages/TableAdaptiveExtensionIndex.ets @@ -22,10 +22,7 @@ export struct TableAdaptiveExtensionIndex { @StorageLink('breakPoint') breakPoint: string = CommonConstants.BREAK_POINT_SM; @Consume('pageInfos') pageInfos: NavPathStack; @State tabIndexSelected: number = 0; - @StorageProp('bottomRectHeight') - bottomRectHeight: number = 0; - @StorageProp('topRectHeight') - topRectHeight: number = 0; + @StorageProp('topRectHeight') topRectHeight: number = 0; @Builder Item(item: Resource, index: number, color: string) { diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index 96dec6c..2a6211e 100644 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -94,7 +94,7 @@ }, { "name": "beijing_stock_exchange", - "value": "Beijing Stock Exchange" + "value": "Stock Exchange" }, { "name": "indicator_name", diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json index b4255b2..c8fedd1 100644 --- a/entry/src/main/resources/en_US/element/string.json +++ b/entry/src/main/resources/en_US/element/string.json @@ -94,7 +94,7 @@ }, { "name": "beijing_stock_exchange", - "value": "Beijing Stock Exchange" + "value": "Stock Exchange" }, { "name": "indicator_name", diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json index 67adbcf..53f9ddd 100644 --- a/entry/src/main/resources/zh_CN/element/string.json +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -94,7 +94,7 @@ }, { "name": "beijing_stock_exchange", - "value": "北交所" + "value": "交易所" }, { "name": "indicator_name", -- Gitee