diff --git a/README.md b/README.md index e1db3c16b3bb41224a3d33c40dfb9c1e4f315a15..6d1bfe8cad4231605403d2b2f4d72a7261ecaa6f 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,13 @@ │ │ ├──ArticleListData.ets // 列表的DataSource │ │ └──LearningResource.ets // 列表数据类 │ ├──pages +│ │ ├──basicPre.ets // 预加载页面 │ │ ├──ForEachListPage.ets // ForEach列表页面 +│ │ ├──Header.ets // 页面头 │ │ ├──Index.ets // 首页页面 -│ │ └──LazyForEachListPage.ets // LazyForEach列表页面 +│ │ ├──LazyForEachListPage.ets // LazyForEach列表页面 +│ │ ├──prefetching.ets // prefetching预加载 +│ │ └──song.ets // SongInfo │ └──utils │ ├──Logger.ets // 日志工具类 │ └──ObservedArray.ets // 数组工具类 diff --git a/README_EN.md b/README_EN.md index 4a632329ffdc728aed05c9de63954401b814d5c9..5a41f0c7cfc661b2cea4d2934b330920a956e3a6 100644 --- a/README_EN.md +++ b/README_EN.md @@ -34,9 +34,13 @@ How to Use │ │ ├──ArticleListData.ets │ │ └──LearningResource.ets │ ├──pages -│ │ ├──ForEachListPage.ets -│ │ ├──Index.ets -│ │ └──LazyForEachListPage.ets +│ │ ├──basicPre.ets +│ │ ├──ForEachListPage.ets +│ │ ├──Header.ets +│ │ ├──Index.ets +│ │ ├──LazyForEachListPage.ets +│ │ ├──prefetching.ets +│ │ └──song.ets │ └──utils │ ├──Logger.ets │ └──ObservedArray.ets diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 7ce1ae2009f9d4df7fb0dde85d9fd23f5b91a5cb..63057e6cc88e29352665150771233ce745d2b0c8 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -17,6 +17,7 @@ import { UIAbility , Want ,AbilityConstant } from '@kit.AbilityKit'; import { window } from '@kit.ArkUI'; import { BusinessError } from '@kit.BasicServicesKit' import { Logger } from '../utils/Logger'; +import { hilog } from '@kit.PerformanceAnalysisKit'; const TAG: string = 'EntryAbility'; @@ -105,5 +106,7 @@ function getDeviceSize(UIContext: UIContext, area: window.AvoidArea): void { } AppStorage.setOrCreate('deviceHeight', UIContext.px2vp(properties.windowRect.height)); AppStorage.setOrCreate('deviceWidth', UIContext.px2vp(properties.windowRect.width)); + }).catch((err: BusinessError) => { + hilog.error(0xFF00, 'ListOptimization', `getLastWindow fail, code = ${err.code}, message = ${err.message}`); }); } \ No newline at end of file diff --git a/entry/src/main/ets/pages/ForEachListPage.ets b/entry/src/main/ets/pages/ForEachListPage.ets index dd2a827fdb904b696376cb525ecad8cf40e8eb1d..2a4f306ee2a3195a59e0a8a9cd8732c239dd99d4 100644 --- a/entry/src/main/ets/pages/ForEachListPage.ets +++ b/entry/src/main/ets/pages/ForEachListPage.ets @@ -19,6 +19,8 @@ import { ObservedArray } from '../utils/ObservedArray'; import { ArticleCardView } from '../components/ArticleCardView'; import Constants from '../constants/Constants'; import { util } from '@kit.ArkTS'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; function bufferToString(buffer: ArrayBufferLike): string { let textDecoder = util.TextDecoder.create('utf-8', { @@ -59,6 +61,8 @@ export struct ForEachListPage { resources.push(res); }); this.articleList = resources; + }).catch((err: BusinessError) => { + hilog.error(0xFF00, 'ListOptimization', `getArticleModelObjFromJSON fail, code = ${err.code}, message = ${err.message}`); }) } diff --git a/entry/src/main/ets/pages/LazyForEachListPage.ets b/entry/src/main/ets/pages/LazyForEachListPage.ets index e3378d5fde02d830d708d0d65a303b289c9f053e..39429d29e03ec5cc85db07e81a392f14c5078d7f 100644 --- a/entry/src/main/ets/pages/LazyForEachListPage.ets +++ b/entry/src/main/ets/pages/LazyForEachListPage.ets @@ -20,6 +20,8 @@ import { ObservedArray } from '../utils/ObservedArray'; import { ReusableArticleCardView } from '../components/ReusableArticleCardView'; import Constants from '../constants/Constants'; import { util } from '@kit.ArkTS'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BusinessError } from '@kit.BasicServicesKit'; function bufferToString(buffer: ArrayBufferLike): string { @@ -65,6 +67,8 @@ export struct LazyForEachListPage { resources.push(res); }); this.data = new ArticleListData(resources); + }).catch((err: BusinessError) => { + hilog.error(0xFF00, 'ListOptimization', `getArticleModelObjFromJSON fail, code = ${err.code}, message = ${err.message}`); }) }