mirror of
https://github.com/openharmony/applications_systemui.git
synced 2026-07-15 07:29:05 -04:00
适配settingsData去常驻
Signed-off-by: tangzhigang1 <tangzhigang7@huawei.com>
This commit is contained in:
@@ -78,7 +78,8 @@ class TimeManager {
|
||||
|
||||
private async initTimeFormat(context: any): Promise<void> {
|
||||
Log.showDebug(TAG, "initTimeFormat");
|
||||
this.mSettingsHelper = await dataShare.createDataShareHelper(context, Constants.URI_VAR);
|
||||
settings.getValueSync(context, TIME_FORMAT_KEY, "24");
|
||||
this.mSettingsHelper = await dataShare.createDataShareHelper(context, Constants.getUriSync(Constants.KEY_TIME_FORMAT));
|
||||
|
||||
const handleTimeFormatChange = () => {
|
||||
if (!this.mSettingsHelper) {
|
||||
|
||||
@@ -74,6 +74,7 @@ export class brightnessManager {
|
||||
let value = parseInt(callback.value);
|
||||
Log.showInfo(TAG, `setValue ${value}`);
|
||||
mBrightnessValue.set(value);
|
||||
settings.setValueSync(this.context, Constants.KEY_BRIGHTNESS_STATUS, JSON.stringify(value));
|
||||
Log.showInfo(TAG, `setValue ${this.context}`);
|
||||
Brightness.setValue(callback.value);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ export default class NavigationBarViewModel {
|
||||
|
||||
private async initHelper(callback: () => void): Promise<void> {
|
||||
this.urivar = Constants.getUriSync(Constants.KEY_NAVIGATIONBAR_STATUS);
|
||||
this.helper = await dataShare.createDataShareHelper(AbilityManager.getContext(AbilityManager.ABILITY_NAME_NAVIGATION_BAR), Constants.URI_VAR);
|
||||
this.helper = await dataShare.createDataShareHelper(AbilityManager.getContext(AbilityManager.ABILITY_NAME_NAVIGATION_BAR), this.urivar);
|
||||
Log.showInfo(TAG, 'initHelper, helper: ' + this.helper + ', uri: ' + this.urivar);
|
||||
this.helper.on('dataChange', this.urivar, () => {
|
||||
Log.showInfo(TAG, 'onDataChange.');
|
||||
|
||||
@@ -132,8 +132,8 @@ struct Index {
|
||||
}
|
||||
|
||||
private async initHelper(dropdownRect, navigationBarRect): Promise<void> {
|
||||
this.helper = await dataShare.createDataShareHelper(AbilityManager.getContext(AbilityManager.ABILITY_NAME_DROPDOWN_PANEL), Constants.URI_VAR);
|
||||
this.urivar = Constants.getUriSync(Constants.KEY_NAVIGATIONBAR_STATUS);
|
||||
this.helper = await dataShare.createDataShareHelper(AbilityManager.getContext(AbilityManager.ABILITY_NAME_DROPDOWN_PANEL), this.urivar);
|
||||
Log.showDebug(TAG, `initHelper ${this.helper}, uri: ${JSON.stringify(this.urivar)}`);
|
||||
this.helper?.on("dataChange", this.urivar, () => {
|
||||
this.resizeDropdownPanelAndNavigationBar(dropdownRect, navigationBarRect);
|
||||
|
||||
Reference in New Issue
Block a user