diff --git a/services/dialog_ui/ams_system_dialog/feature/src/main/ets/entryability/EntryAbility.ets b/services/dialog_ui/ams_system_dialog/feature/src/main/ets/entryability/EntryAbility.ets index 31edff9edb6c856ebb3e833ce53ca9e4235c4a73..8c7611bab208b6a8911e135158de24693c075ca6 100644 --- a/services/dialog_ui/ams_system_dialog/feature/src/main/ets/entryability/EntryAbility.ets +++ b/services/dialog_ui/ams_system_dialog/feature/src/main/ets/entryability/EntryAbility.ets @@ -18,68 +18,69 @@ import AbilityConstant from '@ohos.app.ability.AbilityConstant'; import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant'; import UIAbility from '@ohos.app.ability.UIAbility'; import hilog from '@ohos.hilog'; +import { BusinessError } from '@kit.BasicServicesKit'; import window from '@ohos.window'; const DOMAIN = 0x1323; +const TAG = 'InsightIntents'; export default class EntryAbility extends UIAbility { onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET); AppStorage.setAndLink('context', this.context); - hilog.info(DOMAIN, 'InsightIntents', '%{public}s', 'Ability onCreate'); + hilog.info(DOMAIN, TAG, '%{public}s', 'Ability onCreate'); const callerBundleName: string | undefined = want.parameters?.['ohos.aafwk.param.callerBundleName']?.toString(); if (callerBundleName === undefined || callerBundleName !== 'com.huawei.hmos.aidataservice') { try { this.context.terminateSelf(); } catch (err) { - hilog.error(DOMAIN, 'InsightIntents', 'Failed to context.terminateSelf. Cause: %{public}s', JSON.stringify(err)); + hilog.error(DOMAIN, TAG, 'Failed to context.terminateSelf. Cause: %{public}s', JSON.stringify(err)); } } } onDestroy(): void { - hilog.info(DOMAIN, 'InsightIntents', '%{public}s', 'Ability onDestroy'); + hilog.info(DOMAIN, TAG, '%{public}s', 'Ability onDestroy'); } onWindowStageCreate(windowStage: window.WindowStage): void { - - let windowClass: window.Window; - windowStage.getMainWindow((err, data) => { - windowClass = data; - windowClass.setWindowLayoutFullScreen(true).then(() => { - hilog.info(DOMAIN, 'InsightIntents', 'Set Window Layout Full Screen.'); - }) - + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(DOMAIN, TAG, 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); + return; + } + hilog.info(DOMAIN, TAG, 'Succeeded in loading the content.'); try { - const top = windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect - let navigationHeight = windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height - PersistentStorage.PersistProps([{ - key: 'navigationHeight', defaultValue: navigationHeight - }]) - } catch (err){ - hilog.error(DOMAIN, 'InsightIntents', 'Failed to getWindowAvoidArea.', JSON.stringify(err)); + windowStage.getMainWindow((err, data) => { + data.setWindowLayoutFullScreen(true).then(() => { + hilog.info(DOMAIN, TAG, 'Succeeded in setting the window layout to full-screen mode.'); + }).catch((err:BusinessError) => { + hilog.error(DOMAIN, TAG, 'Failed to set the window layout to full-screen mode. Cause: %{public}s', JSON.stringify(err)); + }) + data.setWindowSystemBarProperties({ + navigationBarColor: '#F1F3F5', + statusBarColor: '#F1F3F5' + }).then(() => { + hilog.info(DOMAIN, TAG, 'Succeeded in setting the system bar properties.'); + }).catch((err: BusinessError) => { + hilog.error(DOMAIN, TAG, 'Failed to set the system bar properties. Cause: %{public}s', JSON.stringify(err)); + }) + }); + } catch (err) { + hilog.error(DOMAIN, TAG, 'Failed to getMainWindow. Cause: %{public}s', JSON.stringify(err)); } - - - windowStage.loadContent('pages/Index', (err) => { - if (err.code) { - hilog.error(DOMAIN, 'InsightIntents', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err)); - return; - } - hilog.info(DOMAIN, 'InsightIntents', 'Succeeded in loading the content.'); - }); }); } onWindowStageDestroy(): void { - hilog.info(DOMAIN, 'InsightIntents', '%{public}s', 'Ability onWindowStageDestroy'); + hilog.info(DOMAIN, TAG, '%{public}s', 'Ability onWindowStageDestroy'); } onForeground(): void { - hilog.info(DOMAIN, 'InsightIntents', '%{public}s', 'Ability onForeground'); + hilog.info(DOMAIN, TAG, '%{public}s', 'Ability onForeground'); } onBackground(): void { - hilog.info(DOMAIN, 'InsightIntents', '%{public}s', 'Ability onBackground'); + hilog.info(DOMAIN, TAG, '%{public}s', 'Ability onBackground'); } } \ No newline at end of file diff --git a/services/dialog_ui/ams_system_dialog/feature/src/main/ets/view/IntentContent.ets b/services/dialog_ui/ams_system_dialog/feature/src/main/ets/view/IntentContent.ets index abf106ec744ff6507710295b6a98e698981b7b5c..c66857d4488b8e83e5a0b8e7b2009588f2df7dff 100644 --- a/services/dialog_ui/ams_system_dialog/feature/src/main/ets/view/IntentContent.ets +++ b/services/dialog_ui/ams_system_dialog/feature/src/main/ets/view/IntentContent.ets @@ -302,7 +302,7 @@ export struct IntentContent { } .width('100%') .height('100%') - .padding({top:36}) + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) .backgroundColor($r('app.color.background_cont')) } } diff --git a/services/dialog_ui/ams_system_dialog/feature/src/main/ets/view/IntentDetailPage.ets b/services/dialog_ui/ams_system_dialog/feature/src/main/ets/view/IntentDetailPage.ets index 99eeac76b621d0a72ac35e2e192dc47d82460414..06e019817e6402e22a8fab9718b6f6d75b3d1169 100644 --- a/services/dialog_ui/ams_system_dialog/feature/src/main/ets/view/IntentDetailPage.ets +++ b/services/dialog_ui/ams_system_dialog/feature/src/main/ets/view/IntentDetailPage.ets @@ -848,7 +848,6 @@ export struct IntentDetailPage { .hideTitleBar(true) .width('100%') .height('100%') - .padding({ top: 36, bottom: 36 }) .backgroundColor($r('app.color.background_cont')) .clip(true) }