/* * Copyright (C) 2024 The Android Open Source Project * * 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 { Component, ElementRef, EventEmitter, Inject, Input, Output, } from '@angular/core'; import {assertDefined} from 'common/assert_utils'; import {SfCuratedProperties} from 'viewers/common/curated_properties'; import {UiPropertyTreeNode} from 'viewers/common/ui_property_tree_node'; import {ViewerEvents} from 'viewers/common/viewer_events'; import {inlineButtonStyle} from './styles/clickable_property.styles'; import {viewerCardInnerStyle} from './styles/viewer_card.styles'; @Component({ selector: 'surface-flinger-property-groups', template: `
Layer not selected.

Visibility

Flags: &ngsp; {{ properties.flags }}

{{ summaryProperty.key }}: {{ summaryProperty.simpleValue }} &ngsp; {{(i === summaryProperty.layerValues.length - 1) ? '' : ', '}}

Geometry

Calculated

Transform:

Crop: &ngsp; {{ properties.calcCrop }}

Final Bounds: &ngsp; {{ properties.finalBounds }}

Requested

Transform:

Crop: &ngsp; {{ properties.reqCrop }}

Buffer

Size: &ngsp; {{ properties.bufferSize }}

Frame Number: &ngsp; {{ properties.frameNumber }}

Transform: &ngsp; {{ properties.bufferTransformType }}

Destination Frame: &ngsp; {{ properties.destinationFrame }}

Destination Frame ignored because item has eIgnoreDestinationFrame flag set.

Hierarchy

z-order: &ngsp; {{ properties.z }}

relative parent: &ngsp; {{ properties.relativeParent }}

Effects

Calculated

Color: &ngsp; {{ properties.calcColor }}

Corner Radius: &ngsp; {{ properties.calcCornerRadius }}

Shadow: &ngsp; {{ properties.calcShadowRadius }}

Corner Radius Crop: &ngsp; {{ properties.calcCornerRadiusCrop }}

Blur: &ngsp; {{ properties.backgroundBlurRadius }}

Requested

Color: &ngsp; {{ properties.reqColor }}

Corner Radius: &ngsp; {{ properties.reqCornerRadius }}

Input

To Display Transform:

Touchable Region: &ngsp; {{ properties.inputRegion }}

Config

Focusable: &ngsp; {{ properties.focusable }}

Crop touch region with item: &ngsp; {{ properties.cropTouchRegionWithItem }}

Replace touch region with crop: &ngsp; {{ properties.replaceTouchRegionWithCrop }}

Input Config: &ngsp; {{ properties.inputConfig }}

Input channel: &ngsp; not set

`, styles: [ ` :host collapsible-section-title { padding-bottom: 8px; } .placeholder-text { padding: 8px 12px; } .property-groups-content { overflow-y: auto; padding: 0px 12px; } .group { display: flex; flex-direction: row; padding: 8px; } .group-header { width: 80px; color: gray; } .left-column { flex: 1; padding: 0 5px; } .right-column { flex: 1; border: 1px solid var(--border-color); border-left-width: 5px; padding: 0 5px; } .column-header { color: gray; } .summary { display: block; } `, inlineButtonStyle, viewerCardInnerStyle, ], }) export class SurfaceFlingerPropertyGroupsComponent { @Input() properties: SfCuratedProperties | undefined; @Output() collapseButtonClicked = new EventEmitter(); constructor(@Inject(ElementRef) private elementRef: ElementRef) {} getTransformType(transformNode: UiPropertyTreeNode): string { const typeFlags = transformNode.formattedValue(); return typeFlags !== 'null' ? typeFlags : 'IDENTITY'; } getTransformMatrix(transformNode: UiPropertyTreeNode): UiPropertyTreeNode { return assertDefined(transformNode.getChildByName('matrix')); } onIdClicked(layerNodeId: string) { const event = new CustomEvent(ViewerEvents.HighlightedIdChange, { bubbles: true, detail: {id: layerNodeId}, }); this.elementRef.nativeElement.dispatchEvent(event); } }