diff --git a/entry/src/main/ets/common/constants/CommonConstants.ets b/entry/src/main/ets/common/constants/CommonConstants.ets index 166482633c58903359f7224e71f12c36cc785b2f..ffaf983e4c9c60c9576488653e04b25e92b3f601 100644 --- a/entry/src/main/ets/common/constants/CommonConstants.ets +++ b/entry/src/main/ets/common/constants/CommonConstants.ets @@ -17,50 +17,10 @@ * Common constants for all features. */ export class CommonConstants { - /** - * Promotional activities. - */ - public static readonly TAB_NAME_1: string = '促销活动'; - /** - * Trip Services. - */ - public static readonly TAB_NAME_2: string = '行程服务'; - /** - * Promotional goods. - */ - public static readonly LIST_NAME_1: string = '促销商品'; - /** - * Itinerary Arrangements. - */ - public static readonly LIST_NAME_2: string = '行程安排'; /** * font weight is 500. */ public static readonly FONT_WEIGHT_FIVE: number = 500; - /** - * font weight is 500. - */ - public static readonly FONT_WEIGHT_FOUR: number = 400; - /** - * The width of the split line is 2. - */ - public static readonly STROKE_WIDTH: number = 2; - /** - * list space is 12. - */ - public static readonly LIST_SPACE: number = 12; - /** - * stack height. - */ - public static readonly STACK_HEIGHT: Length = 'calc(100% - 60vp)'; - /** - * Transparency is 1. - */ - public static readonly FULL_OPACITY: number = 1; - /** - * Transparency is 0. - */ - public static readonly ZERO_OPACITY: number = 0; /** * Width the percentage of the 100. */ diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index 83ad01fb4c98fa7fce1c18cee711165784718f7c..38b535e8a8cfbfff21ea13178fed20f0096c9d47 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -46,11 +46,7 @@ export default class EntryAbility extends UIAbility { onCreate(): void { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); AppStorage.setOrCreate('systemColorMode', this.context.config.colorMode); - try { - this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); - } catch (err) { - hilog.error(0x0000, 'testTag', '%{public}s', `setColorMode fail. error code: ${err.code}`); - } + this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); } onDestroy(): void { @@ -75,6 +71,8 @@ export default class EntryAbility extends UIAbility { } catch (err) { hilog.error(0x0000, 'testTag', '%{public}s', `config window fail. Cause: ${err.code}`); } + }).catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', `Failed to get main window. Cause: ${err.message}`); }); // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); @@ -91,9 +89,12 @@ export default class EntryAbility extends UIAbility { let isLayoutFullScreen = true; windowClass.setWindowLayoutFullScreen(isLayoutFullScreen).then(() => { hilog.info(0x0000, 'testTag', '%{public}s', 'Succeeded in setting the window layout to full-screen mode.'); + }).catch((err: BusinessError) => { + hilog.error(0x0000, 'testTag', `Failed to set the window layout to full-screen mode. Cause: ${err.message}`); }); } catch (err) { - hilog.error(0x0000, 'testTag', '%{public}s', `Failed to set the window layout to full-screen mode. ${err.code}`); + hilog.error(0x0000, 'testTag', '%{public}s', + `Failed to set the window layout to full-screen mode. ${err.code}`); } }); }