1/* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16const TAG = 'avpicker_component_mock '; 17 18export class AVCastPicker extends ViewPU { 19 constructor(parent, params, __localStorage, elmtId = -1) { 20 super(parent, __localStorage, elmtId); 21 this.setInitiallyProvidedValue(params); 22 } 23 24 setInitiallyProvidedValue(params) { 25 } 26 27 updateStateVars(params) { 28 } 29 30 purgeVariableDependenciesOnElmtId(rmElmtId) { 31 } 32 33 aboutToBeDeleted() { 34 SubscriberManager.Get().delete(this.id__()); 35 this.aboutToBeDeletedInternal(); 36 } 37 38 aboutToAppear() { 39 console.info(TAG + 'aboutToAppear'); 40 } 41 42 aboutToDisappear() { 43 console.info(TAG + 'aboutToDisappear'); 44 } 45 46 initialRender() { 47 this.observeComponentCreation((elmtId, isInitialRender) => { 48 ViewStackProcessor.StartGetAccessRecordingFor(elmtId); 49 Column.create(); 50 Column.size({ width: '100%', height: '100%' }) 51 isInitialRender || Column.pop(); 52 ViewStackProcessor.StopGetAccessRecording(); 53 }); 54 this.observeComponentCreation((elmtId, isInitialRender) => { 55 ViewStackProcessor.StartGetAccessRecordingFor(elmtId); 56 Button.createWithChild(); 57 Button.type(ButtonType.Circle); 58 Button.backgroundColor('#00000000'); 59 Button.width('100%'); 60 Button.height('100%'); 61 if (!isInitialRender) { 62 Button.pop(); 63 } 64 ViewStackProcessor.StopGetAccessRecording(); 65 }); 66 this.observeComponentCreation((elmtId, isInitialRender) => { 67 ViewStackProcessor.StartGetAccessRecordingFor(elmtId); 68 Image.create({ "id": 125830232, "type": 20000, params: [] }); 69 Image.width('100%'); 70 Image.height('100%'); 71 Image.draggable(false); 72 if (!isInitialRender) { 73 Image.pop(); 74 } 75 ViewStackProcessor.StopGetAccessRecording(); 76 }); 77 Button.pop(); 78 Column.pop(); 79 } 80 81 rerender() { 82 this.updateDirtyElements(); 83 } 84} 85 86export default AVCastPicker; 87