diff --git a/entry/src/main/ets/common/constants/CommonConstants.ets b/entry/src/main/ets/common/constants/CommonConstants.ets deleted file mode 100644 index bd4f788eaaee8a8475a00a446043dffe2e7391df..0000000000000000000000000000000000000000 --- a/entry/src/main/ets/common/constants/CommonConstants.ets +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default class CommonConstants{ - /** - * The text high - */ - static TEXT_HEIGHT: number = 50; - - /** - * The text width - */ - static DEFAULT_MARGIN: number = 30; - - /** - * Full the width. - */ - static FULL_WIDTH: string = '100%'; - - /** - * Full the height. - */ - static FULL_HEIGHT: string = '100%'; - - /** - * Default fontSize - */ - static DEFAULT_FONT_SIZE: number = 30; - - /* - * Log Domain - * */ - static DOMAIN: number = 0x0000; -} diff --git a/entry/src/main/ets/common/util/Logger.ets b/entry/src/main/ets/common/util/Logger.ets deleted file mode 100644 index b8a3e35b29874530c970b7631c72df64cdd11fab..0000000000000000000000000000000000000000 --- a/entry/src/main/ets/common/util/Logger.ets +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { hilog } from '@kit.PerformanceAnalysisKit'; - -class Logger { - private domain: number; - private prefix: string; - private format: string = '%{public}s, %{public}s'; - - /** - * constructor. - * - * @param Prefix Identifies the log tag. - * @param domain Domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFFF. - */ - constructor(prefix: string = 'MyApp', domain: number = 0xFF00) { - this.prefix = prefix; - this.domain = domain; - } - - debug(...args: string[]): void { - hilog.debug(this.domain, this.prefix, this.format, args); - } - - info(...args: string[]): void { - hilog.info(this.domain, this.prefix, this.format, args); - } - - warn(...args: string[]): void { - hilog.warn(this.domain, this.prefix, this.format, args); - } - - error(...args: string[]): void { - hilog.error(this.domain, this.prefix, this.format, args); - } -} - -export default new Logger('UIAbilityLifeCycle', 0xFF00) \ No newline at end of file diff --git a/entry/src/main/ets/pages/LifeCyclePage.ets b/entry/src/main/ets/pages/LifeCyclePage.ets deleted file mode 100644 index 8a34d1755105e4325c6207172b06f0c472e21755..0000000000000000000000000000000000000000 --- a/entry/src/main/ets/pages/LifeCyclePage.ets +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Logger from '../common/util/Logger'; -import CommonConstants from '../common/constants/CommonConstants'; - -@Entry -@Component -struct LifeCyclePage { - @State textColor: Color = Color.Black; - - aboutToAppear() { - this.textColor = Color.Blue; - Logger.info('[LifeCyclePage] LifeCyclePage aboutToAppear'); - } - - onPageShow() { - this.textColor = Color.Brown; - Logger.info('[LifeCyclePage] LifeCyclePage onPageShow'); - } - - onPageHide() { - Logger.info('[LifeCyclePage] LifeCyclePage onPageHide'); - } - - onBackPress() { - this.textColor = Color.Red; - Logger.info('[LifeCyclePage] LifeCyclePage onBackPress'); - return false; - } - - aboutToDisappear() { - Logger.info('[LifeCyclePage] LifeCyclePage aboutToDisappear'); - } - - build() { - Column() { - Text($r('app.string.hello_message')) - .fontSize(CommonConstants.DEFAULT_FONT_SIZE) - .fontColor(this.textColor) - .margin(CommonConstants.DEFAULT_MARGIN) - .fontWeight(FontWeight.Bold) - } - .width(CommonConstants.FULL_WIDTH) - } -} \ No newline at end of file