1/** 2 * Copyright (c) 2022-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import { BaseStartAppHandler , Log } from '@ohos/common'; 17import { RecentsStyleConstants } from './constants/RecentsStyleConstants'; 18 19 20const TAG = 'RecentMissionStartAppHandler'; 21 22/** 23 * Desktop workspace start app processing class 24 */ 25export class RecentMissionStartAppHandler extends BaseStartAppHandler { 26 private constructor() { 27 super(); 28 } 29 30 static getInstance(): RecentMissionStartAppHandler { 31 if (globalThis.RecentMissionStartAppHandler == null) { 32 globalThis.RecentMissionStartAppHandler = new RecentMissionStartAppHandler(); 33 } 34 return globalThis.RecentMissionStartAppHandler; 35 } 36 37 protected calculateAppIconPosition(): void { 38 const RecentMissionInfo = AppStorage.Get('startAppItemInfo'); 39 Log.showInfo(TAG, `recentMission_CalculateAppIconPosition:${JSON.stringify(RecentMissionInfo)} `); 40 const isSingleLayout = RecentMissionInfo['isSingleLayout']; 41// this.mAppIconSize = RecentsStyleConstants.SINGLE_LIST_DEFAULT_APP_ICON_SIZE_NEW ; 42 const position = RecentMissionInfo['position']; 43 this.mAppIconPositionX = position.x; 44 this.mAppIconPositionY = position.y; 45 } 46 47} 48