diff --git a/local.properties b/local.properties index 5ce895d24453cb504a8e7aa924b733c9c32cccba..7cfde12e7a08fac65dd2683cf828d6be1f204a65 100755 --- a/local.properties +++ b/local.properties @@ -1,17 +1,17 @@ /* - * Copyright (c) 2021 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. - */ +* Copyright (c) 2021 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. +*/ ## This file must *NOT* be checked into Version Control Systems, # as it contains information specific to your local configuration. diff --git a/product/phone/src/main/ets/MainAbility/MainAbility.ts b/product/phone/src/main/ets/MainAbility/MainAbility.ts index f0c26a290b2c1d2a750d85e750ea84dc32d640ec..3b92a3ce8460ff1d9505e399e0410d4aedb91bd2 100644 --- a/product/phone/src/main/ets/MainAbility/MainAbility.ts +++ b/product/phone/src/main/ets/MainAbility/MainAbility.ts @@ -55,44 +55,37 @@ export default class MainAbility extends ServiceExtension { // init Launcher context globalThis.desktopContext = this.context; + // init global const + this.initGlobalConst(); + + // init Gesture navigation + this.startGestureNavigation(); + + // init rdb + let dbStore = RdbStoreManager.getInstance(); + await dbStore.initRdbConfig(); + await dbStore.createTable(); + let registerWinEvent = (win: window.Window) => { win.on('windowEvent', (stageEventType) => { // 桌面获焦或失焦时,通知桌面的卡片变为可见状态 if (stageEventType === window.WindowEventType.WINDOW_ACTIVE) { - launcherAbilityManager.checkBundleMonitor(); localEventManager.sendLocalEventSticky(EventConstants.EVENT_REQUEST_FORM_ITEM_VISIBLE, null); Log.showInfo(TAG, `lifeCycleEvent change: ${stageEventType}`); } }) }; + windowManager.registerWindowEvent(); + navigationBarCommonEventManager.registerNavigationBarEvent(); + // create Launcher entry view windowManager.createWindow(globalThis.desktopContext, windowManager.DESKTOP_WINDOW_NAME, windowManager.DESKTOP_RANK, 'pages/' + windowManager.DESKTOP_WINDOW_NAME, true, registerWinEvent); - await PreferencesHelper.getInstance().initPreference(globalThis.desktopContext); - - // init global const - this.initGlobalConst(); - - // init rdb - let dbStore = RdbStoreManager.getInstance(); - - await dbStore.initRdbConfig(); - await dbStore.createTable(); - - // init Gesture navigation - this.startGestureNavigation(); - - windowManager.registerWindowEvent(); - navigationBarCommonEventManager.registerNavigationBarEvent(); // load recent windowManager.createRecentWindow(); this.registerInputConsumer(); - this.displayManager = DisplayManager.getInstance(); - - AppStorage.setOrCreate('loaded', true); - systemParameter.set('bootevent.launcher.ready', 'true'); } private registerInputConsumer(): void { diff --git a/product/phone/src/main/ets/pages/EntryView.ets b/product/phone/src/main/ets/pages/EntryView.ets index 0e229c88e7f8029ba58285e621d7a3419d5a740c..b5d31d189210643b2bd93ee9d3173e61f21d4df2 100644 --- a/product/phone/src/main/ets/pages/EntryView.ets +++ b/product/phone/src/main/ets/pages/EntryView.ets @@ -42,7 +42,6 @@ struct EntryView { @StorageLink('screenWidth') screenWidth: number = 0; @StorageLink('screenHeight') @Watch('updateScreenInfo') screenHeight: number = 0; @StorageLink('deviceType') deviceType: string = CommonConstants.DEFAULT_DEVICE_TYPE; - @StorageLink('loaded') loaded: boolean = false; @State workSpaceWidth: number = 0; @State workSpaceHeight: number = 0; @State dockHeight: number = 0; @@ -131,7 +130,6 @@ struct EntryView { build() { Stack() { - if (this.loaded) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { Column() { PageDesktopLayout(); @@ -156,7 +154,6 @@ struct EntryView { } FolderOpenComponent(); - } } .backgroundImage(StyleConstants.DEFAULT_BACKGROUND_IMAGE) .backgroundImageSize(ImageSize.Cover)