mirror of
https://github.com/openharmony/applications_systemui.git
synced 2026-07-19 19:44:41 -04:00
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 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 Log from "./Log";
|
||||
|
||||
const TAG = "Base-StyleManager";
|
||||
|
||||
export default class BaseStyleManager {
|
||||
// standard display width
|
||||
static readonly STANDARD_DISPLAY_WIDTH_LARGE: number = 2560;
|
||||
static readonly STANDARD_DISPLAY_WIDTH_NORMAL: number = 1280;
|
||||
static readonly STANDARD_DISPLAY_WIDTH_SMALL: number = 720;
|
||||
|
||||
mAbilityPageName = "";
|
||||
maxWidth: number = BaseStyleManager.STANDARD_DISPLAY_WIDTH_NORMAL;
|
||||
standardWidth: number = BaseStyleManager.STANDARD_DISPLAY_WIDTH_NORMAL;
|
||||
|
||||
constructor(name: string) {
|
||||
Log.showInfo(TAG, `constructor, name: ${name}`);
|
||||
this.mAbilityPageName = name;
|
||||
}
|
||||
|
||||
setAbilityPageName(name: string): void {
|
||||
Log.showInfo(TAG, `setAbilityPageName, name: ${name}`);
|
||||
this.mAbilityPageName = name;
|
||||
}
|
||||
|
||||
setMaxWidth(width: number): void {
|
||||
Log.showInfo(TAG, `setMaxWidth, width: ${width}`);
|
||||
this.maxWidth = width;
|
||||
}
|
||||
|
||||
setStandardWidth(width: number): void {
|
||||
Log.showInfo(TAG, `setStandardWidth, width: ${width}`);
|
||||
this.standardWidth = width;
|
||||
}
|
||||
|
||||
getStyle<T>(key: string, defaultStyle: { new(): T }): T {
|
||||
let newKey = this.mAbilityPageName + "-" + key;
|
||||
if (!AppStorage.Has(newKey)) {
|
||||
AppStorage.SetOrCreate(newKey, new defaultStyle());
|
||||
Log.showInfo(TAG, `Create storageKey of ${newKey}`);
|
||||
}
|
||||
return AppStorage.Get(newKey) as T;
|
||||
}
|
||||
|
||||
number2px(n: number): string {
|
||||
return n.toString() + "px";
|
||||
}
|
||||
|
||||
calcScaleSize(n: number): number {
|
||||
return n * this.maxWidth / this.standardWidth;
|
||||
}
|
||||
|
||||
calcScaleSizePx(n: number): string {
|
||||
return this.number2px(this.calcScaleSize(n));
|
||||
}
|
||||
}
|
||||
@@ -12,17 +12,26 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import BaseStyleManager from "./BaseStyleManager";
|
||||
import Log from "./Log";
|
||||
|
||||
const TAG = "Common-StyleManager";
|
||||
|
||||
export class CommonStyleManager extends BaseStyleManager {
|
||||
static readonly ABILITY_PAGE_NAME_COMMON = "Common-Index";
|
||||
export class CommonStyleManager {
|
||||
mAbilityPageName = '';
|
||||
|
||||
constructor() {
|
||||
super(CommonStyleManager.ABILITY_PAGE_NAME_COMMON);
|
||||
setAbilityPageName(name: string): void{
|
||||
Log.showInfo(TAG, `setAbilityPageName, name: ${name}`);
|
||||
this.mAbilityPageName = name;
|
||||
}
|
||||
|
||||
getStyle<T>(key: string, defaultStyle: { new(): T }): T {
|
||||
let newKey = this.mAbilityPageName + "-" + key;
|
||||
if (!AppStorage.Has(newKey)) {
|
||||
AppStorage.SetOrCreate(newKey, new defaultStyle());
|
||||
Log.showInfo(TAG, `Create storageKey of ${newKey}`);
|
||||
}
|
||||
return AppStorage.Get(newKey) as T;
|
||||
}
|
||||
}
|
||||
|
||||
let commonStyleManager = new CommonStyleManager();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from './CommonStyleManager';
|
||||
import CommonStyleManager from './CommonStyleManager';
|
||||
import deviceInfo from '@ohos.deviceInfo';
|
||||
|
||||
const TAG = 'Common-StyleConfiguration';
|
||||
@@ -30,6 +30,6 @@ export class CommonStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getCommonStyle(): CommonStyle {
|
||||
const key: string = TAG + '-Common';
|
||||
return StyleManager.getStyle(key, CommonStyle);
|
||||
return CommonStyleManager.getStyle(key, CommonStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../default/CommonStyleManager';
|
||||
|
||||
const TAG = 'CommonTemplate-StyleConfiguration';
|
||||
|
||||
@@ -72,16 +72,16 @@ export class SimpleToggleBaseStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getIconTitleBaseStyle(): IconTitleBaseStyle {
|
||||
const key: string = TAG + '-IconTitleBase';
|
||||
return StyleManager.getStyle(key, IconTitleBaseStyle);
|
||||
return CommonStyleManager.getStyle(key, IconTitleBaseStyle);
|
||||
}
|
||||
|
||||
static getIconComponentStyle(): IconComponentStyle {
|
||||
const key: string = TAG + '-IconComponent';
|
||||
return StyleManager.getStyle(key, IconComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, IconComponentStyle);
|
||||
}
|
||||
|
||||
static getSimpleToggleBaseStyle(): SimpleToggleBaseStyle {
|
||||
const key: string = TAG + '-SimpleToggleBase';
|
||||
return StyleManager.getStyle(key, SimpleToggleBaseStyle);
|
||||
return CommonStyleManager.getStyle(key, SimpleToggleBaseStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'battery-StyleConfiguration';
|
||||
|
||||
@@ -38,11 +38,11 @@ export class BatteryPicStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getBatteryComponentStyle(): BatteryComponentStyle {
|
||||
const key: string = TAG + '-BatteryComponent';
|
||||
return StyleManager.getStyle(key, BatteryComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, BatteryComponentStyle);
|
||||
}
|
||||
|
||||
static getBatteryPicStyle(): BatteryPicStyle {
|
||||
const key: string = TAG + '-BatteryPicComponent';
|
||||
return StyleManager.getStyle(key, BatteryPicStyle);
|
||||
return CommonStyleManager.getStyle(key, BatteryPicStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'bluetooth-StyleConfiguration';
|
||||
|
||||
@@ -25,6 +25,6 @@ export class StatusBarBluetoothComponentStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getStatusBarBluetoothComponentStyle(): StatusBarBluetoothComponentStyle {
|
||||
const key: string = TAG + '-StatusBarBluetoothComponent';
|
||||
return StyleManager.getStyle(key, StatusBarBluetoothComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, StatusBarBluetoothComponentStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'brightness-StyleConfiguration';
|
||||
|
||||
@@ -36,6 +36,6 @@ export class BrightnessComponentStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getBrightnessComponentStyle(): BrightnessComponentStyle {
|
||||
const key: string = TAG + '-BrightnessComponent';
|
||||
return StyleManager.getStyle(key, BrightnessComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, BrightnessComponentStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import Constants from './constants';
|
||||
|
||||
const TAG = 'capsule-StyleConfiguration';
|
||||
@@ -32,6 +32,6 @@ export class CapsuleComponentStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getCapsuleComponentStyle(): CapsuleComponentStyle {
|
||||
const key: string = TAG + '-CapsuleComponent';
|
||||
return StyleManager.getStyle(key, CapsuleComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, CapsuleComponentStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'clock-StyleConfiguration';
|
||||
|
||||
@@ -24,6 +24,6 @@ export class ClockComponentStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getClockComponentStyle(): ClockComponentStyle {
|
||||
const key: string = TAG + '-ClockComponent';
|
||||
return StyleManager.getStyle(key, ClockComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, ClockComponentStyle);
|
||||
}
|
||||
}
|
||||
+10
-10
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import Constants from './Constants';
|
||||
|
||||
const TAG = 'ControlCenter-StyleConfiguration';
|
||||
@@ -134,46 +134,46 @@ export class ControlEditDialogStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getControlCenterComponentStyle(): ControlCenterComponentStyle {
|
||||
const key: string = TAG + '-ControlCenterComponent';
|
||||
return StyleManager.getStyle(key, ControlCenterComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, ControlCenterComponentStyle);
|
||||
}
|
||||
|
||||
static getControlCenterUpTitleStyle(): ControlCenterUpTitleStyle {
|
||||
const key: string = TAG + '-ControlCenterUpTitle';
|
||||
return StyleManager.getStyle(key, ControlCenterUpTitleStyle);
|
||||
return CommonStyleManager.getStyle(key, ControlCenterUpTitleStyle);
|
||||
}
|
||||
|
||||
static getControlCenterComplexToggleLayoutStyle(): ControlCenterComplexToggleLayoutStyle {
|
||||
const key: string = TAG + '-ControlCenterComplexToggleLayout';
|
||||
return StyleManager.getStyle(key, ControlCenterComplexToggleLayoutStyle);
|
||||
return CommonStyleManager.getStyle(key, ControlCenterComplexToggleLayoutStyle);
|
||||
}
|
||||
|
||||
static getControlCenterSimpleToggleLayoutStyle(): ControlCenterSimpleToggleLayoutStyle {
|
||||
const key: string = TAG + '-ControlCenterSimpleToggleLayout';
|
||||
return StyleManager.getStyle(key, ControlCenterSimpleToggleLayoutStyle);
|
||||
return CommonStyleManager.getStyle(key, ControlCenterSimpleToggleLayoutStyle);
|
||||
}
|
||||
|
||||
static getSimpleToggleLayoutEditComponentStyle(): SimpleToggleLayoutEditComponentStyle {
|
||||
const key: string = TAG + '-SimpleToggleLayoutEditComponent';
|
||||
return StyleManager.getStyle(key, SimpleToggleLayoutEditComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, SimpleToggleLayoutEditComponentStyle);
|
||||
}
|
||||
|
||||
static getSimpleToggleLayoutEditUpTitleStyle(): SimpleToggleLayoutEditUpTitleStyle {
|
||||
const key: string = TAG + '-SimpleToggleLayoutEditUpTitle';
|
||||
return StyleManager.getStyle(key, SimpleToggleLayoutEditUpTitleStyle);
|
||||
return CommonStyleManager.getStyle(key, SimpleToggleLayoutEditUpTitleStyle);
|
||||
}
|
||||
|
||||
static getSimpleToggleLayoutEditOptMsgStyle(): SimpleToggleLayoutEditOptMsgStyle {
|
||||
const key: string = TAG + '-SimpleToggleLayoutEditOptMsg';
|
||||
return StyleManager.getStyle(key, SimpleToggleLayoutEditOptMsgStyle);
|
||||
return CommonStyleManager.getStyle(key, SimpleToggleLayoutEditOptMsgStyle);
|
||||
}
|
||||
|
||||
static getSimpleToggleLayoutEditGridStyle(): SimpleToggleLayoutEditGridStyle {
|
||||
const key: string = TAG + '-SimpleToggleLayoutEditGrid';
|
||||
return StyleManager.getStyle(key, SimpleToggleLayoutEditGridStyle);
|
||||
return CommonStyleManager.getStyle(key, SimpleToggleLayoutEditGridStyle);
|
||||
}
|
||||
|
||||
static getControlEditDialogStyle(): ControlEditDialogStyle {
|
||||
const key: string = TAG + '-ControlEditDialog';
|
||||
return StyleManager.getStyle(key, ControlEditDialogStyle);
|
||||
return CommonStyleManager.getStyle(key, ControlEditDialogStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'location-StyleConfiguration';
|
||||
|
||||
@@ -25,6 +25,6 @@ export class StartsBarLocationComponentStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getStartsBarLocationComponentStyle(): StartsBarLocationComponentStyle {
|
||||
const key: string = TAG + '-startsBarLocation';
|
||||
return StyleManager.getStyle(key, StartsBarLocationComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, StartsBarLocationComponentStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'capsule-StyleConfiguration';
|
||||
|
||||
@@ -29,11 +29,11 @@ export class ControlCenterRingModeComponentStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getStatusRingModeComponentStyle(): StatusRingModeComponentStyle {
|
||||
const key: string = TAG + '-StatusRingMode';
|
||||
return StyleManager.getStyle(key, StatusRingModeComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, StatusRingModeComponentStyle);
|
||||
}
|
||||
|
||||
static getControlCenterRingModeComponentStyle(): ControlCenterRingModeComponentStyle {
|
||||
const key: string = TAG + '-ControlCenterRingMode';
|
||||
return StyleManager.getStyle(key, ControlCenterRingModeComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, ControlCenterRingModeComponentStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'capsule-StyleConfiguration';
|
||||
|
||||
@@ -29,11 +29,11 @@ export class ControlCenterRingModeComponentStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getStatusRingModeComponentStyle(): StatusRingModeComponentStyle {
|
||||
const key: string = TAG + '-StatusRingMode';
|
||||
return StyleManager.getStyle(key, StatusRingModeComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, StatusRingModeComponentStyle);
|
||||
}
|
||||
|
||||
static getControlCenterRingModeComponentStyle(): ControlCenterRingModeComponentStyle {
|
||||
const key: string = TAG + '-ControlCenterRingMode';
|
||||
return StyleManager.getStyle(key, ControlCenterRingModeComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, ControlCenterRingModeComponentStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'signal-StyleConfiguration';
|
||||
|
||||
@@ -29,6 +29,6 @@ export class SignalComponentStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getSignalComponentStyle(): SignalComponentStyle {
|
||||
const key: string = TAG + '-SignalComponent';
|
||||
return StyleManager.getStyle(key, SignalComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, SignalComponentStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import Constants from './Constants';
|
||||
|
||||
const TAG = 'statusBar-StyleConfiguration';
|
||||
@@ -48,21 +48,21 @@ export class PluginIconItemComponentStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getVerticalStatusBarItemLoadComponentStyle(): VerticalStatusBarItemLoadComponentStyle {
|
||||
const key: string = TAG + '-VerticalStatusBarItemLoadComponent';
|
||||
return StyleManager.getStyle(key, VerticalStatusBarItemLoadComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, VerticalStatusBarItemLoadComponentStyle);
|
||||
}
|
||||
|
||||
static getStatusBarNotificationIconStyle(): StatusBarNotificationIconStyle {
|
||||
const key: string = TAG + '-StatusBarNotificationIcon';
|
||||
return StyleManager.getStyle(key, StatusBarNotificationIconStyle);
|
||||
return CommonStyleManager.getStyle(key, StatusBarNotificationIconStyle);
|
||||
}
|
||||
|
||||
static getIconItemComponentStyle(): IconItemComponentStyle {
|
||||
const key: string = TAG + '-IconItemComponent';
|
||||
return StyleManager.getStyle(key, IconItemComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, IconItemComponentStyle);
|
||||
}
|
||||
|
||||
static getPluginIconItemComponentStyle(): PluginIconItemComponentStyle {
|
||||
const key: string = TAG + '-PluginIconItemComponent';
|
||||
return StyleManager.getStyle(key, PluginIconItemComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, PluginIconItemComponentStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import Constants from './Constants';
|
||||
|
||||
const TAG = 'volumepanel-StyleConfiguration';
|
||||
@@ -44,6 +44,6 @@ export class VolumePanelComponentStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getVolumePanelComponentStyle(): VolumePanelComponentStyle {
|
||||
const key: string = TAG + '-VolumePanelComponent';
|
||||
return StyleManager.getStyle(key, VolumePanelComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, VolumePanelComponentStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'wifi-StyleConfiguration';
|
||||
|
||||
@@ -25,6 +25,6 @@ export class StartsBarWifiComponentStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getStartsBarWifiComponentStyle(): StartsBarWifiComponentStyle {
|
||||
const key: string = TAG + '-startsBarWifi';
|
||||
return StyleManager.getStyle(key, StartsBarWifiComponentStyle);
|
||||
return CommonStyleManager.getStyle(key, StartsBarWifiComponentStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from './StyleManager';
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'NavigationBar-StyleConfiguration';
|
||||
|
||||
@@ -28,6 +28,6 @@ export class KeyButtonStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getKeyButtonStyle(): KeyButtonStyle {
|
||||
const key: string = TAG + '-KeyButton';
|
||||
return StyleManager.getStyle(key, KeyButtonStyle);
|
||||
return CommonStyleManager.getStyle(key, KeyButtonStyle);
|
||||
}
|
||||
}
|
||||
@@ -13,56 +13,64 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import Log from '../../../../../../../common/src/main/ets/default/Log';
|
||||
import BaseStyleManager from '../../../../../../../common/src/main/ets/default/BaseStyleManager';
|
||||
import AbilityManager from '../../../../../../../common/src/main/ets/default/abilitymanager/abilityManager';
|
||||
import StyleConfiguration from './StyleConfiguration';
|
||||
|
||||
const TAG = 'StatusBar-StyleManager';
|
||||
|
||||
export class StyleManager extends BaseStyleManager {
|
||||
static readonly ABILITY_PAGE_NAME_NAVIGATION_BAR = "NavigationBar-Index";
|
||||
export default class StyleManager {
|
||||
static readonly PAD_STANDARD_DISPLAY_WIDTH = 1280;
|
||||
static readonly PAD_STANDARD_DISPLAY_HEIGHT = 800;
|
||||
static readonly PHONE_STANDARD_DISPLAY_WIDTH = 720;
|
||||
static readonly PHONE_STANDARD_DISPLAY_HEIGHT = 1280;
|
||||
static maxWidth: number = StyleManager.PAD_STANDARD_DISPLAY_WIDTH;
|
||||
static rumMode = 'pad';
|
||||
|
||||
constructor() {
|
||||
super(StyleManager.ABILITY_PAGE_NAME_NAVIGATION_BAR);
|
||||
}
|
||||
|
||||
setPadStyle(): void {
|
||||
static setPadStyle(): void {
|
||||
Log.showDebug(TAG, 'setPadStyle');
|
||||
|
||||
let config = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_NAVIGATION_BAR, 'config');
|
||||
this.setMaxWidth(config.maxWidth);
|
||||
this.setStandardWidth(BaseStyleManager.STANDARD_DISPLAY_WIDTH_NORMAL);
|
||||
StyleManager.maxWidth = config.maxWidth;
|
||||
StyleManager.rumMode = 'pad';
|
||||
|
||||
// keyButton
|
||||
{
|
||||
let style = StyleConfiguration.getKeyButtonStyle();
|
||||
style.buttonWidth = this.calcScaleSizePx(88);
|
||||
style.buttonHeight = this.calcScaleSizePx(44);
|
||||
style.buttonBorderRadius = this.calcScaleSizePx(22);
|
||||
style.buttonIconWidth = this.calcScaleSizePx(15);
|
||||
style.buttonIconHeight = this.calcScaleSizePx(15);
|
||||
style.buttonWidth = StyleManager.calcScaleSizePx(88);
|
||||
style.buttonHeight = StyleManager.calcScaleSizePx(44);
|
||||
style.buttonBorderRadius = StyleManager.calcScaleSizePx(22);
|
||||
style.buttonIconWidth = StyleManager.calcScaleSizePx(15);
|
||||
style.buttonIconHeight = StyleManager.calcScaleSizePx(15);
|
||||
}
|
||||
}
|
||||
|
||||
setPhoneStyle(): void {
|
||||
static setPhoneStyle(): void {
|
||||
Log.showDebug(TAG, 'setPhoneStyle');
|
||||
|
||||
let config = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_NAVIGATION_BAR, 'config');
|
||||
this.setMaxWidth(config.maxWidth);
|
||||
this.setStandardWidth(BaseStyleManager.STANDARD_DISPLAY_WIDTH_SMALL);
|
||||
StyleManager.maxWidth = config.maxWidth;
|
||||
StyleManager.rumMode = 'phone';
|
||||
|
||||
// keyButton
|
||||
{
|
||||
let style = StyleConfiguration.getKeyButtonStyle();
|
||||
style.buttonWidth = this.calcScaleSizePx(144);
|
||||
style.buttonHeight = this.calcScaleSizePx(72);
|
||||
style.buttonBorderRadius = this.calcScaleSizePx(36);
|
||||
style.buttonIconWidth = this.calcScaleSizePx(24);
|
||||
style.buttonIconHeight = this.calcScaleSizePx(24);
|
||||
style.buttonWidth = StyleManager.calcScaleSizePx(144);
|
||||
style.buttonHeight = StyleManager.calcScaleSizePx(72);
|
||||
style.buttonBorderRadius = StyleManager.calcScaleSizePx(36);
|
||||
style.buttonIconWidth = StyleManager.calcScaleSizePx(24);
|
||||
style.buttonIconHeight = StyleManager.calcScaleSizePx(24);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let styleManager = new StyleManager();
|
||||
static number2px(n: number): string {
|
||||
return n.toString() + 'px';
|
||||
}
|
||||
|
||||
export default styleManager;
|
||||
static calcScaleSize(n: number): number {
|
||||
return n * StyleManager.maxWidth / (StyleManager.rumMode == 'pad' ? StyleManager.PAD_STANDARD_DISPLAY_WIDTH : StyleManager.PHONE_STANDARD_DISPLAY_WIDTH);
|
||||
}
|
||||
|
||||
static calcScaleSizePx(n: number): string {
|
||||
return StyleManager.number2px(StyleManager.calcScaleSize(n));
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
import Three from './threeLayout'
|
||||
import Log from '../../../../../../../common/src/main/ets/default/Log';
|
||||
import AbilityManager from '../../../../../../../common/src/main/ets/default/abilitymanager/abilityManager'
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager'
|
||||
import NavigationBarViewModel from '../viewmodel/NavigationBarViewModel';
|
||||
import {NavigationBarComponentData} from '../common/constants'
|
||||
import StyleManager from '../common/StyleManager'
|
||||
@@ -44,6 +45,7 @@ struct Index {
|
||||
mConfigManager.initConfig();
|
||||
|
||||
setAppBgColor('#00000000');
|
||||
CommonStyleManager.setAbilityPageName(TAG)
|
||||
if (configInfo.maxWidth > configInfo.maxHeight) { // Pad、PC Mode
|
||||
StyleManager.setPadStyle();
|
||||
} else { // Phone Mode
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from './StyleManager';
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'VolumePanel-StyleConfiguration';
|
||||
|
||||
@@ -23,6 +23,6 @@ export class IndexStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getIndexStyle(): IndexStyle {
|
||||
const key: string = TAG + '-Index';
|
||||
return StyleManager.getStyle(key, IndexStyle);
|
||||
return CommonStyleManager.getStyle(key, IndexStyle);
|
||||
}
|
||||
}
|
||||
@@ -12,44 +12,40 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import BaseStyleManager from '../../../../../../../common/src/main/ets/default/BaseStyleManager';
|
||||
import Log from '../../../../../../../common/src/main/ets/default/Log';
|
||||
import AbilityManager from '../../../../../../../common/src/main/ets/default/abilitymanager/abilityManager';
|
||||
import StyleConfiguration from '../../../../../../../features/volumepanelcomponent/src/main/ets/com/ohos/common/StyleConfiguration';
|
||||
|
||||
const TAG = 'VolumePanel-StyleManager';
|
||||
|
||||
export class StyleManager extends BaseStyleManager {
|
||||
static readonly ABILITY_PAGE_NAME_VOLUMEPANEL = "VolumePanel-Index";
|
||||
export default class StyleManager {
|
||||
static readonly STANDARD_DISPLAY_WIDTH: number = 2560;
|
||||
static readonly STANDARD_DISPLAY_HEIGHT: number = 1600;
|
||||
static maxWidth: number = StyleManager.STANDARD_DISPLAY_WIDTH;
|
||||
|
||||
constructor() {
|
||||
super(StyleManager.ABILITY_PAGE_NAME_VOLUMEPANEL);
|
||||
}
|
||||
|
||||
setStyle(): void {
|
||||
static setStyle(): void {
|
||||
Log.showDebug(TAG, 'setStyle');
|
||||
|
||||
this.setStandardWidth(BaseStyleManager.STANDARD_DISPLAY_WIDTH_LARGE);
|
||||
let config = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_VOLUME_PANEL, 'dis');
|
||||
this.setMaxWidth(config.width);
|
||||
StyleManager.maxWidth = config.width;
|
||||
|
||||
// Pad、PC Mode
|
||||
{
|
||||
let style = StyleConfiguration.getVolumePanelComponentStyle();
|
||||
style.volumePanelSliderMarginTop = this.calcScaleSizePx(40);
|
||||
style.volumePanSliderWidth = px2vp(this.calcScaleSize(8)).toString() + 'vp';
|
||||
style.volumePanSliderHeight = this.calcScaleSizePx(320);
|
||||
style.volumePanelSliderMarginBottom = this.calcScaleSizePx(40);
|
||||
style.volumePanelMutBtnIconSize = this.calcScaleSizePx(48);
|
||||
style.volumePanelMutBtnIconMarginBottom = this.calcScaleSizePx(24);
|
||||
style.volumePanelMuteBtnHeight = this.calcScaleSizePx(72);
|
||||
style.volumePanelSettingIconSize = this.calcScaleSizePx(48);
|
||||
style.volumePanelSettingButtonSize = this.calcScaleSizePx(96);
|
||||
style.volumePanelSliderMarginTop = StyleManager.calcScaleSizePx(40);
|
||||
style.volumePanSliderWidth = px2vp(StyleManager.calcScaleSize(8)).toString() + 'vp';
|
||||
style.volumePanSliderHeight = StyleManager.calcScaleSizePx(320);
|
||||
style.volumePanelSliderMarginBottom = StyleManager.calcScaleSizePx(40);
|
||||
style.volumePanelMutBtnIconSize = StyleManager.calcScaleSizePx(48);
|
||||
style.volumePanelMutBtnIconMarginBottom = StyleManager.calcScaleSizePx(24);
|
||||
style.volumePanelMuteBtnHeight = StyleManager.calcScaleSizePx(72);
|
||||
style.volumePanelSettingIconSize = StyleManager.calcScaleSizePx(48);
|
||||
style.volumePanelSettingButtonSize = StyleManager.calcScaleSizePx(96);
|
||||
style.volumePanelBackground = '#99FFFFFF';
|
||||
style.volumePanelSliderBlockColor = '#FFFFFFFF';
|
||||
style.volumePanelDividerHeight = this.calcScaleSizePx(1);
|
||||
style.volumePanelBorderRadius = this.calcScaleSizePx(48);
|
||||
style.volumeDividerWidth = this.calcScaleSizePx(60);
|
||||
style.volumePanelDividerHeight = StyleManager.calcScaleSizePx(1);
|
||||
style.volumePanelBorderRadius = StyleManager.calcScaleSizePx(48);
|
||||
style.volumeDividerWidth = StyleManager.calcScaleSizePx(60);
|
||||
style.volumeSliderTrackColor = '#FFAEE6E6';
|
||||
style.volumeSelectedColor = '#FF007DFF';
|
||||
style.volumeButtonBackgroundColor = '#00000000';
|
||||
@@ -57,9 +53,18 @@ export class StyleManager extends BaseStyleManager {
|
||||
style.volumePanelDividerColor = '#FF9BCECE';
|
||||
style.volumePanelSettingColor = '#FF4D6666';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
let styleManager = new StyleManager();
|
||||
static number2px(n: number): string {
|
||||
return n.toString() + 'px';
|
||||
}
|
||||
|
||||
export default styleManager;
|
||||
static calcScaleSize(n: number): number {
|
||||
return n * StyleManager.maxWidth / StyleManager.STANDARD_DISPLAY_WIDTH;
|
||||
}
|
||||
|
||||
static calcScaleSizePx(n: number): string {
|
||||
return StyleManager.number2px(StyleManager.calcScaleSize(n));
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import Log from '../../../../../../../common/src/main/ets/default/Log'
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager'
|
||||
import VolumePanelComponent from '../../../../../../../features/volumepanelcomponent/src/main/ets/com/ohos/pages/VolumePanelComponent'
|
||||
import AbilityManager from '../../../../../../../common/src/main/ets/default/abilitymanager/abilityManager'
|
||||
import StyleManager from '../common/StyleManager'
|
||||
@@ -50,6 +51,7 @@ struct Index {
|
||||
WindowManager.resetSizeWindow(WindowType.VOLUME_PANEL, volumeRect);
|
||||
|
||||
setAppBgColor('#00000000');
|
||||
CommonStyleManager.setAbilityPageName(TAG)
|
||||
Log.showDebug(TAG, `configInfo Start, configInfo ${JSON.stringify(configInfo)}`);
|
||||
if (configInfo.width > configInfo.height) { // Pad、PC Mode
|
||||
StyleManager.setStyle();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from './StyleManager';
|
||||
import CommonStyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'ControlPanel-StyleConfiguration';
|
||||
|
||||
@@ -24,7 +24,7 @@ export class IndexStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getIndexStyle(): IndexStyle {
|
||||
const key: string = TAG + '-Index';
|
||||
return StyleManager.getStyle(key, IndexStyle);
|
||||
return CommonStyleManager.getStyle(key, IndexStyle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import BaseStyleManager from '../../../../../../../../common/src/main/ets/default/BaseStyleManager';
|
||||
import Log from '../../../../../../../../common/src/main/ets/default/Log';
|
||||
import AbilityManager from '../../../../../../../../common/src/main/ets/default/abilitymanager/abilitymanager';
|
||||
import CommonTemplateStyleConfiguration from '../../../../../../../../common/src/main/ets/template/common/styleconfiguration';
|
||||
@@ -23,128 +22,125 @@ import IndexStyleConfiguration from './styleconfiguration';
|
||||
|
||||
const TAG = 'ControlPanel-StyleManager';
|
||||
|
||||
export class StyleManager extends BaseStyleManager {
|
||||
static readonly ABILITY_PAGE_NAME_CONTROLPANEL = "ControlPanel-Index";
|
||||
export default class StyleManager {
|
||||
static readonly STANDARD_DISPLAY_WIDTH = 1280;
|
||||
static readonly STANDARD_DISPLAY_HEIGHT = 800;
|
||||
static maxWidth: number = StyleManager.STANDARD_DISPLAY_WIDTH;
|
||||
|
||||
constructor() {
|
||||
super(StyleManager.ABILITY_PAGE_NAME_CONTROLPANEL);
|
||||
}
|
||||
|
||||
setStyle(): void{
|
||||
static setStyle(): void{
|
||||
Log.showDebug(TAG, 'setStyle');
|
||||
|
||||
this.setStandardWidth(BaseStyleManager.STANDARD_DISPLAY_WIDTH_NORMAL);
|
||||
let dis = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_CONTROL_PANEL, 'dis');
|
||||
this.setMaxWidth(dis.width);
|
||||
StyleManager.maxWidth = dis.width;
|
||||
|
||||
// Index
|
||||
this.setIndexStyle();
|
||||
StyleManager.setIndexStyle();
|
||||
// ControlCenter
|
||||
this.setControlCenterComponentStyle();
|
||||
StyleManager.setControlCenterComponentStyle();
|
||||
// ControlCenter-Title
|
||||
this.setControlCenterUpTitleStyle();
|
||||
StyleManager.setControlCenterUpTitleStyle();
|
||||
// ControlCenter-ComplexToggleLayout
|
||||
this.setControlCenterComplexToggleLayoutStyle();
|
||||
StyleManager.setControlCenterComplexToggleLayoutStyle();
|
||||
// ControlCenter-SimpleToggleLayout
|
||||
this.setControlCenterSimpleToggleLayoutStyle();
|
||||
StyleManager.setControlCenterSimpleToggleLayoutStyle();
|
||||
// CommonTemplate-iconTitleBase
|
||||
this.setIconTitleBaseStyle();
|
||||
StyleManager.setIconTitleBaseStyle();
|
||||
// CommonTemplate-iconComponent
|
||||
this.setIconComponentStyle();
|
||||
StyleManager.setIconComponentStyle();
|
||||
// CommonTemplate-simpleToggleBase
|
||||
this.setSimpleToggleBaseStyle();
|
||||
StyleManager.setSimpleToggleBaseStyle();
|
||||
// Brightness
|
||||
this.setBrightnessComponentStyle();
|
||||
StyleManager.setBrightnessComponentStyle();
|
||||
// RingMode
|
||||
this.setControlCenterRingModeComponentStyle();
|
||||
StyleManager.setControlCenterRingModeComponentStyle();
|
||||
// SimpleToggleLayoutEdit
|
||||
this.setSimpleToggleLayoutEditComponentStyle();
|
||||
StyleManager.setSimpleToggleLayoutEditComponentStyle();
|
||||
// SimpleToggleLayoutEdit-title
|
||||
this.setSimpleToggleLayoutEditUpTitleStyle();
|
||||
StyleManager.setSimpleToggleLayoutEditUpTitleStyle();
|
||||
// SimpleToggleLayoutEdit-msg
|
||||
this.setSimpleToggleLayoutEditOptMsgStyle();
|
||||
StyleManager.setSimpleToggleLayoutEditOptMsgStyle();
|
||||
// SimpleToggleLayoutEdit-grid
|
||||
this.setSimpleToggleLayoutEditGridStyle();
|
||||
StyleManager.setSimpleToggleLayoutEditGridStyle();
|
||||
// EditDialog
|
||||
this.setControlEditDialogStyle();
|
||||
StyleManager.setControlEditDialogStyle();
|
||||
}
|
||||
// Index
|
||||
private setIndexStyle(): void {
|
||||
private static setIndexStyle(): void {
|
||||
let style = IndexStyleConfiguration.getIndexStyle();
|
||||
style.borderRadius = this.calcScaleSizePx(24);
|
||||
style.borderRadius = StyleManager.calcScaleSizePx(24);
|
||||
}
|
||||
// ControlCenter
|
||||
private setControlCenterComponentStyle(): void {
|
||||
private static setControlCenterComponentStyle(): void {
|
||||
let style = ControlCenterStyleConfiguration.getControlCenterComponentStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(20);
|
||||
style.marginRight = this.calcScaleSizePx(20);
|
||||
style.marginTop = this.calcScaleSizePx(0);
|
||||
style.upTitleHeight = this.calcScaleSizePx(56);
|
||||
style.titleMarginBottom = this.calcScaleSizePx(0);
|
||||
style.toggleAreaGap = this.calcScaleSizePx(12);
|
||||
style.simpleToggleLayoutMarginTop = this.calcScaleSizePx(23);
|
||||
style.simpleToggleLayoutMarginBottom = this.calcScaleSizePx(0);
|
||||
style.brightnessMarginBottom = this.calcScaleSizePx(12);
|
||||
style.componentBorderRadius = this.calcScaleSizePx(24);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(20);
|
||||
style.marginRight = StyleManager.calcScaleSizePx(20);
|
||||
style.marginTop = StyleManager.calcScaleSizePx(0);
|
||||
style.upTitleHeight = StyleManager.calcScaleSizePx(56);
|
||||
style.titleMarginBottom = StyleManager.calcScaleSizePx(0);
|
||||
style.toggleAreaGap = StyleManager.calcScaleSizePx(12);
|
||||
style.simpleToggleLayoutMarginTop = StyleManager.calcScaleSizePx(23);
|
||||
style.simpleToggleLayoutMarginBottom = StyleManager.calcScaleSizePx(0);
|
||||
style.brightnessMarginBottom = StyleManager.calcScaleSizePx(12);
|
||||
style.componentBorderRadius = StyleManager.calcScaleSizePx(24);
|
||||
style.componentBackgroundColor = '#99FFFFFF';
|
||||
}
|
||||
// ControlCenter-Title
|
||||
private setControlCenterUpTitleStyle(): void{
|
||||
private static setControlCenterUpTitleStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getControlCenterUpTitleStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(24);
|
||||
style.marginRight = this.calcScaleSizePx(21);
|
||||
style.fontSize = this.calcScaleSizePx(20);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(24);
|
||||
style.marginRight = StyleManager.calcScaleSizePx(21);
|
||||
style.fontSize = StyleManager.calcScaleSizePx(20);
|
||||
style.fontColor = '#000000';
|
||||
style.imageWidth = this.calcScaleSizePx(24);
|
||||
style.imageHeight = this.calcScaleSizePx(24);
|
||||
style.imageHoverWidth = this.calcScaleSizePx(32);
|
||||
style.imageHoverHeight = this.calcScaleSizePx(32);
|
||||
style.imageHoverRadius = this.calcScaleSizePx(8);
|
||||
style.imageWidth = StyleManager.calcScaleSizePx(24);
|
||||
style.imageHeight = StyleManager.calcScaleSizePx(24);
|
||||
style.imageHoverWidth = StyleManager.calcScaleSizePx(32);
|
||||
style.imageHoverHeight = StyleManager.calcScaleSizePx(32);
|
||||
style.imageHoverRadius = StyleManager.calcScaleSizePx(8);
|
||||
style.imageHoverColor = 'rgba(0, 0, 0, 0.05)';
|
||||
style.imageTransparentColor = 'rgba(255, 255, 255, 0)';
|
||||
style.upTitleSpace = this.calcScaleSizePx(24);
|
||||
style.upTitleSpace = StyleManager.calcScaleSizePx(24);
|
||||
style.titleImageColor = '#ff182431';
|
||||
}
|
||||
// ControlCenter-ComplexToggleLayout
|
||||
private setControlCenterComplexToggleLayoutStyle(): void {
|
||||
private static setControlCenterComplexToggleLayoutStyle(): void {
|
||||
let style = ControlCenterStyleConfiguration.getControlCenterComplexToggleLayoutStyle();
|
||||
style.columnGap = this.calcScaleSizePx(12);
|
||||
style.rowGap = this.calcScaleSize(12);
|
||||
style.rowHeight = this.calcScaleSize(66);
|
||||
style.columnGap = StyleManager.calcScaleSizePx(12);
|
||||
style.rowGap = StyleManager.calcScaleSize(12);
|
||||
style.rowHeight = StyleManager.calcScaleSize(66);
|
||||
}
|
||||
// ControlCenter-SimpleToggleLayout
|
||||
private setControlCenterSimpleToggleLayoutStyle(): void{
|
||||
private static setControlCenterSimpleToggleLayoutStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getControlCenterSimpleToggleLayoutStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(11);
|
||||
style.marginRight = this.calcScaleSizePx(11);
|
||||
style.columnGap = this.calcScaleSizePx(0);
|
||||
style.rowGap = this.calcScaleSize(0);
|
||||
style.rowHeight = this.calcScaleSize(81);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(11);
|
||||
style.marginRight = StyleManager.calcScaleSizePx(11);
|
||||
style.columnGap = StyleManager.calcScaleSizePx(0);
|
||||
style.rowGap = StyleManager.calcScaleSize(0);
|
||||
style.rowHeight = StyleManager.calcScaleSize(81);
|
||||
}
|
||||
// CommonTemplate-iconTitleBase
|
||||
private setIconTitleBaseStyle(): void{
|
||||
private static setIconTitleBaseStyle(): void{
|
||||
let style = CommonTemplateStyleConfiguration.getIconTitleBaseStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(8);
|
||||
style.marginRight = this.calcScaleSizePx(4);
|
||||
style.componentGap = this.calcScaleSizePx(8);
|
||||
style.titleSize = this.calcScaleSizePx(12);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(8);
|
||||
style.marginRight = StyleManager.calcScaleSizePx(4);
|
||||
style.componentGap = StyleManager.calcScaleSizePx(8);
|
||||
style.titleSize = StyleManager.calcScaleSizePx(12);
|
||||
style.titleColor = $r('sys.color.ohos_id_color_text_secondary'),
|
||||
style.borderRadius = this.calcScaleSizePx(24);
|
||||
style.borderRadius = StyleManager.calcScaleSizePx(24);
|
||||
style.backgroundColor = '#99FFFFFF';
|
||||
style.textMargin = this.calcScaleSizePx(8);
|
||||
style.textHoverHeight = this.calcScaleSizePx(26);
|
||||
style.textHoverWidth = this.calcScaleSizePx(68);
|
||||
style.textHoverRadius = this.calcScaleSizePx(4);
|
||||
style.textMargin = StyleManager.calcScaleSizePx(8);
|
||||
style.textHoverHeight = StyleManager.calcScaleSizePx(26);
|
||||
style.textHoverWidth = StyleManager.calcScaleSizePx(68);
|
||||
style.textHoverRadius = StyleManager.calcScaleSizePx(4);
|
||||
style.hoverColor = 'rgba(0, 0, 0, 0.05)';
|
||||
style.transparentColor = 'rgba(255, 255, 255, 0)';
|
||||
}
|
||||
// CommonTemplate-iconComponent
|
||||
private setIconComponentStyle(): void {
|
||||
private static setIconComponentStyle(): void {
|
||||
let style = CommonTemplateStyleConfiguration.getIconComponentStyle();
|
||||
style.circleWidth = this.calcScaleSizePx(48);
|
||||
style.circleHeight = this.calcScaleSizePx(48);
|
||||
style.iconWidth = this.calcScaleSizePx(24);
|
||||
style.iconHeight = this.calcScaleSizePx(24);
|
||||
style.circleWidth = StyleManager.calcScaleSizePx(48);
|
||||
style.circleHeight = StyleManager.calcScaleSizePx(48);
|
||||
style.iconWidth = StyleManager.calcScaleSizePx(24);
|
||||
style.iconHeight = StyleManager.calcScaleSizePx(24);
|
||||
style.iconOffBG = '#1A000000';
|
||||
style.iconOnBG = '#FF007DFF';
|
||||
style.iconOnColor = '#FFFFFFFF';
|
||||
@@ -153,128 +149,136 @@ export class StyleManager extends BaseStyleManager {
|
||||
style.transparentColor = 'rgba(255, 255, 255, 0)';
|
||||
}
|
||||
// CommonTemplate-simpleToggleBase
|
||||
private setSimpleToggleBaseStyle(): void {
|
||||
private static setSimpleToggleBaseStyle(): void {
|
||||
let style = CommonTemplateStyleConfiguration.getSimpleToggleBaseStyle();
|
||||
style.circleWidth = this.calcScaleSizePx(48);
|
||||
style.circleHeight = this.calcScaleSizePx(48);
|
||||
style.iconWidth = this.calcScaleSizePx(24);
|
||||
style.iconHeight = this.calcScaleSizePx(24);
|
||||
style.dragCircleWidth = this.calcScaleSizePx(60);
|
||||
style.dragCircleHeight = this.calcScaleSizePx(60);
|
||||
style.dragIconWidth = this.calcScaleSizePx(36);
|
||||
style.dragIconHeight = this.calcScaleSizePx(36);
|
||||
style.circleWidth = StyleManager.calcScaleSizePx(48);
|
||||
style.circleHeight = StyleManager.calcScaleSizePx(48);
|
||||
style.iconWidth = StyleManager.calcScaleSizePx(24);
|
||||
style.iconHeight = StyleManager.calcScaleSizePx(24);
|
||||
style.dragCircleWidth = StyleManager.calcScaleSizePx(60);
|
||||
style.dragCircleHeight = StyleManager.calcScaleSizePx(60);
|
||||
style.dragIconWidth = StyleManager.calcScaleSizePx(36);
|
||||
style.dragIconHeight = StyleManager.calcScaleSizePx(36);
|
||||
style.iconOffBG = '#1A000000';
|
||||
style.iconOnBG = '#FF007DFF';
|
||||
style.iconOnColor = '#FFFFFFFF';
|
||||
style.iconOffColor = $r('sys.color.ohos_id_color_secondary');
|
||||
style.componentGap = this.calcScaleSizePx(4);
|
||||
style.titleSize = this.calcScaleSizePx(12);
|
||||
style.componentGap = StyleManager.calcScaleSizePx(4);
|
||||
style.titleSize = StyleManager.calcScaleSizePx(12);
|
||||
style.titleColor = $r('sys.color.ohos_id_color_text_secondary');
|
||||
style.textHoverWidth = this.calcScaleSizePx(68);
|
||||
style.textHoverHeight = this.calcScaleSizePx(18);
|
||||
style.textHoverRadius = this.calcScaleSizePx(4);
|
||||
style.textHoverWidth = StyleManager.calcScaleSizePx(68);
|
||||
style.textHoverHeight = StyleManager.calcScaleSizePx(18);
|
||||
style.textHoverRadius = StyleManager.calcScaleSizePx(4);
|
||||
style.hoverColor = 'rgba(0, 0, 0, 0.05)';
|
||||
style.transparentColor = 'rgba(255, 255, 255, 0)';
|
||||
}
|
||||
// Brightness
|
||||
private setBrightnessComponentStyle(): void {
|
||||
private static setBrightnessComponentStyle(): void{
|
||||
let style = BrightnessStyleConfiguration.getBrightnessComponentStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(12.5);
|
||||
style.marginRight = this.calcScaleSizePx(12.5);
|
||||
style.componentGap = this.calcScaleSizePx(8.5);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(12.5);
|
||||
style.marginRight = StyleManager.calcScaleSizePx(12.5);
|
||||
style.componentGap = StyleManager.calcScaleSizePx(8.5);
|
||||
style.brightnessIconColor = $r('sys.color.ohos_id_color_secondary');
|
||||
style.brightnessReduceWidth = this.calcScaleSizePx(22);
|
||||
style.brightnessReduceHeight = this.calcScaleSizePx(22);
|
||||
style.brightnessPlusWidth = this.calcScaleSizePx(22);
|
||||
style.brightnessPlusHeight = this.calcScaleSizePx(22);
|
||||
style.brightnessHeight = this.calcScaleSizePx(40);
|
||||
style.sliderHeight = px2vp(this.calcScaleSize(20)).toString() + 'vp';
|
||||
style.brightnessReduceWidth = StyleManager.calcScaleSizePx(22);
|
||||
style.brightnessReduceHeight = StyleManager.calcScaleSizePx(22);
|
||||
style.brightnessPlusWidth = StyleManager.calcScaleSizePx(22);
|
||||
style.brightnessPlusHeight = StyleManager.calcScaleSizePx(22);
|
||||
style.brightnessHeight = StyleManager.calcScaleSizePx(40);
|
||||
style.sliderHeight = px2vp(StyleManager.calcScaleSize(20)).toString() + 'vp';
|
||||
style.sliderBlockColor = '#FFFFFFFF';
|
||||
style.sliderTrackColor = '#0D000000';
|
||||
style.sliderSelectedColor = '#FF007DFF';
|
||||
}
|
||||
// RingMode
|
||||
private setControlCenterRingModeComponentStyle(): void {
|
||||
private static setControlCenterRingModeComponentStyle(): void{
|
||||
let style = RingModeStyleConfiguration.getControlCenterRingModeComponentStyle();
|
||||
style.onBgColor = '#FFFF9800';
|
||||
}
|
||||
// SimpleToggleLayoutEdit
|
||||
private setSimpleToggleLayoutEditComponentStyle(): void {
|
||||
private static setSimpleToggleLayoutEditComponentStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getSimpleToggleLayoutEditComponentStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(0);
|
||||
style.marginRight = this.calcScaleSizePx(0);
|
||||
style.marginTop = this.calcScaleSizePx(0);
|
||||
style.titleHeight = this.calcScaleSizePx(56);
|
||||
style.titleMarginBottom = this.calcScaleSizePx(0);
|
||||
style.upGridMarginTop = this.calcScaleSizePx(4);
|
||||
style.upGridMarginBottom = this.calcScaleSizePx(20);
|
||||
style.gridMarginLeft = this.calcScaleSizePx(21);
|
||||
style.gridMarginRight = this.calcScaleSizePx(21);
|
||||
style.msgMarginTop = this.calcScaleSizePx(0);
|
||||
style.msgMarginBottom = this.calcScaleSizePx(4);
|
||||
style.btnMarginTop = this.calcScaleSizePx(4);
|
||||
style.btnMarginBottom = this.calcScaleSizePx(16);
|
||||
style.borderRadius = this.calcScaleSizePx(24);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(0);
|
||||
style.marginRight = StyleManager.calcScaleSizePx(0);
|
||||
style.marginTop = StyleManager.calcScaleSizePx(0);
|
||||
style.titleHeight = StyleManager.calcScaleSizePx(56);
|
||||
style.titleMarginBottom = StyleManager.calcScaleSizePx(0);
|
||||
style.upGridMarginTop = StyleManager.calcScaleSizePx(4);
|
||||
style.upGridMarginBottom = StyleManager.calcScaleSizePx(20);
|
||||
style.gridMarginLeft = StyleManager.calcScaleSizePx(21);
|
||||
style.gridMarginRight = StyleManager.calcScaleSizePx(21);
|
||||
style.msgMarginTop = StyleManager.calcScaleSizePx(0);
|
||||
style.msgMarginBottom = StyleManager.calcScaleSizePx(4);
|
||||
style.btnMarginTop = StyleManager.calcScaleSizePx(4);
|
||||
style.btnMarginBottom = StyleManager.calcScaleSizePx(16);
|
||||
style.borderRadius = StyleManager.calcScaleSizePx(24);
|
||||
style.upAreaBgColor = '#00FFFFFF';
|
||||
style.downAreaBgColor = '#4DFFFFFF';
|
||||
style.editBtnFontColor = '#FF007DFF';
|
||||
style.editBtnFontSize = $r('sys.float.ohos_id_text_size_button1');
|
||||
style.editBtnBgColor = '#0D000000';
|
||||
style.editBtnMarginLeft = this.calcScaleSizePx(16);
|
||||
style.editBtnMarginRight = this.calcScaleSizePx(16);
|
||||
style.editBtnHeight = this.calcScaleSizePx(40);
|
||||
style.editBtnSpace = this.calcScaleSizePx(16);
|
||||
style.editBtnMarginLeft = StyleManager.calcScaleSizePx(16);
|
||||
style.editBtnMarginRight = StyleManager.calcScaleSizePx(16);
|
||||
style.editBtnHeight = StyleManager.calcScaleSizePx(40);
|
||||
style.editBtnSpace = StyleManager.calcScaleSizePx(16);
|
||||
}
|
||||
// SimpleToggleLayoutEdit
|
||||
private setSimpleToggleLayoutEditUpTitleStyle(): void {
|
||||
private static setSimpleToggleLayoutEditUpTitleStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getSimpleToggleLayoutEditUpTitleStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(24);
|
||||
style.imageWidth = this.calcScaleSizePx(20);
|
||||
style.imageHeight = this.calcScaleSizePx(20);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(24);
|
||||
style.imageWidth = StyleManager.calcScaleSizePx(20);
|
||||
style.imageHeight = StyleManager.calcScaleSizePx(20);
|
||||
style.fontColor = '#FF000000';
|
||||
style.editTitleSpace = this.calcScaleSizePx(18);
|
||||
style.titleFontSize = this.calcScaleSizePx(20);
|
||||
style.editTitleSpace = StyleManager.calcScaleSizePx(18);
|
||||
style.titleFontSize = StyleManager.calcScaleSizePx(20);
|
||||
}
|
||||
// SimpleToggleLayoutEdit
|
||||
private setSimpleToggleLayoutEditOptMsgStyle(): void {
|
||||
private static setSimpleToggleLayoutEditOptMsgStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getSimpleToggleLayoutEditOptMsgStyle();
|
||||
style.fontSize = this.calcScaleSizePx(12);
|
||||
style.fontSize = StyleManager.calcScaleSizePx(12);
|
||||
style.fontColor = $r('sys.color.ohos_id_color_text_secondary');
|
||||
style.height = this.calcScaleSizePx(41);
|
||||
style.marginLeftRight = this.calcScaleSizePx(30);
|
||||
style.height = StyleManager.calcScaleSizePx(41);
|
||||
style.marginLeftRight = StyleManager.calcScaleSizePx(30);
|
||||
}
|
||||
// SimpleToggleLayoutEdit-grid
|
||||
private setSimpleToggleLayoutEditGridStyle(): void {
|
||||
private static setSimpleToggleLayoutEditGridStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getSimpleToggleLayoutEditGridStyle();
|
||||
style.columnGap = this.calcScaleSizePx(0);
|
||||
style.rowGap = this.calcScaleSize(0);
|
||||
style.rowHeight = this.calcScaleSize(80);
|
||||
style.dragBgSize = this.calcScaleSizePx(60);
|
||||
style.columnGap = StyleManager.calcScaleSizePx(0);
|
||||
style.rowGap = StyleManager.calcScaleSize(0);
|
||||
style.rowHeight = StyleManager.calcScaleSize(80);
|
||||
style.dragBgSize = StyleManager.calcScaleSizePx(60);
|
||||
}
|
||||
// EditDialog
|
||||
private setControlEditDialogStyle(): void {
|
||||
private static setControlEditDialogStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getControlEditDialogStyle();
|
||||
style.editDialogHeight = this.calcScaleSizePx(121);
|
||||
style.editDialogWidth = this.calcScaleSizePx(374);
|
||||
style.editDialogFontSize = this.calcScaleSizePx(18);
|
||||
style.editDialogBtnMarginLF = this.calcScaleSizePx(13);
|
||||
style.editDialogFontHeight = this.calcScaleSizePx(20);
|
||||
style.editDialogBtnMarginTop = this.calcScaleSizePx(20);
|
||||
style.editDialogButtonSize = this.calcScaleSizePx(18);
|
||||
style.editDialogDividerHeight = this.calcScaleSizePx(20);
|
||||
style.editDialogButtonHeight = this.calcScaleSizePx(30);
|
||||
style.editDialogRadius = this.calcScaleSizePx(20);
|
||||
style.editDialogBtnWidth = this.calcScaleSizePx(173);
|
||||
style.editDialogFontMarginTop = this.calcScaleSizePx(29);
|
||||
style.editDialogHeight = StyleManager.calcScaleSizePx(121);
|
||||
style.editDialogWidth = StyleManager.calcScaleSizePx(374);
|
||||
style.editDialogFontSize = StyleManager.calcScaleSizePx(18);
|
||||
style.editDialogBtnMarginLF = StyleManager.calcScaleSizePx(13);
|
||||
style.editDialogFontHeight = StyleManager.calcScaleSizePx(20);
|
||||
style.editDialogBtnMarginTop = StyleManager.calcScaleSizePx(20);
|
||||
style.editDialogButtonSize = StyleManager.calcScaleSizePx(18);
|
||||
style.editDialogDividerHeight = StyleManager.calcScaleSizePx(20);
|
||||
style.editDialogButtonHeight = StyleManager.calcScaleSizePx(30);
|
||||
style.editDialogRadius = StyleManager.calcScaleSizePx(20);
|
||||
style.editDialogBtnWidth = StyleManager.calcScaleSizePx(173);
|
||||
style.editDialogFontMarginTop = StyleManager.calcScaleSizePx(29);
|
||||
style.editDialogColor = '#FFFFFFFF';
|
||||
style.editDialogBtnFontColor = '#FF0000FF';
|
||||
style.editDialogBtnBgColor = '#00FFFFFF';
|
||||
style.editDialogDividerColor = $r('sys.color.ohos_id_color_secondary');
|
||||
style.editDialogDividerWidth = this.calcScaleSizePx(1);
|
||||
style.editDialogDividerWidth = StyleManager.calcScaleSizePx(1);
|
||||
Log.showDebug(TAG, 'getControlEditDialogStyle');
|
||||
}
|
||||
}
|
||||
|
||||
let styleManager = new StyleManager();
|
||||
static number2px(n: number): string {
|
||||
return n.toString() + 'px';
|
||||
}
|
||||
|
||||
export default styleManager;
|
||||
static calcScaleSize(n: number): number {
|
||||
return n * StyleManager.maxWidth / StyleManager.STANDARD_DISPLAY_WIDTH;
|
||||
}
|
||||
|
||||
static calcScaleSizePx(n: number): string {
|
||||
return StyleManager.number2px(StyleManager.calcScaleSize(n));
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import Log from '../../../../../../../common/src/main/ets/default/Log'
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager'
|
||||
import HeightConfigUtils from '../../../../../../../common/src/main/ets/default/heightcofigUtils/HeightConfigUtils'
|
||||
import AbilityManager from '../../../../../../../common/src/main/ets/default/abilitymanager/AbilityManager'
|
||||
import StyleConfiguration, { IndexStyle } from './common/StyleConfiguration'
|
||||
@@ -68,6 +69,7 @@ struct Index {
|
||||
Log.showInfo(TAG, `aboutToAppear, start`)
|
||||
|
||||
setAppBgColor('#00000000')
|
||||
CommonStyleManager.setAbilityPageName(TAG)
|
||||
this.style = StyleConfiguration.getIndexStyle()
|
||||
StyleManager.setStyle()
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from './StyleManager';
|
||||
import CommonStyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'NotificationPanel-StyleConfiguration';
|
||||
|
||||
@@ -24,6 +24,6 @@ export class IndexStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getIndexStyle(): IndexStyle {
|
||||
const key: string = TAG + '-Index';
|
||||
return StyleManager.getStyle(key, IndexStyle);
|
||||
return CommonStyleManager.getStyle(key, IndexStyle);
|
||||
}
|
||||
}
|
||||
@@ -12,35 +12,40 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import BaseStyleManager from '../../../../../../../../common/src/main/ets/default/BaseStyleManager';
|
||||
import Log from '../../../../../../../../common/src/main/ets/default/Log';
|
||||
import AbilityManager from '../../../../../../../../common/src/main/ets/default/abilitymanager/abilitymanager';
|
||||
import IndexStyleConfiguration from './styleconfiguration';
|
||||
|
||||
const TAG = 'NotificationPanel-StyleManager';
|
||||
|
||||
export class StyleManager extends BaseStyleManager {
|
||||
static readonly ABILITY_PAGE_NAME_NOTIFICATIONPANEL = "NotificationPanel-Index";
|
||||
export default class StyleManager {
|
||||
static readonly STANDARD_DISPLAY_WIDTH = 1280;
|
||||
static readonly STANDARD_DISPLAY_HEIGHT = 800;
|
||||
static maxWidth: number = StyleManager.STANDARD_DISPLAY_WIDTH;
|
||||
|
||||
constructor() {
|
||||
super(StyleManager.ABILITY_PAGE_NAME_NOTIFICATIONPANEL);
|
||||
}
|
||||
|
||||
setStyle(): void {
|
||||
static setStyle(): void {
|
||||
Log.showDebug(TAG, 'setStyle');
|
||||
|
||||
this.setStandardWidth(BaseStyleManager.STANDARD_DISPLAY_WIDTH_NORMAL);
|
||||
let dis = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_NOTIFICATION_PANEL, 'dis');
|
||||
this.setMaxWidth(dis.width);
|
||||
StyleManager.maxWidth = dis.width;
|
||||
|
||||
// Index
|
||||
{
|
||||
let style = IndexStyleConfiguration.getIndexStyle();
|
||||
style.borderRadius = this.calcScaleSizePx(24);
|
||||
style.borderRadius = StyleManager.calcScaleSizePx(24);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
let styleManager = new StyleManager();
|
||||
static number2px(n: number): string {
|
||||
return n.toString() + 'px';
|
||||
}
|
||||
|
||||
export default styleManager;
|
||||
static calcScaleSize(n: number): number {
|
||||
return n * StyleManager.maxWidth / StyleManager.STANDARD_DISPLAY_WIDTH;
|
||||
}
|
||||
|
||||
static calcScaleSizePx(n: number): string {
|
||||
return StyleManager.number2px(StyleManager.calcScaleSize(n));
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from './StyleManager';
|
||||
import CommonStyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'StatusBar-StyleConfiguration';
|
||||
|
||||
@@ -23,6 +23,6 @@ export class IndexStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getIndexStyle(): IndexStyle {
|
||||
const key: string = TAG + '-Index';
|
||||
return StyleManager.getStyle(key, IndexStyle);
|
||||
return CommonStyleManager.getStyle(key, IndexStyle);
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import BaseStyleManager from '../../../../../../../../common/src/main/ets/default/BaseStyleManager';
|
||||
import Log from '../../../../../../../../common/src/main/ets/default/Log';
|
||||
import AbilityManager from '../../../../../../../../common/src/main/ets/default/abilitymanager/abilitymanager';
|
||||
import CommonStyleConfiguration from '../../../../../../../../common/src/main/ets/default/styleconfiguration';
|
||||
@@ -28,161 +27,165 @@ import RingModeStyleConfiguration from '../../../../../../../../features/ringmod
|
||||
|
||||
const TAG = './styleconfigurationer';
|
||||
|
||||
export class StyleManager extends BaseStyleManager {
|
||||
static readonly ABILITY_PAGE_NAME_STATUSBAR = "StatusBar-Index";
|
||||
export default class StyleManager {
|
||||
static readonly STANDARD_DISPLAY_WIDTH = 1280;
|
||||
static readonly STANDARD_DISPLAY_HEIGHT = 800;
|
||||
static maxWidth: number = StyleManager.STANDARD_DISPLAY_WIDTH;
|
||||
|
||||
constructor() {
|
||||
super(StyleManager.ABILITY_PAGE_NAME_STATUSBAR);
|
||||
}
|
||||
|
||||
setStyle(): void {
|
||||
static setStyle(): void {
|
||||
Log.showDebug(TAG, 'setStyle');
|
||||
|
||||
this.setStandardWidth(BaseStyleManager.STANDARD_DISPLAY_WIDTH_NORMAL);
|
||||
|
||||
let config = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'config');
|
||||
this.setMaxWidth(config.maxWidth);
|
||||
StyleManager.maxWidth = config.maxWidth;
|
||||
|
||||
this.setCommonStyle();
|
||||
this.setVerticalStatusBarItemLoadComponentStyle();
|
||||
this.setStatusBarNotificationIconStyle();
|
||||
this.setIconItemComponentStyle();
|
||||
this.setPluginIconItemComponentStyle();
|
||||
this.setClockComponentStyle();
|
||||
this.setBatteryComponentStyle();
|
||||
this.setBatteryPicStyle();
|
||||
this.setSignalComponentStyle();
|
||||
this.setStatusBarBluetoothComponentStyle();
|
||||
this.setStartsBarLocationComponentStyle();
|
||||
this.setStatusRingModeComponentStyle();
|
||||
this.setStartsBarWifiComponentStyle();
|
||||
this.setCapsuleComponentStyle();
|
||||
StyleManager.setCommonStyle();
|
||||
StyleManager.setVerticalStatusBarItemLoadComponentStyle();
|
||||
StyleManager.setStatusBarNotificationIconStyle();
|
||||
StyleManager.setIconItemComponentStyle();
|
||||
StyleManager.setPluginIconItemComponentStyle();
|
||||
StyleManager.setClockComponentStyle();
|
||||
StyleManager.setBatteryComponentStyle();
|
||||
StyleManager.setBatteryPicStyle();
|
||||
StyleManager.setSignalComponentStyle();
|
||||
StyleManager.setStatusBarBluetoothComponentStyle();
|
||||
StyleManager.setStartsBarLocationComponentStyle();
|
||||
StyleManager.setStatusRingModeComponentStyle();
|
||||
StyleManager.setStartsBarWifiComponentStyle();
|
||||
StyleManager.setCapsuleComponentStyle();
|
||||
}
|
||||
// Common
|
||||
private setCommonStyle(): void {
|
||||
private static setCommonStyle(): void {
|
||||
let style = CommonStyleConfiguration.getCommonStyle();
|
||||
style.statusBarFontSize = this.calcScaleSizePx(14);
|
||||
style.statusBarIconWidth = this.calcScaleSizePx(20);
|
||||
style.statusBarIconHeight = this.calcScaleSizePx(20);
|
||||
style.statusBarFontSize = StyleManager.calcScaleSizePx(14);
|
||||
style.statusBarIconWidth = StyleManager.calcScaleSizePx(20);
|
||||
style.statusBarIconHeight = StyleManager.calcScaleSizePx(20);
|
||||
style.statusBarMarginLeftRight = $r("app.float.status_bar_margin_left_right");
|
||||
}
|
||||
|
||||
// StatusBar-VerticalStatusBarItemLoadComponent
|
||||
private setVerticalStatusBarItemLoadComponentStyle(): void {
|
||||
private static setVerticalStatusBarItemLoadComponentStyle(): void {
|
||||
let style = StatusBarStyleConfiguration.getVerticalStatusBarItemLoadComponentStyle();
|
||||
style.statusBarVerticalComponentHeight = this.calcScaleSize(64);
|
||||
style.statusBarVerticalComponentHeight = StyleManager.calcScaleSize(64);
|
||||
}
|
||||
|
||||
// StatusBar-NotificationIcon
|
||||
private setStatusBarNotificationIconStyle(): void {
|
||||
private static setStatusBarNotificationIconStyle(): void {
|
||||
let style = StatusBarStyleConfiguration.getStatusBarNotificationIconStyle();
|
||||
style.iconWidth = this.calcScaleSizePx(16);
|
||||
style.iconHeight = this.calcScaleSizePx(16);
|
||||
style.iconSpace = this.calcScaleSizePx(6);
|
||||
style.iconWidth = StyleManager.calcScaleSizePx(16);
|
||||
style.iconHeight = StyleManager.calcScaleSizePx(16);
|
||||
style.iconSpace = StyleManager.calcScaleSizePx(6);
|
||||
}
|
||||
|
||||
// StatusBar-IconComponent
|
||||
private setIconItemComponentStyle(): void {
|
||||
private static setIconItemComponentStyle(): void {
|
||||
let style = StatusBarStyleConfiguration.getIconItemComponentStyle();
|
||||
style.stackHeight = this.calcScaleSizePx(8 * 2 + 18);
|
||||
style.stackPadding = this.calcScaleSizePx(8);
|
||||
style.stackBorderRadius = this.calcScaleSizePx(8);
|
||||
style.stackHeight = StyleManager.calcScaleSizePx(8 * 2 + 18);
|
||||
style.stackPadding = StyleManager.calcScaleSizePx(8);
|
||||
style.stackBorderRadius = StyleManager.calcScaleSizePx(8);
|
||||
style.stackBgColorSelected = '#33000000';
|
||||
style.stackBgColorUnSelected = '#00000000';
|
||||
style.componentSpace = this.calcScaleSizePx(8);
|
||||
style.iconWidth = this.calcScaleSizePx(18);
|
||||
style.iconHeight = this.calcScaleSizePx(18);
|
||||
style.marginLeft = this.calcScaleSizePx(4);
|
||||
style.marginRight = this.calcScaleSizePx(4);
|
||||
style.componentSpace = StyleManager.calcScaleSizePx(8);
|
||||
style.iconWidth = StyleManager.calcScaleSizePx(18);
|
||||
style.iconHeight = StyleManager.calcScaleSizePx(18);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(4);
|
||||
style.marginRight = StyleManager.calcScaleSizePx(4);
|
||||
}
|
||||
|
||||
// StatusBar-PluginIconItemComponent
|
||||
private setPluginIconItemComponentStyle(): void {
|
||||
private static setPluginIconItemComponentStyle(): void {
|
||||
let style = StatusBarStyleConfiguration.getPluginIconItemComponentStyle();
|
||||
style.iconWidth = this.calcScaleSize(32);
|
||||
style.iconWidth = StyleManager.calcScaleSize(32);
|
||||
}
|
||||
|
||||
// Clock
|
||||
private setClockComponentStyle(): void {
|
||||
private static setClockComponentStyle(): void {
|
||||
let style = ClockStyleConfiguration.getClockComponentStyle();
|
||||
style.statusBarClockMaxWidth = this.calcScaleSizePx(37);
|
||||
style.statusBarClockMaxWidth = StyleManager.calcScaleSizePx(37);
|
||||
}
|
||||
|
||||
// Battery-Icon
|
||||
private setBatteryComponentStyle(): void {
|
||||
private static setBatteryComponentStyle(): void {
|
||||
let style = BatteryStyleConfiguration.getBatteryComponentStyle();
|
||||
style.componentGap = this.calcScaleSizePx(6);
|
||||
style.componentGap = StyleManager.calcScaleSizePx(6);
|
||||
}
|
||||
|
||||
// Battery-Pic
|
||||
private setBatteryPicStyle(): void {
|
||||
private static setBatteryPicStyle(): void {
|
||||
let style = BatteryStyleConfiguration.getBatteryPicStyle();
|
||||
style.picGap = this.calcScaleSizePx(1);
|
||||
style.picBodyWidth = this.calcScaleSizePx(18.75);
|
||||
style.picBodyHeight = this.calcScaleSizePx(10.83);
|
||||
style.picBodyPadding = this.calcScaleSizePx(1);
|
||||
style.picBodyBorderWidth = this.calcScaleSizePx(1);
|
||||
style.picBorderRadius = this.calcScaleSizePx(2);
|
||||
style.picHeadBorderRadius = this.calcScaleSizePx(1);
|
||||
style.picGap = StyleManager.calcScaleSizePx(1);
|
||||
style.picBodyWidth = StyleManager.calcScaleSizePx(18.75);
|
||||
style.picBodyHeight = StyleManager.calcScaleSizePx(10.83);
|
||||
style.picBodyPadding = StyleManager.calcScaleSizePx(1);
|
||||
style.picBodyBorderWidth = StyleManager.calcScaleSizePx(1);
|
||||
style.picBorderRadius = StyleManager.calcScaleSizePx(2);
|
||||
style.picHeadBorderRadius = StyleManager.calcScaleSizePx(1);
|
||||
style.picChargingColor = '#00ff21';
|
||||
style.picLevelLowColor = '#ff0000';
|
||||
style.picHeadWidth = this.calcScaleSizePx(1.5);
|
||||
style.picHeadHeight = this.calcScaleSizePx(5);
|
||||
style.picHeadWidth = StyleManager.calcScaleSizePx(1.5);
|
||||
style.picHeadHeight = StyleManager.calcScaleSizePx(5);
|
||||
}
|
||||
|
||||
// Signal-Icon
|
||||
private setSignalComponentStyle(): void {
|
||||
private static setSignalComponentStyle(): void {
|
||||
let style = SignalStyleConfiguration.getSignalComponentStyle();
|
||||
style.cellularImageWidth = this.calcScaleSizePx(25);
|
||||
style.cellularImageHeight = this.calcScaleSizePx(20);
|
||||
style.statusBarSignalTypeFontSize = this.calcScaleSizePx(7);
|
||||
style.statusBarSignalUnknownFontSize = this.calcScaleSizePx(12);
|
||||
style.signalTextMaxWeight = this.calcScaleSizePx(100);
|
||||
style.netSignalTextMaxWidth = this.calcScaleSizePx(18);
|
||||
style.cellularImageWidth = StyleManager.calcScaleSizePx(25);
|
||||
style.cellularImageHeight = StyleManager.calcScaleSizePx(20);
|
||||
style.statusBarSignalTypeFontSize = StyleManager.calcScaleSizePx(7);
|
||||
style.statusBarSignalUnknownFontSize = StyleManager.calcScaleSizePx(12);
|
||||
style.signalTextMaxWeight = StyleManager.calcScaleSizePx(100);
|
||||
style.netSignalTextMaxWidth = StyleManager.calcScaleSizePx(18);
|
||||
}
|
||||
|
||||
// Bluetooth -Icon
|
||||
private setStatusBarBluetoothComponentStyle(): void {
|
||||
private static setStatusBarBluetoothComponentStyle(): void {
|
||||
let style = BluetoothStyleConfiguration.getStatusBarBluetoothComponentStyle();
|
||||
style.staticBarBluetoothWidth = this.calcScaleSizePx(18);
|
||||
style.staticBarBluetoothHeight = this.calcScaleSizePx(20);
|
||||
style.staticBarBluetoothWidth = StyleManager.calcScaleSizePx(18);
|
||||
style.staticBarBluetoothHeight = StyleManager.calcScaleSizePx(20);
|
||||
}
|
||||
|
||||
// Location-Icon
|
||||
private setStartsBarLocationComponentStyle(): void {
|
||||
private static setStartsBarLocationComponentStyle(): void {
|
||||
let style = LocationStyleConfiguration.getStartsBarLocationComponentStyle();
|
||||
style.statusBarLocationWidth = this.calcScaleSizePx(18);
|
||||
style.statusBarLocationHeight = this.calcScaleSizePx(20);
|
||||
style.statusBarLocationWidth = StyleManager.calcScaleSizePx(18);
|
||||
style.statusBarLocationHeight = StyleManager.calcScaleSizePx(20);
|
||||
}
|
||||
|
||||
// RingMode-Icon
|
||||
private setStatusRingModeComponentStyle(): void {
|
||||
private static setStatusRingModeComponentStyle(): void {
|
||||
let style = RingModeStyleConfiguration.getStatusRingModeComponentStyle();
|
||||
style.statusBarRingModeWidth = this.calcScaleSizePx(20);
|
||||
style.statusBarRingModeHeight = this.calcScaleSizePx(20);
|
||||
style.statusBarRingModeWidth = StyleManager.calcScaleSizePx(20);
|
||||
style.statusBarRingModeHeight = StyleManager.calcScaleSizePx(20);
|
||||
}
|
||||
|
||||
// Wifi-Icon
|
||||
private setStartsBarWifiComponentStyle(): void {
|
||||
private static setStartsBarWifiComponentStyle(): void {
|
||||
let style = WifiStyleConfiguration.getStartsBarWifiComponentStyle();
|
||||
style.statusBarWifiWidth = this.calcScaleSizePx(20);
|
||||
style.statusBarWifiHeight = this.calcScaleSizePx(20);
|
||||
style.statusBarWifiWidth = StyleManager.calcScaleSizePx(20);
|
||||
style.statusBarWifiHeight = StyleManager.calcScaleSizePx(20);
|
||||
}
|
||||
|
||||
// Capsule-Icon
|
||||
private setCapsuleComponentStyle(): void {
|
||||
private static setCapsuleComponentStyle(): void {
|
||||
let style = CapsuleStyleConfiguration.getCapsuleComponentStyle();
|
||||
style.greenCapsulePhoneWidth = this.calcScaleSizePx(15);
|
||||
style.greenCapsulePhoneHeight = this.calcScaleSizePx(15);
|
||||
style.greenCapsuleHeight = this.calcScaleSizePx(30);
|
||||
style.greenCapsulePhoneWidth = StyleManager.calcScaleSizePx(15);
|
||||
style.greenCapsulePhoneHeight = StyleManager.calcScaleSizePx(15);
|
||||
style.greenCapsuleHeight = StyleManager.calcScaleSizePx(30);
|
||||
style.greenCapsuleTextColor = '#CCFFFFFF';
|
||||
style.greenCapsuleTextMarginLeftRight = this.calcScaleSizePx(10);
|
||||
style.greenCapsuleRadius = this.calcScaleSizePx(24);
|
||||
style.greenCapsuleTextMarginLeftRight = StyleManager.calcScaleSizePx(10);
|
||||
style.greenCapsuleRadius = StyleManager.calcScaleSizePx(24);
|
||||
style.greenCapsuleBackgroundColor = '#64BB5C';
|
||||
style.maxLines = 1;
|
||||
}
|
||||
}
|
||||
|
||||
let styleManager = new StyleManager();
|
||||
static number2px(n: number): string {
|
||||
return n.toString() + 'px';
|
||||
}
|
||||
|
||||
export default styleManager;
|
||||
static calcScaleSize(n: number): number {
|
||||
return n * StyleManager.maxWidth / StyleManager.STANDARD_DISPLAY_WIDTH;
|
||||
}
|
||||
|
||||
static calcScaleSizePx(n: number): string {
|
||||
return StyleManager.number2px(StyleManager.calcScaleSize(n));
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
import Log from '../../../../../../../common/src/main/ets/default/Log'
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager'
|
||||
import HeightConfigUtils from '../../../../../../../common/src/main/ets/default/heightcofigUtils/HeightConfigUtils'
|
||||
import StatusBarComponent from '../../../../../../../features/statusbarcomponent/src/main/ets/com/ohos/pages/StatusBarComponent'
|
||||
import StyleManager from './common/StyleManager'
|
||||
@@ -52,6 +53,7 @@ struct Index {
|
||||
StatusBarVM.updateStatusBarData(statusBarData);
|
||||
|
||||
setAppBgColor('#00000000');
|
||||
CommonStyleManager.setAbilityPageName(TAG);
|
||||
StyleManager.setStyle();
|
||||
|
||||
mHeightConfigUtils = new HeightConfigUtils();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from './StyleManager';
|
||||
import CommonStyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
import Constants from './constants';
|
||||
import deviceInfo from '@ohos.deviceInfo';
|
||||
|
||||
@@ -54,21 +54,21 @@ export class DateItemStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getControlStyle(): ControlStyle {
|
||||
const key: string = TAG + '-Control';
|
||||
return StyleManager.getStyle(key, ControlStyle);
|
||||
return CommonStyleManager.getStyle(key, ControlStyle);
|
||||
}
|
||||
|
||||
static getNotificationStyle(): NotificationStyle {
|
||||
const key: string = TAG + '-Notification';
|
||||
return StyleManager.getStyle(key, NotificationStyle);
|
||||
return CommonStyleManager.getStyle(key, NotificationStyle);
|
||||
}
|
||||
|
||||
static getQuicklySettingStyle(): QuicklySettingStyle {
|
||||
const key: string = TAG + '-QuicklySetting';
|
||||
return StyleManager.getStyle(key, QuicklySettingStyle);
|
||||
return CommonStyleManager.getStyle(key, QuicklySettingStyle);
|
||||
}
|
||||
|
||||
static getDateItemStyle(): DateItemStyle {
|
||||
const key: string = TAG + '-DateItem';
|
||||
return StyleManager.getStyle(key, DateItemStyle);
|
||||
return CommonStyleManager.getStyle(key, DateItemStyle);
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import BaseStyleManager from '../../../../../../../../common/src/main/ets/default/BaseStyleManager';
|
||||
import Log from '../../../../../../../../common/src/main/ets/default/Log';
|
||||
import AbilityManager from '../../../../../../../../common/src/main/ets/default/abilitymanager/abilitymanager';
|
||||
import CommonTemplateStyleConfiguration from '../../../../../../../../common/src/main/ets/template/common/styleconfiguration';
|
||||
@@ -22,122 +21,118 @@ import RingModeStyleConfiguration from '../../../../../../../../features/ringmod
|
||||
|
||||
const TAG = 'DropdownPanel-StyleManager';
|
||||
|
||||
export class StyleManager extends BaseStyleManager {
|
||||
static readonly ABILITY_PAGE_NAME_DROPDOWNPANEL = "DropdownPanel-Index";
|
||||
export default class StyleManager {
|
||||
static readonly STANDARD_DISPLAY_WIDTH: number = 720;
|
||||
static readonly STANDARD_DISPLAY_HEIGHT: number = 1280;
|
||||
static maxWidth: number = StyleManager.STANDARD_DISPLAY_WIDTH;
|
||||
|
||||
constructor() {
|
||||
super(StyleManager.ABILITY_PAGE_NAME_DROPDOWNPANEL);
|
||||
}
|
||||
|
||||
setStyle(): void {
|
||||
static setStyle(): void {
|
||||
Log.showDebug(TAG, 'setStyle');
|
||||
|
||||
this.setStandardWidth(BaseStyleManager.STANDARD_DISPLAY_WIDTH_SMALL);
|
||||
|
||||
let rect = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_DROPDOWN_PANEL, 'rect');
|
||||
this.setMaxWidth(rect.width);
|
||||
StyleManager.maxWidth = rect.width;
|
||||
|
||||
// ControlCenter
|
||||
this.setControlCenterComponentStyle();
|
||||
StyleManager.setControlCenterComponentStyle();
|
||||
// ControlCenter-Title
|
||||
this.setControlCenterUpTitleStyle();
|
||||
StyleManager.setControlCenterUpTitleStyle();
|
||||
// ControlCenter-ComplexToggleLayout
|
||||
this.setControlCenterComplexToggleLayoutStyle();
|
||||
StyleManager.setControlCenterComplexToggleLayoutStyle();
|
||||
// ControlCenter-SimpleToggleLayout
|
||||
this.setControlCenterSimpleToggleLayoutStyle();
|
||||
StyleManager.setControlCenterSimpleToggleLayoutStyle();
|
||||
// CommonTemplate-iconTitleBase
|
||||
this.setIconTitleBaseStyle();
|
||||
StyleManager.setIconTitleBaseStyle();
|
||||
// CommonTemplate-iconComponent
|
||||
this.setIconComponentStyle();
|
||||
StyleManager.setIconComponentStyle();
|
||||
// CommonTemplate-simpleToggleBase
|
||||
this.setSimpleToggleBaseStyle();
|
||||
StyleManager.setSimpleToggleBaseStyle();
|
||||
// Brightness
|
||||
this.setBrightnessComponentStyle();
|
||||
StyleManager.setBrightnessComponentStyle();
|
||||
// RingMode
|
||||
this.setControlCenterRingModeComponentStyle();
|
||||
StyleManager.setControlCenterRingModeComponentStyle();
|
||||
// SimpleToggleLayoutEdit
|
||||
this.setSimpleToggleLayoutEditComponentStyle();
|
||||
StyleManager.setSimpleToggleLayoutEditComponentStyle();
|
||||
// SimpleToggleLayoutEdit-title
|
||||
this.setSimpleToggleLayoutEditUpTitleStyle();
|
||||
StyleManager.setSimpleToggleLayoutEditUpTitleStyle();
|
||||
// SimpleToggleLayoutEdit-msg
|
||||
this.setSimpleToggleLayoutEditOptMsgStyle();
|
||||
StyleManager.setSimpleToggleLayoutEditOptMsgStyle();
|
||||
// SimpleToggleLayoutEdit-grid
|
||||
this.setSimpleToggleLayoutEditGridStyle();
|
||||
StyleManager.setSimpleToggleLayoutEditGridStyle();
|
||||
// EditDialog
|
||||
this.setControlEditDialogStyle();
|
||||
StyleManager.setControlEditDialogStyle();
|
||||
}
|
||||
// ControlCenter
|
||||
private setControlCenterComponentStyle(): void{
|
||||
private static setControlCenterComponentStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getControlCenterComponentStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(48);
|
||||
style.marginRight = this.calcScaleSizePx(48);
|
||||
style.marginTop = this.calcScaleSizePx(36);
|
||||
style.upTitleHeight = this.calcScaleSizePx(127);
|
||||
style.titleMarginBottom = this.calcScaleSizePx(0);
|
||||
style.toggleAreaGap = this.calcScaleSizePx(24);
|
||||
style.simpleToggleLayoutMarginTop = this.calcScaleSizePx(48);
|
||||
style.simpleToggleLayoutMarginBottom = this.calcScaleSizePx(20);
|
||||
style.brightnessMarginBottom = this.calcScaleSizePx(44);
|
||||
style.componentBorderRadius = this.calcScaleSizePx(48);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(48);
|
||||
style.marginRight = StyleManager.calcScaleSizePx(48);
|
||||
style.marginTop = StyleManager.calcScaleSizePx(36);
|
||||
style.upTitleHeight = StyleManager.calcScaleSizePx(127);
|
||||
style.titleMarginBottom = StyleManager.calcScaleSizePx(0);
|
||||
style.toggleAreaGap = StyleManager.calcScaleSizePx(24);
|
||||
style.simpleToggleLayoutMarginTop = StyleManager.calcScaleSizePx(48);
|
||||
style.simpleToggleLayoutMarginBottom = StyleManager.calcScaleSizePx(20);
|
||||
style.brightnessMarginBottom = StyleManager.calcScaleSizePx(44);
|
||||
style.componentBorderRadius = StyleManager.calcScaleSizePx(48);
|
||||
style.componentBackgroundColor = '#99FFFFFF';
|
||||
}
|
||||
// ControlCenter-Title
|
||||
private setControlCenterUpTitleStyle(): void{
|
||||
private static setControlCenterUpTitleStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getControlCenterUpTitleStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(72);
|
||||
style.marginRight = this.calcScaleSizePx(72);
|
||||
style.fontSize = this.calcScaleSizePx(40);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(72);
|
||||
style.marginRight = StyleManager.calcScaleSizePx(72);
|
||||
style.fontSize = StyleManager.calcScaleSizePx(40);
|
||||
style.fontColor = '#FFFFFFFF';
|
||||
style.imageWidth = this.calcScaleSizePx(48);
|
||||
style.imageHeight = this.calcScaleSizePx(48);
|
||||
style.imageHoverWidth = this.calcScaleSizePx(64);
|
||||
style.imageHoverHeight = this.calcScaleSizePx(64);
|
||||
style.imageHoverRadius = this.calcScaleSizePx(16);
|
||||
style.imageWidth = StyleManager.calcScaleSizePx(48);
|
||||
style.imageHeight = StyleManager.calcScaleSizePx(48);
|
||||
style.imageHoverWidth = StyleManager.calcScaleSizePx(64);
|
||||
style.imageHoverHeight = StyleManager.calcScaleSizePx(64);
|
||||
style.imageHoverRadius = StyleManager.calcScaleSizePx(16);
|
||||
style.imageHoverColor = 'rgba(0, 0, 0, 0.05)';
|
||||
style.imageTransparentColor = 'rgba(255, 255, 255, 0)';
|
||||
style.upTitleSpace = this.calcScaleSizePx(36);
|
||||
style.upTitleSpace = StyleManager.calcScaleSizePx(36);
|
||||
style.titleImageColor = '#FFFFFFFF';
|
||||
}
|
||||
// ControlCenter-ComplexToggleLayout
|
||||
private setControlCenterComplexToggleLayoutStyle(): void{
|
||||
private static setControlCenterComplexToggleLayoutStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getControlCenterComplexToggleLayoutStyle();
|
||||
style.columnGap = this.calcScaleSizePx(24);
|
||||
style.rowGap = this.calcScaleSize(24);
|
||||
style.rowHeight = this.calcScaleSize(132);
|
||||
style.columnGap = StyleManager.calcScaleSizePx(24);
|
||||
style.rowGap = StyleManager.calcScaleSize(24);
|
||||
style.rowHeight = StyleManager.calcScaleSize(132);
|
||||
}
|
||||
// ControlCenter-SimpleToggleLayout
|
||||
private setControlCenterSimpleToggleLayoutStyle(): void{
|
||||
private static setControlCenterSimpleToggleLayoutStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getControlCenterSimpleToggleLayoutStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(22);
|
||||
style.marginRight = this.calcScaleSizePx(22);
|
||||
style.columnGap = this.calcScaleSizePx(0);
|
||||
style.rowGap = this.calcScaleSize(0);
|
||||
style.rowHeight = this.calcScaleSize(162);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(22);
|
||||
style.marginRight = StyleManager.calcScaleSizePx(22);
|
||||
style.columnGap = StyleManager.calcScaleSizePx(0);
|
||||
style.rowGap = StyleManager.calcScaleSize(0);
|
||||
style.rowHeight = StyleManager.calcScaleSize(162);
|
||||
}
|
||||
// CommonTemplate-iconTitleBase
|
||||
private setIconTitleBaseStyle(): void {
|
||||
private static setIconTitleBaseStyle(): void {
|
||||
let style = CommonTemplateStyleConfiguration.getIconTitleBaseStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(24);
|
||||
style.marginRight = this.calcScaleSizePx(16);
|
||||
style.componentGap = this.calcScaleSizePx(8);
|
||||
style.titleSize = this.calcScaleSizePx(24);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(24);
|
||||
style.marginRight = StyleManager.calcScaleSizePx(16);
|
||||
style.componentGap = StyleManager.calcScaleSizePx(8);
|
||||
style.titleSize = StyleManager.calcScaleSizePx(24);
|
||||
style.titleColor = $r('sys.color.ohos_id_color_text_primary');
|
||||
style.borderRadius = this.calcScaleSizePx(48);
|
||||
style.borderRadius = StyleManager.calcScaleSizePx(48);
|
||||
style.backgroundColor = '#99FFFFFF';
|
||||
style.textMargin = this.calcScaleSizePx(8);
|
||||
style.textHoverHeight = this.calcScaleSizePx(52);
|
||||
style.textHoverWidth = this.calcScaleSizePx(136);
|
||||
style.textHoverRadius = this.calcScaleSizePx(8);
|
||||
style.textMargin = StyleManager.calcScaleSizePx(8);
|
||||
style.textHoverHeight = StyleManager.calcScaleSizePx(52);
|
||||
style.textHoverWidth = StyleManager.calcScaleSizePx(136);
|
||||
style.textHoverRadius = StyleManager.calcScaleSizePx(8);
|
||||
style.hoverColor = 'rgba(0, 0, 0, 0.05)';
|
||||
style.transparentColor = 'rgba(255, 255, 255, 0)';
|
||||
}
|
||||
// CommonTemplate-iconComponent
|
||||
private setIconComponentStyle(): void {
|
||||
private static setIconComponentStyle(): void {
|
||||
let style = CommonTemplateStyleConfiguration.getIconComponentStyle();
|
||||
style.circleWidth = this.calcScaleSizePx(96);
|
||||
style.circleHeight = this.calcScaleSizePx(96);
|
||||
style.iconWidth = this.calcScaleSizePx(48);
|
||||
style.iconHeight = this.calcScaleSizePx(48);
|
||||
style.circleWidth = StyleManager.calcScaleSizePx(96);
|
||||
style.circleHeight = StyleManager.calcScaleSizePx(96);
|
||||
style.iconWidth = StyleManager.calcScaleSizePx(48);
|
||||
style.iconHeight = StyleManager.calcScaleSizePx(48);
|
||||
style.iconOffBG = '#1A182431';
|
||||
style.iconOnBG = '#FF007DFF';
|
||||
style.iconOnColor = '#FFFFFFFF';
|
||||
@@ -146,128 +141,136 @@ export class StyleManager extends BaseStyleManager {
|
||||
style.transparentColor = 'rgba(255, 255, 255, 0)';
|
||||
}
|
||||
// CommonTemplate-simpleToggleBase
|
||||
private setSimpleToggleBaseStyle(): void{
|
||||
private static setSimpleToggleBaseStyle(): void{
|
||||
let style = CommonTemplateStyleConfiguration.getSimpleToggleBaseStyle();
|
||||
style.circleWidth = this.calcScaleSizePx(96);
|
||||
style.circleHeight = this.calcScaleSizePx(96);
|
||||
style.iconWidth = this.calcScaleSizePx(48);
|
||||
style.iconHeight = this.calcScaleSizePx(48);
|
||||
style.dragCircleWidth = this.calcScaleSizePx(120);
|
||||
style.dragCircleHeight = this.calcScaleSizePx(120);
|
||||
style.dragIconWidth = this.calcScaleSizePx(72);
|
||||
style.dragIconHeight = this.calcScaleSizePx(72);
|
||||
style.circleWidth = StyleManager.calcScaleSizePx(96);
|
||||
style.circleHeight = StyleManager.calcScaleSizePx(96);
|
||||
style.iconWidth = StyleManager.calcScaleSizePx(48);
|
||||
style.iconHeight = StyleManager.calcScaleSizePx(48);
|
||||
style.dragCircleWidth = StyleManager.calcScaleSizePx(120);
|
||||
style.dragCircleHeight = StyleManager.calcScaleSizePx(120);
|
||||
style.dragIconWidth = StyleManager.calcScaleSizePx(72);
|
||||
style.dragIconHeight = StyleManager.calcScaleSizePx(72);
|
||||
style.iconOffBG = '#1A182431';
|
||||
style.iconOnBG = '#FF007DFF';
|
||||
style.iconOnColor = '#FFFFFFFF';
|
||||
style.iconOffColor = $r('sys.color.ohos_id_color_secondary');
|
||||
style.componentGap = this.calcScaleSizePx(10);
|
||||
style.titleSize = this.calcScaleSizePx(24);
|
||||
style.componentGap = StyleManager.calcScaleSizePx(10);
|
||||
style.titleSize = StyleManager.calcScaleSizePx(24);
|
||||
style.titleColor = $r('sys.color.ohos_id_color_text_primary');
|
||||
style.textHoverWidth = this.calcScaleSizePx(136);
|
||||
style.textHoverHeight = this.calcScaleSizePx(36);
|
||||
style.textHoverRadius = this.calcScaleSizePx(8);
|
||||
style.textHoverWidth = StyleManager.calcScaleSizePx(136);
|
||||
style.textHoverHeight = StyleManager.calcScaleSizePx(36);
|
||||
style.textHoverRadius = StyleManager.calcScaleSizePx(8);
|
||||
style.hoverColor = 'rgba(0, 0, 0, 0.05)';
|
||||
style.transparentColor = 'rgba(255, 255, 255, 0)';
|
||||
}
|
||||
// Brightness
|
||||
private setBrightnessComponentStyle(): void{
|
||||
private static setBrightnessComponentStyle(): void{
|
||||
let style = BrightnessStyleConfiguration.getBrightnessComponentStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(26);
|
||||
style.marginRight = this.calcScaleSizePx(26);
|
||||
style.componentGap = this.calcScaleSizePx(26);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(26);
|
||||
style.marginRight = StyleManager.calcScaleSizePx(26);
|
||||
style.componentGap = StyleManager.calcScaleSizePx(26);
|
||||
style.brightnessIconColor = $r('sys.color.ohos_id_color_secondary');
|
||||
style.brightnessReduceWidth = this.calcScaleSizePx(44);
|
||||
style.brightnessReduceHeight = this.calcScaleSizePx(44);
|
||||
style.brightnessPlusWidth = this.calcScaleSizePx(44);
|
||||
style.brightnessPlusHeight = this.calcScaleSizePx(44);
|
||||
style.brightnessHeight = this.calcScaleSizePx(44);
|
||||
style.sliderHeight = this.calcScaleSizePx(40);
|
||||
style.brightnessReduceWidth = StyleManager.calcScaleSizePx(44);
|
||||
style.brightnessReduceHeight = StyleManager.calcScaleSizePx(44);
|
||||
style.brightnessPlusWidth = StyleManager.calcScaleSizePx(44);
|
||||
style.brightnessPlusHeight = StyleManager.calcScaleSizePx(44);
|
||||
style.brightnessHeight = StyleManager.calcScaleSizePx(44);
|
||||
style.sliderHeight = StyleManager.calcScaleSizePx(40);
|
||||
style.sliderBlockColor = '#FFFFFFFF';
|
||||
style.sliderTrackColor = '#1A182431';
|
||||
style.sliderSelectedColor = '#FF007DFF';
|
||||
}
|
||||
// RingMode
|
||||
private setControlCenterRingModeComponentStyle(): void{
|
||||
private static setControlCenterRingModeComponentStyle(): void{
|
||||
let style = RingModeStyleConfiguration.getControlCenterRingModeComponentStyle();
|
||||
style.onBgColor = '#FFFF9800';
|
||||
}
|
||||
// SimpleToggleLayoutEdit
|
||||
private setSimpleToggleLayoutEditComponentStyle(): void{
|
||||
private static setSimpleToggleLayoutEditComponentStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getSimpleToggleLayoutEditComponentStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(48);
|
||||
style.marginRight = this.calcScaleSizePx(48);
|
||||
style.marginTop = this.calcScaleSizePx(33);
|
||||
style.titleHeight = this.calcScaleSizePx(127);
|
||||
style.titleMarginBottom = this.calcScaleSizePx(0);
|
||||
style.upGridMarginTop = this.calcScaleSizePx(48);
|
||||
style.upGridMarginBottom = this.calcScaleSizePx(24);
|
||||
style.gridMarginLeft = this.calcScaleSizePx(18.24);
|
||||
style.gridMarginRight = this.calcScaleSizePx(18.24);
|
||||
style.msgMarginTop = this.calcScaleSizePx(0);
|
||||
style.msgMarginBottom = this.calcScaleSizePx(0);
|
||||
style.btnMarginTop = this.calcScaleSizePx(24);
|
||||
style.btnMarginBottom = this.calcScaleSizePx(32);
|
||||
style.borderRadius = this.calcScaleSizePx(48);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(48);
|
||||
style.marginRight = StyleManager.calcScaleSizePx(48);
|
||||
style.marginTop = StyleManager.calcScaleSizePx(33);
|
||||
style.titleHeight = StyleManager.calcScaleSizePx(127);
|
||||
style.titleMarginBottom = StyleManager.calcScaleSizePx(0);
|
||||
style.upGridMarginTop = StyleManager.calcScaleSizePx(48);
|
||||
style.upGridMarginBottom = StyleManager.calcScaleSizePx(24);
|
||||
style.gridMarginLeft = StyleManager.calcScaleSizePx(18.24);
|
||||
style.gridMarginRight = StyleManager.calcScaleSizePx(18.24);
|
||||
style.msgMarginTop = StyleManager.calcScaleSizePx(0);
|
||||
style.msgMarginBottom = StyleManager.calcScaleSizePx(0);
|
||||
style.btnMarginTop = StyleManager.calcScaleSizePx(24);
|
||||
style.btnMarginBottom = StyleManager.calcScaleSizePx(32);
|
||||
style.borderRadius = StyleManager.calcScaleSizePx(48);
|
||||
style.upAreaBgColor = '#99FFFFFF';
|
||||
style.downAreaBgColor = '#4DFFFFFF';
|
||||
style.editBtnFontColor = '#FF007DFF';
|
||||
style.editBtnFontSize = this.calcScaleSizePx(32);
|
||||
style.editBtnFontSize = StyleManager.calcScaleSizePx(32);
|
||||
style.editBtnBgColor = '#0D000000';
|
||||
style.editBtnMarginLeft = this.calcScaleSizePx(32);
|
||||
style.editBtnMarginRight = this.calcScaleSizePx(32);
|
||||
style.editBtnHeight = this.calcScaleSizePx(80);
|
||||
style.editBtnSpace = this.calcScaleSizePx(32);
|
||||
style.editBtnMarginLeft = StyleManager.calcScaleSizePx(32);
|
||||
style.editBtnMarginRight = StyleManager.calcScaleSizePx(32);
|
||||
style.editBtnHeight = StyleManager.calcScaleSizePx(80);
|
||||
style.editBtnSpace = StyleManager.calcScaleSizePx(32);
|
||||
}
|
||||
// SimpleToggleLayoutEdit-title
|
||||
private setSimpleToggleLayoutEditUpTitleStyle(): void{
|
||||
private static setSimpleToggleLayoutEditUpTitleStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getSimpleToggleLayoutEditUpTitleStyle();
|
||||
style.marginLeft = this.calcScaleSizePx(72);
|
||||
style.imageWidth = this.calcScaleSizePx(40);
|
||||
style.imageHeight = this.calcScaleSizePx(40);
|
||||
style.marginLeft = StyleManager.calcScaleSizePx(72);
|
||||
style.imageWidth = StyleManager.calcScaleSizePx(40);
|
||||
style.imageHeight = StyleManager.calcScaleSizePx(40);
|
||||
style.fontColor = '#FFFFFFFF';
|
||||
style.editTitleSpace = this.calcScaleSizePx(36);
|
||||
style.titleFontSize = this.calcScaleSizePx(40);
|
||||
style.editTitleSpace = StyleManager.calcScaleSizePx(36);
|
||||
style.titleFontSize = StyleManager.calcScaleSizePx(40);
|
||||
}
|
||||
// SimpleToggleLayoutEdit-msg
|
||||
private setSimpleToggleLayoutEditOptMsgStyle(): void{
|
||||
private static setSimpleToggleLayoutEditOptMsgStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getSimpleToggleLayoutEditOptMsgStyle();
|
||||
style.fontSize = this.calcScaleSizePx(24);
|
||||
style.fontSize = StyleManager.calcScaleSizePx(24);
|
||||
style.fontColor = $r('sys.color.ohos_id_color_text_secondary');
|
||||
style.height = this.calcScaleSizePx(98);
|
||||
style.marginLeftRight = this.calcScaleSizePx(44);
|
||||
style.height = StyleManager.calcScaleSizePx(98);
|
||||
style.marginLeftRight = StyleManager.calcScaleSizePx(44);
|
||||
}
|
||||
// SimpleToggleLayoutEdit-grid
|
||||
private setSimpleToggleLayoutEditGridStyle(): void{
|
||||
private static setSimpleToggleLayoutEditGridStyle(): void{
|
||||
let style = ControlCenterStyleConfiguration.getSimpleToggleLayoutEditGridStyle();
|
||||
style.columnGap = this.calcScaleSizePx(0);
|
||||
style.rowGap = this.calcScaleSize(0);
|
||||
style.rowHeight = this.calcScaleSize(162);
|
||||
style.dragBgSize = this.calcScaleSizePx(120);
|
||||
style.columnGap = StyleManager.calcScaleSizePx(0);
|
||||
style.rowGap = StyleManager.calcScaleSize(0);
|
||||
style.rowHeight = StyleManager.calcScaleSize(162);
|
||||
style.dragBgSize = StyleManager.calcScaleSizePx(120);
|
||||
}
|
||||
// EditDialog
|
||||
private setControlEditDialogStyle(): void {
|
||||
private static setControlEditDialogStyle(): void {
|
||||
let style = ControlCenterStyleConfiguration.getControlEditDialogStyle();
|
||||
style.editDialogHeight = this.calcScaleSizePx(217);
|
||||
style.editDialogWidth = this.calcScaleSizePx(670);
|
||||
style.editDialogFontSize = this.calcScaleSizePx(30);
|
||||
style.editDialogBtnMarginLF = this.calcScaleSizePx(24);
|
||||
style.editDialogFontHeight = this.calcScaleSizePx(36);
|
||||
style.editDialogBtnMarginTop = this.calcScaleSizePx(36);
|
||||
style.editDialogButtonSize = this.calcScaleSizePx(30);
|
||||
style.editDialogDividerHeight = this.calcScaleSizePx(36);
|
||||
style.editDialogButtonHeight = this.calcScaleSizePx(54);
|
||||
style.editDialogRadius = this.calcScaleSizePx(36);
|
||||
style.editDialogBtnWidth = this.calcScaleSizePx(311);
|
||||
style.editDialogFontMarginTop = this.calcScaleSizePx(52);
|
||||
style.editDialogHeight = StyleManager.calcScaleSizePx(217);
|
||||
style.editDialogWidth = StyleManager.calcScaleSizePx(670);
|
||||
style.editDialogFontSize = StyleManager.calcScaleSizePx(30);
|
||||
style.editDialogBtnMarginLF = StyleManager.calcScaleSizePx(24);
|
||||
style.editDialogFontHeight = StyleManager.calcScaleSizePx(36);
|
||||
style.editDialogBtnMarginTop = StyleManager.calcScaleSizePx(36);
|
||||
style.editDialogButtonSize = StyleManager.calcScaleSizePx(30);
|
||||
style.editDialogDividerHeight = StyleManager.calcScaleSizePx(36);
|
||||
style.editDialogButtonHeight = StyleManager.calcScaleSizePx(54);
|
||||
style.editDialogRadius = StyleManager.calcScaleSizePx(36);
|
||||
style.editDialogBtnWidth = StyleManager.calcScaleSizePx(311);
|
||||
style.editDialogFontMarginTop = StyleManager.calcScaleSizePx(52);
|
||||
style.editDialogColor = '#FFFFFFFF';
|
||||
style.editDialogBtnFontColor = '#FF0000FF';
|
||||
style.editDialogBtnBgColor = '#00FFFFFF';
|
||||
style.editDialogDividerColor = $r('sys.color.ohos_id_color_secondary');
|
||||
style.editDialogDividerWidth = this.calcScaleSizePx(1);
|
||||
style.editDialogDividerWidth = StyleManager.calcScaleSizePx(1);
|
||||
Log.showDebug(TAG, 'getControlEditDialogStyle');
|
||||
}
|
||||
}
|
||||
|
||||
let styleManager = new StyleManager();
|
||||
static number2px(n: number): string {
|
||||
return n.toString() + 'px';
|
||||
}
|
||||
|
||||
export default styleManager;
|
||||
static calcScaleSize(n: number): number {
|
||||
return n * StyleManager.maxWidth / StyleManager.STANDARD_DISPLAY_WIDTH;
|
||||
}
|
||||
|
||||
static calcScaleSizePx(n: number): string {
|
||||
return StyleManager.number2px(StyleManager.calcScaleSize(n));
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,7 @@ import WindowManager, { WindowType, WINDOW_SHOW_HIDE_EVENT
|
||||
} from '../../../../../../../common/src/main/ets/default/WindowManager'
|
||||
import EventManager, { unsubscribe } from "../../../../../../../common/src/main/ets/default/event/EventManager"
|
||||
import { START_ABILITY_EVENT } from "../../../../../../../common/src/main/ets/default/event/EventUtil"
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager'
|
||||
import MultimodalInputManager from '../../../../../../../common/src/main/ets/default/MultimodalInputManager'
|
||||
import AbilityManager from '../../../../../../../common/src/main/ets/default/abilitymanager/abilityManager'
|
||||
import HeightConfigUtils from '../../../../../../../common/src/main/ets/default/heightcofigUtils/HeightConfigUtils'
|
||||
@@ -93,6 +94,7 @@ struct Index {
|
||||
Log.showInfo(TAG, `aboutToAppear, start`);
|
||||
|
||||
setAppBgColor('#00000000');
|
||||
CommonStyleManager.setAbilityPageName(TAG);
|
||||
StyleManager.setStyle();
|
||||
|
||||
let dropdownRect = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_DROPDOWN_PANEL, 'rect');
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import StyleManager from './StyleManager';
|
||||
import CommonStyleManager from '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
|
||||
|
||||
const TAG = 'StatusBar-StyleConfiguration';
|
||||
|
||||
@@ -23,6 +23,6 @@ export class IndexStyle {
|
||||
export default class StyleConfiguration {
|
||||
static getIndexStyle(): IndexStyle {
|
||||
const key: string = TAG + '-Index';
|
||||
return StyleManager.getStyle(key, IndexStyle);
|
||||
return CommonStyleManager.getStyle(key, IndexStyle);
|
||||
}
|
||||
}
|
||||
@@ -12,33 +12,36 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import BaseStyleManager from '../../../../../../../../common/src/main/ets/default/BaseStyleManager';
|
||||
import Log from '../../../../../../../../common/src/main/ets/default/Log';
|
||||
import AbilityManager from '../../../../../../../../common/src/main/ets/default/abilitymanager/abilitymanager';
|
||||
|
||||
const TAG = 'StatusBar-StyleManager';
|
||||
|
||||
export class StyleManager extends BaseStyleManager {
|
||||
static readonly ABILITY_PAGE_NAME_STATUSBAR = "StatusBar-Index";
|
||||
export default class StyleManager {
|
||||
static readonly STANDARD_DISPLAY_WIDTH = 720;
|
||||
static readonly STANDARD_DISPLAY_HEIGHT = 1280;
|
||||
static maxWidth: number = StyleManager.STANDARD_DISPLAY_WIDTH;
|
||||
|
||||
constructor() {
|
||||
super(StyleManager.ABILITY_PAGE_NAME_STATUSBAR);
|
||||
}
|
||||
|
||||
setStyle(): void {
|
||||
static setStyle(): void {
|
||||
Log.showDebug(TAG, 'setStyle');
|
||||
|
||||
this.setStandardWidth(BaseStyleManager.STANDARD_DISPLAY_WIDTH_SMALL);
|
||||
|
||||
let config = AbilityManager.getAbilityData(AbilityManager.ABILITY_NAME_STATUS_BAR, 'config');
|
||||
this.setMaxWidth(config.maxWidth);
|
||||
StyleManager.maxWidth = config.maxWidth;
|
||||
|
||||
// xxx
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let styleManager = new StyleManager();
|
||||
static number2px(n: number): string {
|
||||
return n.toString() + 'px';
|
||||
}
|
||||
|
||||
export default styleManager;
|
||||
static calcScaleSize(n: number): number {
|
||||
return n * StyleManager.maxWidth / StyleManager.STANDARD_DISPLAY_WIDTH;
|
||||
}
|
||||
|
||||
static calcScaleSizePx(n: number): string {
|
||||
return StyleManager.number2px(StyleManager.calcScaleSize(n));
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import WindowManager, {WindowType, WINDOW_SHOW_HIDE_EVENT
|
||||
} from '../../../../../../../common/src/main/ets/default/WindowManager'
|
||||
import EventManager, {unsubscribe} from "../../../../../../../common/src/main/ets/default/event/EventManager"
|
||||
import {obtainLocalEvent} from "../../../../../../../common/src/main/ets/default/event/EventUtil"
|
||||
import CommonStyleManager from '../../../../../../../common/src/main/ets/default/CommonStyleManager'
|
||||
import HeightConfigUtils from '../../../../../../../common/src/main/ets/default/heightcofigUtils/HeightConfigUtils'
|
||||
import StatusBarComponent from '../../../../../../../features/statusbarcomponent/src/main/ets/com/ohos/pages/StatusBarComponent'
|
||||
import StatusBarVM from '../../../../../../../features/statusbarcomponent/src/main/ets/com/ohos/viewmodel/StatusBarVM'
|
||||
@@ -55,6 +56,7 @@ struct Index {
|
||||
this.updateStatusBarData();
|
||||
|
||||
setAppBgColor('#00000000');
|
||||
CommonStyleManager.setAbilityPageName(TAG);
|
||||
StyleManager.setStyle();
|
||||
|
||||
this.mClearCallback = EventManager.subscribe(WINDOW_SHOW_HIDE_EVENT, (args) => this.onWindowShowHideEvent(args));
|
||||
|
||||
Reference in New Issue
Block a user