!177 弹窗按钮宽度调整

Merge pull request !177 from fanchenxuan/master_
This commit is contained in:
openharmony_ci 2023-09-26 12:15:16 +00:00 committed by Gitee
commit 453b357b75
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
8 changed files with 10 additions and 13 deletions

View File

@ -30,6 +30,7 @@ export default class GlobalExtensionAbility extends extension {
console.info(TAG + 'want: ' + JSON.stringify(want));
GlobalContext.store('globalState', want.parameters['ohos.sensitive.resource']);
GlobalContext.store('context', this.context);
try {
let dis = display.getDefaultDisplaySync();

View File

@ -16,6 +16,7 @@
import UIAbility from '@ohos.app.ability.UIAbility';
import bundleManager from '@ohos.bundle.bundleManager';
import account_osAccount from '@ohos.account.osAccount';
import { GlobalContext } from '../common/utils/globalContext';
const TAG = 'PermissionManager_MainAbility:';
const USER_ID = 100;
@ -23,6 +24,8 @@ const USER_ID = 100;
export default class MainAbility extends UIAbility {
onCreate(want, launchParam): void {
console.log(TAG + 'MainAbility onCreate, ability name is ' + want.abilityName + '.');
GlobalContext.store('context', this.context);
}
onWindowStageCreate(windowStage): void {

View File

@ -95,8 +95,7 @@ export struct globalDialog {
confirm() {
if (this.currentGroup === 'CAMERA') {
let context: any = this.context;
let cameraManager = camera.getCameraManager(context);
let cameraManager = camera.getCameraManager(GlobalContext.load('context'));
cameraManager.muteCamera(true);
if (this.controller !== undefined) {
this.controller.close();

View File

@ -20,7 +20,6 @@ import Constants from '../utils/constant';
.fontWeight(FontWeight.Medium)
.fontSize(Constants.TEXT_SMALLER_FONT_SIZE)
.height(Constants.LOCATION_BUTTON_HEIGHT)
.width(Constants.LOCATION_BUTTON_WIDTH)
.borderRadius(Constants.LOCATION_BUTTON_RADIUS)
.position({ x: Constants.LOCATION_BUTTON_POSITION_X, y: Constants.LOCATION_BUTTON_POSITION_Y })
}

View File

@ -328,7 +328,6 @@ export default class Constants {
static LOCATION_CANVAS_MARGIN_BOTTOM = 8;
static LOCATION_CANVAS_INITIAL_SCALE = 1;
static LOCATION_CANVAS_ZOOM_SCALE = 1.3;
static LOCATION_BUTTON_WIDTH = 120;
static LOCATION_BUTTON_HEIGHT = 32;
static LOCATION_BUTTON_RADIUS = 16;
static LOCATION_BUTTON_POSITION_X = 137.5;

View File

@ -97,8 +97,7 @@ struct authorityManagementPage {
})
})
} else {
let context: any = this.context;
let cameraManager = camera.getCameraManager(context);
let cameraManager = camera.getCameraManager(GlobalContext.load('context'));
let mute = cameraManager.isCameraMuted();
GlobalContext.store('isMuteSupported', cameraManager.isCameraMuteSupported());
router.pushUrl({

View File

@ -381,8 +381,7 @@ struct applicationItem {
if (globalGroup.indexOf(this.currentGroup) !== -1) {
this.globalIsOn = globalIsOn;
if (this.currentGroup == "CAMERA") {
let context: any = this.context;
let cameraManager = camera.getCameraManager(context);
let cameraManager = camera.getCameraManager(GlobalContext.load('context'));
cameraManager.on('cameraMute', (err, curMuted) => {
console.log(TAG + 'curMuted: ' + JSON.stringify(curMuted) + ' err: ' + JSON.stringify(err));
this.globalIsOn = !curMuted;
@ -427,8 +426,7 @@ struct applicationItem {
.onChange((isOn: boolean) => {
if (isOn) {
if (this.currentGroup == "CAMERA") {
let context: any = this.context;
let cameraManager = camera.getCameraManager(context);
let cameraManager = camera.getCameraManager(GlobalContext.load('context'));
cameraManager.muteCamera(false);
} else {
let audioManager = audio.getAudioManager();

View File

@ -122,7 +122,6 @@ struct globalDialog {
accept() {
Log.info('global accept');
let context: any = this.context;
if (this.globalState == MICROPHONE) {
let audioManager = audio.getAudioManager();
let audioVolumeManager = audioManager.getVolumeManager();
@ -133,11 +132,11 @@ struct globalDialog {
})
})
} else if (this.globalState == CAMERA) {
let cameraManager = camera.getCameraManager(context);
let cameraManager = camera.getCameraManager(GlobalContext.load('context'));
cameraManager.muteCamera(false);
this.context.terminateSelf();
} else {
let cameraManager = camera.getCameraManager(context);
let cameraManager = camera.getCameraManager(GlobalContext.load('context'));
cameraManager.muteCamera(false);
let audioManager = audio.getAudioManager();
let audioVolumeManager = audioManager.getVolumeManager();