如何在 Harmony App Development 中动态更改对话框中设置的动画组件的大小?

How to dynamically change size of dialog box with respect to animating component set inside it in Harmony App Development?

我正在创建 Harmony 应用程序。
在这里,我正在创建一个通用对话框并设置一个自定义组件并使用 component.createAnimatorProperty() 创建动画器 属性 并盯着它。
当我开始动画时,只有组件使用特定属性进行动画处理,但对话框(对话框window)不会根据内部组件大小的变化而改变其大小。 如何使用内部组件大小动态更改其大小。

// created a custom component for setting it
CommonDialog commonDialog = new CommonDialog(getContext);
commonDialog.setContentCustomComponent(customComponent);
commonDialog.show();
Thread.sleep(1000);
AnimatorProperty animatorProperty = customComponent.createAnimatorProperty().setDuration(100)
                .scaleX(1.04f).scaleY(1.04f).scaleXFrom(1).scaleYFrom(1);
animatorProperty.start();

在你提供的代码中,如果你放大了对话框的内容,为了随着内容的放大而放大对话框,你也可以设置对话框的放大效果。

根据当前的 HMOS 平台支持,动画只能设置为在对话框中设置的 customComponent 或 titleComponent 对象。换句话说,可以只对组件对象设置动画。为对话框设置动画,以查看对话框边界动画 - 目前不支持。让我们继续关注未来的 HMOS 更新。