diff --git a/entry/src/main/ets/common/constants/BreakpointSystem.ets b/entry/src/main/ets/common/constants/BreakpointSystem.ets index 9abc0230a18f2d4b14e3a02ee4ae7a0d80876857..fd4b4fc914512df7af4ae069685940285e959e72 100644 --- a/entry/src/main/ets/common/constants/BreakpointSystem.ets +++ b/entry/src/main/ets/common/constants/BreakpointSystem.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Huawei Device Co., Ltd. + * Copyright (c) 2024 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 @@ -36,4 +36,4 @@ export class BreakpointType { } return undefined; } -} +} \ No newline at end of file diff --git a/entry/src/main/ets/common/constants/CommonConstants.ets b/entry/src/main/ets/common/constants/CommonConstants.ets index b2a3151f2f1d13bd5a77de444dae8b8dbc64b201..6c5077c3553dbd3cb7d03b0bbbc573f8a4030a5d 100644 --- a/entry/src/main/ets/common/constants/CommonConstants.ets +++ b/entry/src/main/ets/common/constants/CommonConstants.ets @@ -49,46 +49,11 @@ export class CommonConstants { */ public static readonly ELEMENTS_MARGIN = 12; - /** - * One hundred percent. - */ - public static readonly ONE_HUNDRED_PERCENT: string = '100%'; - - /** - * One hundred eleven percent. - */ - public static readonly ONE_HUNDRED_ELEVEN_PERCENT: string = '100%'; - /** * The hundred percent of the components */ public static readonly FULL_PERCENT: string = '100%'; - /** - * Ninety two percent. - */ - public static readonly NINETY_PERCENT: string = '90%'; - - /** - * Ninety two percent. - */ - public static readonly NINETY_TWO_PERCENT: string = '92%'; - - /** - * Ninety five percent. - */ - public static readonly NINETY_FIVE_PERCENT: string = '95%'; - - /** - * Eighty five percent. - */ - public static readonly EIGHTY_FIVE_PERCENT: string = '85%'; - - /** - * Thirty percent. - */ - public static readonly THIRTY_PERCENT: string = '30%'; - /** * Forty percent. */ @@ -99,31 +64,6 @@ export class CommonConstants { */ public static readonly SEVENTY_FIVE_PERCENT: string = '75%'; - /** - * Rotation angle. - */ - public static readonly ANGLE: number = 45; - - /** - * Line Spacing. - */ - public static readonly SPACE: number = 16; - - /** - * Moving distance. - */ - public static readonly TRANSLATE: number = 1000; - - /** - * Zero six. - */ - public static readonly ZERO_SIX: number = 0.6; - - /** - * Zero eight. - */ - public static readonly ZERO_EIGHT: number = 0.8; - /** * Duration. */ @@ -134,31 +74,11 @@ export class CommonConstants { */ public static readonly DELAY: number = 500; - /** - * GridCount. - */ - public static readonly GRID_COUNT: number = 2; - /** * Zero. */ public static readonly ZERO: number = 0; - /** - * Four - */ - public static readonly FOUR: number = 4; - - /** - * Eight. - */ - public static readonly EIGHT: number = 8; - - /** - * Twelves. - */ - public static readonly TWELVES: number = 12; - /** * Space. */ @@ -174,21 +94,6 @@ export class CommonConstants { */ public static readonly ELEMENTS_MARGIN_M: number = 8; - /** - * 0.0. - */ - public static readonly ZERO_ZERO: number = 0.0; - - /** - * 0.3. - */ - public static readonly ZERO_THREE: number = 0.3; - - /** - * 1.0. - */ - public static readonly ONE_ZERO: number = 1.0; - /** * Saturday. */ @@ -233,9 +138,4 @@ export class CommonConstants { * MD and LG width. */ public static readonly WIDTH_MD_LG: number = 448; - - /** - * All breakpoints - */ - public static readonly BREAKPOINTS: string[] = ['sm', 'md', 'lg']; } \ No newline at end of file diff --git a/entry/src/main/ets/pages/BindSheet.ets b/entry/src/main/ets/pages/BindSheet.ets index 4aa6b97c95ff811724ed5e0d4ae51ddd4a97080a..46ba0ca048b03850f61ae320934878ae8100ca77 100644 --- a/entry/src/main/ets/pages/BindSheet.ets +++ b/entry/src/main/ets/pages/BindSheet.ets @@ -13,15 +13,15 @@ * limitations under the License. */ +import { ConfigurationConstant } from '@kit.AbilityKit'; import { BreakpointType } from '../common/constants/BreakpointSystem'; import { CommonConstants } from '../common/constants/CommonConstants'; -import { ConfigurationConstant } from '@kit.AbilityKit'; @Entry @Component struct BindSheetDemo { - @StorageProp('systemColorMode') - currentMode: ConfigurationConstant.ColorMode = ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT; + @StorageProp('systemColorMode') currentMode: ConfigurationConstant.ColorMode = + ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT; @StorageLink('topRectHeight') topRectHeight: number = 0; @StorageLink('bottomRectHeight') bottomRectHeight: number = 0; @StorageLink('currentBreakpoint') curBp: string = CommonConstants.BREAK_POINT_SM; diff --git a/entry/src/main/ets/viewmodel/DataManager.ets b/entry/src/main/ets/viewmodel/DataManager.ets index 53bd6186a441f2a7017d81ef2984156b4ceb646a..dc9fd6665f2fc9a7fe755184fe6b48c247ad3f9a 100644 --- a/entry/src/main/ets/viewmodel/DataManager.ets +++ b/entry/src/main/ets/viewmodel/DataManager.ets @@ -13,7 +13,7 @@ * limitations under the License. */ -import dataPreferences from '@ohos.data.preferences'; +import { preferences } from '@kit.ArkData'; import { DateModel } from './DateModel'; import { getRealTimeDate } from './GetDate'; @@ -21,11 +21,11 @@ export class DataManager { static getDate(context: Context, callback: (dateModel: DateModel) => void) { let dateModel: DateModel = getRealTimeDate(); try { - let promise = dataPreferences.getPreferences(context, 'date'); - promise.then((object: dataPreferences.Preferences) => { + let promise = preferences.getPreferences(context, 'date'); + promise.then((object: preferences.Preferences) => { try { let getPromise = object.get('selectedDate', ''); - getPromise.then((data: dataPreferences.ValueType) => { + getPromise.then((data: preferences.ValueType) => { let dateSting = data as string; if (dateSting.length > 0) { dateModel = JSON.parse(dateSting) as DateModel; @@ -49,8 +49,8 @@ export class DataManager { static setDate(context: Context, dateModel: DateModel, callback: () => void) { try { - let promise = dataPreferences.getPreferences(context, 'date'); - promise.then((object: dataPreferences.Preferences) => { + let promise = preferences.getPreferences(context, 'date'); + promise.then((object: preferences.Preferences) => { try { let setPromise = object.put('selectedDate', JSON.stringify(dateModel)); setPromise.then(() => { @@ -77,8 +77,8 @@ export class DataManager { static deleteDate(context: Context, callback: () => void) { try { - let promise = dataPreferences.getPreferences(context, 'date'); - promise.then((object: dataPreferences.Preferences) => { + let promise = preferences.getPreferences(context, 'date'); + promise.then((object: preferences.Preferences) => { try { let deletePromise = object.delete('selectedDate'); deletePromise.then(() => {