# FabDialogMorph **Repository Path**: chinasoft4_ohos/FabDialogMorph ## Basic Information - **Project Name**: FabDialogMorph - **Description**: Ohos 上的 Fab 和对话框变形动画 - **Primary Language**: Java - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 3 - **Created**: 2021-06-21 - **Last Updated**: 2024-11-08 ## Categories & Tags **Categories**: harmonyos-popup **Tags**: None ## README # FabDialogMorph # #### 项目介绍 - 项目名称:FabDialogMorph - 所属系列:openharmony的第三方组件适配移植 - 功能:Ohos 上的 Fab 和对话框变形动画 - 项目移植状态:完成 - 调用差异:无 - 开发版本:sdk6,DevEco Studio2.2 Beta1 - 基线版本:master分支 #### 效果演示 ![效果演示](https://images.gitee.com/uploads/images/2021/0621/110947_e51f6b29_7918188.gif "FABDialog.gif") #### 安装教程 无 #### 使用说明 java ```java public void setStackLayoutWindow(StackLayout stackLayout, boolean isShow) { int intColor = Color.getIntColor("#AA000000"); stackLayout.setAlpha(0); stackLayout.setClickable(true); ShapeElement shapeElementOver = new ShapeElement(); if (isShow) { stackLayout.setVisibility(Component.HIDE); shapeElementOver.setRgbColor(getRgbColor(intColor)); } else { stackLayout.setVisibility(Component.VISIBLE); shapeElementOver.setRgbColor(new RgbColor(0, 0, 0, 0)); } stackLayout.setBackground(shapeElementOver); } public boolean showOverlay(Component overlayLayout, AnimationGroupEnd end) { AnimatorValue animatorValue = new AnimatorValue(); animatorValue.setDuration(duration); animatorValue.setValueUpdateListener((animatorValue1, v) -> { overlayLayout.setTag(animatorValue); overlayLayout.setAlpha(v); if (v >= FLOAT_005) { overlayLayout.setVisibility(Component.VISIBLE); } }); animatorValue.start(); animatorValue.setStateChangedListener(new Animator.StateChangedListener() { @Override public void onStart(Animator animator) { } @Override public void onStop(Animator animator) { } @Override public void onCancel(Animator animator) { } @Override public void onEnd(Animator animator) { end.animationGroup(); end.animationGroupEnd(); } @Override public void onPause(Animator animator) { } @Override public void onResume(Animator animator) { } }); return true; } ``` #### 测试信息 CodeCheck代码测试无异常 CloudTest代码测试无异常 病毒安全检测通过 当前版本demo功能与原组件基本无差异 ## 版本迭代 1.0.0 ## 版权和许可信息 ```` The MIT License (MIT) Copyright (c) 2016 Hujiawei Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.